Module 1 - Number Systems
Module 1 - Number Systems
Number Systems
Number Systems
• Identify the different number systems used in logic
circuits
• Perform conversion of one number system into
another
Number Systems
Number system is numerical language used to represent
digits in ordered sets of symbols governed by different
mathematical rules.
Base/ Radix – number of digits in ordered set
(W.F)r
W= integer part
F = fractional part
. = radix point
r = radix
Number is a group of digits in ordered set.
cj coefficient of r
rj = radix raise to j
i = number of integer digits
f = number of fractional digits
Four number system
▪ Decimal (10)
▪ Binary (2)
▪ Octal (8)
▪ Hexadecimal (16)
▪ ............
• Number system with radix or base equals to 2
• Bits is the term use to define the unit which came from
binary digit
• Represented by logic 1 or 0
• Electrical signal can be interpreted as high voltage for
logic 1 and low voltage for logic 0
Computers work only on two states
• On
• Off
Basic memory elements hold only two states
• Zero / One
Thus a number system with two elements {0,1}
A binary digit – bit !
B = log2N
B is the no. of bits in which you can present one of N
probable events
eg. Determine the number of bits in which you can
represent 26 letters in the alphabet. Compare with dits.
Coding efficiency
Ub=(4.7/5)x100%=94%
Ud= (log26)/2 * 100% = 71 %
In digital circuits, there are specified values of logic 1
being specified as high level with corresponding
minimum and maximum value and logic 0 as low level
with corresponding minimum and maximum value.
Radix = 10
Base r to Base 10:
(W.F)r to (W.F)10
Pointers
Write WFr in polynomial and simplify using decimal
operation ( multiply and add)
eg.
(11.01)2 = 1x21 + 1x20 + 0x2-1 + 1x2-2 =
(11)8 = 1x81 + 1x80 =
(A1)16 = Ax161 + 1x160 =
Base 10 to Base r:
(W.F)10 to (W.F)r
Pointers
Separate integer part from fractional part.
For integer part, divide the integer part by base r until
you reach zero quotient. Then the last remainder will be
the MSB while the first one will be the LSB.
For fractional part, multiply the decimal number by base
r giving integer and fractional part. Continue
multiplication until you reach zero product for the
fractional part and read the first integer up to the last
integer as the desired number.
eg.
(13.75)10 =
• Sum of Weights Method
• Write the binary numbers in the weights of power of 2
and cross out the weights above zero then add the
remaining weights.
Octal: 3bits 000-111 0 to 7
Hexadecimal: 4bits 0000-1111 0 to F
1101 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20
=1x8+1x4+0x2+1x1
=8+4+0+1
(1101)2 = (13)10
(13)10 = (1101)2
Each digit represent 3 bits .
Each digit represent 4 bits.
137 = 1 x 82 + 3 x 81 + 7 x 80
= 1 x 64 + 3 x 8 + 7 x 1
= 64 + 24 + 7
(137)8 = (95)10
(95)10 = (137)8
BAD = 11 x 162 + 10 x 161 + 13 x 160
= 11 x 256 + 10 x 16 + 13 x 1
= 2816 + 160 + 13
(BAD)16 = (2989)10
(2989)10 = (BAD)16
Convert to decimal first then decimal to non decimal.
Ease of use and conversion
Three bits make one octal digit
111 010 110 101
7 2 6 5 => 7265 in octal
001 ( 1)10
101 (-3)10
110 (-2)10
Solution:
2’s complement
r=2 ; 26 – 100111 = 1000000-100111=011001
1’s complement
r=2 and f=0
26 –20 – 100111= 1000000-1-100111 =011000
2’s complement of binary number, invert all its and add
logic 1 to LSB.
100111 will become 011000 then add 1 to become 011001
Answer:
432010-8523210 = -80,91210
Perform the indicated operation using 2’s complement
a. 11012-11002
Solution:
M= 1101
S = 1100
radix = 2
1. Make M=S digits 1101 and 1100
2. Take the 2’s complement of S
24-1100 =100002-11002 = 0100
3. Add M+S 2’s complement
1101
+0100
----------------
1carry0001
4. Check if M>S, yes, disregard the carry
Answer : 11012-11002 = 00012
Perform the indicated operation using 1’s complement
a. 10012-11002
Solution:
M= 1001
S = 1100
radix = 2
1. Make M=S digits 1001 and 1100
2. Take the 1’s complement of S
24-20 -1100 =100002- 1-11002 = 0011
3. Add M+S 2’s complement
1001
+0011
----------------
1100
4. Check if M>S, No, take the 1’s complement of sum
and place a negative number
Answer : 10012-11002 = -00112
Perform the indicated operation using 9’s complement
a. 543210-1325010
Solution:
M= 5432
S = 13250
radix = 2
1. Make M=S digits 5432 and 13250
2. Take the 9’s complement of S
105-100-13250 =86,749
3. Add M+S 9’s complement
05,432
+86,749
----------------
Sum 92,181
4. Check if M>S, No, 5432<13250, take the 9’s
complement of 92,181 qnd place a negative sign
5. 105-100-92,181= 7,818
Answer : 543210-1325010 = -7,818
Perform the indicated operation using 7’s
complement
a. 368-768
Solution:
M= 36
S = 76
radix = 8
1. Make M=S digits 36 and 76, convert S to decimal
system before proceeding to no.2
768 = 7x81+6x80=6210
2. Take the 7’s complement of S
82-80-6210 = 110 = 18
3. Add M+S 7’s complement in octal
368
+ 18
----------------
Sum 378
4. Check if M>S, No, 36<76, take the 7’s complement of
378 qnd place a negative sign
82-80--31= 3210 convert to base 8