1.1 decimal number system the decimal number system …
TRANSCRIPT
Dr. I. Manimehan, Department of Physics, MRGAC Page 1
NUMBER SYSTEM
A digital computer is a programmable machine that processes binary data, i.e., data
represented in binary number system. We have to understand computers and digital electronics
only with the help of binary number system. But we are used to decimal number system in our
everyday life for a long period of time and we take the rules for granted.
1.1 DECIMAL NUMBER SYSTEM
The decimal number system makes use of ten digits namely, 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Since ten basic symbols or digits are used, the decimal number system is said to have a base or
radix of ten. When we want to express numbers of value greater than 9, we use two or more
digits and the position of each digit within the number gives us the magnitude it represents. All
the digits in the decimal system are expressed in powers of 10 like 100, 101, 102 etc., for the
integer part and 10−1, 10−2, 10−3 etc., for the fractional part. The integer portion and fractional
portion in a decimal portion in a decimal number system are separated by a decimal point.
The quantities 100, 101, 102 etc., simply represent the units, tens, hundreds etc and the
quantities 10−1, 10−2, 10−3 etc., represent one tenth, one hundredth, one thousandth etc. The
quantities 102, 101, 100, 10−1, 10−2, 10−3 etc., are called weights.
i) 25 = 20 + 5
= 2 x 10 + 5 x 1
= 2 x101 + 5 x100
The digit 2 has a weight 10 and the digit 5 has a weight 1.
ii) 7694 = 7000 + 600 + 90 + 4
= 7x1000 + 6x100 + 9x10 + 4x1
= 7x103 + 6x102 + 9x101 + 4x100
The digit 7 has a weight 1000, digit 6 has a weight 100, the digit 9 has a weight 10 and the digit
4 has a weight 1.
1.2 BINARY NUMBER SYSTEM
A binary number system uses only two symbols or digits namely, 0 and 1. That is the
binary number system has a base or radix of 2. A binary 0 or 1 is often called a bit. All the bits
will have powers of 2 like 20, 21, 22, etc., for the integer portion and 2−1, 2−2, 2−3, etc., for the
fractional portion. Here we have a binary point in a binary number system.
A 4-bit binary word is called as a nibble. An 8-bit binary word is called as a byte. A 16-
bit binary word is simply called as a word and a 32-bit binary word is called as double word.
Dr. I. Manimehan, Department of Physics, MRGAC Page 2
1.3 BINARY TO DECIMAL CONVERSION
A binary number can be converted into a decimal number by adding the products of each
bit and its weight. Let us take a few examples
i) 1 0 1 2
1 x20 = 1 x 1 =1
0 x21
= 0 x 2 = 0
1 x22 = 1 x 4 = 4
(101)2 = (5)10
ii) (1 0 0 1 1)2
1x20 = 1x1 = 1
1x21 = 1x2 = 2
0x22 = 0x4 = 0
0x23 = 0x8 = 0
1x 24 = 1x16 = 16
(1011)2 = (19)10
iii) (0. 1 0 1)2
1x2−1 = 1x0.5 = 0.5
0x2−2 = 0x0.25 = 0
1x2−3 = 1x0.125 = 0.125
(0.101)2 = (0.625)10
Example 1.1
Convert (1101011.1011)2 to its equivalent decimal number.
Solution:
For integer part,
Dr. I. Manimehan, Department of Physics, MRGAC Page 3
(1 1 0 1 0 1 1)2
1 x 20 = 1x1 = 1
1 x 21 = 1x2 = 1
0 x 22 = 0x4 = 0
1x 23 = 1x8 = 8
0x 24 = 0x16 = 0
1x25 = 1x32 = 32
1x26 = 1x64 = 64
(1101011)2 = 107 10
For fraction part,
(.1 0 1 1)2
1x2−4 = 1x0.0625 = 0.0625
1x2−3 = 1x0.125 = 0.125
0x2−2 = 0x0.25 = 0
1x2−1 = 1x0.5 = 0.5
(.1 0 1 1)2 = (6875)10
(1101011.1011)2 = (107.6875)10
Dr. I. Manimehan, Department of Physics, MRGAC Page 4
1.4 DECIMAL TO BINARY CONVERSION
A decimal like 19 can be converted into binary by repeatedly dividing the number by 2
and collecting the remainders (double dabble method)
2 19
9 - 1 (LSB)
4 - 1
2 - 0
1 - 0
0 - 1 (MSB)
(19)10 = (10011)2
Example 1.2
Convert (107.6875)10 to its equivalent binary number.
Solution:
For integer part, divide by 2 repeatedly and collect the remainders.
2 107
53 - 1 (LSB)
26 - 1
13 - 0
6 - 1
3 - 0
1 - 1
0 - 1 (MSB)
(107)10 = (110 1011)2
Dr. I. Manimehan, Department of Physics, MRGAC Page 5
For the fractional part, multiply by 2 repeatedly and collect the carries.
0.6875x2 = 1.3750; carry 1 (MSB)
0.3750x2 = 0.7500; carry 0
0.7500x2 = 1.5000; carry 1
0.5000x2 = 1.0000; carry 1 (LSB)
Therefore, (107.6875)10 = (110 1011.1011)2
1.5 HEXADECIMAL NUMBER SYSTEM
The hexadecimal number system as a base 16. The basic digits are 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, A, B, C, D, E, F. The base of the hexadecimal number system is 16 and the base of the
binary number system is 2. Since 24 = 16, it follows that any hex digit can be represented by a
group of four bit binary sequence.
The table (1.1) gives the decimal, hexadecimal and the four bit binary equivalence for the
decimal numbers 0 to 15.
Decimal
Hexadecimal
Binary
23 + 22 + 21 + 20
8 + 4 + 2 +1
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
Dr. I. Manimehan, Department of Physics, MRGAC Page 6
1.6 HEXADECIMAL TO DECIMAL COVERSION
The hex to decimal conversion is similar to binary to decimal conversion, only the
weights are different. In this case, the weights used are 160, 161, 162 etc., for the integer part
and 16−1, 16−2, 16−3 etc., for the fractional part. In hexadecimal number system we have a
hexadecimal point.
Example 1.3
Convert the following hexadecimal numbers to decimal.
(a) (E9)H (b) (3FC.8)H (C) (FFFF)H
Solution:
(a) (E 9)H
9x160 = 9x1 = 9
14x161 = 14x16 = 224
(E9)H = (233)10
(b) (3FC.8)H
8x16−1 = 8x0.0625 = 0.5
12x 160 = 12x1 = 12
15x161 = 15x16 =240
3x 162= 3x 256 = 768
(3FC.8)H = (1020.5)10
(C) (F FF F)H
15x160 =15x1 = 15
15x161 = 15x16 = 240
15x 162 = 1 x256 = 3840
15x 163 = 15x4096 = 61440
(FFFF)H = (65535)10
Dr. I. Manimehan, Department of Physics, MRGAC Page 7
1.7 DECIMAL TO HEXADECIMAL CONVERSION
To convert a decimal number to hex, we have to divide the decimal number by 16
repeatedly and collect the remainders from top to bottom (for the integer part). The remainders
also must be taken in hex.
Example 1.4
Convert the following decimal numbers to hex equivalents
(a) 1020 (b) 98.625
Solution:
(a) 16 1020
63 - 12 C (LSB)
3 - 15 F
0 - 3 3 (MSB)
(1020)10 = (3FC) H
(b) The hex number 980625 is separated as the integer part 98 and fractional part .625. The
integer 98 is converted into hex by repeated division by 16.
16 98
6 - 2
0 - 6
(98)10 = (62)H
The fraction 0.625 is converted into hex by multiplying 0.625 by 16 and collecting the carry.
0.625 x 16 = 10.000
The carry obtained is 10 which must be taken in hex as ‘A’.
Therefore, (98.625)10 = (62.A) H
Dr. I. Manimehan, Department of Physics, MRGAC Page 8
1.8 HEXADECIMAL TO BINARY CONVERSION
To convert a decimal number to binary we have adopted a procedure of repeatedly
dividing the given decimal number by 2. Since the base of hexadecimal number system is 16
which is equal to 24, to convert a hexadecimal number to binary, all we have to do is replace
each hex digit with its equivalent 4-bit binary.
Table 1.1 gives the hex, decimal and the corresponding binary combination. Using the
table, we can write the binary equivalent of any hexadecimal number.
Example 1.5
Convert the following hexadecimal numbers to binary.
(a) (25)H (b) (3A.7)H (C) (CD.E8)H
Solution:
(a) (25)H = (0010 0101)2
(b) (3A.7)H = (0011 1010)2
(c) (CD.E8)H = (1100 1101.1110 1000)2
1.9 BINARY TO HEXADECIMAL CONVERSION
To convert a binary number to hex, we have to arrange the bits into group of 4 bits
starting from LSB (Least Significant Bit). If the final group has less than 4 bits, just include
zeros to make it a group of 4 bits. For example, 100101 2 into hex, arrange the bits as
10 0101 2. Now include two zeros for the first group at the front. The binary combination
now becomes 0010 0101 2. In last step replace each 4 bit binary group by its equivalent hex
digit. i.e, 0010=2 and 0101=5.
Therefore, 100101 2 = 0010 0101 2 = 25 H
The digit, whether it is an integer part or fractional part must be represented by a group of 4-bits.
For integer part, 4-bit groups are formed starting from the hexadecimal point and moving
towards left. For the fractional part, 4-bit groups are formed starting from the hexadecimal point
and moving towards right.
Example 1.6
Convert the following binary numbers to hexadecimal numbers.
(a) (101011)2 (b) (11110.111)2 (c) (111011011.111011)2
Solution:
Dr. I. Manimehan, Department of Physics, MRGAC Page 9
(a) (101011)2 = (0010 1011)2
= ( 2 B )H
= (2B)H
(b) (11110.111)2 = (0001 1110.1110)2
= ( 1 E . E )H
= (1E.E)H
(c) (111011011.111011)2 = (0001 1101 1011.1110 1100)2
= ( 1 D B . E G )H
= (1DB.EG)H
1.10 OCTAL NUMBER SYSTEM
The octal number system has a base 8. The basic digits used are 0, 1, 2, 3, 4, 5, 6, 7. The
base of the octal number system is 8 and the base of the binary number system is 2. Since 28 =
8, it follows that any octal digit can be represented by a group of 3-bit binary sequence. The
following table (1.2) gives the decimal, octal and the three bit binary equivalence for the decimal
numbers 0 to 7.
Decimal
Octal
Binary
22 + 21 + 20
0 0 000
1 1 001
2 2 010
3 3 011
4 4 100
5 5 101
6 6 110
7 7 111
1.11 OCTAL TO DECIMAL CONVERSION
The octal to decimal conversion is similar to binary to decimal conversion, only the
weights are different. In this case, the weights used are 80, 81, 82, etc., for the integer part 8−1,
8−2, etc., for the fractional part. In octal number system, we have an octal point to separate the
integer and fractional parts.
Dr. I. Manimehan, Department of Physics, MRGAC Page 10
Example 1.7
Convert the following octal numbers to decimal.
(a) (62)8 (b) (45.6)8
Solution:
(a) (6 2)8
2x80 = 2x1 = 2
6x 81 = 6x8 = 48
(62)8 = (50)10
(b) (4 5 .6)8
6x8−1 = 6x0.125 = 0.75
5x 80 = 5x1 = 5
4x81 = 4x8 = 32
(45.6)8 = (37.75)10
1.12 DECIMAL TO OCTAL CONVERSION
To convert a decimal number to octal, we have to divide the decimal number by 8
repeatedly and collect the remainders from top to bottom (for the integer part). The remainders
also must be taken in octal.
Example 1.8
Convert the following decimal numbers to octal equivalents.
(a) 109 (b) 98.625
Solution:
(a) 8 109
13 - 5 (LSB)
1 - 5
0 - 1 (MSB)
(109)10 = (155)8
Dr. I. Manimehan, Department of Physics, MRGAC Page 11
(b) The octal number 98.625 is separated as the integer part 98 and fractional part .625. The
integer 98 is converted into octal by repeated division by 8.
8 98
12 - 2 (LSB)
1 - 4
0 - 1 (MSB)
(98)10 = (142)8
The fraction 0.625 is converted into octal by multiplying 0.625 by 8 and collecting the carry.
0.625x8 = 5.000; carry is 5.
Therefore, (98.625)10 = (142.5)8
1.13 OCTAL TO BINARY CONVERSION
To convert a decimal number to binary we have adopted a procedure of repeatedly
dividing the given decimal number by 2. Since the base of octal number system is 8 which is
equal to 23, to convert an octal number to binary, all we have to do is replace each octal digit
with its equivalent 3-bit binary. Using table 1.3, we can write the binary equivalent of any octal
number. We can see that for 3-bit binary combination, the weights required are only 22, 21 and
20.
Octal Binary Decimal
27 010 111 23
135 001 011 101 93
45.5 100 101 . 101 37.625
1.14 BINARY TO OCTAL CONVERSION
To convert a binary number to octal, we have to arrange the bits into group of 3 bits
starting from LSB (Least Significant Bit). If the final group has less than 3 bits, just include
zeros to make it a group of 3 bits. For example, to convert (10 101) into octal, arrange the bits as
(10 101). Now include a zero for the first group at the front. The binary combination now
becomes (010 101). In the last step, replace each 3-bit binary group by its equivalent octal digit.
i.e. 010 = 2 and 101 =5.
Therefore, 10 101 2 = 010 101 2 = 25 8
Dr. I. Manimehan, Department of Physics, MRGAC Page 12
The digit, whether it is an integer part or fractional part must be represented by a group of 3-bits.
For integer part, 3-bit groups are formed starting from the octal point and moving towards left.
For the fractional part, 3-bit groups are formed starting from the octal point and moving towards
right.
Example 1.10
Convert the following binary numbers to hexadecimal numbers.
(a) (101011)2 (b) (11110.11)2 (c) (11011011.1111)2
Solution:
(a) (101011)2 = (101 011)2
= ( 5 3 )8
= (53)8
(b) (11110.11)2 = (011 110.110)2
= ( 3 6 . 6 )8
= (36.6)8
(c) (11011011.1111)2 = (011 011 011.111 100)2
= ( 3 3 3 . 7 4 )8
= (333.74)8
Dr. I. Manimehan, Department of Physics, MRGAC Page 13
BINARY ARITHMETIC
2.1. 1’s AND 2’s COMPLEMENTS
There are two types of complements for binary number system, namely, 1’s complement
and 2’s complement. 1’s complement and 2’s complement can be used to perform subtraction
using adder circuits. Also they are used to represent negative numbers.
1’s Complement:
The 1’s complement of the binary digit (bit) is defined as 1 minus that bit.
i.e 1’s complement of 1 is 1 – 1=0
1’s complement of 0 is 1 – 0 =1
However, it is easy to remember that 1’s complement of 0 is 1 and 1’s complement of 1 is 0. In
other words, 1’s complement of any binary number is formed by simply changing all the 1’s to
0’s and all 0’s to 1’s.
Few examples are given below:
Binary Number 1’s Complement
1011 0100
110001 001110
100100 011011
11001110 00110001
10101101 01010010
2’s Complement:
2’s complement of a binary number is formed by adding 1 to the 1’s complement of that
number. A 1 is added to the least significant bit position. For example, let us find the 2’s
complement of 1010.
1’s complement of 1010 = 0 1 0 1 +
Add 1 = 1
2’s complement of 1010 = 0 1 1 0
Dr. I. Manimehan, Department of Physics, MRGAC Page 14
A few more examples are given below
BOOLEAN ALGEBRA
For better understanding of digital systems one must have through knowledge in Boolean
algebra and De – morgan’s theorems.
Boolean algebra invented by George Boole, provides a simple mathematical technique
for the design, simplification and analysis of digital switching circuits, which are very complex
for visual analysis. The technique also gives a method of representing different switches and
logic function in mathematical form.
Boolean algebra will be useful in the following ways:
1. The logic functions may be expressed as algebraic equations offering more compactness
and clarity than the truth tables of logic gates.
2. Am algebraic equation can be obtained from a truth table by using the Boolean algebra.
3. A Boolean equation may be simplified, leading to an understanding of implementation of
a desired logic function.
Boolean algebra requires the use of a set of special symbols given below.
1. Symbols for constants 0 and 1
2. Symbols for variables A, B, C, X, Y, Z, W, Q, etc.,
3. Symbols for funtions; AND function (.)
OR function (+)
NOT function (-)
4. Symbols for equality (=)
Boolean postulates
The Boolean postulates originate from the three basic logic functions of AND, OR and
NOT, whose truth tables are shown below.
Binary Number 1’s Complement 2’s Complement
1011 0100 0101
110001 001110 001111
100100 011011 011100
11001110 00110001 00110010
10101101 01010010 01010011
Dr. I. Manimehan, Department of Physics, MRGAC Page 15
AND
A B C
0 0 0
0 1 0
1 0 0
1 1 1
The postulates are expressed as algebraic equations, using the appropriate functions symbols as
given below.
Algebraic equations
AND function OR function NOT function
0.0 = 0 0+0 = 0 0 = 1
1.0 = 0 0+1 = 1 1 = 0
1.0 = 0 1+0 = 1 -
1.1 = 1 1+1 = 1 -
OR
A B C
0 0 0
0 1 1
1 0 1
1 1 1
NOT
A Y
0 1
1 0
Dr. I. Manimehan, Department of Physics, MRGAC Page 16
Laws of Boolean Algebra:
i) Commutative Law
A + B = B + A
A . B = B . A
ii) Associative Law
A + (B + C) = (A + B) + C
A . (B . C) = (A .B) . C
iii) Distributive Law
A . (B + C) = AB + AC
Dr. I. Manimehan, Department of Physics, MRGAC Page 17
DeMorgan’s Laws:
De morgan’s laws are helpful to see how an expression using AND operation can be
converted into equivalent expression using OR operation and vice versa.
Any logic expression can be inverted (or complement) using simply by inverting every
terms so that A becomes𝐴 , B becomes 𝐵 and every AND becomes OR and vice – versa.
This is stated mathematically by Demorgan’s laws as follows.
LAW I:
The complement of sum equals the product of complements.
The law reveals that a NOR gate 𝐴 + 𝐵 is equivalent to bubbled AND gate 𝐴 . 𝐵
𝐴 + 𝐵 = 𝐴 . 𝐵
LAW II:
The complement of product equals the sum of complements.
The law reveals that a NAND gate 𝐴. 𝐵 is equivalent to bubbled OR gate 𝐴 + 𝐵
𝐴. 𝐵 = 𝐴 + 𝐵
Proof:
Case (i): A = 0, B = 0
LHS; 𝐴. 𝐵 = 0.0 = 0 = 1
RHS; 𝐴 + 𝐵 = 0 + 0 = 1 + 1 = 1
Case (ii): A = 0, B = 1
Dr. I. Manimehan, Department of Physics, MRGAC Page 18
LHS; 𝐴. 𝐵 = 0.1 = 0 = 1
RHS; 𝐴 + 𝐵 = 0 + 1 = 1 + 0 = 1
Case (iii): A = 1, B = 0
LHS; 𝐴. 𝐵 = 1.0 = 0 = 1
RHS; 𝐴 + 𝐵 = 1 + 0 = 0 + 1 = 1
Case (iv): A = 1, B = 1
LHS; 𝐴. 𝐵 = 1.1 = 1 = 0
RHS; 𝐴 + 𝐵 = 1 + 1 = 0 + 0 = 0
In all the four cases, 𝐴. 𝐵 = 𝐴 + 𝐵
Using Truth table
Duality principle:
1) A + 0 = A
2) A + 1 = 1
3) A + A= A
4) A + 𝐴 = 1
5) 𝐴 = A
6) 𝐴 . 0 =0
7) 𝐴 . 1 = A
8) 𝐴 . A = A
A B A.B 𝐴. 𝐵 𝐴 𝐵 𝐴 + 𝐵
0 0 0 1 1 1 1
0 1 0 1 1 0 1
1 0 0 1 0 1 1
1 1 1 0 0 0 0
Dr. I. Manimehan, Department of Physics, MRGAC Page 19
9) 𝐴 . 𝐴 = 0
10) 𝐴 = A
A + AB = A
A . (1 + B) = A . 1 = A
A(A + B) = A . A + A . B
= A + AB
= A
Exercise: 1
Y = 𝐴 𝐵 + 𝐴 B
= 𝐴 (𝐵 . B)
= 𝐴 . 1
Y = 𝐴
𝐴 𝐵 𝐶
Y
Dr. I. Manimehan, Department of Physics, MRGAC Page 20
Exercise: 2
𝐴 𝐵 C + A 𝐵 C + A B 𝐶 + A B C = AB + 𝐵 C
Solution:
LHS = 𝐴 𝐵 C + A 𝐵 C + A B 𝐶 + A B C
= 𝐵 C (𝐴 + 𝐴) + AB (𝐶 + C)
= 𝐵 C.1 + AB.1
= AB + 𝐵 C
LHS = RHS
Hence, it is proved.
𝑩 . 𝑪 𝐵 . 𝐶
𝐵 . 𝐶
C𝐵 . 𝐶
𝐵 . 𝐶
Y = A.B + 𝑩 . 𝑪
Dr. I. Manimehan, Department of Physics, MRGAC Page 21
PROBLEMS:
F (A,B,C) = A B C + 𝐴 𝐵 C + 𝐴 B C + A B 𝐶 + 𝐴 𝐵 𝐶
= A B C + A B 𝐶 + 𝐴 𝐵 C + 𝐴 𝐵 𝐶 + 𝐴 B C
= A B (C + 𝐶 ) + 𝐴 𝐵 (C + 𝐶 ) + 𝐴 B C
= A B.1 + 𝐴 𝐵 .1 + 𝐴 B C
= A B + 𝐴 𝐵 + 𝐴 B C
= 𝐴 𝐵 + B (A + 𝐴 C)
= 𝐴 𝐵 + B (A + C)
= 𝐴 𝐵 + A B + B C
Exercises:
1) Show that 𝐴 B + 𝐵 C + 𝐶 A = A 𝐵 + B 𝐶 + C 𝐴
Solution:
SOP = Sum of Product
LHS = 𝐴 B + 𝐵 C + 𝐶 A
= 𝐴 B .1+ 𝐵 C.1 + 𝐶 A.1
= 𝐴 B.(C + 𝐶 )+ 𝐵 C.(A + 𝐴 ) + 𝐶 A.(B + 𝐵 )
= 𝐴 B C + 𝐴 B 𝐶 + 𝐵 C A + 𝐵 C 𝐴 +𝐶 A B + 𝐶 A 𝐵
= 𝐴 B C + 𝐴 B 𝐶 + A 𝐵 C + 𝐴 𝐵 C + A B 𝐶 + A 𝐵 𝐶
= A 𝐵 (C +𝐶 ) + B 𝐶 (𝐴 + A) + C 𝐴 (B + 𝐵 )
= A 𝐵 + B 𝐶 + C 𝐴 LHS = RHS
Hence it is proved.
Dr. I. Manimehan, Department of Physics, MRGAC Page 22
POS:
F (A,B,C)= (A + B + C) . (𝐴 +𝐵 + 𝐶 )
2) Show that (𝐴 + B) (𝐵 + C) (𝐶 + A ) = (A + 𝐵 ) (B +𝐶 ) (C + 𝐴 )
LHS =(𝐴 + B) (𝐵 + C) (𝐶 + A )
= (𝐴 𝐵 + 𝐴 C + B 𝐵 + B C ) (𝐶 + A)
= (𝐴 𝐵 + 𝐴 C + B C ) (𝐶 + A)
= 𝐴 𝐵 𝐶 + 𝐴 C 𝐶 + B C 𝐶 + 𝐴 𝐵 . A + 𝐴 C . A + B C . A
= 𝐴 𝐵 𝐶 + A B C
RHS = (A + 𝐵 ) ( B + 𝐶 ) (C + 𝐴 )
3) Show that 𝐴 B C + A 𝐵 C + A B 𝐶 + A B C = A B +B C + C A
LHS =𝐴 B C + A 𝐵 C + A B 𝐶 + A B C
= 𝐴 B C + A 𝐵 C + A B (𝐶 + C)
= 𝐴 B C + A 𝐵 C + A B
= 𝐴 B C + A (𝐵 C + B) therefore, 𝐵 C + B = B + C
= 𝐴 B C + A ( B + C)
= 𝐴 B C + A B + A C
= B (𝐴 C + A ) + A C therefore 𝐴 C + A = A + C
= B (A + C) + A C
= A B +B C + C A
= RHS
Dr. I. Manimehan, Department of Physics, MRGAC Page 23
Exercise: 3
F(A, B, C, D) = ABC + ABD + 𝐴 B 𝐶 + CD + B 𝐷
= ABC + ABD + B 𝐷 + 𝐴 B 𝐶 + CD
= ABC + B (AD + 𝐷 ) + 𝐴 B 𝐶 + CD AD + 𝐷 = A + D
= ABC + B (A + D) + 𝐴 B 𝐶 + CD
= ABC + BA + BD + 𝐴 B 𝐶 + CD
= AB (C + 1) + BD + 𝐴 B 𝐶 + CD
= AB + BD + 𝐴 B 𝐶 + CD
= B(A + 𝐴 𝐶 ) + BD + CD
= B(A + 𝐶 ) + BD + CD
= AB + B 𝐶 + BD + CD
= AB + B 𝐶 + BD (𝐶 + C) + CD
= AB + B 𝐶 + BD 𝐶 + BDC + CD
= AB + B 𝐶 (D + 1) + CD (B + 1)
= AB + B 𝐶 + CD
Logic Gates:
A digital circuit with one or more input pulse voltages but only one output pulse voltage
is called Gate. They are normally used to make logical decisions.
The most basic Gates are the AND gate, the OR gate and the NOT gate. By connecting
these gates in different ways, we can construct with the human brain. Since these circuits
simulate mental processes, the gates are often called logic gates.
The basic logic gates are:
1. The AND gate,
2. The OR gate,
3. The NOT gate.
The AND gate:
Consider the series electrical circuit shown in fig. The bulb will lit only if both switches
are closed. This circuit action is called the logical AND functions.
Dr. I. Manimehan, Department of Physics, MRGAC Page 24
The AND gate is a logic circuit which gives an output of 1 state only when all the
inputs are in 1 state.
The logic symbol and the truth table (one which gives the summary of possible actions) for two
inputs A and B are given below.
The output is given by Y = A.B. Which is read as Y equals A and B. This is Boolean expression
for the output of AND gate.
The truth table shows that the output is 1 state only when both the inputs A and B are in the 1
state. In the expression Y = A.B the dot (.) indicates the AND functions.
The OR gate:
Consider the circuit shown in the fig. The bulb will be lit when weather or both of the
parallel switches are closed. This circuit action is called the logical OR functions.
Inputs Outputs
A B Y = A.B
0 0 0
0 1 0
1 0 0
1 1 1
Dr. I. Manimehan, Department of Physics, MRGAC Page 25
The OR gate is a logic circuit which gives an output of ‘1’ state if one or more inputs
are in ‘1’ state. The logic symbol, Truth table and Boolean expression for two input OR gate
are given below.
The output is given by Y = A + B, which is read as Y equals A and B. This is Boolean
expression for the output of OR gate. The truth table shows that the output is 1 state when either
or both of the inputs A and B are in the 1 state when either or both of the inputs A and B are in
the state. In the expression for A + B (+ plus) indicates the OR function. So the plus sign is read
as OR.
The NOT gate:
The NOT gate has only one input and one output. Its function is to invert the imput so
that the output is always opposite. If the input is 1, the output is 0; if the input is 0, the output
will be 1. The NOT gate is commonly known as complementary circuit or an inverter. Thus the
NOT gate is an inverter circuit which is used to negative signal.
The logic symbol, the truth table and the Boolean expression of the NOT gate are given
below.
Inputs Outputs
A B Y = A + B
0 0 0
0 1 1
1 0 1
1 1 1
Dr. I. Manimehan, Department of Physics, MRGAC Page 26
The output is in the 1 state when the input is in the 0 state and vice-versa. This result can be
stated as,
Y = 𝐴 in Boolean notation
𝐴 (A bar or not A) is the negation of A
The NOT logic gate for positive logic can be implemented using an NPN transistor as follows.
The NAND gates as universal building block:
The NAND logic gate is a negated AND logic gate i.e., when NOT gate follows an AND
gate, the combination is called the NAND gate.
The logic symbol the truth table and the Boolean expression for the output of the NAND
are given below.
The Boolean expression for the output is Y equals A dot B the whole bar i.e., not (A and
B). The bubble or complementing circle in the symbol indicates inversion of the AND.
The chip IC 7400 is a quad – two – input NAND gate.
Input Output
A Y = 𝐴
0 1
1 0
Inputs Outputs
A B Y = 𝐴. 𝐵
0 0 1
0 1 1
1 0 1
1 1 0
Dr. I. Manimehan, Department of Physics, MRGAC Page 27
The NAND gate can be regarded as universal building block because it can be connected to other
NAND gates to generate any logic function. The NOT, the AND, the OR logic gates can be
fabricated with the use of NAND gates only.
NOT gate using NAND gates:
In a NAND gate, let the inputs be A and B
The output Y = 𝐴. 𝐵 . If the inputs are same, each equal to A, then
Y = 𝐴. 𝐴
Y = 𝐴
For the input A, the output is 𝐴 . Thus, the function of the NOT gate is performed.
AND gate using NAND gates:
The inputs A and B are fed to NAND gate (1) and its output is 𝐴𝐵 . This is used to feed two equal
inputs, 𝐴𝐵 each to the NAND gate (2); The second NAND gate works as a NOT gate.
The output Y = 𝐴. 𝐵
Y = A.B
Thus, the function of an AND gate is carried out by the use of two NAND gates.
OR gate using NAND gates:
The input A is fed to the NAND gate which acts as an inverter (NOT gate). The output is 𝐴
similarly, the input B is fed to the NAND, which acts as an inverter, to get the output 𝐵 . Now, 𝐴
and 𝐵 are fed as inputs to the NAND. After the NAND operation, the output becomes.
Y = 𝐴 . 𝐵
Using Demorgan’s law
Y= 𝐴 + 𝐵
Y = A + B
Thus, the OR operation is carries out with three NAND gates only.