Introduction To Computing
Introduction To Computing
Lecture # 7
Technique
◦ Multiply each bit by 2n, where n is the
“weight” of the bit
◦ The weight is the position of the bit,
starting from 0 from the right
◦ Add the results
Binary to Decimal
(1 0 1)2 = ( __________________)10
1 x 20 = 1
0 x 21 = 0
1 x 22 = 4
Bit “0”
Bit “0” Results of *
1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
Octal to Decimal
Decimal Octal
Technique
◦ Multiply each bit by 8n, where n is the
“weight” of the bit
◦ The weight is the position of the bit,
starting from 0 from the right
◦ Add the results
Example
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
Hexadecimal to Decimal
Hexadecimal Decimal
Technique
◦ Multiply each bit by 16n, where n is the “weight” of
the bit
◦ The weight is the position of the bit, starting from
0 from the right
◦ Add the results
Example
Decimal Binary
Technique
◦ Divide by two, keep track of the remainder
◦ First remainder is bit 0 (LSB, least-significant bit)
◦ Second remainder is bit 1
◦ Etc.
Example
12510 = ?2 2 125
2 62 1
2 31 0
2 15 1
2 7 1
2 3 1
2 1 1
0 1
12510 = 011111012
Binary to Decimal
Binary to Decimal
Octal Binary
Technique
◦ Keep in mind Octal has a biggest number which is
7
◦ Each octal number shall be separately converted
in binary up to three bits from the right side then
you have to combine this number.
7 0 5
7058 = 1110001012
Hexadecimal to Binary
Hexadecimal Binary
Technique
◦ Keep in mind Octal has a biggest number which is F
and F = 15 in decimal and comes on four bits of
binary i.e.; 1111
◦ Same as octal you have to perform the separate
conversion for each number from the right side
toward left side.
Example
10AF16 = ?2
1 0 A F
10AF16 = 00010000101011112