Professional Documents
Culture Documents
Unit – 1
Number Systems and
Codes
4
1 2 3
32 16 8 4 2 1 0.5 0.25
Octal Numbers
Computer scientists are often looking for shortcuts to do things.
One of the ways in which we can represent binary numbers is to use their octal equivalents instead
This is especially helpful when we have to do fairly complicated tasks using numbers.
The octal numbering system includes eight base digits (0-7). After 7, the next placeholder to the right
begins with a “1”. The Octal numbers are: 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13 ...
Base
The decimal equivalent of A, B, C, D, E and F are 10, 11, 12, 13, 14 and 15 respectively, for obvious
reasons
The hexadecimal number system provides a condensed way of representing large binary numbers
stored and processed inside the computer. One such example is in representing addresses of different
memory locations.
Base
Binary 1001 = 9
Binary 1111 = 15
Binary 0010 = 2
Decimal to Binary Conversion
Divide by 2 Process
Decimal # 13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
1 1 0 1
Decimal to Binary Conversion
TEST
Convert the following decimal numbers into binary:
Decimal 11 = 1011
Decimal 4 = 0100
Decimal 17 = 10001
Octal to Decimal Conversion
The decimal equivalent of the octal number (137.21)8 is determined as follows:
• The integer part = 137
• The decimal equivalent = 1 × 83 + 3 × 81 + 7 × 80 = 64 + 24 + 7 = 95
Octal 10 = 8
Octal 73 = 59
Octal 24 = 20
Decimal to Octal Conversion
Divide by 8 Process
Decimal # 73 ÷ 8 = 9 remainder 1
9 ÷ 8 = 1 remainder 1
1 ÷ 8 = 1 remainder 1
1 1 1
Decimal to Octal Conversion
TEST
Convert the following decimal numbers into octal:
Decimal 11 = 13
Decimal 4 = 4
Decimal 17 = 21
Hexadecimal to Decimal Conversion
Hexadecimal 1F = 31
Hexadecimal 73 = 115
Hexadecimal 2A = 42
Decimal to Hexadecimal Conversion
Divide by 16 Process
Decimal # 82 ÷ 16 = 5 remainder 2
5 ÷ 16 = 5 remainder 5
5 2
Decimal to Hexadecimal Conversion
TEST
Convert the following decimal numbers into
Hexadecimal:
Decimal 121 = 79
Decimal 45 = 2D
Decimal 73 = 49
Binary to Octal and Vice Versa
• The given octal number = (374.26)8 Octal Binary
• The binary equivalent = (011 111 100.010 110)2 = 0 000
(011111100.010110)2 1 001
2 010
• Any 0s on the extreme left of the integer part and extreme right of 3 011
the fractional part of the equivalent 4 100
5 101
binary number should be omitted. Therefore,
6 110
(011111100.010110)2 = (11111100.01011)2
7 111
• The given binary number = (1110100.0100111)2 10 001 000
= (1 110 100.010 011 1)2 11 001 001
…
= (001 110 100.010 011 100)2
= (164.234)8
Hexadecimal Binary
Binary to Hexadecimal and Vice Versa 0 0000
1 0001
2 0010
• The given hex number = (17E.F6)16
3 0011
• The binary equivalent = (0001 0111 1110.1111 0110)2
4 0100
= (000101111110.11110110)2 5 0101
= (101111110.1111011)2 6 0110
7 0111
• The 0s on the extreme left of the integer part and on the
8 1000
extreme right of the fractional part have been omitted.
9 1001
• The given binary number = (1011001110.011011101)2 A 1010
= (10 1100 1110.0110 1110 1)2 B 1011
Digital Microprocessor
Electronics Architecture,
Principles, Programming,
REFERENCE By By
Anil K. Maini Ramesh Gaonkar