90 likes | 218 Views
Fixed Point Representation. OBJECTIVES. You should be able to: Convert binary fractions to a decimal Convert decimal fractions to binary. Fixed Point Representation.
E N D
OBJECTIVES You should be able to: • Convert binary fractions to a decimal • Convert decimal fractions to binary
Fixed Point Representation • We have previously dealt with converting between decimal and binary integers (whole numbers). We shall now deal with converting between decimal and binary fractions (real numbers). • Recapping : The number 5.385 can be broken up into:
Binary Fraction • Binary fractions operate in a similar way. See the table below:
Converting a binary fraction to decimal Using the value for each binary digit in a binary fraction we can find the decimal equivalent. eg. Convert the binary fraction 101.1112 to decimal. Starting from the left of the binary fraction, we record the digits down the table. TOTAL = 5.875 10
Exercise 1 Convert the following binary fractions to decimal: • 11.10112 6. 1.112 • 1.101012 7. 1111.101012 • 101.112 8. 1001.11012 • 111.1012 9. 1.1010112 • 11.11112 10. 10.1101012
Converting decimal fractions to binary • In order to convert a decimal fraction to binary the fraction must be multiplied by 2 after which the 0 or 1 produced to the left of the decimal point is recorded. This process is repeated until the fraction part becomes zero or the fraction part starts to repeat itself. eg. Convert the decimal fraction 0.75 to binary. STEP 1: 0.75 x 2= 1.50 so the first bit is 1, with 0.50 remaining STEP 2: 0.50 x2= 1.00 so the second bit is 1 (fraction part becomes zero) Therefore 0.7510= .112 ( Counting bits starting from the top)
Converting decimal fractions to binary continued eg. Convert .6510 to binary (5 bit representation). STEP 1: .65 x 2= 1.30 so the first bit is 1, remainder is .30 STEP 2: .30 x 2= 0.60 so the second bit is 0, remainder is .60 STEP 3: .60 x 2= 1.20 so the third bit is 1, remainder is .20 STEP 4: .20 x 2= 0.40 so the fourth bit is 0, remainder is .40 STEP 5: .40 x 2= 0.80 so the fifth bit is 0, remainder is .80 STEP 6: .80 x 2= 1.60 so the sixth bit is 1, remainder is .60 STEP 7: .60 x 2= 1.20 so the seventh bit is 1, remainder is .20 The remainders begin to repeat in STEP 6 and STEP 7 therefore this pattern is repeating itself. The answer can be written as .101002,ignoring any bits after the fifth bit (truncated) or as .101012 , rounding off the result.
Exercise 2 Convert the following decimal fractions to binary: 1. .25 2. .375 3. 5.435 4. 9.857