2-Lecture Notes Lesson1 4
2-Lecture Notes Lesson1 4
2-Lecture Notes Lesson1 4
Objectives
Given the representation of some number (XB) in a number system of radix
B, this lesson will show how to obtain the representation of the same
number (X) in another number system of radix A, i.e. (XA).
Knowns
1
Where ai ∈ {0-(A-1)}
Divisible
Q0 = Qby1A+a
A 1 NotDividing
Divisible
Q0bybyA
Q0 = Q1A+a1
Q1 = Q2A+a2
…………..……………….
Qm-3=Qm-2A+am-2
Qm-2=am-1 < A (not divisible by A)
=Qm-1A+am-1
Where Qm-1 = 0
2
In other words, we get the digits of the integer number starting from the
radix point and moving lefts
Example :
Convert (53) 10 (? )2
Stopping Point
Thus (53)10=(110101.)2
Since we always divide by the radix, and the quotient is re-divided again by
the radix, the solution table may be compacted into 2 columns only as
shown:
Binary Point
51 53
25 1 a0 26 1 LSB
12 1 13 0
6 0 6 1
3 0 3 0
1 1 1 1
0 1 am 0 1 MSB
3
(51)10=(110011.)2
(53)10=(110101.)2
Example :
Convert (755)10 (? )8
Division Step Quotient Remainder
755 ÷ 8 Q0 =94 3 = a0 LSB
94 ÷ 8 Q1 =11 6 = a1
11 ÷ 8 Q2 =1 3 = a2
1 ÷ 8 0 1 = a3 MSB
Example :
Convert (1606)10 (? )12
4
1606 ÷12
133 ÷12 10 = A LSB
11 ÷12 1
0 11 = B MSB
(1606)10 ( B1A.)12
Converting Fractions
Assuming X to be a fraction ( < 1),
1. Assume that XB has n digits
XB = (0.b-1 b-2 b-3…….b-n)B
Knowns
Unknowns
XB = a-1*A-1+a-2*A-2+………a-m*A-m
Integer Fraction
5
Repeating:
XB1*A = a-2 + XB2
………………….
XBm-2*A = a-m-1 + XBm-1
XBm-1*A = a-m
Example :
Convert (0.731) 10 (? )2
Binary Point
0.731*2=1.462
0.462*2=0.924
0.924*2=1.848
0.848*2=1.696
0.696*2=1.392
0.392*2=0.784
0.784*2=1.568
(0.731) 10 = (.1011101)2
6
Example :
Convert (0.731) 10 (? )8
Octal Point
8*0.731 =5.848
8*0.848 = 6.784
8*0.784 = 6.272
8*0.272 = 2.176
(0.731) 10 =(0.5662) 8
Example :
Convert (0.357) 10 (? )12
• For radix twelve, the allowed digit set is:
{0-9, A, B}
System Point
12*0.357 =4.284
12*0.284 = 3.408
12*0. 408= 4.896
12*0. 896= 10.752 A=10
=A
7
IMPORTANT NOTE
For a number that has both integral and fractional parts, conversion is done
separately for both parts, and then the result is put together with a system
point in between both parts.
Example
( )7 ( )5
( )9 ( )12
2 Approaches
1. Convert to Decimal
2. Convert from Decimal to new base
(in the above example bases 5&12)
8
Binary To Octal Conversion
Starting Point
Group of 3 Binary Bits Octal
bi+2 bi+1 bi Equivalent
0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7
Example :
Convert (1110010101.1011011)2 ino Octal.
001__110__010__101_._101__101__100
1 6 2 5 5 5 4
9
001__110__010__101_._101__101__100 = (1625.554)8
Starting Point
4- 4- 4-
bits bits bits
10
Example :
Convert (1110010101.1011011)2 into Hexadecimal.
0011__1001__0101_._1011__0110
3 9 5 B 6
= (395.B6)16
11