Number System Conversion
Number System Conversion
Number System Conversion
Hexa (16)
Octal (8)
More Interest
We need decimal system for real world (for presentation and input):
for example: we use 10-based numbering system for input and output
in digital calculator.
We need binary system inside calculator for calculation.
1 1 0 1 1
+ + + = 16+8+2+1= 2710
24 +23 0 21 20
= 12 + remainder of 1 (LSB)
= 6 + remainder of 0
= 3 + remainder of 0
= 1 + remainder of 1
= 0 + remainder of 1 (MSB)
2510 = 1 1 0 0 12
=
3 0 (a1)
1 1 (a2)
0 1 (a3)
Answer (13)10 = (a3 a2 a1 a0) = (1101)2
Example 3: Convert 0.62510 to binary number
Multiply by 2 Integer Fraction coefficient
0.625*2 = 1 + 0.25 a1 = 1
0.250*2 = 0 + 0.50 a2 = 0
0.500*2 = 1 + 0(stop) a3 = 1
Correct
Answer (0.625)10 = (0.a1 a2 a3)2 = (0.101)2 order
c) Octal-to-decimal
To convert, we need to multiply each octal digit by its positional
weight.
Example 1
Example 2
d) Decimal to octal
Repeated division by 8.
= 33 + remainder of 2 (LSD)
= 4 + remainder of 1
= 0 + remainder of 4
26610 = 4 1 2(8)
Example 2: Convert 0.3510 to octal number.
Multiply by 8 Integer Fraction coefficient
0.35*8= 2 + 0.80 a1 = 2
0.2*8 = 1 + 0.60 a4 =1
0.6*8 = 4 + 0.80 a5 =4
356(16) =
= 26 + remainder of 7 (LSD)
= 1 + remainder of 10
= 0 + remainder of 1
42310 = 1 A 7(16)
g) Hexa-to-binary:
Each hexa digit is converted to its four-bit binary equivalent:
9 F 2
9F2(16) = 100111110010(2)
h) Binary-to-hexa
The binary numbers are grouped into groups of four bits and each
group is converted to its equivalent hexa digit.
Zeros are added as needed to complete a four-bit group.
Solution:
Added
0011 1010 0110
zeros
3 A 6
1110100110(2) = 3A6(16)
Solution:
Solution:
4 7 2
472(8)) = 100111010(2)
Solution:
Solution:
Added
011 010 110
zero
3 2 6
11010110(2) = 326(8)
Note:
Zero was placed to the left of the MSB to produce groups
of 3 bits.
General example:
= 22 + remainder of 1 (LSD)
= 2 + remainder of 6
= 0 + remainder of 2
17710 = 2 6 1(8)
Thus 17710 = 261(8), now we can quickly convert this octal number
to its binary equivalent 010110001 to get eight bit representation.
So: