1 Write the following base10 numbers in 16 bit fixedpoint tw
1- Write the following base-10 numbers in 16- bit fixed-point twos complement format with eight integer bits and eight fraction bits: 162.625, -98.5, 42.875, -10.015625
Solution
1.
162.625
162 remainders
2|162
2|81 0
2|40 1
2|20 0
2|10 0
2|5 0
2|2 1
2|1 0
2|0 1
= 10100010
0.625 *2 = 1.25
0.25 *2 = 0.50
0.50*2 = 1.00
0.625 = 101
162.625 = 1010 0010 . 1010 0000
1\'s complement = 0101 1101. 0101 1111
+1(Add 1 to the least significant bit in fraction part)
2\'s complement = 0101 1101. 0110 0000
2
-98.5
98 remainders
2|98
2|49 0
2|24 1
2|12 0
2|6 0
2|3 0
2|1 1
2|0 1
= 1100010
0.5* 2= 1.0
-98.5 = - 0110 0010 . 1000 0000
1\'s complement = 1001 1101.0111 1111
+1
2\'s complement = 1001 1101. 1000 0000
3.
42.875
42 remainders
2|42
2|21 0
2|10 1
2|5 0
2|2 1
2|1 0
2|0 1
= 101010
0.875*2 = 1.75
0.75*2 = 1.50
0.5 * 2 = 1.00
42.875 = 0010 1010 . 1110 000
1\'s complement = 1101 0101.0001 1111
+1
2\'s complement = 1101 0101.0010 0000
4.
-10.015625
10 remainders
2|10
2|5 0
2|2 1
2|1 0
2|0 1
= -1010
0.015625 * 2= 0.03125
0.03125* 2 = 0.0625
0.0625*2 = 0.125
0.125*2 = 0.25
0.25*2 =0.50
0.50*2 = 1.00
= - 0000 1010.0000 0100
1\'s complement = 1111 0101. 1111 1011
+1
2\'s complement = 1111 0101. 1111 1100


