Presentation is loading. Please wait.

Presentation is loading. Please wait.

Floating Point Binary A2 Computing OCR Module 2509.

Similar presentations


Presentation on theme: "Floating Point Binary A2 Computing OCR Module 2509."— Presentation transcript:

1 Floating Point Binary A2 Computing OCR Module 2509

2 Negative Binary Numbers
410 = 310 = 210 = 110 = 010 = -110 = ? Imagine a milometer… 9 9 9 9 9 9 9 9 1 4 3 2

3 Negative Binary Numbers
410 = 310 = 210 = 110 = 010 = -110 = -210 = -310 = -410 = Imagine a milometer… 9 9 9 9 9 9 9 6 8 7 9 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 = 1 1 1 1 Flip Leave sign (0 ≡ positive; 1 ≡ negative) = 1 1 Two’s complement

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

6 Floating Point Binary: Negative Exponent
If the leading bit of the exponent is 1, the exponent is negative… 111110 mantissa exponent sign 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: = = -2 Number is therefore x 2-2 x 2-2 ≡ 1/8+1/16+1/64

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

8 Normalisation of Floating Point Binary Numbers
Normalise the floating point binary number What do we know? It is a positive number It has a positive exponent The number, as it stands, is x 22 = Normalised: = 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 So, the normalised version of is: The sign bit is a 0 The leftmost bit of the exponent is also 0


Download ppt "Floating Point Binary A2 Computing OCR Module 2509."

Similar presentations


Ads by Google