MPU-21
101111
2
= lx2
0
+ 1x2
1
+ lx2
2
+ lx2
3
+ 0x2
4
+ 1x2
5
= 1x1 + 1x2 + 1x4 + 1x8 + 0x16 + 1x32
= 1 + 2 + 4 + 8 + 0 + 32
= 47
10
In general, converting from a number in any base to a number in base
10 is accomplished as follows:
(A
0
B
0
+ A
1
B
1
+ A
2
B
2
+ A
3
B
3
+ A
4
B
4
-- -- -- -- A
n
B
n
)
where B is the base of the number system and A is the particular digit in the
original number corresponding to its position to the left of the decimal
point. On the example just completed, (101111). A
0
= 1, A
1
= 1, A
2
= 1, A
3
=
1, A
4
= 0, & A
5
= 1 and B = 2 (base 2).
Another base which is very convenient in digital computers is base
8, since base 8 is really a convenient way of representing base 2. Lets
illustrate by converting a base 10 number to base 8 & base 2. Let's convert
61 in base 10 to a number in base 8 and a number in base 2. By continuous
division:
7
8
61 R=5
0
8
7 R=7 75
8
30
2
61 R=1
15
2
30 R=0
7
2
15 R=1
3
2
7 R=1 111101
2
1
2
3 R=1
0
2
1 R=1
Comments to this Manuals