Presentation is loading. Please wait.

Presentation is loading. Please wait.

7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report.

Similar presentations


Presentation on theme: "7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report."— Presentation transcript:

1 7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report

2 7/11/20082 Excess Notation Table Bit patternsValue Rep 1113 1102 1011 1000 011 010-2 001-3 000-4

3 7/11/20083 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.  ¾  (-)3 1/2 When using floating point format, what is the largest value that can be represented? Also indicate the smallest value that can be represented?

4 7/11/20084 Solution Demonstrated by instructor on white board

5 7/11/20085 Today's Agenda 10 th Nov 08 Truncation Errors Image Representation Hexadecimal Notation Student Presentation

6 7/11/20086 Truncation Errors Lets try to represent 2 5/8 with one byte floating point format. Steps- First represent 2 5/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 2 1/2 instead of 2 5/8

7 7/11/20087 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)

8 7/11/20088 Suppose we are asked to add 2 1/2 + 1/8 + 1/8 If we add 2 1/2 and 1/8 we get should get 2 5/8 (hence truncation error) but 2 5/8 gets represented as 2 1/2 Now the next step is to add 1/8 to the result obtained by the addition of 2 1/2 and 1/8 (which is 2 1/2. Again a truncation error occurs and our final answer is 2 1/2. Now try to add values in reverse order Add 1/8 and 1/8, we get ¼ (.01) –result is 00111000.

9 7/11/20089 Now we add ¼ to the next value in the list which is 2 1/2, and obtain 2 3/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

10 7/11/200810 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

11 7/11/200811 Bit patternsHexadecimal Representation 00000 00011 00102 00113 01004 01015 01106 01117 10008 Bit patternsHexadecimal Representation 10019 1010A 1011B 1100C 1101D 1110E 1111F

12 7/11/200812 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?

13 7/11/200813 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

14 7/11/200814 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

15 7/11/200815 Common bitmap formats include: BMP GIF JPEG, JPG PNG PICT (Macintosh) PCX TIFF PSD (Adobe Photoshop)bitmap formats Popular bitmap editing programs are: Microsoft Paint Adobe Photoshop Corel Photo-Paint Corel Paint Shop Pro The GIMPbitmap editing programs


Download ppt "7/11/20081 Today’s Agenda Friday 6 th Nov Revision of certain topics Floating point notation Excess Notation Exam format Interim Report."

Similar presentations


Ads by Google