1 / 8

Floating Point Binary

Floating Point Binary. A2 Computing OCR Module 2509. Negative Binary Numbers. 4 10 = 00000100 3 10 = 00000011 2 10 = 00000010 1 10 = 00000001 0 10 = 00000000 -1 10 = ?. Imagine a milometer…. 0. 9. 0. 9. 9. 0. 9. 0. 0. 9. 0. 9. 9. 0. 4. 3. 2. 1. 0. 9.

omar
Download Presentation

Floating Point Binary

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Floating Point Binary A2 Computing OCR Module 2509

  2. Negative Binary Numbers 410 = 00000100 310 = 00000011 210 = 00000010 110 = 00000001 010 = 00000000 -110 = ? Imagine a milometer… 0 9 0 9 9 0 9 0 0 9 0 9 9 0 4 3 2 1 0 9

  3. Negative Binary Numbers 410 = 00000100 310 = 00000011 210 = 00000010 110 = 00000001 010 = 00000000 -110 = 11111111 -210 = 11111110 -310 = 11111101 -410 = 11111100 Imagine a milometer… 9 9 9 9 9 9 9 9 8 7 6 Two’s complement

  4. Negative Binary Numbers: The Easy Method • Starting from the right, leave the digits alone up to the first 1 • Change all the other digits from 1 to 0 or 0 to 1 8810 = 0 1 0 1 1 1 0 0 0 0 0 0 Flip Leave sign (0 ≡ positive; 1 ≡ negative) - 8810 = 1 0 1 0 Two’s complement

  5. sign mantissa exponent 0 110100000 000011 Floating Point Binary Imagine a 2 byte, 16 bit, number… The sign tells us it is a positive number (0 ≡ positive, 1 ≡ negative) The mantissa and exponent tell us that that the number is 0.1101 x 23 0.1101 x 23 ≡ 110.1 ≡ 6.510

  6. sign mantissa exponent 0 110100000 111110 Floating Point Binary: Negative Exponent N.B. If the exponent is negative, it will be written in two’s complement • Therefore, first convert the exponent from two complement to base 10: 111110 = -000010 = -2 • Number is therefore 0.1101 x 2-2 If the leading bit of the exponent is 1, the exponent is negative… 0.1101 x 2-2 ≡ 0.001101 ≡ 1/8+1/16+1/64 ≡ 0.203125

  7. Normalisation of Floating Point Binary Numbers In base 10: 234,567,000 ≈ 0.002346 x 1011 234,567,000 = 0.234567 x 109 This has lostsome accuracy and precision This number is normalised:it uses the mantissa to give the mostaccurate representation of the numberby making sure the first digit after thedecimal place is significant (i.e. not a zero)

  8. Normalisation of Floating Point Binary Numbers • Normalise the floating point binary number 0 000110101 000010 • What do we know? • It is a positive number • It has a positive exponent • The number, as it stands, is 0.000110101 x 22 = 0.0110101 Normalised: = 0.110101 x 2-1 • We need the binary equivalent of -1 to represent the exponent N.B. The exponent is negative so will need to be two’s complement Two’s complement of -1 is 111111 • So, the normalised version of 0 000110101 000010 is: 0.110101000 111111 The sign bit is a 0 The leftmost bit of the exponent is also 0

More Related