5 - 5
In the example below, a decimal number 157 is converted into the binary number.
1)
157
128
29
16
13
8
5
4
1
1
0
1
0 0
1 1 1
0
1
128
64 32 2
Bit
weights
16
8
4 1
2)
157
1
0 0
1 1 1
0
1
128
64 32 2
16 8 4 1
78
39
19
9
4
2
1
1
Quotient
2
Remainder
2
2
2
2
2
2
0
1
1
1
0
0
In the example below, a decimal number 157 is converted into the hexadecimal number.
1)
1 0 0 1 1 1 0 1
9 D
157
16
913(D)
How to convert the decimal number into the binary number
How to convert the decimal number into the hexadecimal number