|
|
Decimal number: 123.45
^^^ ^^
||| ||
||| |+--- weight = 1/100
||| +---- weight = 1/10
||+------- weight = 1
|+-------- weight = 10
+--------- weight = 100
|
|
|
Binary number: 101.01
^^^ ^^
||| ||
||| |+--- weight = 1/4
||| +---- weight = 1/2
||+------- weight = 1
|+-------- weight = 2
+--------- weight = 4
|
|
|
Example:
Given the following fixed point binary representation:
10111.1011
The value represented is computed as:
10111.1011
||||| ||||
||||| |||+--- 1*(1/16)
||||| ||+---- 1*(1/8)
||||| |+----- 0*(1/4)
||||| +------ 1*(1/2)
|||||
||||+-------- 1*(1)
|||+--------- 1*(2)
||+---------- 1*(4)
|+----------- 0*(8)
+------------ 1*(16)
value represented = 16 + 4 + 2 + 1 + 1/2 + 1/8 + 1/16
= 23 11/16
= 23.6875
|
|
|
|
So we never use fixed point fractional numbers.
This material is just used as an introduction to floating point numbers.
We will study that next.