Logic Circuits and Switching Theory: Number System Conversion
Logic Circuits and Switching Theory: Number System Conversion
Logic Circuits and Switching Theory: Number System Conversion
Module 1
NUMBER SYSTEM :
CONVERSION
Objectives
Number
Base Symbol
System
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
Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Place value
Example: 4292
Using place values, the number 4292
is understood to mean,
4000 + 200 + 90 + 2 = 4292
This can also be expressed as
(4x1000) + (2x100) + (9x10) +
(2x1) = 4292
Example: 4292
Note that each digit is multiplied by powers of 10,
so that the above is equal to –
(4x103) + (2x102) + (9x101) + (2x100) = 4292
(4x1000) + (2x100) + (9x10) + (2x1) = 4292
4000 + 200 + 90 + 2 = 4292
Note that the rightmost exponent starts from zero
and increases by 1 as the place value increases.
Noticed that the most significant value or the
leftmost value has an exponent equal to the number
of digits minus one.
Binary Number System
DIV Q R
1635/2 817 1 DIV Q R DIV Q R
817/2 408 1 1635/8 204 3 1635/16 102 3
408 /2 204 0 204/8 25 4 102/16 6 6
204 /2 102 0 25 /8 3 1 6 /16 0 6
102 /2 51 0 3 /8 0 3
51/2 25 1
25/2 12 1 31438 66316
12/2 6 0
6/2 3 0
3/2 1 1
1/2 0 1
( Bin to Octal - use: code 4-2-1) ( Bin to Hexa - use: code 8-4-2-1)
110011000112 011/001/100/0112 0110/0110/00112
= 31438 = 66316
31438
66316
3x80 = 3x1 = 3 3x160 = 3x1 == 3
4x81 = 4x8 = 32 6x161 = 6x16 == 96
1x82 = 1x64 = 64 6x162 = 6x256 == 1536
3x83 = 3x512 = 1536 1635
1635
110011000112
1X20 = 1X1 = 1
1X21 = 1X2 = 2
0X22 = 0X4 = 0
0X23 = 0X8 = 0
0X24 = 0X16 = 0
1X25 = 1X32 = 32
1X26 = 1X64 = 64
0X27 = 0X128 = 0
0X28 = 0X256 = 0
1X29 = 1X512 = 512
1X210 = 1X1024 = 1024
1635
Summary
A number base is a specific collection of symbols on which a
number system can be built.
Place value means that the value of a digit in a number depends
not only on its own natural value but also on its location in the
number.
Decimal number system has base 10. Since it is in base 10, ten
symbol are used in the decimal number system.{0,1,2,3,4,5,6,7,8,9}
Binary number system has base 2. Since it is in base 2, two symbol
are used in the binary number system. {0,1}
Octal number system has base 8. Since it is in base 8, eight
symbols are used in the octal number system. {0,1,2,3,4,5,6,7}
Hexadecimal number system has base 16. Since it is in base 16,
sixteen symbols are used in the hexadecimal number system.
{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
Summary (continuation)
To convert any number system to decimal you need to
use the expanded notation method. Use the base from
which number system is to be converted to decimal.
While if you will convert decimal to any number system
you will use the division remainder technique. For
integer division use the base into which number system
will be converted. Remember to use integer division since
you are after the remainder. Division operation will took
place until quotient is equal to zero. The reversed order
of the remainder will form the equivalent number
system.
Summary (continuation)
If octal to binary. Convert each octal digit to a set of
three binary digits. While if binary to octal. Convert each
set of three binary digits to an octal digit starting from
the right going to the left, adding leading zeroes if
necessary. Use code : 4-2-1
If hexa to binary. Convert each hexa digit to a set of four
binary digits. While if binary to hexa. Convert each set
of four binary digits to a hexa digit starting from the
right going to the left, adding leading zeroes if necessary.
Use code : 8-4-2-1
Thanks for your time.
PM is the key