Ch1 - Number System - Part2 Decimal To Binary VV
Ch1 - Number System - Part2 Decimal To Binary VV
Position weights 24 23 22 21 20
digits 1 0 1 1
How is a positive integer represented in binary?
Let’s analyze the binary number 110:
110 = (1 x 22) + (1 x 21) + (0 x 20)
= (1 x 4) + (1 x 2) + (0 x 1)
Position weights 22 21 20
Number digits 1 1 0
0 x20 = 0 +
1 x21 = 2 +
1 x 22 = 4
6
positional powers of 2: 2 4 23 22 2 1 20
decimal positional value: 16 8 4 2 1
binary number: 1 0 1 1 1
16 +0+ 4 + 2 + 1 = 2310
Example #3: 1100102
positional powers of 2: 25 24 23 22 21 20
decimal positional value: 32 16 8 4 2 1
binary number: 1 1 0 0 1 0
2 ) 56 Rem:
2 ) 28 0
2 ) 14 0
2) 7 0
2) 3 1
2) 1 1
0 1
Subtract out largest power of 2 possible
(without going below zero), repeating until you
reach 0.
Place a 1 in each position where you COULD subtract the value
Place a 0 in each position that you could NOT subtract out the value
without going below zero.
Example 1: 2110
21 26 25 24 23 22 21 20
64 32 16 8 4 2 1
- 16
5 1 0 1 0 1
- 4
1
- 1 Answer: 2110 = 101012
0
Example 2: 5610
56 2 6 | 2 5 2 4 2 3 22 2 1 2 0
- 32 64| 32 16 8 4 2 1
24 |1 1 1 0 0 0
- 16
8
- 8 Answer: 5610 = 1110002
0