You are on page 1of 25

NUMBER SYSTEMS

VALID VALUES

DECIMAL 0 1 2 3 4 5 6 7 8 9

BINARY 0 1

OCTAL 0 1 2 3 4 5 6 7

HEXADECIMAL 0 1 2 3 4 5 6 7 8 9 A B C D E F

A = 10, B = 11, C = 12, D = 13, E = 14, F = 15


CONVERSION

From
DECIMAL
to
ANY NUMBER SYSTEM
CONVERSION FROM DECIMAL TO

BINARY, DIVISOR IS 2

OCTAL, DIVISOR IS 8

HEXADECIMAL, DIVISOR IS 16

Steps :

Divide the decimal number by the divisor until the


quotient becomes zero (0).

The remainder should be noted down for each division


step.

Then the remainders are read in reverse order.


DECIMAL TO Division Quotient Remainder
BINARY 26
CONVERSION ------ = 13 0
2
Convert 26 to 13
binary ------ = 6 1
2

6
26 = 110102 ------ =3 0
2

3
------ =1 1
2

1
------ =0 1
2
DECIMAL TO OCTAL CONVERSION
Convert 426 to octal

Division Quotient Remainder


426
------ = 53 2
8

53
426 = 6528 ------ = 6 5
8

6
------ =0 6
8
DECIMAL TO HEXADECIMAL CONVERSION
Convert 348 to hexadecimal

Division Quotient Remainder


348
------ = 21 12
16

21
348 = 15C16 ------ = 1 5
16

1
------ =0 1
16
CONVERSION

From
ANY NUMBER SYSTEM
to
DECIMAL
CONVERSION FROM ANY NUMBER SYSTEM TO
DECIMAL

Take note of the positional weight of the digits in the number


systems

Binary number 1 1 0 1 02
Positional weight 43210
Octal number 4 2 68
Positional weight 210

Hexadecimal number 1 5 C16


Positional weight 210

Multiply each digit to be converted with its positional weight


depending on the base of the number system
CONVERSION FROM ANY BINARY SYSTEM TO
DECIMAL

Example Binary number 1 1 0 1 02


Positional weight 43210

Multiply each bit with its positional weight depending on the


base (radix) of the number system

= 1 X 24 + 1 X 23 + 0 X 22 + 1 X 21 + 0 X 20

= 1 X 16 + 1 X 8 + 0 X 4 + 1 X 2 + 0 X 1
= 16 + 8 + 0 + 2 + 0
= 26

Hence 1 1 0 1 02 = 2610
CONVERSION FROM ANY OCTAL SYSTEM TO
DECIMAL

Example Octal number 6 5 28


Positional weight 210

Multiply each digit with its positional weight depending on


the base of the number system

= 6 X 82 + 5 X 81 + 2 X 80

= 6 X 64 + 5 X 8 + 2 X 1
= 384 + 40 + 2
= 426

Hence 6528 = 42610


CONVERSION FROM HEXADECIMAL SYSTEM TO
DECIMAL

Example Hexadecimal number 1 5 C16


Positional weight 210

Multiply each digit with its positional weight depending on


the base of the number system

= 1 X 162 + 5 X 161 + 12 X 160

= 1 X 256 + 5 X 16 + 12 X 1
= 256 + 80 + 12
= 348

Hence 1 5C16 = 34810


CONVERSION

From
BINARY to OCTAL
and
VICE VERSA
CONVERSION FROM BINARY TO OCTAL

In an octal number system the maximum digit is


7, which is represented in binary as 1112

To convert binary to octal,

- Group the digits by 3s starting at the least


significant bit (LSB) which is the leftmost

- Replace each group by the decimal equivalent


CONVERSION FROM BINARY TO OCTAL

Example 1011010102
- Group the digits by 3s starting at the least
significant bit (LSB) which is the leftmost

101 101 010

- Replace each group by the octal equivalent

101 101 010


5 5 2

Hence 1011010102 = 5528


CONVERSION FROM OCTAL TO BINARY

- Each octal digit is converted into a 3-bit-


equivalent binary number

- Combine all the digits to get the final binary


equivalent

Example 5528

5 5 2
101 101 010

Therefore : 5528 = 1011010102


CONVERSION

From
BINARY to HEXADECIMAL
and
VICE VERSA
CONVERSION FROM BINARY TO HEXADECIMAL

In a hexadecimal number system the maximum


digit is 15, which is represented in binary as
11112

To convert binary to hexadecimal,

- Group the digits by 4s starting at the least


significant bit (LSB) which is the leftmost

- Replace each group by the hexadecimal


equivalent
CONVERSION FROM BINARY TO HEXADECIMAL

Example 1011010102
- Group the digits by 4s starting at the least
significant bit (LSB) which is the leftmost

0001 0110 1010

- Replace each group by the hexadecimal


equivalent

0001 0110 1010


1 6 A

Hence 1011010102 = 16A16


CONVERSION FROM HEXADECIMAL TO BINARY

- Each hexadecimal digit is converted into a 4-


bit-equivalent binary number

- Combine all the digits to get the final binary


equivalent

Example 16A16

1 6 A
0001 0110 1010

Therefore : 16A16 = 1011010102


CONVERSION

From
OCTAL to HEXADECIMAL
and
VICE VERSA
CONVERSION FROM OCTAL TO HEXADECIMAL

- Convert the octal number to its binary


equivalent
- Form groups of 4 bits starting from LSB
- Write the equivalent hexadecimal for each
group of 4 bits
CONVERSION FROM HEXADECIMAL TO OCTAL

- Convert the hexadecimal number to its


binary equivalent
- Form groups of 3 bits starting from LSB
- Write the equivalent octal for each group of
3 bits
CONVERSION FROM OCTAL TO HEXADECIMAL
Example : 5528
- Convert the octal number to its binary
equivalent
5 5 2
101 101 010
- Form groups of 4 bits starting from LSB
101101010  0001 0110 1010

- Write the equivalent hexadecimal for each


group of 4 bits
0001 0110 1010
1 6 A

Therefore : 5528 = 16A16


CONVERSION FROM HEXADECIMAL TO OCTAL
Example : 16C16
- Convert the hexadecimal number to its
binary equivalent
1 6 C
0001 0110 1100
- Form groups of 3 bits starting from LSB
10110110  101 101 100

- Write the equivalent octal for each group of


3 bits
101 101 100
5 5 4

Therefore : 16C16 = 5548


References:

Digital Principles and Logic Design


A. Saba & N. Manna

You might also like