Section 4.5
4 Data Representation
4.5 Fixed Point Binary Numbers
4.5.1 Positive Fixed Point Binary Numbers
In binary we can have functional column headings.
27
|
26
|
25
|
24
|
23
|
22
|
21
|
20
|
|
2-1
|
2-2
|
128
|
64
|
32
|
16
|
8
|
4
|
2
|
1
|
|
0.5
|
0.25
|
1
|
0
|
1
|
0
|
0
|
1
|
0
|
0
|
.
|
1
|
1
|
=164.75
|
Binary Fraction
|
Fraction
|
Decimal
|
0.1
|
1/2
|
0.5
|
0.01
|
1/4
|
0.25
|
0.001
|
1/8
|
0.125
|
0.0001
|
1/16
|
0.0625
|
4.5.2 Using Two's Complement With Fixed Point Binary Numbers
For negative numbers we use two's complement representation on the entire bit
pattern.
Example
Represent -5.2510 in 8-bit binary with the binary point after the
fourth digit.
Step 1
Calculate the positive equivalent number in binary.
|
|
|
|
5
|
.
|
2
|
5
|
|
|
|
0
|
1
|
0
|
1
|
.
|
0
|
1
|
0
|
0
|
Step 2
Change 0s to 1s and 1s to 0s (Complement).
|
1
|
0
|
1
|
0
|
.
|
1
|
0
|
1
|
1
|
Step 3
Add 1 to the result.
|
1
|
0
|
1
|
0
|
.
|
1
|
1
|
0
|
0
|
Advantages And Disadvantages Of The Fixed Point Binary System
Advantages
- Preserves accuracy as required.
- Easy to convert.
Disadvantages
- Limited degree of accuracy.