Presentation is loading. Please wait.

Presentation is loading. Please wait.

OBJECTIVES You should be able to:  Convert binary fractions to a decimal  Convert decimal fractions to binary.

Similar presentations


Presentation on theme: "OBJECTIVES You should be able to:  Convert binary fractions to a decimal  Convert decimal fractions to binary."— Presentation transcript:

1

2 OBJECTIVES You should be able to:  Convert binary fractions to a decimal  Convert decimal fractions to binary

3 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: DigitPlace ValueDecimal Fraction Decimal Value 510 01 / 1 or 1 (integer) 5 310 -11 / 10.3 810 -21 / 100.08 510 -31 / 1000.005

4 Binary Fraction  Binary fractions operate in a similar way. See the table below: BinaryPlace Value Decimal Fraction Decimal Value First bit after the point (.1) 2 -11/21/2.5 Second bit after the point (.01) 2 -21/41/4.25 Third bit after the point (.001) 2 -31/81/8.125 Fourth bit after the point (.0001) 2 -41 / 16.0625 Fifth bit after the point (.00001) 2 -51 / 32.03125

5 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.111 2 to decimal. Starting from the left of the binary fraction, we record the digits down the table. TOTAL = 5.875 10 BinaryWeightingValue 12 1 x 2 2 = 4 02121 0 x 2 1 = 0 12020 1 x 2 0 = 1 12 -1 1 x 2 -1 =.5 12 -2 1 x 2 -2 =.25 12 -3 1 x 2 -3 =.125

6 Exercise 1 Convert the following binary fractions to decimal: 1. 11.1011 2 6. 1.11 2 2. 1.10101 2 7. 1111.10101 2 3. 101.11 2 8. 1001.1101 2 4. 111.101 2 9. 1.101011 2 5. 11.1111 2 10. 10.110101 2

7 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.75 10 =.11 2 ( Counting bits starting from the top)

8 Converting decimal fractions to binary continued eg. Convert.65 10 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.10100 2, ignoring any bits after the fifth bit (truncated) or as.10101 2, rounding off the result.

9 Exercise 2 Convert the following decimal fractions to binary: 1..25 2..375 3.5.435 4.9.857


Download ppt "OBJECTIVES You should be able to:  Convert binary fractions to a decimal  Convert decimal fractions to binary."

Similar presentations


Ads by Google