MTES3013 TAJUK2 Number Base
MTES3013 TAJUK2 Number Base
MTES3013 TAJUK2 Number Base
2. Number Bases
Convert any base-a number to base-b
number up to base-16.
Make connection between numbers of
various bases
Converting to Base 10:
Notice that the last problem was base 6, which is
lower than our base. What if the number was in
base 12 (which is larger than our base)? In base
12, there should be 12 different symbols, starting
with 0. So we could list 0,1,2,3,4,5,6,7,8,9, but
then what? We cannot use 10 and 11 because
they are not different symbols, they are a
combination of two symbols.
In our text, the following symbols for base 12 are
used: 0,1,2,3,4,5,6,7,8,9,T,E. To remember this,
think the T stands for ten and the E stands for
eleven.
2
OCTAL TO DECIMAL CONVERTION
Convert from octal to decimal by multiplying each octal digit by its positional
weight.
Convert from decimal to octal by using the repeated division method used
for decimal to binary conversion.
Divide the decimal number by 8
The first remainder is the LSB and the last is the MSB.
Example : convert 35910 to Decimal Value
Solve = 35910 = ?8
= 359 44 balance 7 LSB
8
= 44 5 balance 4
8
= 58 0 balance 5 MSB
... Answer = 5478
OCTAL TO BINARY CONVERTION
Convert from octal to binary by converting each octal digit to a
three bit binary equivalent
Octal digit 0 1 2 3 4 5 6 7
Binary 000 000 000 000 000 000 000 000
Equivalent
6
Converting to Base 10:
Basically, converting to base 10 involved writing
a number in expanded form and multiplying to
find the value of each digit. Then find the sum
of all of the values.
To see more examples of converting to base 10,
look at page 162 in the text, Examples 2,3, and
4.
7
Converting from Base 10 to another base:
What if we want to convert the other way? It
would make sense that we would do the
opposite operation division.
8
Converting from Base 10 to another base:
3. Convert 146 ( which is in base 10) to base 5.
The positional values in base 5 are
. . . 54 , 53 , 52 , 5 , 1 or . . . 625 , 125 , 25 , 5 , 1
The highest power of 5 that is less than or equal
to 146 is 53 or 125. Divide 146 by 125.
146/125 = 1 with remainder 21.
Therefore, there is 1 group of 125 in 146.
( 1 is the first digit in the answer )
9
Converting from Base 10 to another base:
3 continued: Next divide the remainder, 21, by 25
(the next lower positional-value of 5).
21/25 = 0 with remainder 21
Therefore, there are 0 groups of 25 in 21.
(0 is the 2nd digit in the answer)
Next divide the remainder, 21, by 5 (the next
lower positional-value of 5).
21/5 = 4 with remainder 1
Therefore, there are 4 groups of 5 in 21 with 1
unit remaining.
(4 is the 3rd digit in the answer)
10
Converting from Base 10 to another base:
3 continued: The answer is:
146 = (1 x 125) + (0 x 25) + (4 x 5) + (1 x 1)
= (1 x 53) + (0 x 52) + (4 x 5) + (1 x 1)
= 10415
Note: We place a subscript 5 to the right of
1041 to show that it is a base 5 number.
11
Converting from Base 10 to another base:
4. Convert 1695 to base 12.
The positional values in base 12 are
. . .123 , 122 , 12 , 1 or . . . 1728 , 144 , 12 , 1
The highest power of 12 that is less than or
equal to 1695 is 144. Divide 1695 by 144.
1695/144 = 11 with remainder 111
Therefore, there are 11 groups of 144 in 1695.
( E, the symbol for 11 in base 12, is the first digit
in the answer)
12
Converting from Base 10 to another base:
Next, divide the remainder, 111, by 12 (the next
lower positional-value of 12).
111/12 = 9 with remainder 3
Therefore, there are 9 groups of 12 in 111 and 3
units remaining.
(9 is the 2nd digit in the answer)
1695 = (E x 122 ) + ( 9 x 12 ) + ( 3 x 1 )
= E9312
13
Converting from Base 10 to another base:
More examples converting from base 10 to
another base can be found in the text on pages
162-164, Examples 5-7.
14
OCTAL TO BINARY CONVERTION
Convert from octal to binary by converting each octal digit to a
three bit binary equivalent
Octal digit 0 1 2 3 4 5 6 7
Binary 000 000 000 000 000 000 000 000
Equivalent
The hexadecimal system uses base 16. Thus, it has 16 possible digit symbols. It uses
the digits 0 through 9 plus the letters A, B, C, D, E, and F as the 16 digit symbols.
16 4 163 16 2 161 16 0 16 1 16 2 16 3 16 4 16 5
23
Decimal Number 4-bit Binary Number Hexadecimal Number
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
26
Addition in Other Bases:
In some examples, the book uses addition
tables from each base to solve addition
problems. In this course, we will not be using
addition tables. In this course, you will not be
asked to use addition tables, and you will not be
allowed to use them when taking a test.
In the long run, it is faster to learn to add
numbers without the tables.
27
Addition in Other Bases:
To add in bases other that base 10, we will add
as if we were in base 10, and then convert the
answer to the given base. Once the sum is
converted to the given base, then we can
record it under the problem.
It is much easier to explain this by showing an
example. The following slides will show how to
add in bases other than 10.
28
Addition in Other Bases:
29
Addition in Other Bases:
1
30
Addition in Other Bases:
1
31
Addition in Other Bases:
1
32
Addition in Other Bases:
1
33
Addition in Other Bases:
2. Add 341 5
1 + 1 = 2 10 = 2 5
+ 341 5
34
Addition in Other Bases:
2. Add 341 5
1 + 1 = 2 10 = 2 5
+ 341 5
2 Record the 2.
35
Addition in Other Bases:
2. Add 341 5
1 + 1 = 2 10 = 2 5
+ 341 5
2 Record the 2.
4 + 4 = 8 10 = 13 5
36
Addition in Other Bases:
1
2. Add 341 5 1 + 1 = 2 10 = 2 5
+ 341 5
Record the 2.
32
4 + 4 = 8 10 = 13 5
Record the 3 and carry
the 1.
37
Addition in Other Bases:
1
2. Add 341 5 1 + 1 = 2 10 = 2 5
+ 341 5
Record the 2.
32
4 + 4 = 8 10 = 13 5
Record the 3 and carry
the 1.
1 + 3 + 3 = 7 10 = 12 5
38
Addition in Other Bases:
1
2. Add 341 5 1 + 1 = 2 10 = 2 5
+ 341 5
Record the 2.
1232 5
4 + 4 = 8 10 = 13 5
Record the 3 and carry
the 1.
1 + 3 + 3 = 7 10 = 12 5
Record the 12. You are
finished. 39
Addition in Other Bases:
Study Examples 4 and 5 on pages 168 and 169
in the text. These are more examples of
addition in other bases.
40
Subtraction in Other Bases:
Subtraction can be performed in other bases
relatively easily. Remember that when you
have to borrow, you borrow the amount of the
base given in the problem. For example, if you
are subtracting in base 3, when you borrow, you
borrow 3.
41
Subtraction in Other Bases:
3. Subtract 536 7
- 124 7
42
Subtraction in Other Bases:
43
Subtraction in Other Bases:
44
Subtraction in Other Bases:
45
Subtraction in Other Bases:
46
Subtraction in Other Bases:
47
Subtraction in Other Bases:
48
Subtraction in Other Bases:
49
Subtraction in Other Bases:
Notice how that was no different than if we
would have been calculating in base 10. That is
because we did not have to borrow.
Lets look at an example that involves
borrowing.
50
Subtraction in Other Bases:
4. Subtract 1221 3
- 202 3
51
Subtraction in Other Bases:
52
Subtraction in Other Bases:
1
53
Subtraction in Other Bases:
1 4
54
Subtraction in Other Bases:
1 4
55
Subtraction in Other Bases:
1 4
56
Subtraction in Other Bases:
1 4
57
Subtraction in Other Bases:
1 4
58
Subtraction in Other Bases:
1 4
59
Subtraction in Other Bases:
1 4
60
Subtraction in Other Bases:
1 4
61
Subtraction in Other Bases:
1 4
62
Subtraction in Other Bases:
1 4
64
Multiplication in Other Bases:
To multiply in bases other that base 10, we will
multiply as if we were in base 10, and then
convert the answer to the given base. Once the
product is converted to the given base, then we
can record it under the problem.
It is much easier to explain this by showing an
example. The following slides will show how to
multiply in bases other than 10.
65
Multiplication in Other Bases:
5. Multiply 123 5
x 45
66
Multiplication in Other Bases:
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45
67
Multiplication in Other Bases:
2
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
2 the 2.
68
Multiplication in Other Bases:
2
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
2 the 2.
(4 x 2) + 2 = 10 10 = 20 5
69
Multiplication in Other Bases:
22
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
02 the 2.
(4 x 2) + 2 = 10 10 = 20 5
Record the 0 and carry
the 2.
70
Multiplication in Other Bases:
22
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
02 the 2.
(4 x 2) + 2 = 10 10 = 20 5
Record the 0 and carry
the 2.
(4 x 1) + 2 = 6 10 = 11 5
71
Multiplication in Other Bases:
22
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
1102 5 the 2.
(4 x 2) + 2 = 10 10 = 20 5
Record the 0 and carry
the 2.
(4 x 1) + 2 = 6 10 = 11 5
Record the 11.
72
Multiplication in Other Bases:
22
5. Multiply 123 5 3 x 4 = 12 10 = 22 5
x 45 Record the 2 and carry
1102 5 the 2.
(4 x 2) + 2 = 10 10 = 20 5
Record the 0 and carry
the 2.
(4 x 1) + 2 = 6 10 = 11 5
Record the 11.
The problem is complete. 73
THE END
74