Professional Documents
Culture Documents
Chapter - 1
Chapter - 1
Chapter - 1
Ch ter
1 Number Systems
1.1 Introduction
A digital system is a combination of devices designed to manipulate physical
quantities or information that are represented in digital form, that, is they can
only take discrete values. A digital system includes digital computers, calculators,
telephone system and digital audio and video equipment.
d1 d2 d3 ....dm
(N )b = dn1 dn2 dn3 ....d1 d0 |{z}
| {z } | {z }
integral portion radix fractional portion
point
Where,
N = number
b = base or radix
d = different symbols used in the number system
n = number of digits in the left side of the radix point
m = number of digits in the right side of the radix point
Radix is defined as the number of different symbols used in a particular num-
ber system. For example, in decimal number system, the base is 10. So, we use
10 different symbols (digits) 0, 1, 2, 3, 4....8, 9 to represent any decimal number.
Note:
The maximum value of digit in any number system is given by (b 1).
For example, maximum value of digit in decimal number system = (10 -1) = 9
Any number system can be converted into decimal number system by using
the following formula:
Decimal equivalent = dn1 (b)n1 + dn2 (b)n2 + ...... + d1 (b)1 + d0 (b)0 +
d1 (b)1 + d2(b)2 + ........ + dm (b)m
Example 1.1 Convert the decimal number (23)10 into its equivalent binary num-
ber.
I Solution
Taking the remainders from bottom to top, the equivalent binary number can be
written as (10111)2 .
Example 1.2 Convert the decimal number (18.125)10 into its equivalent binary
number.
I Solution
The integral part and the fractional part are computed separately.
Integral conversion:
2 18 Top
2 9 - 0
2 4 - 1
2 2 - 0
1 - 0 Bottom
(18)10 = (10010)2
Fractional conversion:
If the decimal number contains a fractional part, then its binary equivalent is ob-
tained by multiplying the fractional part continuously by 2, removing the carry
1.4 Digital Electronics, an easy approach to learn
over (whether 0 or 1) in the integer position each time. The removed carry over in
forward order gives the required binary number.
0.125
2
0.250
Forward
2
order
0.500
2
1.000
(0.125)10 = (0.001)2
Hence, (18.125)10 = (10010.001)2
Example 1.3 Convert the decimal number (12.1)10 into its binary equivalent.
I Solution
Integral conversion:
2 12 Top
2 6 - 0
2 3 - 0
1 - 1 Bottom
Fractional conversion:
0.1
2
0.2
Forward
2
order
0.4
2
0.8
2
1.6
2
1.2
2
0.4
2
0.8
2
1.6
2
1.2
Number Systems 1.5
Hence,
(12.1)10 = (1100.000110011....)2
= (1100.00011)2
Example 1.4 Convert the binary number (10110)2 into its decimal equivalent.
I Solution
Base, b = 2
n = number of digits = 5
Hence by using the formula,
Decimal equivalent = (1 24 ) + (0 23 ) + (1 22 ) + (1 21 ) + (0 20 )
= 16 + 0 + 4 + 2 + 0
= 22
So, (10110)2 = (22)10
Example 1.5 Convert the binary number (111001)2 into its decimal equivalent.
I Solution
Base, b = 2
n = number of digits = 6
Hence by using the formula,
Decimal equivalent = (1 25 ) + (1 24 ) + (1 23 ) + (0 22 )
+ (0 21 ) + (1 20 )
= 32 + 16 + 8 + 0 + 0 + 1
= 57
So, (111001)2 = (57)10
1.6 Digital Electronics, an easy approach to learn
Example 1.6 Convert the binary number (10000.1011)2 into its decimal equiv-
alent.
I Solution
Base, b = 2
n = number of digits = 5 (considering only integral part)
Hence by using the formula,
Decimal equivalent = (1 24 ) + (0 23 ) + (0 22 ) + (0 21 ) + (0 20 )
+ (1 21 ) + (0 22 ) + (1 23 ) + (1 24 )
= 16 + 0 + 0 + 0 + 0 + 0.5 + 0 + 0.125 + 0.0625
= 16.6875
2 Concept: Any decimal number can be converted to any other number system by
dividing the decimal number by the base of the other number system progressively,
until the quotient of zero is obtained and taking the remainder after each division in
reverse order.
For example, while converting decimal to binary, we divide the decimal number pro-
gressively by 2.
Example 1.7 Convert the decimal number (78)10 into its equivalent octal num-
ber.
I Solution
8 78 Top
8 9 - 6
1 - 1 Bottom
Number Systems 1.7
Taking the remainders from bottom to top, the equivalent octal number can be
written as (116)8 .
Example 1.8 Convert the decimal number (321.456)10 into its equivalent octal
number.
I Solution
The integral part and the fractional part are computed separately.
Integral conversion:
8 321 Top
8 40 - 1
5 - 0 Bottom
Fractional conversion:
Decimal equivalent = (6 83 ) + (3 82 ) + (2 81 ) + (7 80 ) + (4 81 )
+ (0 82 ) + (5 83 ) + (1 84 )
4 5 1
= 3072 + 192 + 16 + 7 + + 0 + +
8 512 4096
= 3287.510098
F = 15
Since this system contains both numeric digits and alphabets, this is called as
alphanumeric number system.
Example 1.10 Convert the decimal number (156.625)10 into its equivalent hex-
adecimal number system.
I Solution
The integral part and the fractional part are computed separately.
Integral conversion:
16 156 Top
9 - C Bottom
Fractional conversion:
0.625
Forward 16
order A.000
I Solution
n = 3; b = 16
I Solution
Binary conversion:
Octal conversion:
8 189 Top
8 23 - 5
2 - 7 Bottom
Hexadecimal conversion:
16 189 Top
11 - 13 Bottom
Example 1.13 Convert (110111001)2 into its equivalent base 8, base 10, and
base 16 number system.
I Solution
Octal conversion:
There are two methods of binary to octal conversion.
Method 1:
Convert the binary number into its decimal equivalent and then convert the deci-
mal into octal.
Number Systems 1.11
(110111001)2 ;
Here, n = 9, b = 2
Decimal equivalent = (1 28 ) + (1 27 ) + (0 26 ) + (1 25 ) + (1 24 )
+ (1 23 ) + (0 22 ) + (0 21 ) + (1 20 )
= 441
8 441 Top
8 55 - 1
6 - 7 Bottom
Method - 2
2 Concept: Octal has base 8 i.e. 23 . So, make a grouping of 3 binary bits from right
hand side in order to obtain the corresponding octal number.
Decimal equivalent = (1 28 ) + (1 27 ) + (0 26 ) + (1 25 ) + (1 24 )
+ (1 23 ) + (0 22 ) + (0 21 ) + (1 20 )
= 441
16 441 Top
16 27 - 9
1 - 11 Bottom
Method - 2
2 Concept: Hexadecimal has a base 16 i.e. 24 . So, make a grouping of 4 binary bits
from right hand side inorder to obtain the corresponding hexadecimal equivalent for a
given binary number representation.
Example 1.14 Convert the octal number (172)8 into its corresponding binary,
decimal and hexadecimal equivalent.
I Solution
Binary conversion:
(1 7 2)8
. &
001 111 010
So, (172)8 = (001111010)2
Decimal conversion:
n = 3, b = 8
Decimal equivalent = (1 82 ) + (7 81 ) + (2 80 )
= 64 + 56 + 2 = 122
Method - 1
Octal decimal hexadecimal
Method - 2 (easier)
Octal binary hexadecimal
From method - 2
(1 7 2)8 = (001111010)2
. &
001 111 010
I Solution
For left side of the radix point we group the bit from LSB (Least Significant Bit),
and if needed, we append additional 0 in the left most side,
(MSB) |{z}
001 011 |{z}
|{z} 110 (LSB)
011 |{z}
1 3 3 6
For right side of the radix point we group the bit from MSB (Most Significant
Bit), and if needed, we append additional 0 in the right most side,
(MSB) |{z}
110 |{z} 110 (LSB)
100 |{z}
010 |{z}
6 2 4 6
So, (1011011110.11001010011)2 = (1336.6246)8
Example 1.16 Convert the hexadecimal number (2F 9A)16 into its correspond-
ing binary equivalent.
I Solution
2 |{z}
|{z} 9 |{z}
F |{z} A
0010 1111 1001 1010
So, (2F 9A)16 = (0010111110011010)2
1.14 Digital Electronics, an easy approach to learn
Example 1.17 Convert the hexadecimal number (29B.2F )16 into its correspond-
ing octal equivalent.
I Solution
|{z} 9 |{z}
2 |{z} 2 |{z}
B |{z} F
0010 1001 1011 0010 1111
1.3 Complements
Complements are used in digital systems for simplifying the subtraction operation
and for logical manipulation. There are two types of complements for each base-b
system: radix complements and diminish radix complement.
Radix complement is referred to as the bs complement and the diminished
radix complement is referred to as (b 1)s complement, where b is the base or
radix of the number system.
For example, in decimal (base-10) system, two types of complements are pos-
sible: 10s complements and 9s complements.
Complements
Method - 1
Here, b = 2; N = 101011; n = 6.
2s complement of (101011)2 = bn N
= (26 )2 101011
= 1000000 101011
= 010101
And 1s complement of (101011)2 = bn N 1
= (26 )2 101011 1
= 1000000 101011 1
= 010100
Trick:
Method - 2
For 1s complement the result is obtained by complementing each binary bit that
is by replacing 1 with 0 and vice-versa.
1.16 Digital Electronics, an easy approach to learn
I Solution
As for example, +3 0, 11
-3 1, 11
Note: The range of numbers that can be represented using signed magnitude rep-
resentation is (2n1 1) to (2n1 1), where n is the integer.
Note:
Positive numbers in all the three representations are identical and have zero
in the left most position.
The signed 2s complement system has only one representation for zero
(i.e., for +0 and -0, same representation is used).
Multiplication: Division:
00=0 0 / 0 = not allowed
01=0 0/1=0
10=0 1 / 0 = not allowed
11=1 1/1=1
Number Systems 1.19
Binary addition
Two binary numbers can be added in the same way as two decimal numbers are
added.
For example,
10101 11
+ 11101 + 11
110010 110
Binary subtraction
The binary subtraction is nothing but the addition of one binary number with a
negative (complemented) binary number.
Binary subtraction can be carried out in two ways -
Method 1 (using 1s complement)
Take 1s complement of the number to be subtracted, as 1s complement is
used to represent a negative number
Add both the numbers
If there is any overflow, then it is removed and added with the rest to obtain
the final result
If the MSB, after addition is 1, then the final result is obtained by taking 1s
complement of the addition, keeping the MSB as it is
I Solution
0110 = 0110
- 1010 + 0101
1,011
Here MSB is
1 without overflow
So, the result is 1,100(i.e. keeping MSB as it is and complementing the rest)
(0110)2 (1010)2 = (1, 100)2
So, the result is 1,101(i.e. keeping MSB as it is and 2s complementing the rest)
(1001)2 (1110)2 = (1, 101)2
Binary multiplication
Binary multiplication is similar to decimal multiplication.
I Solution
1011
101
1011
0000X
1011XX
110111
Binary division
Binary division also follows a similar procedure as decimal division.
I Solution
1.22 Digital Electronics, an easy approach to learn
Result = 101.01100
Hence, (11011)2 (101)2 = (101.01100)2
Octal addition
Example 1.27 Add the octal numbers.
I Solution
(i) 123
+ 452
575
So (123)8 + (452)8 = (575)8
(ii) 457
+ 411
1070
So (457)8 + (411)8 = (1070)8
Octal subtraction
Example 1.28 Subtract the octal numbers.
I Solution
(i) 765
- 234
531
So (765)8 (234)8 = (531)8
(ii) 751
- 254
475 (whenever we take a borrow, 8 is added to the digit and then the
required subtraction is carried out).
So (751)8 (254)8 = (475)8
Octal multiplication
Example 1.29 Multiply the octal numbers.
(i) (23)8 and (12)8 .
(ii) (56)8 and (45)8 .
I Solution
(i) 23
12
46
23
276
So (23)8 (12)8 = (276)8
(ii) 56
45
346
270
3246 (6 5 = 30. Subtract the maximum multiple of 8 from 30,
i.e. 8 3 = 24. So, 30 - 24 =6.
|
This 3 represents carry over
So (56)8 (45)8 = (3246)8
1.24 Digital Electronics, an easy approach to learn
Octal division
Example 1.30 Divide the octal numbers.
(i) (24)8 and (2)8 .
(ii) (127)8 and (6)8 .
I Solution
(i) 2)24(12
2
04
4
0
So (24)8 (2)8 = (12)8
(ii) 6) 127 (16.4
6 Hints:
47 (6)8 (2)8 6= (12)8
44 (6)8 (2)8 = (14)8
30 (6)8 (6)8 = (44)8
30 (6)8 (4)8 = (30)8
00
So (127)8 (6)8 = (16.4)8
Hexadecimal addition
Example 1.31 Add the following Hexadecimal numbers.
(i) (21A)16 and (1B1)16 .
(ii) (E75)16 and (68B)16 .
Number Systems 1.25
I Solution
(i) 21A
+ 1B1
3CB
So (21A)16 + (1B1)16 = (3CB)16
(ii) E75
+ 68B
1500
So (E75)16 + (68B)16 = (1500)16
Hexadecimal subtraction
Example 1.32 Subtract the following hexadecimal numbers.
I Solution
(i) A68
837
231
So (A68)16 - (837)16 = (231)16
(ii) C93
BD
BD6 (whenever we borrow, 16 is added to the digit).
So (C93)16 - (BD)16 = (BD6)16
Hexadecimal multiplication
Example 1.33 Multiply the following hexadecimal numbers.
I Solution
(i) 23
46
D2
8C
992
So (23)16 (46)16 = (992)16
(ii) 45
B3
CF
2F7
303F (B 5 = 55. Subtract the maximum multiple of 16 from 55,
i.e. 16 3 = 48. So, 55 - 48 = 7.
Therefore, keeping 7, 3 is forwarded as carry.
So (45)16 (B3)16 = (303F )16
Hexadecimal division
I Solution
(i) 2)34(1A
2
14
14
0
[ (2)16 (A)16 = (14)16 ]
|0 110101000111110
{z } 1100111
| {z }
mantissa exponent
1.28 Digital Electronics, an easy approach to learn
Brain teasers
1. Find out the minimum decimal equivalent of (111C.0).
I Solution
Generally, one would solve the above question as
(1 163 ) + (1 162 ) + (1 161 ) + (C 160 )
But the minimum decimal equivalent can be obtained by looking at the
maximum value present in the question which is C = 12. So, we can
represent the above number in the question with base 13 (i.e. using 0 to 12
digits)
So, the minimum
= (1 133 ) + (1 132 ) + (1 131 ) + (C 130 )
decimal equivalent
= 2197 + 169 + 13 + 12
= 2391
I Solution
L.H.S in decimal equivalent is
= (2 82 ) + (5 81 ) + (7 80 ) + (1 43 ) + (2 42 )
+ (0 41 ) + (3 40 )
= 128 + 40 + 7 + 64 + 32 + 0 + 3
= (274)10
I Solution
Let base = b
x2 (1 b0 ) x(1 b1 + 1 b0 ) + 2 b1 + 2 b0 = 0
x2 x(b + 1) + 2b + 2 = 0
Putting x = 3,
9 3(b + 1) + 2b + 2 = 0
b=8
Putting x = 6,
36 6(b + 1) + 2b + 2 = 0
b=8
I Solution
Since, the signed bit is 1, it is a negative number.
Leaving the signed bit as it is, and taking the 2s complement of the remain-
ing gives the magnitude of the actual number.
That is, 2s complement of (0001)2 is (1111)2 = (15)10
So, the actual value in decimal number system is -15
1.30 Digital Electronics, an easy approach to learn
Objective Questions
1. One hex digit is sometimes referred to as a(n):
A. Byte C. Grouping
B. Nibble D. Instruction
1. B 2. A 3. A 4. C 5. B 6. A
7. D 8. B 9. A 10. A 11. A 12. D
Exercises
1.1 Convert each binary number into its octal, decimal and hexadecimal equiv-
alent.
a) (1011)2 c) (1011.10)2
b) (110110)2 d) (110110.11010)2
1.2 Convert each decimal number into its equivalent binary, octal and hexadec-
imal equivalent.
a) (25)10 c) (67.89)10
b) (375)10 d) (138.657)10
1.3 Convert each octal number into its equivalent binary, decimal and hexadec-
imal equivalent.
a) (37)8 b) (62)8 c) (23.12)8 d) (54.623)8
1.32 Digital Electronics, an easy approach to learn
1.4 Convert each hexadecimal number into its equivalent binary, octal and dec-
imal equivalent.
a) (19)16 c) (C1.56)16
b) (AF)16 d) (BCD.12)16
1.5 Add, subtract, multiply and divide the following binary numbers:
1.6 Add, subtract, multiply and divide the following octal numbers:
1.7 Add, subtract, multiply and divide the following hexadecimal numbers:
a) 563 b) 24 c) 1079
b) 66, 54, 36