Ece Module 9
Ece Module 9
4232 4232
INDEX
Sr. Pg.
Contents Topics
No. No.
1. Boolean Algebra
Introduction 1
Number System 2
Binary Number System 3
Binary Arithmetic 8
Octal Number System (BASE 8) 12
Hexadecimal Number System (BASE 16) 13
Codes 16
Notes
Logic Gates 21
Boolean Algebra 26
Standard Representation of Logic Functions 33
Circuit Minimization 35
Karnaugh Map (KMAP) 36
Don't-Care Input Combinations 46
LMR (Last Minute Revision) 47
Assignment1 Questions 50
Test Paper1 Questions 53
Sr. Pg.
Contents Topics
No. No.
2. Combinational Logic Circuits, MUX and Decoders
Introduction 56
Implementing Combinational Logic 56
Code Converters 58
Multiplexer 65
Demultiplexer/Decoders 70
Notes
Special Decoders 75
Encoders 76
Functions of Combinational Logic 79
Comparators 86
LMR (Last Minute Revision) 90
Assignment2 Questions 92
97
Test Paper2 Questions
5. Computer Organization
Introduction 175
Numbers and Arithmetic Operations 177
Basic ALU Organization 180
Notes
Instruction Cycle 190
Addressing Modes 192
Instruction Formats 195
Sr. Pg.
Contents Topics
No. No.
Instruction Interpretation 197
Implementation Methods 197
LMR (Last Minute Revision) 203
Assignment5 Questions 205
Test Paper5 Questions 209
Practice Problems Questions 212
ID Problems Questions 225
SOLUTIONS
Answer Key 231
Assignment
Model Solutions 233
Answer Key 249
Test Paper
Model Solutions 251
Answer Key 265
Practice Problems
Model Solutions 266
Answer Key 278
ID Problems
Model Solutions 279
Topic 1 : Boolean Algebra
INTRODUCTION
Since the introduction of microprocessors, the digital systems have gained tremendous
power and importance. There is no field of knowledge which has affected our lives as
much as the digital theory and applications, in such a short span of time.
Some of the principal reasons for the widespread use of digital techniques and
systems are:
x The devices used in digital circuits generally operate in one of the two states, known
as ON and OFF resulting in a very simple operation.
x There are only a few basic operations in digital circuits which are very easy to
understand.
x Digital techniques require Boolean algebra which is very simple and can easily be
learnt even in schools.
x Digital circuits require basic concepts of electric network analysis which can easily be
learnt at the junior level in colleges. The principal electrical characteristics required
are switching speed and loading considerations. On the other hand, analog circuits
and systems involve frequency and time domain concepts, complicated circuit
analysis techniques, etc. which make the understanding of these circuits much more
difficult than the digital circuits.
x A large number of ICs are available for performing various operations. These are
highly reliable, accurate, small in size and the speed of operation is very high. A
number of programmable ICs are also available.
x Various ICs are available in a logic family with similar electrical characteristics which
make the design and development of digital systems very simple and also reduce
interfacing problems.
x Digital circuits have capability of memory which makes these circuits highly suitable
for computers, calculators, watches, telephones, etc.
x The display of data and other information is very convenient, accurate and elegant
using digital techniques.
x It is a very fascinating and challenging field of study because most of the latest
electronic systems are digital in nature.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.1
Vidyalankar : GATE – EC
NUMBER SYSTEM
Introduction
We all are familiar with the number system in which an ordered set of ten symbols
0, 1, 2, 3, 4, 5, 6, 7, 8 and 9, know as digits are used to specify any number. This
number system is popularly known as the decimal number system. The radix or base of
this number system is 10 (number of distinct digits). Any number is a collection of these
digits.
For example, 1982.365 signifies a number with an integer part equal to 1982 and a
fractional part to 0.365, separated from the integer part with a radix point () also known
as decimal point. There are some other systems also used to represent numbers. Some
of the other commonly used number systems are: binary, octal and hexadecimal number
systems.
There number systems are widely used in digital systems like microprocessors, logic
circuits, computers, etc. and therefore, the knowledge of these number systems is very
essential for understanding, analyzing and designing digital systems.
Number Systems
In general, in any number system there is an ordered set of symbols known as digits with
rules defined for performing arithmetic operations like addition, multiplication, etc. A
collection of these digits makes a number which in general has two parts integer and
fractional, set apart by a radix point (.), that is
where N = a number
b = radix or base of the number system
n = number of digits in integer portion
m = number of digits in fractional portion
dn1 = most significant digit (MSB)
dm = least significant digit (LSB)
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.2
Notes on Boolean Algebra
p
binary point
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.3
Vidyalankar : GATE – EC
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.4
Notes on Boolean Algebra
0.3125 u 2 = 0.6250
0 (MSB)
0.6250 u 2 = 1.2500
1
0.2500 u 2 = 0.5000
0
0.5000 u 2 = 1.0000
1 (LSB)
? (0.3125)10 = (0.0101)2
Example:
Find the decimal equivalent of the following binary numbers assuming sign-
magnitude representation of the binary numbers.
(i) 101100 (ii) 001000 (iii) 1111
Solution:
(i) Sign bit is 1, wh ich means the number is negative.
Magnitude = 01100 = (12)10
(101100)2 = (12)10
(ii) Sign bit is 0, which means the number is positive.
Magnitude = 01000 = 8
? (001000)2 = (+ 8)10
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.5
Vidyalankar : GATE – EC
Example:
(i) Find the one’s complement of the following binary numbers.
0100111001
Solution:
The 1's complement of following binary number is
1011000110
From the above examples, it can be observed that for an n-bit number, the maxi-
mum positive number which can be represented in l’s complement
representation is (2 1) and the maximum negative number is (2 1).
n1 n 1
It is also observed that the 2’s complement of the 2’s complement of a number is
the number itself.
Example:
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.6
Notes on Boolean Algebra
Solution:
(i) Number 0 1 0 0 1 1 1 0
1’s complement 1 0 1 1 0 0 0 1
Add 1 1
1 0 1 1 0 0 1 0
(ii) Number 0 0 1 1 0 1 0 1
1’s complement 1 1 0 0 1 0 1 0
Add 2 1
1 1 0 0 1 0 1 1
1. If the LSB of the number is 1, its 2’s complement is obtained by changing each 0
to 1 and 1 to 0 except the least-significant bit.
2. If the LSB of the number is 0, its 2’s complement is obtained by scanning the
number from the LSB to MSB bit by bit and retaining the bits as they are up to
and including the occurrence of the first 1 and complements all other bits.
Example 1 :
p
(ii) Number 0 1 1 0 0 1 1 1
2’s Complement 1 0 0 1 1 0 0 1
Example 2 :
Represent (17)10 in
(i) Sign-magnitude,
(ii) One’s complement,
(iii) Two’s complement representation.
Solution:
The minimum number of bits required to represent (+ 17)10 in signed number format
is six.
? (+17)10 = (010001)2
Therefore, (17)10 is represented by
(i) 110001 in sign-magnitude representation.
(ii) 101110 in 1’s complement representation.
(iii) 101111 in 2’s complement representation.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.7
Vidyalankar : GATE – EC
BINARY ARITHMETIC
x Binary Addition
The rules of binary addition are given in following table.
Rules of binary addition
Example 1:
Example 2 :
Solution:
1 Two pair of 1’s in the
previous column
(1) (1) (1) 1 (1) (1) (1) m One pair of 1’s in the
0 1 1 0 1 0 1 0 previous column
0 0 0 0 1 0 0 0
1 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1
1 1 1 1 0 0 1 0
1
Carry Even number of 1’s in column
odd number of 1’s in column
? The sum = 1 1 1 1 1 0 0 1 0
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.8
Notes on Boolean Algebra
Example:
minuend: 101101
subtrahend: 100111
difference: 000110
x Binary Multiplication
Binary multiplication is similar to decimal multiplication. In binary, each partial
product is either zero (multiplication by 0) or exactly same as the multiplicand
(multiplication by 1). An example of binary multiplication is given below:
Example :
Multiply 1001 by 1101.
Solution:
10 01 Multiplicand
u1 101 Multiplier
1 0 01
I
0000 II Partial Products
10 01 III
IV
10 01
111 0 1 0 1 Final Products
x Binary Division
Binary division is obtained using the same procedure as decimal division. An
example of binary division is given below:
Example:
Divide
1110101 by 1001
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.9
Vidyalankar : GATE – EC
Solution:
1101 m Quotient
Divisor o 1001 1110101
m Dividend
1001
1011
1001
001001
1001
Ans: 1101 0000
Example:
Perform binary subtraction using 1cs complement method.
(i) Subtract 5 from 7
(ii) Subtract 7 from 5.
Solution :
Here final carry is zero. Therefore the answer is negative and is in 1cs complement form.
? 1cs complement of 1 1 0 1 = 0 0 1 0 i.e. (2)10
? Therefore answer is (2)10
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.10
Notes on Boolean Algebra
Example:
Perform binary subtraction using 2’s complement representation of negative numbers.
Solution:
(i)
7 0 1 1 1 Minuend
5 () 1 0 1 1 2’s complement of subtrahend
2 1 0 0 1 0
n
(ii) 5 0 1 0 1 Minuend
7 () 1 0 0 1 2’s complement of subtrahend
2 1 1 1 0
The final carry = 0. Therefore, the answer is negative and is in 2cs complement form.
2cs complement of 1110 = 0010. Therefore, the answer is (2)10.
Note:
Both the 1’s and 2’s complement are complex, compared to direct subtractions. But
they have distinct advantage when implemented using logic circuits because they
allow subtraction to be done by using only addition.
Both 1’s and 2’s complement can be realized using logic circuits, and 2’s complement
has an advantage over the 1’s complement in that an end around carry operation
does not have to be performed.
Overflow
For Addition
If an addition operation produces a result that exceeds the range of the number
system, overflow is said to occur. A simple rule for detecting overflow in addition: An
addition overflow occurs if the signs of the addends are the same and the sign of the
sum is different from the addends’ sign.
For Subtraction
Overflow in subtraction can be detected by examining the signs of the minuend and
the complemented subtrahend, using the same rule as in addition.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.11
Vidyalankar : GATE – EC
Older computer systems use octal numbers to represent binary information. There are
3
eight (2 ) combinations of 3 bit binary number. Therefore, sets of 3 bit binary numbers
can be represented by a singe octal number and this can be conveniently used for
entering data in the computer. Octal number system uses eight symbols 0 to 7. Octal
numbers are also referred to as base 8 numbers. The advantage of the octal system is its
usefulness in converting directly from a 3 bit binary number.
2 u 512 + 3 u 64 + 7 u 8 + 4 u 1 = (1276)10
? (2374)8 = (1276)10
Since octal number system has base of 8 each successive digit position is an
0
increasing power of 8, beginning with 8 . The decimal number can be obtained by
multiplying each digit by its weight and summing the products.
Example:
Convert (1276)10 to it’s octal equivalent
Solution:
8 1276 Remainder LSB
8 159 4
8 19 7
8 2 3
0 2 MSB
?(1276)10 = (2374)8
Note: Fractional numbers are converted in the same way as for binary by repeated
multiplication by 8.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.12
Notes on Boolean Algebra
To convert octal to binary, simply replace the octal digit by its binary number using 3
bits.
(100)2 (111)2
? (47)8 = (100111)2
101101 101110
0 (55.56)8 …( 0 appended zero)
n n n n 2
Group 3 bits in the arrow direction
§ 100 111 ·
e.g.: ¨ ¸ o Binary
© 4 7 ¹2
? (100111)2 = (47)8.
Note : While grouping we can append zero to the left of MSB and to the right of LSB
to make pair of there as shown above.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.13
Vidyalankar : GATE – EC
Example :
(11011001)2
D 9
? (1101 1001)2 = (D9)16.
Example:
(4CA)16 (0100 1100 1010)2
4 C A
With 2 hexadecimal digits, we can count upto (FF)16 = (255)10, with four hexadecimal
digits, we get (FFFF)16 = (65535)10.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.14
Notes on Boolean Algebra
Solution:
Remainder
16 45816 8 LSB
16 2863 15 (F)
16 178 2
16 11 11(B)
0 MSB
? (45816)10 = (B2F8)16
x Hexadecimal Addition
The following rules are applied:
1. In any given column of an addition problem, think of the two hexadecimal digits in
terms of their decimal value.
e.g. (5)16 = (5)10
(C)16 = (12)10
2. If the sum of these two digits is (15)10 or less, bring down the corresponding
hexadecimal digit.
3. If the sum of these two digits is greater than (15)10, bring down the amount of the
sum that exceeds (16)10 and carry a 1 to the next column.
e.g. (DF)16 + (AC)16
D F
A C
18 B
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.15
Vidyalankar : GATE – EC
Procedure : F + C = 15 + 12 = 27
? 27 – 16 = B with carry 1
D + A + 1 = 13 + 10 + 1 = 24
24 – 16 = 8 with a carry 1.
? (DF)16 + (AC)16 = (18B)16
CODES
Almost all digital circuits (Computers, calculators) understand only binary numbers. But
most people understand only decimal numbers. Thus, we must have electronic devices
that can translate from decimal to binary and from binary to decimal numbers.
1 2 3 Output Display
4 5 6 Processing
Unit Decoder
7 8 9 0
Binary Decimal
Decimal
1001
9
The device that translates from keyboard decimal numbers to binary is called an encoder.
The device converting from binary numbers to decimal numbers is called decoder.
(i) Binary Codes
In this, the decimal numbers are converted, to their straight binary equivalent.
e.g. 13 is represented as 1101.
(ii) BCD Code (8–4–2–1)
x In this code, decimal digits 0 through 9 are represented (coded) by their natural
binary equivalents using four bits. For example, (23)10 is represented by 0010
0011 using BCD code, rather than (10111)2.
x This code is also known as 8421 code or simply BCD code. 8, 4, 2 and 1 are
the weights of the four bits of the binary code of each decimal digit similar to
straight binary number system. Therefore, this is a weighted code.
In applications such as frequency counters, digital voltmeters or calculators where
the output is decimal display, BCD code is usually used.
Example:
Decimal (5 2 9)10
BCD 0101 0010 1001
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.16
Notes on Boolean Algebra
The Gray code is a reflected code and can be constructed using this property as
given below:
(i) A 1-bit Gray code has two code words 0 and 1 representing decimal numbers 0
and 1 respectively
n1
(ii) An n-bit (n t 2) Gray code will have first 2 Gray codes of (n 1) bits written in
order with a leading 0 appended.
n1
(iii) The last 2 Gray codes will be equal to the Gray code words of an (n 1) bit
n1
Gray code, written in reverse order (assuming a mirror placed between first 2
n1
and last 2 Gray codes) with a leading 1 appended
Example:
Determine (a) 1-bit (b) 2-bit (c) 3-bit Gray codes and tabulate along with their
equivalent decimal numbers.
Solution:
(a) 1-bit Gray code is constructed using (i) above.
Decimal number Gray code
0 0
1 1
(b) 2-bit Gray code is constructed using (ii) and (iii) above and Gray code of 1-bit
Decimal number Gray code
0 00
1 01
2 11
3 10
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.17
Vidyalankar : GATE – EC
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.18
Notes on Boolean Algebra
(a) EBCDIC
This is an 8 bit code without parity. A ninth bit can be added for parity. Used in
IBM equipments.
(b) ASCII
This code is widely used to send information to and from microcomputers. It is a
7 bit code used in transferring coded information from keyboards and to
computer displays and printers. The abbreviation ASCII stands for the American
Standard Code for Information Interchange. The ASCII Code is used to represent
numbers, letters, punctuation marks as well as control characters. e.g. The 7 bit
ASCII Code 111 1111 stands for DEL. i.e., Delete.
With 7 bits we can code upto 128 characters which is enough for the full upper and
lower case alphabet, numbers, punctuation marks, and control characters. The
code is arranged so that if only uppercase letters, numbers, and a few control
characters are needed, only the lower 6 bits are all that are required. If a parity
check is wanted, a parity bit is added to the basic 7 bit code in the MSB position.
The binary word 1100 0100 is the ASCII Code for uppercase D with odd parity.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.19
Vidyalankar : GATE – EC
i
(i) The bit position in Hamming code word is then numbered from 1 through 2
1. In this case, any position whose bit position number is a power of 2 is a
parity bits and remaining are data bits, e.g. thus for 4 bit data (D3 D2 D1 D0),
number of parity bits required are 3 (P2 P1 P0). Thus code word becomes.
2 1 0
2 2 2
Bit Position 7 6 5 4 3 2 1
Code Word D3 D2 D1 P2 D0 P1 P0
(ii) After this, each parity bit is grouped with a subset of information bits, whose
position number have a 1 in the same bit when expressed in binary.
e.g. Parity bit P1 (Position 2 i.e. 0 1 0) is grouped with data bits whose
positions is 3 (0 1 1), 6 (1 1 0) and 7 (1 1 1). This process is done for all
parity bits.
(iii) Once grouping is done parity bit is chosen to produce even parity. i.e. even
number of ones.
Example:
Generate Hamming code for data bits 0 1 1 0
Step 1 :
Arranging of bits
2 1 0
2 2 2
Bit position : 7 6 5 4 3 2 1
Code Word : D3 D2 D1 P2 D0 P1 P0
0 1 1 0
Step 2 and 3 :
Grouping and assignments
Parity
P0 : P0 D0 D1 D3 : 010 1010
P1 : P1 D0 D2 D3 : 010 1010
P2 : P2 D1 D2 D3 : 110 0110
Thus, P0 1, P1 1, P2 0
0 1 1 0 0 1 1
? Transmitted code word :
P2 P1 P0
Error detecting and correcting ability of Hamming code. From above example, we
see that transmitted code as word 0 1 1 0 0 1 1. Now let there be a 1 bit error
during transmission, such that bit position 6 becomes zero. Therefore received
code word is 0 0 1 0 0 1 1. Our aim is to detect this error and correct it.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.20
Notes on Boolean Algebra
Bit position : 7 6 5 4 3 2 1
D3 D2 D1 P2 D0 P1 P0
Transmitted word : 0 1 1 0 0 1 1
Received word : 0 0 1 0 0 1 1
error
P0 D0 D1 D3 : 1 0 1 0 error : 0
P1 D0 D2 D3 : 1 0 0 0 error : 1
P2 D1 D2 D3 : 0 1 0 0 error : 1
LOGIC GATES
In a digital system there are only a few basic operations performed, irrespective of the
complexities of the system. The basic operations are AND, OR, NOT, and FLIP-FLOP.
The AND, OR, and NOT operations are discussed here and the FLIP-FLOP, which is a
basic memory element used to store binary information will be introduced in chapter 4.
I/P O/P
0 1
1 0
Complementation laws
0 1
1 0
A A
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.21
Vidyalankar : GATE – EC
A
B X=AB N
N
Standard Logic symbols for an AND gate
INPUTS OUTPUT
A B X
0 0 0
0 1 0
1 0 0
1 1 1
The AND gate acts as an Enable/Inhibit Device: The AND gate is used to enable the
passage of signal from one point to another at certain times and to inhibit the
passage at other times.
A0 0 Null
A 1 A Identity
AA A Idempotent
AA 0 Complement
A B B A Commutative
ABC A(BC) (AB)C Associative
A (B C) A B A C Distributive
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.22
Notes on Boolean Algebra
A
B
X
N
Standard Logic symbol for N input OR Gate
input OR gate
Truth table of 2
INPUTS OUTPUT
A B X
0 0 0
0 1 1
1 0 1
1 1 1
Laws of OR function
A0 A Null
A 1 1 Identity
AA A Idempotent
AA 1 Complement
A B B A Commutative law
A (B C) A B) C Associative law
A
X
B
A B
X
OR AND
X=A+B X = A B
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.23
Vidyalankar : GATE – EC
These operations have become very popular and are widely used, because only one
type of gates, either NAND or NOR are sufficient for the realization of any logical
expression. Because of this reason, NAND and NOR gates are known as universal
gates.
X AB
A X
B A B N
N
AND NOT
A
X
B A B N
N
The output of NAND gate is HIGH, when at least one input to the NAND gate is
LOW.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.24
Notes on Boolean Algebra
NOT A X X =AA A
AND A AB X AB AB
B
OR A
A
X AB
$ %
B
B
X A B N
A X AB N
B
N
A X AB N
B
N
The output of NOR gate is HIGH only when all the inputs are LOW.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.25
Vidyalankar : GATE – EC
NOT A
Y=AA A
OR A AB
Y AB AB
B
A A
AND
Y A B $ %
B
B
The NAND and NOR functions are commutative but not associative.
BOOLEAN ALGEBRA
The digital signals are discrete in nature and can only assume one of the two values
0 or 1. A number system based on these two digits is known as binary number system.
The rules for manipulations of binary variables, is known as Boolean algebra. This is the
basis of all digital systems like computers, calculators, etc. The Boolean algebraic
theorems are given below.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.26
Notes on Boolean Algebra
Observe that the even numbered theorems can be obtained from their preceding odd
numbered theorems by (i) interchanging + and signs, and (ii) interchanging 0 and 1.
Theorems which are related in this way are called duals. The last two theorems are
called Demorgan’s theorems.
Theorem 1.10 can be proved by making the truth table given in table below.
Operator Precedence
When solving Boolean expressions, the precedence in descending order is
1. Parenthesis 2. NOT
3. AND 4. OR
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.27
Vidyalankar : GATE – EC
x De Morgan’s Theorem
Statement:
It states that the complement of a function is obtained by interchanging AND and OR
operators and complementing each literal (variable).
DeMorgan’s Laws
1. A B A B
i.e. NOR gate is equivalent to bubbled AND gate, which is as shown below.
A X AB A X A B A B
B B
2. AB A B
i.e. NAND gate is equivalent to bubbled OR gate, which is as shown below.
A X = AB A X AB
B B
1. Complement function Y AB C
2. Change operators Y (A B)C
3. Complement variables Y (A B)C
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.28
Notes on Boolean Algebra
Example:
Realize equation F = AB + C using
(i) Using AndOR gates only
(ii) Using only NAND gates only
(iii) Using only NOR gates only
Solution:
(i) Using AND OR gates
A
B
F = AB + C
C
A A
B B
F = AB + C F = AB + C
C C
A
C
F = AB + C
A A
C C
F = AB + C F = AB + C
B B
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.29
Vidyalankar : GATE – EC
INPUTS OUTPUT
A B X
0 0 0
0 1 1
1 0 1
1 1 0
EX-OR gate using AND-OR-Invert
A
B
Y AB AB
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.30
Notes on Boolean Algebra
To implement EXOR function of more than 2inputs following methods are used.
1. X A BC
A
B X
C
2. X A B CD
A
B
X
C
D
x A B AB AB
$% $%
$ %
i.e. one of the inputs of EXOR is inverted then the EXOR gate works as EXNOR.
x A B AB A B
x A B 1 A B A B
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.31
Vidyalankar : GATE – EC
A X A B
B
Standard Logical Symbol for 2input EXNOR Gate
AB
EXNOR is called as equality comparator as output of EXNOR is logic 1 only when
the even no. of inputs are equal.
Useful formulae for EXNOR Gate
x A 0 A
x A 1 A
x A A 1
x A A 0
x A B A B
x A B A B
x A B A B
x A B AB A B
x A AB AB
x A (A B) AB
x A AB A B
x A (A B) AB AB
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.32
Notes on Boolean Algebra
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.33
Vidyalankar : GATE – EC
F = 6 X,Y,Z (0,3,4,6,7)
= Xc Yc Zc Xc Y Z X Yc Zc X Y Zc X Y Z
Here, the notation 6 X,Y,Z (0,3,4,6,7) is a minterm list and means “the sum of minterms 0,
3, 4, 6, and 7 with variables X, Y, and Z.”
x The canonical product of a logic function (standard POS) is a product of the
maxterms corresponding to input combinations for which the function produces a 0
output. For example, the canonical product of the same logic function shown in
above table is
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.34
Notes on Boolean Algebra
F = 3 X,Y,Z (1,2,5)
= (X Y Z) (X Y Z) (X Y Z)
Here, the notation 3 X,Y,Z (1,2,5) is a maxterm list and means “the product of
maxterms 1, 2, and 5 with variables X, Y, and Z.”
Example:
Consider the truth table of 3 variables as shown below.
(i) Write expression of given function F in standard SOP form
(ii) Write expression of given function F in standard POS form
A B C Output (F)
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 1
Solution :
(i) Standard SOP
? F = ¦ m(1, 4, 6, 7) ABC ABC ABC ABC …(1)
(A,B,C) (0 0 1) (1 0 0) (1 1 0) (1 1 1)
Thus, we see that both equation (1) and (2) represents the same truth table
? F = ¦ (A, B, C) (1, 4, 6, 7) (A, B, C) (0, 2, 3, 5)
CIRCUIT MINIMIZATION
Minimization of any Boolean equation, leads to circuit with less hardware components.
This reduces the size, cost of circuit and circuit becomes more reliable. Thus circuit
minimization is one of the important steps before designing any digital circuits.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.35
Vidyalankar : GATE – EC
Thus it requires one 3-input AND gates and one 2-input OR gate (assuming inverters
are freely available).
Disadvantage
x Method is complex and not systematic.
x In a complex equation, it becomes difficult visualize relationship between various
terms.
x Also, one is not sure about the final equation obtained is truly a minimal one.
X X X W
XY WX
01 11 10 00 01 11 10
Y 0 1 Z 00 YZ
0 2
0 0 0 2 6 4 00 0 4 12 8
1
1 3 Y 1
1 3 7 5 Z 01 1 5 13 9
Z
11 3 7 15 11
(a) 2-Variable Y Y
10 2 6 14 10
(b) 3-Variable
X
Karnaugh maps (c) 4-Variable
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.36
Notes on Boolean Algebra
Discription of K-maps
n
x For a n-variable function, K-map contains 2 cells, one for each possible input
combination (minterm / maxterm).
x The rows and columns of K-map are labeled so that input combination for any cell is
easily determined from row and column heading as shown above.
x In each row and column heading first bit corresponds to first variable and second bit
corresponds to second variable, which help to identify cells.
x The smaller number inside each cell is the corresponding minterm/maxterm number
in the truth table.
x Gray code has been used for identification of each cell e.g. cell 13 in 4-variable map
corresponds to the truth table row in which WXYZ = 1 1 0 1.
X Y Z F
0 0 0 0 XY X
0 0 1 1 Z 00 01 11 10
0 1 0 1
0 1 1 0 0 00 2
1
6
0
4
0
1 0 0 0
1 0 1 1 1 1 3 7 5 Z
1 0 1 1
1 1 0 0
1 1 1 1 (a) Y (b)
On the other hand, if a K-map is given we can make the truth table corresponding to this
by following the reverse process. That is, the output F is logical 1 corresponding to the
decimal numbers/minterms represented by cells with entries 1. In all other rows, the
output F is logical 0.
Note: From now on, we’ll reduce the clutter in maps by copying only the 1s or the 0s, not
both.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.37
Vidyalankar : GATE – EC
Solution:
The given function is F = 6A,B,C(1,2,4,7). Thus, AB
corresponding to each minterm in the equation, 00 01 11 10
C
there is a cell in the K-map and a 1 is entered in 0 0 2 6 4
each one of these cells. The K-map will be as 0 1 0 1
shown in following figure (1). Similarly, from the 1 1 3 7 5
K-map, we can write the corresponding logical 1 0 1 0
equation in standard SOP form by ORing the
minterms corresponding to each 1 entry in the Fig.: 1 K-map for example 1
K-map.
Example 2 :
Write the logical equation in the standard SOP form for the K-map of following figure (2).
AB
00 01 11 10
CD
0 4 12 8
00
1 1
1 5 13 9
01
1 1
3 7 15 11
11
1 1
2 6 14 10
10 1
Fig.2: K-map of example 2
Solution :
F = ¦m(0,5,7,9,12,14,15)
= ABCD ABCD ABCD ABCD ABCD ABCD ABCD
Logical equation in standard POS form can be represented on K-map by entering 0’s in
the cells of K-map corresponding to each maxterm present in the equation.
Example 1 :
Solution :
The above function F = (A,B,C)(0,3,5,6). Thus, corresponding to each maxterm in the
equation, there is a cell in the K-map and a 0 is entered in each one of these cells. The
K-map will be same as shown in above figure (1). From a given K-map, we can write the
logical equation in the standard POS form by ANDing the maxterms corresponding to
each 0 entry in the K-map.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.38
Notes on Boolean Algebra
Example 2 :
Write the logical equation in the standard POS form for the K-map of shown in above
figure (2).
Solution:
Y = 3 M (1, 2, 3, 4, 6, 8, 10, 11, 13)
= (A B C D) (A B C D) (A B C D)
(A B C D) (A B C D) (A B C D)
(A B C D) (A B C D) (A B C D)
Simplification of logical functions with K-map is based on the principle of combining terms
in adjacent cells. Two cells are said to be adjacent if they differ in only one variable. In
adjacent cells one of the literals is same, whereas the other literal appears in
uncomplemented form in one and in the complemented form in the other cell.
From this it becomes clear that if the Gray code is used for the identification of cells in K-
map, physically adjacent (horizontal and vertical but not diagonal) cells differ in only one
variable. Also, the left-most cells are adjacent to their corresponding right-most cells and
similarly the top cells are adjacent to their corresponding bottom cells. The simplification
of logical function is achieved by grouping adjacent 1cs or 0cs in groups of 2i, where i = 1,
2, …n and n is the number of variables.
x If a circle covers only areas of the map where the variable is 0, then the variable is
complemented in the product term.
x If a circle covers only areas of the map where the variable is 1, then the variable is
uncomplemented in the product term.
x If a circle covers both areas of the map where the variable is 0 and areas where it is
1, then the variable does not appear in the product term.
x On 3 variables Kmap AB AB AB AB
00 01 11 10
C0 1 1 1 1
C 1 1 1 1 1
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.39
Vidyalankar : GATE – EC
x On 4 variables Kmap AB AB AB AB
CD 1 1 1
CD 1 1
CD
CD 1 1
AB
AB 00 01 11 10
CD
C 00 01 11 10
00 1 1 1 1
0 1 1 1 1
01 1
1 1 1 1
11 1 1 1
10 1 1 1 1
10 1 1 1
Note: For POS form, same grouping mechanism is followed, in which 0’s are grouped
instead of 1cs.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.40
Notes on Boolean Algebra
For minimizing a given expression in SOP form or for a given truth table, we have to
prepare the K-map first and then look for combinations of ones on the K-map. The
following algorithm can be used which will definitely lead to minimized expression:
1. Identify the ones which can not be combined with any other ones and encircle them.
These are essential prime implicants.
2. Identify group of eight adjacent ones, encircle such groups of ones.
3. Identify group of four adjacent ones, encircle such groups of ones.
4. Identify groups of two adjacent ones, encircle such groups of ones.
5. After identifying the essential groups of 2, 4, and 8 ones, if there still remain some 1s
which have not been encircled then these are to be combined with each other or with
other already encircled 1s. Of course, however, we should combine the left-over ones
in largest possible groups and in as few groupings as possible.
Example 1 :
Minimize the four-variable logic function using K-map.
f (A, B, C, D) = 6m (0, 1, 2, 3, 5, 7, 8, 9, 11, 14)
Solution :
The K-map of above function is shown in figure below.
AB
00 01 11 10
CD
1
00 0 4 8
1 BC
1
1 5 1 1 9 BD
01 1
1
3 7 1 1
11 1 1 1
2 6 1 1
10 1 1 ABCD
AB AD
K-map for given function
Therefore, the minimized equation is
f (A, B, C, D) = ABCD BC BD AD AB
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.41
Vidyalankar : GATE – EC
Example:
Minimize following function in POS form
(i) F ¦(X, Y, Z) m(0, 1, 4, 5, 6) in POS form
(ii) F ¦(A, B, C, D) m(0, 1, 2, 3, 5, 7, 8, 9, 11, 14) in POS form
Solution :
(i) As we know that for POS form function must be in maxterm form.
? F = ¦ (X, Y, Z) m(0, 1, 4, 5, 6) (X, Y, Z) M(2, 3, 7)
? Corresponding K-map is
(X Y)
XY 0 0 0 1 1 1 1 0
Z
0 0
1 0 0
(Y Z)
? F = (X Y) (Y Z)
which is minimal POS equation
(ii) Similarly
? F = ¦(A, B, C, D) m(0, 1, 2, 3, 5, 7, 8, 9, 11, 14) (A, B, C, D) M(4,6, 10, 12, 13, 15)
? Corresponding K-map is
AB 0 0 0 1 1 1 1 0
CD
00 0 0 (A B C)
01 0
(A B D) 11 0 (A B D)
10 0 0 (A B C D)
?F= (A B C) (A B D) (A B D) (A B C D)
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.42
Notes on Boolean Algebra
Solution:
this is a 4-variable function, each term must have 4 literals (either complemented or
uncomplemeted form) so as to consider as a standard SOP form.
Here we use following theorem.
X1=X
X (Y + y ) = X … [as Y + Y = 1]
Thus, the missing term are added in the form Y Y
? F(A,B,C,D) = ABCD ABCD ABC(D D) AB(C C)D A(B B)C(D D)
ABC(D D) (A A)B(C C)(D D)
AB 0 0 0 1 1 1 1 0
CD
00 1 1 1
01 1 1 1 AC
11 1 1 1
10 1 1
A CD B
? minimal SOP form is
F = B AC ACD
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.43
Vidyalankar : GATE – EC
Method 2 :
Follow the following procedure
1. Enter ones for minterms and zeros for maxterms
2. Enter a pair of ones/zeros for each of the terms with one variable less than the total
number of variables.
3. Enter four adjacent ones/zeros for terms with two variables less than the total number
of variables.
4. Repeat for other terms in the similar way.
Once the K-map is prepared the minimization procedure is same as discussed earlier.
? Term A C can be represented as AB 0 0 0 1 1 1 1 0
CD
A 1 (we see column 3 and 4)
C 0 (we see row 1 and 2) 00 1 1
AC
So intersection of this is the required region 0 1 1 1
11
10
Similarly we can represent other terms, in order to prepare entire K-map. Once this is
done simplification process is same as discussed before
Example 2 :
Express following logic function in standard POS form and then minimize it
F(A,B,C,D) (A B C D) (A C D) (A B C D) (B C) (B C) (A B) (B D)
Solution :
Method 1 :
Here we use
X+0=X
X + YY X … [as Y Y 0]
and (X + Y) (X + Y ) = X
… [Distributive property of addition i.e. logical addition distributes one logical multiplication]
where Y missing term
? Given function becomes
? F(A,B,C,D) = (A B C D) (A C D BB) (A B C D)
(AA B C DD) (AA B C DD) (A B CC DD) (A A B CC D)
= (A B C D) (A B C D) (A B C D) (A B C D)
(A B C D) (A B C D) (A B C D) (A B C D)
(A B C D) (A B C D) (A B C D)
= (A,B,C,D)M(3,4,5,6,7,9,11,12,13,14,15) … [required standard POS form]
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.44
Notes on Boolean Algebra
01 0 0 0
(A D)
11 0 0 0 0
(C D)
10 0 0
Method 2 :
It is similar to method 2, used for SOP form. Here only difference is that we use zeros in
place of ones, for instance the term (A B) in above function can be represented as
AB 0 0 0 1 1 1 1 0
(for maxterm form) CD
here 00 0
A 0 (we see column 1 and 2
B 1 (we see column 2 and 3) 01 0
? intersection of this, it the desired region.
11 0
10 0
(A B)
Similarly we represent other terms, in order to get final K-map. Once K-map is obtained
minimization process is straight forward obtained by grouping zeros.
Diagonal and Offset Grouping
If we have to construct the equation using EXOR or EXNOR gates then use the
Diagonal and Offset grouping.
Diagonal Grouping
AC
AB
00 01 11 10
C
0 1 1
1 1
1
diagonal AC
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.45
Vidyalankar : GATE – EC
Offset Grouping
(i) (ii) AB
AB
C 00 01 11 10
C 00 01 11 10
0
0 1 1 AB
AB 1 1 1
1 1 1
offset
offset ABC
ABC
? F = AB + AB ? F = ABC ABC
= A B = C (AB AB)
= C(A B)
Note: Avoid the mixing of grouping (i.e. horizontal, vertical with diagonal and offset).
Consider for example, suppose we wanted to build a prime-number detector whose 4-bit
input
B = B3B2B1B0 is always a BCD digit; then minterms 1015 should never occur.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.46
Notes on Boolean Algebra
? K-map becomes
B3B2
B1B0 0 0 0 1 1 1 1 0
00 d don't group cells
don't consider since containing all dcs
01 1 1 d
two 1cs are already B3B0
considered 11 1 1 d d
10 1 d d
Octal to
Binary Substitution 12348 = 001 010 011 1002
Hexadecimal Substitution 12348 = 001 010 011 1002 = 0010 1001 11002 = 29C16
Decimal Summation 12348 = 1 512 + 2 64 + 3 8 + 4 1 = 66810
Hexadecimal
to
Binary Substitution C0DE16 = 1100 0000 1101 11102
Octal Substitution C0DE16 = 1100 0000 1101 11102 = 1 100 000 011 011 1102 = 1403368
Decimal Summation C0DE16 = 12 4096 + 0 256 + 13 16 + 14 1 = 4937410
Decimal to
Binary Division 10810 y 2 = 54 remainder 0 (LSB)
y 2 = 27 remainder 0
y 2 = 13 remainder 1
y 2 = 6 remainder 1
y 2 = 3 remainder 0
y 2 = 1 remainder 1
y 2 = 0 remainder 1 (MSB)
10810 = 11011002
Octal Division 10810 y 8 = 13 remainder 4 (LSB)
y 8 = 1 remainder 5
y 8 = 0 remainder 1 (MSB)
10810 = 1548
Hexadecimal Division 10810 y 16 = 6 remainder 12 (LSB)
y 16 = 0 remainder 6 (MSB)
10810 = 6C16
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.47
Vidyalankar : GATE – EC
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.48
Notes on Boolean Algebra
x An OR gate produces a HIGH on the output when any of the inputs is HIGH.
x Boolean addition is the same as the OR function.
x Boolean addition differs from binary addition in the case where two 1’s are added.
There is no carry in Boolean addition.
x When solving Boolean expressions, the precedence in descending order is
a. Parenthesis b. NOT c. AND d. OR
x DeMorgan’s Theorem : It states that the complement of a function is obtained by
interchanging AND and OR operators and complementing each literal.
x DeMorganization : “just break the line, change the sign”.
x The NAND and NOR gates are called universal gates as any basic gate (AND, OR
and NOT) can be implemented using these gates.
x NAND gate is equivalent to bubbled OR gate.
x The output of NAND gate is HIGH, when at least one input to the NAND gate is LOW.
x NOR gate is equivalent to bubbled AND gate.
x The output of NOR gate is HIGH only when all the inputs are LOW.
x The NAND and NOR functions are commutative but not associative.
x Converting circuits to Universal Logic :
a) Draw the circuit in AND/OR/invert logic
b) If NAND realization is chosen, add a circle to the outputs of each AND gate on
the logic diagram, and add circles to the inputs of all OR gates.
c) In NOR realization, add circle to the output of gates and add circle to the inputs
of AND gates.
d) Add or subtract an inverter on each line that received a circle in step 2 or 3.
x EXOR is mathematically represented as
X AB AB
x In EXOR, for even inputs output is LOW and for odd inputs output is HIGH.
x It is also noted that EXOR is inequality comparator.
x EXNOR is mathematically represented as
X AB AB
x EXNOR is called as equality comparator as output of EXNOR is logic 1 only when
the even no. of inputs are equal.
n
x Kmap is used to determine minimal expression. Each n variable map consists of 2
cells or squares.
x Minterm : ‘Minterm’ is a product term which has each of all the variables as factors in
either complemented or uncomplemented form.
x Maxterm : ‘Maxterm’ is a sum term which has each of all the variables as factors in
either complemented or uncomplemented form.
x Canonical form : The switching function expressed as the sum of all the minterms is
called the canonical Sum Of Products (SOP) or disjunctive normal expression.
x The switching function expressed as a produce of all the Maxterms is called the
canonical Product Of Sum (POS) form.
x POS form is found out by complementing minterm equation.
GATE/EC/DC/SLP/Module_3/Ch.1_Notes/Pg.49
Vidyalankar : GATE – EC
ASSIGNMENT 1
Duration : 45 Min. Maximum Marks : 30
GATE/EC/DC/SLP/Module_3/Ch.1_Assign/Pg.50
Assignment on Boolean Algebra
9. To represent reduced expression of the following POS form, the no. of NOR
gates required are
y = 3 M(0, 1, 2, 3, 6, 7, 8, 9, 11, 15)
(A) 6 (B) 7
(C) 8 (D) 9
10. The no. of required gates to represent XOR using NAND only are
(A) 3 (B) 4
(C) 5 (D) 6
11. The decimal number 39 is expressed in 2’s complement form as
(A) 00100111 (B) 11011000
(C) 11011001 (D) 11010001
Lamp
13. (A B) (A B)
(A) A B (B) A B
(C) A (D) B
14. For the switching circuit given below, taking open as 0 and close as 1, the
expression for the circuit is
A C E G
y y
B D F H
GATE/EC/DC/SLP/Module_3/Ch.1_Assign/Pg.51
Vidyalankar : GATE – EC
16. To realize minimized function of K map shown below, no. of gates required are
AB
CD
1 1
1 1
1 1
1 1
(A) 1 (B) 3
(C) 4 (D) None of these
Rc2 Rc3
RB1
Q1 Q3
RB2
Q2
18. The minimum number of NOR gates to implement the function f = AB + AB are
(A) 0 (B) 2
(C) 4 (D) 6
GATE/EC/DC/SLP/Module_3/Ch.1_Assign/Pg.52
Test Paper on Boolean Algebra
TEST PAPER 1
Duration : 30 Min. Maximum Marks : 25
(A) (x y) x y z (B) x z (x y z)
(C) (x z) (x y z) (D) (x y) (x y z)
GATE/EC/DC/SLP/Module_3/Ch.1_Test/Pg.53
Vidyalankar : GATE – EC
01 0 1 1 0
11 0 1 1 0
10 1 0 0 1
(A) M(1, 3, 4, 6, 9, 11, 12, 14) (B) M(0, 2, 5, 7, 8, 10, 11, 15)
(C) M(1, 3, 4, 7, 8, 10, 11, 15) (D) M(0, 2, 4, 7, 9, 11, 12, 14)
9. How many minimum NAND gates are required to implement following Boolean
function ?
y (A B) (A C)
(A) 5 (B) 6
(C) 7 (D) 8
12. The singleprecision floating point binary number of the binary no.
111111011100000 is
(A) 0 10001101 11111011100000000000000
(B) 1 10001001 11111101110000000000000
(C) 0 10110101 11111011100100000000000
(D) 1 11001010 11011001110010000000000
GATE/EC/DC/SLP/Module_3/Ch.1_Test/Pg.54
Test Paper on Boolean Algebra
14(a). The 10cs complement of a no. is (47480)10 Find the no. in decimal equivalent.
(A) 52520 (B) 37480
(C) 47480 (D) 63620
GATE/EC/DC/SLP/Module_3/Ch.1_Test/Pg.55