7/11/20081 today’s agenda friday 6 th nov revision of certain topics floating point notation...
TRANSCRIPT
![Page 1: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/1.jpg)
7/11/2008 1
Today’s Agenda Friday 6th Nov
Revision of certain topicsFloating point notationExcess NotationExam formatInterim Report
![Page 2: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/2.jpg)
7/11/2008 2
Excess Notation Table
Bit patterns Value Rep
111 3
110 2
101 1
100 0
011 -1
010 -2
001 -3
000 -4
![Page 3: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/3.jpg)
7/11/2008 3
QUIZ 2 (Time 17 min) Decode the following using floating point format (i-e left most bit is s.b, next
three are exp and the next four are mantissa) . Show all your working?
01001010 01101101 11011100 10101011
Code the following values into floating point format. ¾
(-)31/2
When using floating point format, what is the largest value that can be represented? Also indicate the smallest value that can be represented?
![Page 4: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/4.jpg)
7/11/2008 4
Solution
• Demonstrated by instructor on white board
![Page 5: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/5.jpg)
7/11/2008 5
Today's Agenda 10th Nov 08 Truncation Errors Image Representation Hexadecimal Notation Student Presentation
![Page 6: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/6.jpg)
7/11/2008 6
Truncation Errors Lets try to represent 25/8 with one byte floating
point format. Steps- First represent 25/8 in binary, which
gives us 10.101. Copy this pattern into mantissa field Problem- when we do this we run out of
space and the last 1(representing 1/8) is lost If this problem is ignored and exponent and
sign-bit fields are populated, we get 01101010 i-e 21/2 instead of 25/8
![Page 7: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/7.jpg)
7/11/2008 7
Longer Mantissa and Exponent fields can reduce this problem
Its common to use at least 32 bits for storing values in floating point notation
Truncation errors in decimal system : e-g of which is the problem of non terminating expansions (occurs when trying to express 1/3 in decimal system).
Truncation Errors are an everyday concern for people working in the area of numerical analysis (branch of maths that deals with problems involved when doing computations that are often massive and require significant accuracy)
![Page 8: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/8.jpg)
7/11/2008 8
Suppose we are asked to add 21/2 +1/8+1/8
If we add 21/2 and 1/8 we get should get 25/8
(hence truncation error) but 25/8 gets represented as 21/2
Now the next step is to add 1/8 to the result obtained by the addition of 21/2 and 1/8(which is 21/2. Again a truncation error occurs and our final answer is 21/2.
Now try to add values in reverse order Add 1/8 and 1/8 , we get ¼ (.01) –result is
00111000.
![Page 9: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/9.jpg)
7/11/2008 9
Now we add ¼ to the next value in the list which is 21/2, and obtain 23/4 which can be accurately stored in a byte as 01101011. The result this time is the correct answer.
Crux: When adding values – order in which they are added are is important. Problem occurs when a very large number is added to a very small number, the small number gets truncated.
General rule for adding multiple values is to add the smaller values first, in hope that they will accumulate to a value that is significant when added to larger values
![Page 10: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/10.jpg)
7/11/2008 10
Hexadecimal Notation When considering the internal activities of a
computer, we deal with strings of bits, some of which are very long.
Human mind has difficulty handling such detail
Merely transcribing the pattern 101101010011 is tedious and error prone
To simply the representation of bit patterns, therefore, we usually use a shorthand notation called the hexadecimal notation
![Page 11: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/11.jpg)
7/11/2008 11
Bit patterns Hexadecimal
Representation
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
Bit patterns Hexadecimal
Representation
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
![Page 12: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/12.jpg)
7/11/2008 12
Hexdecimal Notation Left column displays all bit patterns of length
4 Right column shows the symbol used in hex-
dec notation to represent the patterns on the left.
Bit pattern 10110101 represents B5 Obtained by dividing the string into substrings
of length 4 and then representing each substring by its hex-dec equivalent.
Decode 1010010011001000 in hex-dec notation?
![Page 13: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/13.jpg)
7/11/2008 13
Representing Images (Bitmap technique) 2 popular ways of representing images Bitmap technique (Rastor images) and Vector technique Rastor or bitmap image is a collection of dots, each of which is called a pixel In its simplest form, an image represents a long string of bits representing the rows
of pixels in the image, where each bit is either 1 or 0 depending on whether the corresponding pixel is black or white.
Color images are slightly more complicated, where each pixel is represented by a combination of bits representing the color of that pixel.
Computer Peripherals convert color images into bitmap form. These devices record color of each pixel as three components: red, blue and green component
One byte is used to represent the intensity of each color component. Hence 3 bytes of storage are used to represent a single pixel in the original image. Three byte per pixel format means that an image consisting of 1280 rows of 1024
pixels (typical photograph) requires several megabytes of storage. This bulkiness of image is reduced by using compression technique. Disadvantage of bitmap images is that they cannot be rescaled to any arbitrary
size. This is because this will lead to bigger pixels which leads to grainy images.
Vector technique
![Page 14: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/14.jpg)
7/11/2008 14
Vector technique RRM (Slide 14 and 15) Vector technique represents images using lines and geometric curves
Vector Graphics is a series of commands that describes a lines direction, thickness and color
File size is very small because not every pixel is accounted for. Vector graphics can be resized mathematically and these changes
can be calculated dynamically Vector Technique not good for representing real life images- JPEG
are far superior in that but vector graphics are good in representing line art and cartoon style drawings.
Most popular vector format is Flash- Flash images are stored in binary format and require a special editor to create.
Another vector format- SVG
![Page 15: 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report](https://reader036.vdocuments.us/reader036/viewer/2022072015/56649ebf5503460f94bc9e65/html5/thumbnails/15.jpg)
7/11/2008 15
Common bitmap formats include: • BMP • GIF • JPEG, JPG • PNG • PICT (Macintosh) • PCX • TIFF • PSD (Adobe Photoshop)
Popular bitmap editing programs are: • Microsoft Paint • Adobe Photoshop • Corel Photo-Paint • Corel Paint Shop Pro • The GIMP