Number Systems
Through this lecture, students will
be able to represent numbers in
Learning various numeration systems, convert
Outcomes a numeral from one base to another
base
Why learn Number Systems?
Common Number Systems
System Base Symbols
Decimal 10 0,1,2,3,4,5,6,7,8,9
Binary 2 0, 1
Octal 8 0, 1,2,3,4,5,6, 7
Hexa- 16 0, 1, … 9,
decimal A, B, … F
Conversion Among Bases
• The possibilities:
Decimal Octal
Binary Hexadecimal
Types of Conversion
1. Decimal Number System to any other Number System
2. Other Number System to Decimal Number System
3. Other Number System to any Number System
1. Decimal to other Number System
Decimal Octal
Binary Hexadecimal
Method
Steps
Step 1 − Divide the decimal number to be converted by the value of the new base.
Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant
digit) of new base number.
Step 3 − Divide the quotient of the previous divide by the new base.
Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new
base number.
Decimal to Binary
This process also works to convert decimal to binary,
but this time the system radix is 2:
For example, to convert the decimal number 1310 to
binary:
Example 1.2.1 Decimal to Binary
Conversion
Therefore 1310 = 11012
Example
Decimal Number: 2910
Calculating Binary Equivalent −
Step Operation Result Remainder
Step 1 29 / 2 14 1
Step 2 14 / 2 7 0
Step 3 7/2 3 1
Step 4 3/2 1 1
Step 5 1/2 0 1
Decimal Number − 2910 = Binary Number − 111012.
Decimal to Octal
• For example,
• To convert the decimal number 8610 to octal:
• Divide 8610 by the system radix, which when converting
to octal is 8.
• This gives the answer 10, with a remainder of 6. Example 1.2.2 Decimal to
Octal Conversion
• Continue dividing the answer by 8 and writing down the
remainder until the answer = 0
• Now simply write out the remainders, starting from the
bottom, to give 1268
• Therefore 8610 = 1268
Decimal to Hexadecimal
To convert decimal to hexadecimal,
Where the radix is 16:
• As some of the remainders may be greater
than 9 (and so require their alphabetic
replacement),
• you may find it easier to use Decimal for the
remainders, and then convert them to Hex. Example 1.2.3 Decimal to
Hexadecimal Conversion
Therefore 286110 = B2D16
2. Other Base System to Decimal
System
Decimal Octal
Binary Hexadecimal
Method
• Step 1 − Determine the column (positional) value of each
digit (this depends on the position of the digit and the base
of the number system).
• Step 2 − Multiply the obtained column values (in Step 1) by
the digits in the corresponding columns.
• Step 3 − Sum the products calculated in Step 2. The total
is the equivalent value in decimal.
Binary to Decimal
Convert 11012 to decimal.
The same method can be used to convert binary number to decimal:
= (1x23)+(1x22)+(0x21)+(1x20)
= 8 + 4 +0 +1
= 1310
Therefore 11012 = 1310.
Example
Binary Number − 111012
Calculating Decimal Equivalent −
Ste Binary Number Decimal Number
p
4 3
Ste
p1
111012 ((1 × 2 ) + (1 × 2 ) +
2 1
(1 × 2 ) + (0 × 2 ) +
0
(1 × 2 ))10
Ste
p2
111012 (16 + 8 + 4 + 0 + 1)10
Ste
p3
111012 2910
Binary Number − 111012 = Decimal Number − 2910
Octal to Decimal
For example the system radix of octal is 8, since any of the 8
values from 0 to 7 can be written as a single digit.
Convert 1268 to decimal.
• Using the values of each column (which in an octal integer are powers of 8) the octal value
1268 can also be written as:
• (1x82) + (2x81) + (6 x 80)
• As (82 = 64), (81 = 8) and (80 =1),
• this gives a multiplier value for each column.
• Multiply the digit in each column by the column multiplier value for that column to give:
• 1x64 = 64 2x8 =16 6x1 = 6
• Then simply add these results to give the decimal value.
• 64 + 16 + 6 = 8610
• Therefore 1268 = 8610.
Hexadecimal to Decimal
Convert B2D16 to decimal.
Using the same method to convert hexadecimal to decimal.
= (Bx162)+(2x161)+(Dx160)
= (11x162)+(2x161)+(13x160)
= 2816 + 32 +13
= 286110
Therefore B2D16 = 286110.
The same method (multiplying each digit by it's column value) can
be to convert any system to decimal.
Try these conversions to decimal
1. 1102
2. 678
3. AFC16
4. FC16
Now try some conversions yourself
Convert:
1. 110100112 to decimal.
2. 101110112 to decimal.
3. 34F216 to decimal.
4. FFFF16 to decimal.
3. Other Base System to
Non-Decimal System
Steps
Step 1 − Convert the original number to a decimal
number (base 10).
Step 2 − Convert the decimal number so obtained to the
new base number.
Example: Octal to Binary
Octal Number − 258
Step 1 − Convert to Decimal
Ste Octal Number Decimal Number
p
1 0
Ste 258 ((2 × 8 ) + (5 × 8 ))10
p1
Ste 258 (16 + 5 )10
p2
Ste 258 2110
p3
Octal Number − 258 = Decimal Number − 2110
Step 2 − Convert Decimal to Binary
Ste Operation Result Remainder
p
Ste 21 / 2 10 1
p1
Ste 10 / 2 5 0
p2
Ste 5/2 2 1
p3
Ste 2/2 1 0
p4
Ste 1/2 0 1
p5
Decimal Number − 2110 = Binary Number − 101012
Octal Number − 258 = Binary Number − 101012
Examples
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 = 11111012
Example
7058 = ?2
7 0 5
111 000 101
7058 = 1110001012
Example
10AF16 = ?2
1 0 A F
0001 0000 1010 1111
10AF16 = 00010000101011112
Example
123410 = ?8
8 1234
8 154 2
8 19 2
8 2 3
0 2
123410 = 23228
Example
123410 = ?16
16 1234
16 77 2
16 4 13 = D
0 4
123410 = 4D216
Example
10110101112 = ?8
1 011 010 111
1 3 2 7
10110101112 = 13278
Example
10101110112 = ?16
10 1011 1011
2 B B
10101110112 = 2BB16
Example
10768 = ?16
1 0 7 6
001 000 111 110
2 3 E
10768 = 23E16
Example
1F0C16 = ?8
1 F 0 C
0001 1111 0000 1100
1 7 4 1 4
1F0C16 = 174148
Exercise – Convert ...
Hexa-
Decimal Binary Octal decimal
33
1110101
703
1AF
Don’t use a calculator!
Thank you