DPSD Final Approved by Author With ISBN
DPSD Final Approved by Author With ISBN
Design
(Second Year B.E/B.Tech Students)
As per the Syllabus & Regulation (KNCET – UGR2020)
(CSE & IT)
Our Link
http://thecharulathapublications.com/
May 2021
Price :450
ISBN : 978-93-90967-82-7
This book is divided into five units, covering the topics such as Boolean Algebra and Logic
Gates, Combinational Logic, Synchronous Sequential Logic, Asynchronous Sequential Logic,
Memory and Programmable Logic. It covers the entire syllabus.
The central core of the book is easy, with clear steps and practical applications. The main
concept for the preparation of this book is totally based on the learning capacity of budding
Engineering students from different levels.
Each and every topic in this book is approached with different dimensions, diagrams and
analysis in a lucid manner.
We are glad to receive all your suggestions, comments to enrich the quality of the material
to this mail id [email protected].
ACKNOWLEDGEMENT
We thank all the faculty members, friends and family members for providing unconditional
support for bringing out this book on time.
Understand the Digital fundamentals, Boolean algebra and its applications in digital
systems
Familiarize with the design of various combinational digital circuits using logic gates
Introduce the analysis and design procedures for synchronous and asynchronous sequential
circuits
Number Systems – Decimal, Binary, Octal, Hexadecimal, radix conversion ,1's and
2's complements, Codes – Binary, BCD, Excess 3, Gray, Alphanumeric codes, Boolean theorems
& Postulates, Logic gates, Universal gates, Sum of products and product of sums, Minterms and
Maxterms, Karnaugh map Minimization
Design of Half and Full Adders, Half and Full Subtractors, Binary Parallel Adder – Carry
look ahead Adder, BCD Adder, Binary Multiplier, Multiplexer, Magnitude Comparator, Decoder,
Encoder, Priority Encoder – Parity checker & Generator, Introduction to HDL – HDL Models of
Combinational circuits.
Latches, Flip flops – SR, JK, T, D– operation and excitation tables, Triggering of FF,
Analysis and design of clocked sequential circuits – Design - Moore/Mealy models, state
minimization, state assignment, circuit implementation – Design of Counters- Ripple Counters,
Synchronous Counter, Ring Counters, Shift registers, Universal Shift Register- HDL Models of
Sequential Circuits.
UNIT - IV ASYNCHRONOUS SEQUENTIAL LOGIC 9
Stable and Unstable states, output specifications, cycles and races, state reduction, race free
assignments, Hazards, Essential Hazards, Pulse mode sequential circuits, Design of Hazard free
circuits.
Basic memory structure – ROM -PROM – EPROM – EEPROM –EAPROM, RAM – Static
and dynamic RAM - Programmable Logic Devices – Programmable Logic Array (PLA) -
Programmable Array Logic (PAL) – Field Programmable Gate Arrays (FPGA) . Implementation
of combinational logic circuits using PLA, PAL.
TOTAL: 45 PERIODS
OUTCOMES:
Analysis and design procedures for synchronous and asynchronous sequential circuits
TEXT BOOK:
1. Morris.M R. Mano, Michael D. Ciletti, "Digital Design: With an Introduction to the Verilog
HDL, VHDL, and SystemVerilo", 6th Edition, Pearson Education, 2018.
REFERENCES:
2. John F.Wakerly, Digital Design Principles and practices, Fifth Edition, Pearson education,
2017
3. Charles H.Roth Jr, Larry L.Kinney, Fundamentals of Logic design, Sixth Edition,
CENGAGE learning, 2013
CONTENTS
UNIT I – BOOLEAN ALGEBRA AND LOGIC GATES
1.1 Introduction 1.1
1.2 DecimalNumberSystem 1.1
1.3 BinaryNumberSystem 1.1
1.4 OctalNumberSystem 1.2
1.5 HexadecimalNumberSystem 1.2
1.6 NumberBaseConversions 1.3
1.7 Complements 1.12
1.8 SignedBinaryNumbers 1.20
1.9 Binary Arithmetic 1.22
1.10 OtherNumberSystems 1.28
1.11 BinaryCodes 1.28
1.12 ErrorDetectionCodes 1.33
1.13 Alphanumericcode 1.35
1.14 BooleanPostulatesandLaws 1.37
1.15 DeMorgan’sTheorems 1.44
1.16 BooleanRulesforSimplification 1.46
1.17 MinimizationofBooleanExpressions 1.50
1.18 Duality 1.56
1.19 BooleanFunctions 1.58
1.20 ProductofSums(POS)Method 1.59
1.21 SumofProducts(SOP)Method 1.61
1.22 Minterms 1.63
1.23 Maxterms 1.64
1.24 Canonicalform 1.65
1.25 Conversionbetweencanonicalforms 1.71
1.26 KarnaughMaps 1.72
1.27 TabulationMethod(Quine-McCluskeyMethod) 1.98
1.28 BasicLogicGates 1.114
1.29 OtherLogicGates 1.115
1.30 GateConversions 1.118
1.31 DigitalICS 1.120
1.32 UniversalGates 1.121
UNIT II – COMBINATIONAL LOGIC
2.1 Introduction 2.1
2.2 DesignProcedure 2.1
2.3 HalfAdder 2.4
2.4 FullAdder 2.5
2.5 HalfSubtractor 2.8
2.6 FullSubtractor 2.9
2.7 ParallelBinaryAdders 2.12
2.8 ParallelSubtractor 2.13
2.9 BinaryAdder/Subtractor 2.14
2.10 SerialAdder 2.15
2.11 SerialSubtractor 2.17
2.12 SerialAdder/Subtractor 2.17
2.13 BinaryMultiplier 2.18
2.14 CarryLookAheadAdder 2.20
2.15 BCDAdder 2.23
2.16 MagnitudeComparator 2.26
2.17 ParityGeneratorandChecker 2.29
2.18 CodeConverters 2.31
2.19 Decoders 2.39
2.20 Encoders 2.43
2.21 Multiplexers 2.47
2.22 Demultiplexers 2.51
2.23 ImplementationsofCombinationalLogic 2.53
2.24 IntroductiontoHardwareDescriptionLanguage 2.59
2.25 HDLBasedDesignFlow 2.61
2.26 VHDLBuildingBlocks 2.63
2.27 Library 2.72
2.28 TypesandConstants 2.72
2.29 PredefinedTypes 2.73
2.30 User-DefinedTypes 2.74
2.31 SequentialStatements 2.75
2.32 ChallengesinHDL 2.78
2.33 HDLforCombinationalCircuits 2.79
UNIT III – SYNCHRONOUS SEQUENTIAL LOGIC
3.1 Introduction 3.1
3.2 ClassificationofLogicCircuits 3.2
3.3 Flip-flops 3.2
3.4 SRFliflop 3.3
3.5 ClockedSRFlipflop 3.5
3.6 Triggeringofflipflops 3.6
3.7 DFlipflop 3.8
3.8 JKFlipflop 3.9
3.9 TFlipflop 3.11
3.10 MasterSlaveJKFlipflop 3.11
3.11 ExcitationTable 3.12
3.12 RealizationofOneFlipflopusingotherFlipflops 3.15
3.13 Classificationofsynchronoussequentialcircuits 3.19
3.14 StateEquation 3.20
3.15 StateTable 3.20
3.16 StateDiagram 3.20
3.17 AnalysisofSynchronousSequentialCircuits 3.21
3.18 StateMinimization 3.31
3.19 StateAssignment 3.34
3.20 DesignofSynchronousSequentialCircuits 3.35
3.21 ASMChart 3.43
3.22 ShiftRegisters 3.46
3.23 Counters 3.54
3.24 SynchronousCounters 3.58
3.25 Modulus-NCounter 3.64
3.26 ShiftRegisterCounters 3.65
3.27 DesignofCounters 3.68
3.28 Up/DownRippleCounter 3.89
3.29 HDLforSequentialLogicCircuits 3.91
UNIT IV–ASYNCHRONOUS SEQUENTIAL LOGIC
4.1 Introduction 4.1
4.2 TypesofAsynchronousSequentialCircuits 4.1
4.3 TransitionTable 4.2
4.4 FlowTable 4.2
4.5 PrimitiveFlowTable 4.3
4.6 AnalysisofFundamentalModeCircuits 4.3
4.7 AnalysisofPulseModeCircuits 4.7
4.8 Races 4.12
4.9 Cycles 4.14
4.10 RaceFreeStateAssignment 4.14
4.11 MinimizationofPrimitiveFlowTable 4.18
4.12 DesignofFundamentalModeAsynchronousCircuits 4.22
4.13 DesignofPulseModeAsynchronousCircuits 4.29
4.14 Hazards 4.36
4.15 DesignofHazardFreeCircuits 4.37
UNITV–MEMORY AND PROGRAMMABLE LOGIC
5.1 Introduction 5.1
5.2 MemoryUnit 5.1
5.3 WriteOperation 5.2
5.4 ReadOperation 5.3
5.5 ClassificationofMemories 5.3
5.6 RAMOrganization 5.5
5.7 StaticRAMCell 5.6
5.8 BipolarRAMCell 5.7
5.9 MOSFETRAMCell 5.8
5.10 DynamicRAMCell 5.9
5.11 ROM 5.12
5.12 ROMCell 5.12
5.13 ROMOrganization 5.14
5.14 PROM 5.15
5.15 EPROM 5.17
5.16 UVEPROM 5.18
5.17 EEPROM 5.18
5.18 MemoryCycles 5.19
5.19 MemoryDecoding 5.20
5.20 MemoryExpansion 5.22
5.21 AdvantagesofRAM 5.25
5.22 AdvantagesofROM 5.25
5.23 DisadvantagesofROM 5.25
5.24 ComparisonBetweenRAM/ROM 5.26
5.25 ComparisonBetweenSRAM/DRAM 5.26
5.26 ComparisonofTypesofMemories 5.26
5.27 ImplementationofCombinationalLogicCircuits 5.27
5.28 ProgrammableLogicDevices 5.29
5.29 ClassificationofPLDS 5.30
5.30 ProgrammableROM 5.32
5.31 ProgrammableLogicArray 5.34
5.32 ImplementationofCombinationalUsingPLA 5.36
5.33 ProgrammableArrayLogic 5.46
5.34 ImplementationofCombinational 5.47
5.35 FieldProgrammableGateArrays 5.52
5.36 Comparison Between PROM, PLA and PAL 5.54
5.37 EAPROM 5.54
Boolean Algebra and Logic Gates 1.1
UNIT I
1.1 INTRODUCTION
The number systems are used quite frequently in the field of digital electronics and computers.
Number systems of a given radix or base provide the means of quantifying information for processing
by digital systems. There are several number systems but the following are the important ones in the
field of digital electronics:
Decimal number system Binary number system
Octal number system Hexadecimal number system
1.2 DECIMAL NUMBER SYSTEM
The decimal number system has 10 numerals or symbols. These symbols are 0, 1, 2, 3, 4, 5, 6, 7,
8 and 9. The decimal system is also called the base-10 system because it has 10 digits. The position
weights in decimal number system is shown in Figure 1.1.
103 102 101 100 101 102 103 104
Fig. 1.1: Position weights in binary number system
For example, the decimal number 183 represents one hundred, eight tens and three ones. Any
number has two parts, one part is integer part and the other part is fractional part. The decimal point
is used to separate the integer and fractional parts of the number. The number 8265.14 is equal to,
( ) ( ) ( ) ( ) ( ) ( )
1 1 0 1 1 1 0 0
1.2 Digital Principles and System Design
Example 1.3: 0. 8 51 0 = ?2
0.312510 = 0.01012
Example 1.5: 0.62510 = ?2
0.62510 = 1012
Example 1.11: 2 6 51 0 = ?8
8 265
8 33 1
41 2 6 51 0 = 4 1 18
Example 1.12: 0 . 5 51 0 =?8
0.55 8 = 4.4 = 0.4 with a carry of 4
0.4 8 = 3.2 = 0.2 with a carry of 3
0.2 8 = 1.6 = 0.6 with a carry of 1
0.6 8 = 4.8 = 0.8 with a carry of 4
0.8 8 = 6.4 = 0.4 with a carry of 6
0.5510 = 0.431468 (approximate)
1.6 Digital Principles and System Design
1111
0101
0110
F 5 6
(111101010110)2 = (F56)16
Example 1.19: 11111100002 = ?16
0011 1111
0000
3 F 0
(1111110000)2 = (3F0)16
010
101
111
2 5 7 (10101111)2 = (257)8
011
011
100
3 3 1 (0.110111)2 = (0.331)8
001
010
011 001
010
1 2 3 1 2 (1010011.00101)2 = (123.12)8
(3)+(2) +
= 214.2773437510
326.216 8 214.2773437510
1.6.9 Octal-to-Hexa Decimal Conversion
Example 1.34: 3278 = ?16
3 2 7
Octal to Binary
011 010 111
0000 1101 0111
Binary to Hex 0 D 7
1.10 Digital Principles and System Design
(327)8 (D7)16
Example 1.35: 6158 = ?16
6 1 5
Octal to Binary
110 001 101
Binary to Hex 0001 1000 1101
1 8 D
(615)8 ( 1 8 D )1 6
Example 1.39: 7 A F 4 B B 1 6 = ? 2
7 A F 4 B B
0111 1010 1111 0100 1011 1011
1
( 7 A F 4 B B)1 6 = (111101011110100.10111011)2
Boolean Algebra and Logic Gates 1.11
1.6.11 Hexa Decimal-to-Decimal Conversion
The positional weight for the hexadecimal number system and their decimal equivalents are given
in Figure 1.7.
4096 256 16 1 0.0625 0.0039 0.00024
163 162 161 160 161 162 163
Fig. 1.7: Positional weight and decimal equivalent of Hex
( 2 ) +( F ) +( 5 ) ( 9 )
( 2 ) +( 1 5 ) + ( 5 ) ( 5 ) +9
= 1212110 ( 2 F 5 9)1 6 = (12121)10
Example 1.41: A B C D1 6 =?1 0
( A ) +( B ) +( C ) ( D )
( 1 0 ) +( 1 1 ) + ( 1 2 ) ( 1 3)
= 40960 + 2816 + 192 + 13
= 4398110 ( A B C D )1 6 = (43981)10
Example 1.42: F 8 E 61 6 =?1 0
1.7 COMPLEMENTS
Complements are used in digital computers for simplifying the subtraction operation and for
logical manipulation. There are two types of complements:
r’s complement
(r 1)’s complement
For binary numbers, r(base) = 2
2’s complement
1’s complement
For decimal numbers, r(base) = 10
10’s complement
9’s complement
1.7.1 1’s Complement
The 1’s complement of a binary number is the number that results when we complement each bit.
If the binary number is,
A A A A
The 1’s complement is
A A A A
Boolean Algebra and Logic Gates 1.13
Therefore, the 1’s complement of a binary number is formed by changing 1’s to 0’s and 0’s to 1’s.
The following are some examples:
The 1’s complement of 10110001 is 01001110
The 1’s complement of 1111 is 0000
X , Y
1’s complement of Y = 0101
Solution: X = 1110
1’s complement of Y = 0101 (+)
Sum = 1 0011
End-around carry = 1 (+)
X Y = 0100
1.14 Digital Principles and System Design
Example 1.47: (X Y) = 9 3 = 6
X = 1001
1’s complement of Y = 1100 (+)
Sum = 1 0101
End-around carry = 1 (+)
XY= 0110
Subtraction of a large number (X) from a smaller (Y), the 1’s complement method as follows:
Obtain the 1’s complement of the larger number (X).
Add this to the smaller number (Y).
The answer is the 1’s complement of the result and is opposite in sign. There is no carry.
Example 1.48: Y X = 10 14 = 4
X = 1110
1’s complement of X = 0001
Y = 1010
Solution: Y = 1010
1’s complement of X = 0001 (+)
Sum = 1011
1’s complement of result (1011) is 0100 and is opposite sign. i.e., 0100.
Example 1.49: Y X = 3 9 = 6
X = 1001
1’s complement of X = 0110
Y = 0011
Solution: Y = 0011
1’s complement of X = 0110 (+)
Sum = 1001
1’s complement of result (1001) is 0110 and is opposite sign.
i.e., 0110.
Example 1.55: 55 10 = 45
9’s complement of 10 is, 99 10 = 89
55
89 (+)
Carry (1) 44
1 (+)
45
Subtraction of a larger number from a smaller one by the 9’s complement method is as follows:
Determine the 9’s complement of the larger number.
Add this is to the smaller number.
The answer is the 1’s complement of the true result and is opposite in sign.
Example 1.56: 15 67 = 52
9’s complement of 67 is, 99 67 = 32
15
32 (+)
47
True result = (1’s complement of 47)
i.e., (99 47) = 52
Example 1.75: Perform each of the following computations using signed, 8 bit words in 1’s complement
and 2’s complement binary arithmetic. (Dec. 2005)
1. (+95)10 + (63)10
2. (+42)10 + (87)10
3. (13)10 + (59)10
4. (+38)10 + (38 )10
5. (105 )10 + (120 )10
1. (+95)10 + (63 )10 .
In signed binary number, the left most bit is the sign bit and the remaining bits are the magnitude
bits.
(+63 )10 = 0 0111 111
(63 )10 = 1 01111111
sign magnitude
1’s complement of (63)10 = 1 1000000
2’s complement of (63)10 = 1 1000001
1.26 Digital Principles and System Design
Excess-3 Gray Parity Hamming
BCD 5421 2421 84 74 ASCII EBCDIC Hollerith
(8421)
2. Other 4 bit codes: Table 1.5 shows the 4 bit binary codes for the decimal digits 0 to 9.
Table 1.5: Binary Codes
(iii) Binary-to-Gray Code Conversion: The binary-to-gray code conversion is achieved using
following rules:
The most significant bit (MSB) in the Gray code is the same as the corresponding MSB in the
binary number.
Going from left to right, perform an EX-OR operation between the adjacent pair of binary code
bits to get the next Gray code bit.
Example 1.76: Convert the binary number 1001 to Gray code,
Binary : 1 0 0 1
Gray : 1 1 0 1
Gray Code : 1101
Example 1.77: Convert the binary (10110)2 to its gray code.
Binary : 1 0 1 1 0
Gray : 1 1 1 0 1
Gray Code : 11101
Let the binary number is represented as B, B , B ,. . . , BN and gray code is G, G , G ,. . . , GN then
G B
G B B
G B B
.
.
.
G N B N BN
(iv) Gray-to-Binary Code Conversion: The gray-to-binary code conversion is achieved using
following rules:
The MSB in the binary code is the same as the corresponding bit in the gray code.
To obtain the next binary digit, perform an EX-OR operation between the bit just written down
and the next gray code bit.
Example 1.78: Convert the Gray code 1000 to binary
Gray : 1 0 0 0
Binary : 1 1 1 1
Binary Number : 1 1 1 1
Boolean Algebra and Logic Gates 1.33
Example 1.79: Convert the gray code 10101111 to binary
Gray : 1 0 1 10 1 1 1
Binary : 1 1 0 0 1 0 1 0
Binary number is 11001010
A B AB B A BA
0 0 0 0 0 0
0 1 0 = 0 1 0
1 0 0 1 0 0
1 1 1 1 1 1
Table 1.10(a)
Theorem 1b : A + B = B + A
“A OR B” is same as “B OR A”
A B A+B B A B+A
0 0 0 0 0 0
0 1 1 = 0 1 1
1 0 1 1 0 1
1 1 1 1 1 1
Table 1.10(b)
The commulative properties can be extended to any number of variables:
A+B+C=B+A+C ABCD = BACD
A+C=C+A BADC = ABDC
B+A+C=B+C+A
(ii) The Associative Properties
Theorem 2a: (AB)C = A(BC)
2b: (A + B) + C = A + (B + C)
Theorem 2a : (AB)C = A(BC)
A AND B ANDed with C is same as A ANDed with B AND C
Boolean Algebra and Logic Gates 1.39
A B C AB (AB)C A B C BC A(BC)
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 1 0 0
0 1 0 0 0 0 1 0 0 0
0 1 1 0 0 0 1 1 1 0
1 0 0 0 0 1 0 0 0 0
1 0 1 0 0 = 1 0 1 0 0
1 1 0 1 0 1 1 0 0 0
1 1 1 1 1 1 1 1 1 1
Note that, (A + B) + C = A + (B + C) = A + B + C
The associative properties can be extended to any number variables:
A(BCD) = (AB)(CD) = (ABC)D = ABCD
A + (B + C + D) = (A + B) + (C + D) = (A + B + C) + D
=A+B+C+D
(iii) The Idempotent Properties
Theorem 3a : AA = A
Theorem 3b : A + A = A
AA= A A+A=A
Note: A A A = A
A+A+A=A
(iv) Identity Properties
Theorem 4a : A 1 = A
Theorem 4b : A + 1 = 1
A 1= A A+1=1
If A = 0, then A .
If A = 1, then A .
A 0=A
If A = 0, then A A
If A = 1, then A A
Note:
A B C D
AB C D ABC D
A AB+BC
B
C A(B+C) A
B+C
C AC
Fig. 1.10: Distributive Law
A B C (B + C) A(B + C) A B C AB AC AB + AC
0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 0 1 0 0 0
0 1 0 1 0 0 1 0 0 0 0
0 1 1 1 0 = 0 1 1 0 0 0
1 0 0 0 0 1 0 0 0 0 0
1 0 1 1 1 1 0 1 0 1 1
1 1 0 1 1 1 1 0 1 0 1
1 1 1 1 1 1 1 1 1 1 1
A B C A B C AB AC AB AC
1.42 Digital Principles and System Design
A B C D E A B C A B D E
A B C D A B C A B D
AC BC ADBD
Note: The distributive property is often used in reverse called as factoring.
A B A C A B C
X Y W X Y Z X Y W Z
(vii) The Negative Properties
Theorem 7a : AA
Theorem 7b : A A
Theorem 8 : A A
If A , A , A A
If A , A , A A
Note: A + BC = A + BC.
A B A A A A BC D A
Boolean Algebra and Logic Gates 1.43
9b) A(A + B) = A
AA AB A AB A X Y X Y W Y Z X Y
9c) A+ AB = A+ B
A AB A A B AB A A B A B
A A A B X Y X Y Z
= A B =X+Y+Z
=A+B
Bubbled AND Gate
A
A A
Y Y
B
B
B
AND gate with inverted inputs Bubbled AND gate - Truth Table
Y AB A B Y
0 0 1
0 1 0
1 0 0
1 1 0
Fig. 1.11: Bubbled AND gate
Bubbled OR Gate
A
A A
Y B Y
B
B
Theorem (1) : A B A B
Theorem (2) : A B A B
De Morgan’s First Theorem
AB A B
“The complement of a product equals the sum of the complements.”
A NAND gate performs the same operation as a bubbled OR gate.
A A
AB = A+B
B B
NAND Bubbled OR
A B AB AB A B A B A B
0 0 0 1 0 0 1 1 1
0 1 0 1 0 1 1 0 1
1 0 0 1 1 0 0 1 1
1 1 1 0 1 1 0 0 0
Fig. 1.13: De Morgan’s Theorem 1
A B AB
“The complement of sum equals the product of the complements”.
A NOR gate performs the same operation as Bubbled AND gate
A
A AB
A+B = B
B
Note: A B A B ; A B A B
De Morgan’s two theorems can be regarded as a single theorem by observing the following rule:
“Change the logic operation covered by the inversion bar, remove the inversion bar, and complement
each variable that was originally covered by the bar.”
(i) A B C A B C and A B C A BC
(ii) AB A B A B
(iii) A B C A B C A B C
(iv) AB C A B C A B C
(v) A B CD E A B CD E
= A B CD E
= A B C D E
= A B C D E
(vi) A B C B C A B C B C
= ABC BC
= A BC B C
= AB C BB C B CC
= AB C
= AB C
The Boolean theorems are given in Table 1.11.
1.46 Digital Principles and System Design
1. Commutative 1a AB = BA 1b A+B=B+A
2. Associative 2a (AB)C = A(BC) 2b (A + B) + C =
A + (B + C)
3. Idempotent 3a AA = A 3b A+A=A
4. Identity 4a A A 4b A+1=1
7. Negation 7a AA 7b A A
8. Double Negation 8 A A
9. Absorption 9a A + AB = A 9b A(A + B) = A
9c A AB A B
10. De Morgan A B A B A B A B
A (Same)
A
A
A+AB
A
AB
B
This rule may be proven symbolically by factoring an “A” out of the two terms, then applying the
rules of A + 1 = 1 and 1A = A to achieve the final result:
A + AB
A(1 + B)
Applying identity B + 1 = 1
A(1)
Applying identity 1A = A
A
Rule 2: (Dec. 2005)
A AB A B
A A
A
A+AB
B
AB
(same)
A+B
A AB
Applying the previous rule to expand A term A + AB = A
A A B AB
Factoring B out of 2nd and 3rd terms
A B A A
Applying negation A A
A + B(1)
Applying identity 1B = B
A+B
Rule 3:
(A + B) (A + C) = A + BC
AB + BC(B + C)
Distributing terms
AB + BBC + BCC
Applying identity AA = A to 2nd and 3rd terms
AB + BC + BC
Applying identity A + A = A to 2nd and 3rd terms
AB + BC
Factoring B out of terms
B(A + C)
The final expression, B(A + C), is much simpler than the original, yet performs the same function.
The truth tables for these two expressions should be identical.
Example 1.83: X A B C A BC
A B C C (Theorem 6)
= A B (Theorem 7b)
= AB (Theorem 4a)
Example 1.84: W X XY Z XY Z
= X XY Z X XY Z
= Y Z Y Z
=0+0
=0
AB C C AB C A BC (Theorem 6)
AB AC
AB AC (Theorem 4a)
Example 1.86: W X X X X X X X X
X X X X X X X X X X X X X (Theorem 6)
X X X X X X X X X (Theorem 7a, 3a)
X X X X X X X X X
X X X X X X X
X X X (Theorem 7b)
X (Theorem 4b)
=1
Example 1.87: A W X Y W X WY W XY W X X Y
W X Y W X W X Y WY W XYW X W XY X Y
W Y W X X W X W YY WW XY X W X X YY (Theorem 7a)
W Y W W X W XY X W X X (Theorem 5a)
=0+0+0+0 (Theorem 3b)
=0
Example 1.88: Y = ABC + AB + A
= A(BC + B + 1) (Theorem 4b)
= A (Theorem 4a)
= A
Example 1.89: W X Y YZ X
X Y X YZ (Theorem 1a)
XY (Theorem 9a)
Example 1.90: W A BC
A B C (De Morgan’s Theorem 10b)
= ABC
Example 1.91: W A B C D
A B C D (Theorem 10a)
AC D C A B
A CD C AB (Theorem 8)
1.52 Digital Principles and System Design
A AB C CD (Theorem 1b)
=A+B + C+ D (Theorem 9c)
Example 1.93: W A B C A B
A BC A B
AB C A B
Example 1.94: Y A A B A B C A B C D
= A(1 + B + BC + BCD)
A A
Example 1.95: W A A A B A A B C A A B C D
A A A A
=AAAA=A
Example 1.96: A A
A A A A A
A A A A A A A
A A A A A A A
A A A A A A A A A A
A A A A
AA AB B A B B
AB A B B
A A B B
B B B B B.
Boolean Algebra and Logic Gates 1.53
AB AB AB A B C
AB B AB B C
A A C
A A C
C C .
Example 1.100: Y AB C B D AB C
ABC ABB D AB C
ABC C ABC
ABC ABC (CC = C)
BC A A BC A A
BC
B C A A A BC ABC ABC
BC AB C C ABC A A
1.54 Digital Principles and System Design
B C AB ABC C C
B C B A AC
B C B A C A AC A C
B C AB BC
Example 1.104: Y A B A B
A A A B A B B B
AB AB B B A A
AB AB B B B B
A A B A A
B
Boolean Algebra and Logic Gates 1.55
Example 1.105: Y A B A B C B B C
= AB + AB + AC + BB + BC
= AB + AB + AC + B + BC (BB = B)
= AB + AC + B + BC (AB + AB = AB)
= AB + AC + B (B + BC = B)
= AB + B + AC
= B + AC (AB + B = B)
Example 1.106: Y A B A C A BC
A B A C A B C
A B A C A BC
A A AC A B BC A BC
A BC A C A B A BC A A A
A BC AC A B A B ABC AB C A B
A BC A B A AC A C A
A BC A A B A B A
Example 1.107: Y = ABC.D
ABC D
A BC D
A BC D
AC BC D
Example 1.108: Simplify the following Boolean expression to a minimum number of literals:
(i) AC ABC AC (Dec 2011)
A AC C ABC (Theorem 9C)
A C C AB
A AB C C
ABCC
1.56 Digital Principles and System Design
A 1 B
1 B 1
y xz x xz
xy z y yx
y xz x z xy z y x
xy yz xz
y xxz
xy yz zx
y 1 z
= y(1)
=y
AB AB AC D B
B D DC A B C D
B D C AB AC AD
A A CD BC
BD BC AB AC AD
A ACD ABC
AC BD
1.18 DUALITY
The dual is formed by replacing
AND with OR
OR with AND
0 with 1
1 with 0 in a Boolean expression.
Boolean Algebra and Logic Gates 1.57
The variables and components are left unchanged. This rule for forming the dual as,
D
f X ,X , . . . ,X N ,, , , f X ,X ,. . .,X N , , , ,
2. X X
X X
X X X
X X
XX
=1
3. A B C D E F A B C D E F
A BC DE F ABCDE F
A B C D E F
1.58 Digital Principles and System Design
X Y Z F1 = X Y Z F2 = X +Y Z F3 = X Y Z F4 = X Y X Z
X Y Z +X Y
0 0 0 0 0 0 0
0 0 1 0 1 1 1
0 1 0 0 0 0 0
0 1 1 0 0 1 1
1 0 0 0 1 1 1
1 0 1 0 1 1 1
1 1 0 1 1 0 0
1 1 1 0 1 0 0
When X = 1, Y=1, Z=1
F
F .
F . . . . .
F . .
A Boolean function may be transformed from an algebraic expression into a logic diagram
composed of AND, OR and NOT gates
(a) F1 = X Y Z
Boolean Algebra and Logic Gates 1.59
(b) F2 = X +Y Z
(c) F3 = X Y Z + X Y Z + XY
(d) F4 = XY + X Z
To implement a Boolean function with a less number of gates we have to minimize literals and the
number of terms. Usually, literals (Boolean variables in complemented or uncomplemented form)
and terms are arranged in one of the two standard forms of switching equations:
Sum of Product form (SOP)
Product of Sum form (POS)
A B C Y
0 0 0 0 A BC
0 0 1 1
0 1 0 1
0 1 1 0 A B C
1 0 0 1
1 0 1 1
1 1 0 0 A B C
1 1 1 1
F A B C A B C A B C
Figure 1.21 Shows the OR-AND logic circuit and Figure 1.22 shows the NOR-NOR logic circuit
for this expression.
A
B
C
A
B Y
C
A
B
C
F A BC A B C ABC
A C B B A BC
A C A BC
This simplified expression is a sum of products; but not a standard sum of products.
The logic expression corresponding to a given truth table can be written in a standard sum-of-
products form of writing one product term for each input combination that produces an output of 1.
These product terms are ORed together to create the standard sum of products.
TABLE 1.15 : SOP table
A B C F
0 0 0 0
0 0 1 1 A BC
0 1 0 0
0 1 1 0
1 0 0 1 A BC
1 0 1 1 A BC
1 1 0 0
1 1 1 0
We note that F is 1 when A = 0, B = 0 and C = 1 , so this particular combination makes the output
of an AND gate equal to 1 when A and B roman and C are all equal to 1. Thus A B C is one product
term. Similarly other two product terms are A B C and A B C . Thus the standard sum-of-products
form is,
F A BC A BC A BC
1.62 Digital Principles and System Design
A
B
C ABC
A Y
B
C ABC
A
B
C ABC
Fig. 1.23: AND-OR circuit
1.22 MINTERMS
The ‘n’ variables forming an AND term, with each variable being primed or unprimed, provide 2n
possible combinations, called Minterms or Standard Products.
Consider two binary variables x and y combined with an AND operation. Since each variable may
appear in either form, there are 4 possible combinations:
x y,xy,x y and x y
Each of these four AND terms represents one of the distinct areas in the Venn diagram and is
called a Minterm.
x y
xy xy xy
xy
The 2n difference minterms may be determined by a method similar to one shown in Table 1.17
for 3 variables. The binary numbers from 0 to 2n 1 are listed under the ‘n’ variables. Each Minterm
1.64 Digital Principles and System Design
is obtained from an AND term of the ‘n’ variables, with each variable being primed, if the corresponding
bit of the binary number is a ‘0’ and unprimed if a ‘1’.
Symbol for Minterm Mj
TABLE 1.17 : Minterms and Maxterms
Minterms Maxterms
X Y Z Term Symbol Term Symbol
0 0 0 xyz m0 x y z M0
0 0 1 xyz m1 x y z M1
0 1 0 xyz m2 x y z M
0 1 1 xyz m x y z M
1 0 0 xyz m x y z M
1 0 1 xyz m x y z M
1 1 0 xyz m x y z M
1 1 1 xyz m x y z M
1.23 MAXTERMS
The ‘n’ variables forming an OR term, with each variable being primed or unprimed, provide in 2n
possible combinations, called Maxterms or Standard sums.
The eight maxterms for 3 variables, together with their symbolic designation are listed in Table.
Each maxterm is obtained from an OR term of the ‘n’ variables, with each variable being unprimed if
the corresponding bit is a 0 and primed if a 1.
Each Maxterm is the complement of its corresponding Minterm and Vice versa.
A Boolean function may be expressed algebraically from truth table (Table 1.18) by forming a
minterm for each combination of the variables that produces a 1 in the function and then taking the
OR of all those terms for example the function f 1 in the table is determined by expressing the
combinations 001, 100 and 111 as x y z , x y z and x y z.
f x y z x y z x y z m m m
f x y z x y z x yz x y z m m m m
“Any Boolean function can be expressed as a sum of Minterms (by ‘SUM’ is meant the ORing of
terms)”.
Boolean Algebra and Logic Gates 1.65
The complement of f1 is
f x y z x y z xy z x yz x yz
TABLE 1.18 : Truth Table for f 1 and f 2
Function Function
x y z
f1 f2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
f x y z x y z x y z x y z x y z
M M M M M
Similarly, it is possible to read the expression for f2 from the table,
f x y z x y z x y z x y z
M M M M
“Any Boolean function can be expressed as a product of Maxterms (by ‘product’ is the meant of
ANDing of terms).”
1.24 CANONICAL FORM
Boolean functions expressed as a sum of minterms m or product of maxterms ( π M) are said
to be in canonical forms.
1.24.1 Sum of Minterms
The sum of minterms of a Boolean function is obtained in two ways:
from truth table from algebraic expression.
The following example clarifies these procedure:
Example 1.112: Express the Boolean function F A BC in a sum of minterms.
Method 1: The truth table for the function F A BC is shown in Table 1.19.
1.66 Digital Principles and System Design
A B C B BC F A BC
0 0 0 1 0 0
0 0 1 1 1 1
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 1 0 1
1 0 1 1 1 1
1 1 0 0 0 1
1 1 1 0 0 1
The combination of variables that produces ‘1’ in the function are the minterms and then taking
the OR of all these minterms is the sum of minterms.
F(A , B , C) m m m m m
m , ,, ,
Method 2: Explaining the expression into a sum of AND terms. Each term is then inspected to see if
it contains all the variables. If it misses one or more variables, it is ANDed with an expression such as
x x , where x is one of the missing variables.
X Y Z XY XZ F = X Y + XZ
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 1 1
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 1 0 1
1 1 1 1 0 1
Form a maxterm for each combination of the variables that produces a 0 in the function and then
form the AND of all those maxterms. Therefore the product of Maxterms,
F M M M M
F X ,Y ,Z π M , , ,
or π , , ,
Method 2: Expanding the expression into a product of OR terms using the distributive law, X + YZ
= (X + Y) (X + Z) . Each term is then inspected to see if it contains all the variables. If it misses one
or more variables, it is ORed with an expression such as xx , where x is one of the missing variables.
F X Y XZ
X Y X X Y Z
X X Y X X Z Y Z
X Y X Z Y Z
The function has 3 variables: X, Y and Z. Each OR term is missing one variable; therefore,
I term, X Y X Y Z Z X Y Z X Y Z
II term, X Y X Y YY X Y Z X Y Z
III term, Y Z Y Z X X X Y Z X Y Z
1.68 Digital Principles and System Design
Combining all the terms and removing those that appear more than once, we finally obtain:
F X Y Z X Y Z X Y Z X Y Z
M M M M
π M , , ,
F(X, Y, Z) = π (0, 2, 4, 5)
Example 1.114: Express the Boolean function
F A B C B C D A B C D in canonical POS form.
Solution: The first term is missing variable ‘D’
A B C A B C DD A B C D A B C D
The second term is missing variable ‘A’
B C D B C D AA A B C D A B C D
The third term is already in standard form.
A B C D A B C D A B C D
Example 1.115: Convert the Boolean function into canonical SOP form,
F ABC A B A BC D
Solution: First term is missing variable ‘D’.
AB C A B C D D A B C D A B C
A B AB C C ABC A BC
then, A B C A B C D D A B C D A B C D A B CD A B C D
Third term is already in standard form,
A B A B A B AB
A B A B AB
Example 1.117: Obtain the canonical SOP of the function F = AB + ACD .
Solution: First term is missing two variables C and D
A B A B C C D D
A B C A BC D D
A B C D A B C D A BCD A BC D
Second term is missing one variable ‘B’
A C D A C D B B
A B C D ABC D
Canonical form,
F A B C D A B C D A BC D A BC D ABC D
Example 1.118: Obtain the canonical SOP of the function,
F = A + BC
Solution: F A B B C C B C A A
A B A B C C A B C AB C
A B C A BC A BC ABC A BC A B C
A B C A BC A BC ABC A B C
This result can be checked with the truth table.
TABLE 1.21 : Truth Table for F = A + BC
A B C BC F = A + BC
0 0 0 0 0
0 0 1 0 0
0 1 0 0 0
0 1 1 1 1 AB C
1 0 0 0 1 ABC
1 0 1 0 1 ABC
1 1 0 0 1 A BC
1 1 1 1 1 ABC
1.70 Digital Principles and System Design
F A B C A BC A BC A BC A B C
m , , , ,
A B A B C C A B C A B C
B C B C A A A B C A B C
Canonical form is F A B C A B C A B C A B C
F π , ,
Boolean Algebra and Logic Gates 1.71
1.25 CONVERSION BETWEEN CANONICAL FORMS
The binary values of the product terms in given canonical SOP expression are not present in the
equivalent canonical POS expression. Therefore to convert from canonical SOP to canonical POS,
the following steps are taken:
Step 1: Evaluate each product term in the SOP expression. i.e., determine the binary numbers that
represent the product terms.
Step 2: Determine all of the binary numbers not included in the evaluation of step 1.
Step 3: Write the equivalent sum term for each binary number from step 2 and express in POS form.
Using a similar procedure, we can convert POS to SOP form.
Example 1.121: Convert the following SOP expression to an equivalent POS expression:
A BC A BC A B C A BC A B C
Solution:
Step 1: The evaluation is: 000 + 010 + 011 + 101 + 111
Step 2: Since there are 3 variables, 23 = 8 possible combinations are possible. The SOP expression
contains 5 of these combinations, so the POS must contain other 3 combinations, which are 001, 100
and 110.
Step 3: POS expression is, A B C A B C A B C
Method 2: The conversion between canonical forms can be done by another method:
The complement of a function expressed as the sum of minterms equals the sum of minterms
missing from the original function. This is because the original function is expressed by those minterms
that make the function equal to 1, whereas its complement as a 1 for those minterms that the function
is a 0. As an example consider the function,
F A, B, C A B C A B C A B C A B C A B C
, , , ,
This has a complement that can be expressed as
F , , m m m
Example 1.122: Convert the canonical SOP into canonical POS F(A , B , C) = , , , .
Solution: F , , ,
F , , ,
m m m m
By DeMorgan’s theorem,
F m m m m
m m m m
M M M M
π , , ,
Using this complementary relationship, find logical function in terms of maxterms. For example,
for a 4 variable if
F , , , , , , ,
0 0 1 0 AB 1 0
0 1 0 1 AB 1 1
0 1 1 0 AB 0 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
(3) Four variable maps:
A B C D Y CD CD CD CD
0 0 0 0 0 AB 0 1 0 0
0 0 0 1 1 AB 0 0 1 1
0 0 1 0 0 AB 0 0 0 1
0 0 1 1 0 AB 0 0 0 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 1 1 0 1
AB 0 0 0 0 = ABC
1.74 Digital Principles and System Design
CD CD CD CD
AB 0 0 0 0
AB 0 0 0 0 Y A B CD A BCD
AB 0 0 0 1 A CD B B
AB 0 0 0 1 A CD
Quads: A quad is a group of four 1’s that are horizontally or vertially adjacent
CD CD CD CD A BC D ABC D A B C D A B C D
AB 0 0 0 0 A B C D D A BC D D
AB 0 0 0 0 A B C A BC
AB 1 1 1 1 A B C C
AB 0 0 0 0 = AB
CD CD CD CD
AB 0 0 0 0 A B C D A B C D ABC D ABC D
AB 0 0 0 0 A B C D D A BC D D
AB 0 0 1 1 A C B B
AB 0 0 1 1 = AC
CD CD CD CD Y A BC D A BC D A B C D A BCD
AB 0 0 0 0 ABC D ABC D ABC D ABC D
AB 0 0 0 0 A B C D D A BC D D
AB 1 1 1 1 A B C D D A B C D D
AB 1 1 1 1 A B C C A B C C
A B A B = A B B = A
Boolean Algebra and Logic Gates 1.75
1.26.2 Karnaugh Map Simplifications
Encircle octets first, the quads second and the pairs last.
C D CD CD C D
AB 0 1 1 1
AB 0 0 0 1 Y AC C D A B D
AB 1 1 0 1
AB 1 1 0 1
Overlapping Groups: It is possible to use the same 1 more than once.
C D CD CD C D
AB 0 0 0 0
AB 0 1 0 0 Y A BC D
AB 1 1 1 1
AB 1 1 1 1
It is valid to encircle the 1’s as shown below. But the isolated 1 results in a more complicated
equation.
C D CD CD C D
AB 0 0 0 0
AB 0 1 0 0 Y A A BC D
AB 1 1 1 1
AB 1 1 1 1
Rolling the map
CD CD CD CD CD CD CD CD
AB 0 0 0 0 AB 0 0 0 0
AB 1 0 0 1 AB 1 0 0 1
AB 1 0 0 1 AB 1 0 0 1
AB 0 0 0 0 AB 0 0 0 0
Visualize the picking up the karnaugh map and rolling it so that the left side touches the right
side. By doing so, the two pairs can be realised as Quad.
The quad has the equation,
Y BD
1.76 Digital Principles and System Design
Y BC D B C D
B D C C B D
Rolling and Overlapping: It is possible to overlap and roll the map to get large groups.
CD CD CD CD CD CD CD CD
AB 1 1 0 0 AB 1 1 0 0
AB 1 1 0 1 AB 1 1 0 1
AB 1 1 0 1 AB 1 1 0 1
AB 1 1 0 0 AB 1 1 0 0
Y C B C D Y C B D
CD CD CD CD CD CD CD CD
AB 1 1 0 1 AB 1 1 0 1
AB 1 1 0 1 AB 1 1 0 1
AB 1 1 0 0 AB 1 1 0 0
AB 1 1 0 1 AB 1 1 0 1
Y C ABC D AC D Y C AD A B D
CD CD CD CD
AB 1 1 0 1
AB 1 1 0 1
AB 1 1 0 0
AB 1 1 0 1
Y C AD BC D
CD CD CD CD CD CD CD CD
AB 0 0 1 0 AB 0 0 1 0
AB 1 1 1 0 AB 1 1 1 0
AB 0 1 1 1 AB 0 1 1 1
AB 0 1 0 0 AB 0 1 0 0
Fig. 1.26 (a) Fig. 1.26 (b)
AB 0 0 0 0 AB 0 0 0 0
AB 0 0 1 0 AB 0 0 0 0
AB X X X X AB X X X X
AB 0 0 X X AB X X X X
Y BCD Y AD
Solution:
1. Given the truth table, draw a Karnaugh map with other 0’s, 1’s and don’t cares.
2. Enclose the actual 1’s on the Karnaugh map in the largest groups you can find by treating the
don’t cares as 1’s.
3. After the actual 1’s have been included in groups, disregard the remaining don’t cares by
visualizing them as 0’s.
Example:
CD CD CD CD
AB 1 0 0 0
AB 0 0 0 0
AB X X X X
AB X X X X
Y A BC D
Here don’t cares are of no help. The best way is, encircle the isolated 1, while treating don’t cares
as 0’s.
1.78 Digital Principles and System Design
C
0 1 AB 0 1
00 0 1 00 ABC ABC
01 2 3 01 ABC AB C
01 6 7 11 A BC ABC
10 4 5 10 ABC ABC
(b) Three Variable Map
CD
00 01 11 10 AB 00 01 11 10
00 0 1 3 2 00 A BCD A BCD A BC D A BCD
01 4 5 7 6 01 A BCD A BCD AB CD AB CD
11 12 13 15 14 11 A BC D A BCD ABCD A B CD
10 8 9 11 10 10 A BC D A BC D A BC D A BCD
(c) 4 Variable Map
Fig.1.27: Representation of functions in the Map
1.80 Digital Principles and System Design
A BC A BC A BC A B C
Solution: The expression is evaluated as follows:
A BC A BC A BC A B C
001 010 110 111
C
AB 0 1
00 1
01 1
11 1 1
10
F BC A B A BC
Example 1.125: Simplify the SOP by using K-map
Y = m (0,1,3,7)
AB C 0 1
00 1 1
01 1
11 1
10
Y A B BC
Example 1.126: Simplify the expression Y m m m m
Solution:
C
AB 0 1
00
01 1
11 1 1
10 1
Y BC AC
Boolean Algebra and Logic Gates 1.81
A B AB C C AB C A BC
B C B C A A AB C A BC
F AC A B A BC B C
A B C A BC A B C A BC A BC A B C A BC
A BC A BC ABC A BC A B C
C
AB 0 1
00 1
01 1 1
11 1
10 1
F C A B
Example 1.128: Use a K map to minimize the following SOP expression:
F A BC D A BC D A BC D A BC D
A BC D A BC D A BC D A BC D A BCD A BC D
Solution:
CD
AB 00 01 11 10
00 1 1 1
01 1 1
11 1 1
10 1 1 1
F D BC
1.82 Digital Principles and System Design
F = m(0,2,4,5,6,7,8,10,11,12,14,15)
Solution:
CD
AB 00 01 11 10
00 1 1
0 1 3 2
01 1 1 1 1
4 5 7 6
11 1 1 1
12 13 15 14
10 1 1 1
8 9 11 10
F D AB A C
Example 1.130: Simplify the expression using K-map
F m m m m m m m
CD
AB 00 01 11 10
00 1
0 1 3 2
01 1
4 5 7 6
11 1 1 1
12 13 15 14
10 1 1
8 9 11 10
F AC D A BC A C D A BC
BC A B A BC A BC D A BCD A BC D
Boolean Algebra and Logic Gates 1.83
Solution: The SOP expression is obviously not in standard form because each product term does not
have 4 variables. The first and second term are both missing 2 variables, the third term is missing one
variable and the rest of the terms are standard. First expand the terms by including all combinations of
the missing variables numerically as follows:
BC AB + A BC + A BC D + A BCD + A BC D
CD
00 01 11 10
AB
00 1 1
0 1 3 2
01
4 5 7 6
11 1 1
12 13 15 14
10 1 1 1 1
8 9 11 10
F A B AC A BC
Solution:
CD
00 01 11 10
AB
00
0 1 3 2
01 1
4 5 7 6
11 X X X X
12 13 15 14
10 1 1 X X
8 9 11 10
F = A + BCD
Note: Without don’t cares, F A BC A B C D
With don’t cares, F = A + BCD
Therefore, it is clear that, the advantage of using don’t care terms is to get the simplest expression.
Example 1.133: Simplify using K-map
F(A, B, C, D) m (1,3,7,11,15) + d(0,2,5)
Solution:
CD
00 01 11 10
AB
00 X 1 1 X
0 1 3 2
01 X 1
4 5 7 6
11 1
12 13 15 14
10 1
8 9 11 10
F ABC D
(or)
Boolean Algebra and Logic Gates 1.85
CD
00 01 11 10
AB
00 X 1 1 X
0 1 3 2 F AD C D
01 X 1 F A B C D (or)
4 5 7 6 AD C D
11 1
12 13 15 14
10 1
8 9 11 10
Example 1.134: Using the K-Map method, simplify the following Boolean function
F AC B D
Example: Simplify the following Boolean function F using Karnaugh map method.
1.86 Digital Principles and System Design
00 1
0 1 3 2
01 1 1 1
4 5 7 6
11 1 1 1
12 13 15 14
10
8 9 11 10
00 1 1 1
0 1 3 2
01 1 1 1
4 5 7 6
11 1
12 13 15 14
10 1
8 9 11 10
00 1 1
0 1 3 2
01
4 5 7 6
11 1 1 1 1
12 13 15 14
1 1
10
8 9 11 10
F A, B,C, D AB BC
00 1 1
0 1 3 2
01 1 1 1 1
4 5 7 6
11 1 1
12 13 15 14
10 1 1
8 9 11 10
F A, B,C, D AB BD BD
z
xy 0 1
00 1
0 1
01 1 1
4 5
11 1
12 13
10 1 1
8 9
F z xy xy
z z
x x
xy
y z . xy . xy
y y z xy x y
xy
00 1
0 1
01 1 1
2 3
11 1
6 7
10 1 X
4 5
f C AB
Example 1.141: F(w, x, y, z) = m(0, 7, 8, 9, 10, 12) + d(2, 5, 13) (May 2013)
CD
AB 00 01 11 10
00 1 X
0 1 3 2
01 X 1
4 5 7 6
11 1 X
12 13 15 14
10 1 1 1
8 9 11 10
F wy xz wx
00 0 0
0 1 3 2
01 0 0 0
4 5 7 6
11 0 0 0
12 13 15 14
10 0 0
8 9 11 10
F C B D
Example 1.143: Simplify the POS expression
F π (0,6,7,8,12,13, 14,15)
CD
AB 00 01 11 10
00 0
0 1 3 2
01 0 0
4 5 7 6
11 0 0 0 0
12 13 15 14
10 0
8 9 11 10
F A B B C B C D
Boolean Algebra and Logic Gates 1.91
Example 1.144: Simplify the expression
F(A, B, C, D) = π M (4,5,6,7,8,12) . d(1,2,3,9,11,14)
Solution:
CD
00 01 11 10
AB
00 X X X
0 1 3 2
01 0 0 0 0
4 5 7 6
11 0 X
12 13 15 14
10 0 X X
8 9 11 10
F A B A C D
Example 1.145: Simplify the POS expression,
F π M (0,3,4,7,8,10,12,14).d(2,6)
CD
00 01 11 10
AB
00 0 0 X
0 1 3 2
01 0 0 0 X
4 5 7 6
11 0 0
12 13 15 14
10 0 0
8 9 11 10
F D AC
1.92 Digital Principles and System Design
Example 1.146: Determine the minterm sum of product form of the switching function.
F = (0,1,4,5,6,11,14,15,16,17,20,22,30,32,33,36,37,48,49,52,53,59,63) (Dec. 2010)
Solution:
Fill up the K-map with the variable given
F = Function of A, B, C, D E and F
A
0 1
B CE
CD CD
EF 00 01 11 10 EF 00 01 11 10
00 1 1 00 1 1
0 01 1 1 01 1 1
11 1 1 11 1 1
10 1 1 AB CEF 10
CD CD
EF 00 01 11 10 EF 00 01 11 10
00 1 1 00 1 1
1
01 1 1 01 1 1
11 11 1 1
10 1 1 10
AEFD ABCEF
Four 1’s in each box form a group of 16 bits and their reduced function is CE . Therefore
F = (0,1,4,5,6,11,14,15,16,17,20,22,30,32,33,36,37,48,49,52,53,59,63)
F(A, B, C, D, E, F) = CE AEFD ABCEF ABCEF
Boolean Algebra and Logic Gates 1.93
Example 1.147: Minimize the following expression using Karnaugh map.
Y A BCD A BCD ABCD ABCD A BCD. (May 2011)
CD
AB 00 01 11 10
00 0 0 0 1
01 1 1 0 0
11 1 0 0 0
10 0 1 0 0
AB 1
AB 1 1 1
AB 1 1
AB
F B C D A CD BC D
CD
AB CD CD CD CD
AB 1 1
AB 1 1 1
AB 1
AB 1
F A C ABD AC D
AB 1 1
AB
AB 1 1 1 1
AB
F AB ABC
(iv) F A, B, C, D 0, 2, 5, 7, 8,10,13,15
CD
AB CD CD CD CD
AB 1 1
AB 1 1
AB 1 1
AB 1 1
F BD B D
Boolean Algebra and Logic Gates 1.95
Example 1.149: Simplify F(A, B, C, D) = (0, 1, 2, 5, 8, 9, 10) in sum of products and
product of sums using K-map. (Dec 2012)
Solution: CD 00 01 11 10
AB
1 1 1
00 0 1 3 2
1
01 4 5 7 6
11 12 13 15 14
1 1 1
10 8 9 11 10
SOP:
F = BD ACD ABC
POS:
CD 00 01 11 10
AB
0 0 0
00
0
01
11
0 0 0
10
POS: F = B D A C D A B C
1.96 Digital Principles and System Design
0 1 3 2 16 17 19 18
01 1 1 1 1 01 1
4 5 7 6 20 21 23 22
11 1 11 1
12 13 15 14 28 29 31 30
10 1 10
1
8 9 11 10 24 25 27 26
F DE A B C B C E
In DE and B C E terms, A is not included because the adjacent squares belong to both A = 0 and
A = 1.
In A B C term, it is necessary to include A because all the squares are associated with A = 0.
F DE A B C B C E
Boolean Algebra and Logic Gates 1.97
Example 1.151: Simplify the Boolean function
F ( A, B, C, D, E) = ( 0, 1, 4, 5, 16, 17, 21, 25, 29)
DE A= 0 A=1
DE
BC 00 01 11 10 00 01 11 10
BC
00 1 1 00 1 1
0 1 3 2 16 17 19 18
01 1 1 01 1
4 5 7 6 20 21 23 22
11 11 1
12 13 15 14 28 29 31 30
10 10 1
8 9 11 10 24 25 27 26
F A D E ADE BCD
Example 1.152: Find the minimal sum of product form for the following switching function:
f ( x1 , x2 , x3 , x4 , x5) = m ( 2, 3, 6,7, 11, 12, 13,14, 15, 23, 28, 29, 30,31) (May 2006)
x4x5 x1 = 0 x4x5 x1 = 1
x2x3 00 01 11 10 x2x3 00 01 11 10
00 1 1 00
0 1 3 2 16 17 19 18
01 1 1 01 1
4 5 7 6 20 21 23 22
11 1 1 1 1 11 1 1 1 1
12 13 15 14 28 29 31 30
10 1 10
8 9 11 10 24 25 27 26
F x2 x3 x1 x4 x5 x1 x 2 x4 x1 x3 x4 x5
1.98 Digital Principles and System Design
Example 1.153: Find the minimal sum of product expression for the following switching function:
f ( x1 , x2 , x3 , x4 , x5) = m ( 1, 2, 3, 6, 8, 9, 14, 17, 24, 25, 26, 27, 30, 31) + d(4, 5)
(May 2006)
x4x5 x1 = 0 x4x5 x1= 1
x2x3 00 01 11 10 x2x3 00 01 11 10
00 1 1 1 00 1
0 1 3 2 16 17 19 18
01 X X 1 01
4 5 7 6 20 21 23 22
11 1 11 1 1
12 13 15 14 28 29 31 30
10 1 1 10 1 1 1 1
8 9 11 10 24 25 27 26
F x2 x3 x 4 x3 x 4 x5 x1 x2 x4 x1 x 2 x3 x4 x1 x3 x4 x5
Any two number in these groups which differ from each other by only variable can be chosen and
combined, to get 2 cell combination as shown in Table 1.23(c).
Table 1.23(c) 2-cell combination
Combination A B C D
(0,2) 0 0 0
(0,8) 0 0 0
(2,3) 0 0 1
(2,6) 0 1 0
(2,10) 0 1 0
(8,10) 1 0 0
(8,12) 1 0 0
(3,7) 0 1 1
(6,7) 0 1 1
(12,13) 1 1 0
Table 1.23(d) 4 cell combination
Combination A B C D
(0,2,8,10) 0 0
(2,3,6,7) 0 1
From the 2-cell combinations, are variable and a dash () in the same position can be combined to
form 4-cell combination as shown in Table 1.23(d).
The cells (0,2) and (8,10) from the same 4 cell combination as the cells (0,8) and (2,10). The order
in which the cells are placed in a combination does not have any effect. Thus the (0,2,8,10) combination
may be given as (0,8,2,10)
i.e., (0,2,8,10) = (0,8,2,10)
(2,3,6,7) = (2,6,3,7)
Using Table 1.28(c) and (d) the prime implicants table can be as shwon in Table 1.23(e).
Table 1.23(e) Prime Implicant Table
Minterms
Prime Implicants
0 2 3 6 7 8 10 12 13
(8, 12)
(12,13)*
(0,2,8,10)*
(2,3,6,7)*
Boolean Algebra and Logic Gates 1.101
The columns having only one cross (X) mark correspond to essential prime implicants. A tick
mark put against every column which has only one cross mark. A star (*) mark is placed against every
essential prime implicant. The sum of the prime implicants gives the function in its minimal SOP
form. Therefore, F = (1 1 0 ) + ( 0 0) + (0 1 )
F A, B, C , D A B C B D AC
Example 1.155: Find the minimal SOP for the given function using Quine-McCluskey method
F m (0,1,2,8,10,11,14,15) (April 2005)
Solution: Binary representation of minterms
Minterms Binary equivalent
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
8 1 0 0 0
10 1 0 1 0
11 1 0 1 1
14 1 1 1 0
15 1 1 1 1
Group of minterms for different number of 1's:
Number of 1's Minterm A B C D
0 0 0 0 0 0
1 1 0 0 0 1
2 0 0 1 0
8 1 0 0 0
2 10 1 0 1 0
3 11 1 0 1 1
14 1 1 1 0
4 15 1 1 1 1
2 cell combination 4 cell combination
Combination A B C D Combination A B C D
(0,1) 0 0 0 (0,2,8,10) 0 0
(0,2) 0 0 0 (10,11,14,15) 1 1
(0,8) 0 0 0
(2,10) 0 1 0
(8,10) 1 0 0
(10,11) 1 0 1
(10,14) 1 1 0
(11,15) 1 1 1
(14,15) 1 1 1
1.102 Digital Principles and System Design
(0,1)*
(0,2,8,10)*
(10,11,14,15)*
F = [(0 0 0 ) + ( 0 0) + (1 1 )]
F A BC B D AC
Only m2 column has single cross (X) mark and hence the prime implicant corresponding to it
(2,3) is included in the final expression.
m1 column has 2 cross marks. We can include the prime implicants which has more minterms -
(1,3,9,11).
Columns d4, d8 and d11 are don’t cares.
m5 is not included yet, therefore prime implicants (1,5) is included in the final expression.
m12 is not included yet, therefore prime implicant (12,14) is included.
m15 also can be included in the final expression by including prime implicant (14,15)
Boolean Algebra and Logic Gates 1.105
The final expression is,
F = (0 0 1) + ( 0 0 1 ) + (1 1 0 ) + (1 1 1 ) + ( 0 1)
AC D A BC A B D A B C B D
The don’t care columns are omitted when forming prime implicants table
Prime implicants 2 3 7 9 11 13
(1,3,9,11)
(2,3,10,11)*
(3,7,11,15)*
(9,11,13,15)*
F = ( 0 1 ) + ( 1 1) + (1 1)
= B C + CD + AD
Boolean Algebra and Logic Gates 1.107
Example 1.158: Simplify the following 5 vairiable expression using Mccluskey method.
F = m(0, 1, 9, 15, 24, 29, 30) + d(8, 11, 31) (Dec 2010)
Solution:
0 0000 0, 1 (1) 0, 1, 8, 9
1 0001 0, 8 (8)
8 1000 1, 9(8)
9 01001 8, 9(1)
24 11000 8, 24(16)
11 1011 9, 11(2)
31 11111
0 1 9 15 24 29 30
0, 1, 8, 9
8, 24
9, 11
11, 15
15, 31
29, 31
30, 31
1.108 Digital Principles and System Design
Answer:
Or
Example 1.159: Minimize the expression using Quine McCluskey (Tabulation) method
CD CD CD CD
1
CD 00 01 11 10
AB
1 1
AB 00 0 1 3 2
1
1
AB 01 4 5 7 6
1 1
AB 11 12 13 15 14
1
AB 10 8 9 11 10
0 0 0 0 0
2 0 0 1 0
5 0 1 0 1
9 1 0 0 1
12 1 1 0 0
13 1 1 0 1
Boolean Algebra and Logic Gates 1.109
Number of 1’s Minterms A B C D
0 0 0 0 0 0
1 2 0 0 1 0
2 5 0 1 0 1
9 1 0 0 1
12 1 1 0 0
3 13 1 1 0 1
2 – cell combination
Combination A B C D
(0, 2) 0 0 0
(5, 13) 1 0 1
(9, 13) 1 0 1
(12, 13) 1 1 0
Prime implicants 0 2 5 9 12 13
(0, 2)
(5, 13)
(9, 13)
(12, 13)
Example 1.160: Simplify the Boolean function using Quine McCluskey method:
F(A, B, C, D, E, F) = m(0, 5, 7, 8, 9, 12, 13, 23, 24, 25, 28, 29, 37, 40, 42, 44, 46, 55,
56, 57, 60, 61) (May 2013)
1.110 Digital Principles and System Design
Solution:
Minterms Binary equivalent
0 0 0 0 0 0 0
5 0 0 0 1 0 1
7 0 0 0 1 1 1
8 0 0 1 0 0 0
9 0 0 1 0 0 1
12 0 0 1 1 0 0
13 0 0 1 1 0 1
23 0 1 0 1 1 1
24 0 1 1 0 0 0
25 0 1 1 0 0 1
28 0 1 1 1 0 0
29 0 1 1 1 0 1
37 1 0 0 1 0 1
40 1 0 1 0 0 0
42 1 0 1 0 1 0
44 1 0 1 1 0 0
46 1 0 1 1 1 0
55 1 1 0 1 1 1
56 1 1 1 0 0 0
57 1 1 1 0 0 1
60 1 1 1 1 0 0
61 1 1 1 1 0 1
Group of mintrems for different number of 1’s
Number of 1’s Minterms A B C D E F
0 0 0 0 0 0 0 0
1 8 0 0 1 0 0 0
2 5 0 0 0 1 0 1
9 0 0 1 0 0 1
Boolean Algebra and Logic Gates 1.111
12 0 0 1 1 0 0
24 0 1 1 0 0 0
40 1 0 1 0 0 0
3 7 0 0 0 1 1 1
13 0 0 1 1 0 1
25 0 1 1 0 0 1
28 0 1 1 1 0 0
37 1 0 0 1 0 1
42 1 0 1 0 1 0
44 1 0 1 1 0 0
56 1 1 1 0 0 0
4 23 0 1 0 1 1 1
29 0 1 1 1 0 1
46 1 0 1 1 1 0
57 1 1 1 0 0 1
60 1 1 1 1 0 0
5 55 1 1 0 1 1 1
61 1 1 1 1 0 1
2-Cell Combination
Combination A B C D E F
(0, 8) 0 0 0 0 0
(8, 9) 0 0 1 0 0
(8, 12) 0 0 1 0 0
(8, 24) 0 1 0 0 0
(8, 40) 0 1 0 0 0
(5, 7) 0 0 0 1 1
(5, 13) 0 0 1 0 1
(5, 37) 0 0 1 0 1
(9, 13) 0 0 1 0 1
(9, 25) 0 1 0 0 1
(12, 13) 0 0 1 1 0
(12, 28) 0 1 1 0 0
1.112 Digital Principles and System Design
(24, 25) 0 1 1 0 0
(24, 28) 0 1 1 0 0
(24, 56) 1 1 0 0 0
(40, 42) 1 0 1 0 0
(40, 44) 1 0 1 0 0
(40, 56) 1 1 0 0 0
(7, 23) 0 0 1 1 1
(13, 29) 0 1 1 0 1
(25, 29) 0 1 1 0 1
(25, 57) 1 1 0 0 1
(28, 29) 0 1 1 1 0
(28, 60) 1 1 1 0 0
(42, 46) 1 0 1 1 0
(44, 46) 1 0 1 1 0
(44, 60) 1 1 1 0 0
(56, 57) 1 1 1 0 0
(56, 60) 1 1 1 0 0
(23, 55) 1 0 1 1 1
(29, 61) 1 1 1 0 1
(57, 61) 1 1 1 0 1
(60, 61) 1 1 1 1 0
4 Cell Combination
Combination A B C D E F
(9, 13, 25, 29) 0 0 0 1
(12, 13, 28, 29) 0 1 1 0
(24, 25, 28, 29) 0 1 1 0
(24, 25, 56, 57) 1 1 0 0
(24, 28, 44, 60) 1 1 0 0
(24, 28, 56, 60) 1 1 0 0
(40, 42, 44, 46) 1 0 1 0
(25, 29, 57, 61) 1 1 0 1
(28, 29, 60, 61) 1 1 1 0
Boolean Algebra and Logic Gates 1.113
Prime Implicant Table
0 5 7 8 9 12 13 23 24 25 28 29 37 40 42 44 46 55 56 57 60 61
(0, 8)
(8, 9)
(8, 12)
(8, 24)
(8, 40)
(5, 7)
(5, 13)
(5, 37)
(40, 56)
(7, 23)
(23, 55)
The input to the NOT gate A is inverted i.e., the binary input state of 0 gives an output of 1 and
the binary input state of 1 gives an output of 0.
A A
0 1
1 0
The output from the NAND gate is written as A B . The Boolean expression A B reads as “A
NAND B”. The truth table for a two-input NAND gate is given below:
TRUTH TABLE
A B A B
0 0 1
0 1 1
1 0 1
1 1 0
1.29.2 The NOR gate
The NOR gate has two or more inputs. The output from A
the NOR gate is 1 if and only if all of the inputs are 0, otherwise A+B
B
the output is 0. This output behaviour is the NOT of A OR B.
The NOR gate is drawn as shown in Figure 1.32. Fig. 1.32: NOR-Logic Symbol
The output from the NOR gate is written as A+B which reads “A NOR B”.
The truth table for a two-input NOR gate is given below:
TRUTH TABLE
A B A B
0 0 1
0 1 0
1 0 0
1 1 0
For a 3-input XOR gate with inputs A, B and C the truth table is given by
A B C A B C
0 0 0 0
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1
1.29.4 The Exclusive-NOR (XNOR) gate
The exclusive-NOR or XNOR gate has two or more inputs. The output is equivalent to inverting
the output from the exclusive-OR gate described above. Therefore an equivalent circuit would comprise
an XOR gate, the output of which feeds into the input of a NOT gate.
In general, an XNOR gate gives an output value of 1 when there are an even number of 1’s on the
inputs to the gate. The truth table for a 3-input XNOR gate below illustrates this point.
The XNOR gate is drawn using the same symbol as the XOR gate with an invert bubble on the
output line as is illustrate in Figure 1.34.
A
B
The output from the XNOR gate is written as A B which reads “A XNOR B”.
Y A B
AB AB
AB AB
A B A B
Y AB A B
The truth table for a two-input XNOR gate looks like
TRUTH TABLE
A B A B
0 0 1
0 1 0
1 0 0
1 1 1
For a 3-input XNOR gate with inputs A, B and C the truth table is given by
A B C A B C
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
vcc
The 14 Pin DIP (Dual-in-line package) was one of the first
types of Integrated Circuits (IC’s) developed. The term dual- DUAL-IN-LINE
in-line package comes from the two parallel sets of pins that PACKAGE
are situated across each other on the IC. The typical layout of
GND
a 14 pin DIP is shown in Figure 1.36.
1 2 3 4 5 6 7
The pins are normally number counterclockwise with pin # 1 falling under the notch. For most
IC’s pin 7 is GND and pin 14 is Vcc. In order to utilize this IC, pin 14 must be connected to a supply
voltage (usually 5V) and pin 7 must grounded. Then the various gates within the IC may be used for
analysis.
1.31.2 74X04 Hex Inverter
14 13 12 11 10 9 8
The 74X04 is a hex inverter. The 04 is the number that
v cc
determines the chip type. It is a hex inverter because it contains
6 inverters on a single IC. The X is in place of specific features
that the IC may contain. The most commonly listed special 7404
feature is the 74LS04, where LS stands for Low Power Shottky
GND
Transistors. The pin-out for the 74X04 is shown in
Figure 1.37. 1 2 3 4 5 6 7
1 2 3 4 5 6 7
v cc
7432
GND
1 2 3 4 5 6 7
v cc
1.31.5 74X00 Quad NAND Gate
The 74X00 contains 4 NAND gates. The 00 is the number
that determines the chip type. It is called a quad NAND gate 7400
because it contains 4 NAND gates on a single IC. The pin-out
GND
for the 74X00 is shown in Figure 1.40.
1 2 3 4 5 6 7
A A+A=A A NOT A
NOR
A A
NOR
A
A+B=AB AND AB
B
B
NOR
B
A+B A
A OR A+B
NOR NOR A+B B
B
24. What is the feature of gray code? What are its applications
The advantage of gray code also called reflected code over pure binary numbers is that a number
in gray code changes by only one bit as it proceeds from one number to the next. A typical
application of the reflected code occurs when the analog data are represented by a continuous
change of a shaft position. The shaft is portioned into segments and each segment is assigned a
number. If adjacent segment are made to correspond to adjacent reflected-code numbers,
ambiguity is reduced when detection is sensed in the line that separates any two segments.
So in 3-bit code, error may occur due to one bit position, other two bit positions of adjacent
sectors are always same and hence there is no possibility of error. Thus in 3-bit code, probability
of error is reduced to 66 % and in 4-bit code it is reduced upto 25%.
MCQ QUESTIONS
1. The decimal equivalent of the binary number (1011.011)2 is ________
a) (11.375)10
b) (10.123)10
c) (11.175)10
d) (9.23)10
Answer: a. (11.375)10
3. If the decimal number is a fraction then its binary equivalent is obtained by ________ the
number continuously by 2.
a) Dividing
b) Multiplying
c) Adding
d) Subtracting
Answer: b. Multiplying
8. Divide the binary number (011010000) by (0101) and find the quotient
a) 100011
b) 101001
c) 110010
d) 010001
Answer: b. 101001
Digital Fundamentals 1.130
12. The logical sum of two or more logical product terms is called __________
a) SOP
b) POS
c) OR operation
d) NAND operation
Answer: a. SOP
1.131 Digital Electronics
13. The canonical sum of product form of the function y(A,B) = A + B is __________
a) AB + BB + A’A
b) AB + AB’ + A’B
c) BA + BA’ + A’B’
d) AB’ + A’B + A’B’
Answer: b. AB + AB’ + A’B
14. A Karnaugh map (K-map) is an abstract form of ____________ diagram organized as a matrix
of
squares.
a) Venn Diagram
b) Cycle Diagram
c) Block diagram
d) Triangular Diagram
Answer: a. Venn Diagram
16. The prime implicant which has at least one element that is not present in any other implicant
is known as ___________
a) Essential Prime Implicant
b) Implicant
c) Complement
Digital Fundamentals 1.132
d) Prime Complement
Answer: a. Essential Prime Implicant
17. Don’t care conditions can be used for simplifying Boolean expressions in ___________
a) Registers
b) Terms
c) K-maps
d) Latches
Answer: c. K-maps
18. It should be kept in mind that don’t care terms should be used along with the terms that are
present in ___________
a) Minterms
b) Expressions
c) K-Map
d) Latches
Answer: a. Minterms
19. These logic gates are widely used in _______________ design and therefore are available in
IC form.
a) Sampling
b) Digital
c) Analog
d) Systems
Answer: b. Digital
c) A = 0, B = 0
d) A = 0, B’ = 1
Answer: c. A = 0, B = 0
21. In which of the following gates the output is 1 if and only if at least one input is 1?
a) AND
b) NOR
c) NAND
d) OR
Answer: d. OR
22. The code where all successive numbers differ from their preceding number by single bit is
__________
a) Alphanumeric Code
b) BCD
c) Excess 3
d) Gray
Answer: d. Gray
c) (A’ + B)(C’ + D)
d) (A + B’)(C + D’)
Answer: b. (A + B’)(C’ + D)
29. On subtracting (01010)2 from (11110)2 using 1’s complement, we get ____________
a) 01001
b) 11010
c) 10101
d) 10100
Answer: d. 10100
30. On subtracting (001100)2 from (101001)2 using 2’s complement, we get ____________
a) 1101100
b) 011101
c) 11010101
d) 11010111
Answer: b
Digital Fundamentals 1.136
REVIEW QUESTIONS
1. State and prove the postulates, theorems of Boolean algebra.
5. Find a Min SOP and Min POS for F = b’c’d + bcd +acd’ + a’b’c +a’bc’d
6. Using the K-Map find the MSB form of F = ∑m(0-3, 12-15) + ∑d(7,11)
UNIT 2
COMBINATIONAL LOGIC
2.1 INTRODUCTION
A combinational circuit consists of logic gates
whose outputs at any time are determined directly
from the present combination of input without
regard to previous inputs. A combination circuit 1 1
consists of input variables, logic gates and output 2 2
variables. The logic gates accept signals from the Combinational
Input Logic Output
inputs and generate signals to the outputs. This variables Circuit variables
process transforms binary information from the
given input data to the required output data. A n m
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
BC
00 01 11 10
A
0 0 0 1 0
1 0 1 1 1
Y = AB + AC + BC
Combinational Logic 2.3
Draw the logic diagram for Y = AB + AC + BC.
Example 2.2: Design a combinational logic circuit that has four inputs and one output. The output is
high if both inputs A and B are high or both inputs C and D are high.
Solution: The relationship between input variables (A, B, C, D) and output variable (Y) is tabulated as
shown in Table 2.2.
TABLE 2.2 : Truth Table
A B C D Y
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 1
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
2.4 Digital Principles and System Design
CD
AB 00 01 11 10
00 0 0 1 0
01 0 0 1 0
11 1 1 1 1
10 0 0 1 0 Y = AB + CD
Draw the logic diagram for Y = AB + CD.
B B
0 1 0 1
A A
0 0 1 0 0 0
1 1 0 1 0 1
Sum = AB AB Carry = Cout = AB
=A B
The output carry is produced with an AND gate with A and B on the inputs and the output sum is
produced with an EX-OR gate as shown in Figure 2.5.
A
S
B
Cout
Full
B
adder
Cin Cout
INPUTS OUTPUTS
A B Cin S Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
Fig. 2.6(b): Truth Table
By using K-map simplification, determine the expression for output variables S and Cout.
(i) Expression for Carry
BCin
A 00 01 11 10
0 1
1 1 1 1
BCin
A 00 01 11 10
0 1 1
1 1 1
S A B Cin A B C in A B C in A B C in ABCin
A B Cin BC in A B C in BCin
A B Cin A B Cin
Let X = B Cin , then S = AX AX
=A X
Replacing X with B Cin, then
S = A B Cin
Cout = ACin + AB + BCin
Combinational Logic 2.7
The logic diagram is constructed by logic gates as shown in Figure 2.7.
A
B Sum
Cin
AB
BCin
Cout
ACin
Using these expressions draw the logic diagram for full adder.
A
B Sum
Cin
Notice in Figure 2.8, there are two half adders, connected as shown in the block diagram Figure
2.9, with their output carries ORed.
Half adder Half adder
A S S
B Cout Cout
Cin
AB
Fig. 2.9 : Implementation of full adder with half adders
K-map Simplification
(i) Expression for ‘D’:
BBin
A 00 01 11 10
0 0 1 0 1
1 1 0 1 0
D A B Bin A B B in A B B in ABBin
(ii) Expression for Borrow (Bout)
BBin
A 00 01 11 10
0 0 1 1 1
1 1 0 1 0
Bin A B AB B in AB A B
Bin A B Bin A B
Bin Bin A B A B
Bin A B
The logic diagram of full subtractor is constructed by logic gates is shown in Figure 2.13.
A
B D
Bin
ABin
AB Bout
BBin
Bout A B
AB ABin B B BBin
AB BBin A BBin
AB ABBin A B Bin
AB Bin AB AB
Bout A B Bin A B
Using these expressions, draw the logic diagram for full subtractor as given below:
A
B
Bin
AB
Fig. 2.14 : Implementation of full subtractor
2.12 Digital Principles and System Design
Notice in Figure 2.14, there are two half subtractors connected as shown in the block diagram
Figure 2.15, with their output borrows ORed.
8 bit Parallel adder: In order to accomplish addition of large binary numbers, two or more IC adders
can be connected together, i.e., cascaded. Figure 2.18. Shows two 74LS83A adders connected to add
two 8 bit numbers, A7 A6 A5 A4 A3 A2 A1 A0 and B7 B6 B5 B4 B3 B2 B1 B0.
The addition and subtraction operations can be combined into one circuit with one common
binary adder. This is done by including an EX-OR gate with each full- adder. When ADD /SUB = 0,
the circuit is an adder and when ADD /SUB = 1, the circuit is a subtractor. Each EX-OR gate receives
input ADD /SUB and one of the inputs of B.
ADDER
When ADD /SUB = 0, the operation is B 0 = 0. The full-adder receives the value of B and the
input carry C0 = 0. Thus the circuit performs the addition operation, A + B.
SUBTRACTOR
When ADD /SUB = 1, the operation is B 1 B . The full adder receives the value of B and the
input carry C0 = 1. The B inputs are all complemented and a 1 is added through the input carry (C0).
Thus the circuit performs the subtraction operation, i.e.,
A + (2’s complement of B) = A B.
Combinational Logic 2.15
B3 A3 B2 A2 B1 A1 B0 A0
ADD/SUB
S3 S2 S1 S0
Fig. 2.20 : 4 Bit Adder/Subtractor
DELAY
Fig. 2.21 : Serial Adder
2.16 Digital Principles and System Design
Sum/Difference
Register
The four bit serial adder/subtractor is shown in Figure 2.23. When ADD /SUB = 0, the
uncomplemented B3 B2 B1 B0 will be applied to the full adder. The D-flipflop is initially cleared by
applying a low pulse at CLR input and the circuit function as a 4-bit serial adder. When ADD /SUB=1,
the complemented output of B register B3 B 2 B1 B 0 will be applied to the full adder. The D-flipflop
is set to 1 so as to get the 2’s complement of the subtrahend by applying a low pulse at PR input and
thus the circuit function as a 4-bit serial subtractor.
Sum/Difference
Register
From the above multiplication process, one can easily understand that if the multiplier bit is 1,
then the multiplicand is simply copied as a partial product; if the multiplier bit is 0, then the partial
product is 0. Whenever a partial product is obtained, it is shifted one bit to the left of the previous
partial product. This process is continued until all the multiplier bits are checked, and then the
partial products are added to this multiplication process, i.e. multiplication by partial product addi-
tion and shifting, can be implemented using the block diagram shown in figure.
In the shown figure, the 4-bit multiplier is stored in register Y (Y3Y2Y1Y0); the 4-bit
multiplicand is stored in register M (M3M2M1M0), and the X register (X4X3X2X1X0) is initially cleared
to 00000. Here, to perform multiplication, the least significant bit of the multiplier bit (Y0) is checked
whether it is 0 or 1. If Y0 = 1, the number in the multiplicand register (M) is added with the least
significant 4-bits of X register (X3X2X1X0;X4 is to store carry in addition process) and the combined
X and Y register is shifted to the right by 1 bit. If Y0 = 0, the combined X and Y register is shifted to
the right by 1 bit without performing any addition. This process has to be repeated four times to
perform 4-bit multiplication. Now, the multiplication result (R7R6R5R4R3R2R1R0) will be available
in X and Y registers (X3X2X1X0Y3Y2Y1Y0).
Combinational Logic 2.19
Parallel Multiplier
The 4-bit multiplier using shift method requires 4 cycles of addition and shifting operations, but
it requires only a single 4-bit parallel adder. The speed of multiplication process can be increased
considerably in parallel multiplier at the extra cost of increased hardware. The circuit diagram for a
4-bit parallel mutliplier is shown in figure.
It requires three 4-bit parallel binary adders and 16 numbers of 2-input AND gates. Here, each group
of 4 AND gates is used to obtain partial products while 4-bit parallel adders are used to add the
partial products. Since the generation of partial products and their additions are performed
in parallel in the group of AND gates and 4-bit adders respectively, the multiplication result
(P7P6P5P4P3P2P1P0) will be available at the output immediately after the propagation delay in the
multiplier circuit.
The operation of the parallel multiplier can be understood in a better manner from the
symbolic form of binary multiplication process shown in figure.
The method of speeding up this process by eliminating inter stage carry delay is called look
ahead-carry addition. This method utilizes logic gates to look at the lower order bits of the augend
and addend to see if a higher-order carry to be generated. It uses two functions: carry generate and
carry propagate.
Carry generate, Gi = Ai Bi
Carry propagate, Pi = Ai Bi
Sum, Si = Pi Ci
= Ai Bi Ci
Carry, Ci+1 = Gi + Pi Ci
The structure of one stage of a carry look ahead adder is shown in Figure 2.27.
Ai
Bi
Ci
Ai–1
A0
Carry
Lookahead
Bi–1
Logic Cout
B0
C0
Fig. 2.27 : Structure of one stage of a carry look ahead adder
2.22 Digital Principles and System Design
Gi (carry generate) generates carry if both Ai and Bi are 1 regardless of the input carry.
Pi (carry propagate) propagates carries if atleast one of its addend bits is 1. The carry output of a
stage can now be written in terms of the generate and propagate signals:
Ci+1 = Gi + Pi Ci
To eliminate carry ripple, expand the Ci term for each stage and multiply out to obtain a 2-level
AND-OR expression. Using this technique, we can obtain the following carry equations for the first
four adder stages are obtained.
C1
C2 = G1 + P1 C1
C3 = G2 + P2 C2 = G2 + P2 (G1 + P1 C1)
= G2 + P2 G1 + P2 P1 C1
C4 = G3 + P3 C3 = G3 + P3 (G2 + P2 G1 + P2 P1 C1)
= G3 + P3 G2 + P3 P2 G1 + P3 P2 P1 C1
From these equations, it can be seen that C4 does not have to wait for C3 and C2 to propagate.
Infact, C4 is propagated at the same time as C2 and C3. Figure 2.28shows the implementation of carry
equations for C2, C3 and C4 using AND-OR logic.
C4
P3
G3
C3
P2
G2
P1
C2
G1
C1
Fig. 2.28 : Logic diagram of a look ahead carry generator
Combinational Logic 2.23
2.15 BCD ADDER
The BCD adder is used to add two BCD digits and produces a sum in BCD digit. We know that,
BCD number means 0 to 9 (10 digits) and are represented in the binary form 0000 to 1001.
BCD numbers cannot be greater than 9 and 10 is represented in BCD as 0001 0000. In BCD
addition, the sum is greater than 9(1001), we obtain a non-valid BCD representation. The addition of
binary 6(0110) to the binary sum converts it to the correct BCD representation and also produces an
output carry as required.
Let us consider BCD addition of 5 and 10,
5 0101
10 1010 (+)
15 1111
1
1111 is an invalid BCD number. It can be corrected by the addition of 6(0110) to the invalid BCD
number.
15 1111
1
6 0110 (+)
0001 0101 15 (BCD)
Thus we can summarize the BCD addition procedure as follows:
1. Add two BCD numbers using ordinary binary addition.
2. If the result is equal to or less than 9, no correction is needed. The sum is in correct BCD form.
3. If the result is greater than 9 or if a carry is generated from the result, the result is invalid and the
correction is needed.
4. To correct the invalid sum add 6(0110) to the result. If a carry results from this addition, add it
to the next higher order BCD digit.
Implementation of BCD adder using logic circuit as follows:
4-bit binary adder for initial addition.
Logic circuit to detect sum greater than 9.
Second 4-bit binary adder to add 6(0110) to the result if result is greater than 9 or carry is 1.
The logic circuit to detect result greater than 9 can be determined by simplifying the boolean
expression of given Table 2.4.
2.24 Digital Principles and System Design
Draw the K-map for the above truth table and find out the expression
S1 S0
S3 S2 00 01 11 10
00 0 0 0 0
01 0 0 0 0
11 1 1 1 1
10 0 0 1 1
Y = S3 S2 + S3 S1
Combinational Logic 2.25
This Binary to BCD correction expression is shown in Figure 2.29.
In first binary adder, two BCD numbers together with input carry are added. When the result is
equal to zero (i.e., result 9 or Cout = 0), nothing is added to the result. When the result is one
(i.e., result 9 or Cout = 1) binary 0110 is added to the result through second binary adder. The Cout
generated by second adder can be ignored, since it supplies information already available at the
output carry terminal. The single digit BCD adder is shown in Figure 2.30. Multiple digit BCD
adders can be constructed by cascading as many single digit adders as needed. The BCD carry-out
from each stage would be connected to the carry-in of the next higher order stage.
A
1
B
A0 = B0
A0 > B0 A0 < B0
(A0 = 1, B0 = 0) (A0 = 0, B0 = 1)
Fig. 2.32 : Comparator Operation
Combinational Logic 2.27
A0
B0 A0>B0
A0
A0
B0 A0=B0
B0
B0
A0 A0<B0
B1B0 B1B0
00 01 11 10 00 01 11 10
A1A0 A1A0
00 0 0 0 0 00 0 1 1 1
01 1 0 0 0 01 0 0 1 1
11 1 1 0 1 11 0 0 0 0
10 1 1 0 0 10 0 0 1 0
A0 B1 B 0 A1 B1 A1 A0 B 0 A0 B1 B0 A1 B1 A1 A0 B0
B1B0 For A = B
A1A0 00 01 11 10
00 1 0 0 0
01 0 1 0 0
11 0 0 1 0
10 0 0 0 1
A1 A 0 B 1 B 0 A1 A0 B 1 B 0 A1 A0 B1 B 0 A1 A 0 B1 B 0
A1 B1 A0 B 0 A0 B0 A1 B1 A0 B0 A0 B 0
A1 B1 A1 B1 A0 B 0 A0 B0 A1 B1 A0 B0
A B is A0 B1 B 0 A1 B1 A1 A0 B 0
A B is A0 B1 B0 A1 B1 A1 A0 B0
A B is, A
1 B1 A0 B0
Combinational Logic 2.29
The implementation of 2 bit magnitude comparator using EX-NOR and AND gates using the
above expressions is shown in Figure 2.34.
output = 1
Fig. 2.36: 16 bit parity checker
0 0100 0001.
B0 = A B1 = DC B DB
For B2 For B3
BA BA
DC 00 01 11 10 DC 00 01 11 10
00 0 0 0 0 00 0 0 0 0
01 1 1 1 1 01 0 0 0 0
11 0 0 1 1 11 0 0 0 0
10 0 0 0 0 10 1 1 0 0
B2 = DC CB B3 DC B
Combinational Logic 2.33
For B4
B0 A
BA B1 DC B DB
00 01 11 10
DC
B2 DC CB
00 0 0 0 0
B3 DC B
01 0 0 0 0
B4 DC DB
11 1 1 1 1
10 0 0 1 1
B4 = DC + DB
Logic Diagram
For E1 For E0
B1B0 B1B0
B3B2 00 01 11 10 B3B2 00 01 11 10
00 1 0 1 0 00 1 0 0 1
01 1 0 1 0 01 1 0 0 1
11 X X X X 11 X X X X
10 1 0 X X 10 1 0 X X
E1 B1 B 0 B1 B0 B1 B0 E0 B 0 E3 B3 B2 B0 B1
E2 B2 B1 B 0 B2 B0 B1
E1 B1 B0
E0 B 0
Combinational Logic 2.35
BCD code BCD code
B3 B2 B1 B0
Excess-3 code
E0
E1
E2
E3
K-map Simplification
For G0 For G1
BA BA
DC 00 01 11 10 DC 00 01 11 10
00 0 1 0 1 00 0 0 1 1
01 0 1 0 1 01 1 1 0 0
11 0 1 0 1 11 1 1 0 0
10 0 1 0 1 10 0 0 1 1
G0 BA B A G1 C B CB
BA CB
For G2 For G3
BA BA
DC 00 01 11 10 00 01 11 10
DC
00 0 0 0 0 00 0 0 0 0
01 1 1 1 1 01 0 0 0 0
11 0 0 0 0 11 1 1 1 1
10 1 1 1 1 10 1 1 1 1
G2 DC DC D C G3=D G0 B A
Logic Diagram G1 C B
G2 D C
Binary Code Gray Code
G3 D
A G0
B G1
C G2
D G3
G3 G2 G1 G0 D C B A
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 1 0 0 1 0
0 0 1 0 0 0 1 1
0 1 1 0 0 1 0 0
0 1 1 1 0 1 0 1
0 1 0 1 0 1 1 0
0 1 0 0 0 1 1 1
1 1 0 0 1 0 0 0
1 1 0 1 1 0 0 1
1 1 1 1 1 0 1 0
1 1 1 0 1 0 1 1
1 0 1 0 1 1 0 0
1 0 1 1 1 1 0 1
1 0 0 1 1 1 1 0
1 0 0 0 1 1 1 1
K-map Simplification
For A For B
G1G0
G1G0
G3 G2 00 01 11 10
G3 G2 00 01 11 10
00 0 1 0 1 00 0 0 1 1
01 1 0 1 0 01 1 1 0 0
11 0 1 0 1 11 0 0 1 1
10 1 0 1 0 10 1 1 0 0
2.38 Digital Principles and System Design
G3 G2 G1 G 0 G1G0 G3 G2 G1G0 G1 G 0
G3 G2 G2 G0 G3 G2 G1 G0
G3 G2 G1 G0 G3 G2 G1 G0
G3 G2 G1 G0 A G3 G2 G1 G0
B G 3 G 2 G3G2 G1 G 3G2 G3 G 2 G1 B G3 G2 G1
G3 G2 G1 G3 G2 G1 C G3 G2
D G3
G3 G2 G1 G3 G2 G1 G3 G2 G1
For C For D
G1 G0 G1G0
G3 G2 00 01 11 10 G3 G2 00 01 11 10
00 0 0 0 0 00 0 0 0 0
01 1 1 1 1 01 0 0 0 0
11 0 0 0 0 11 1 1 1 1
10 1 1 1 1 10 1 1 1 1
C G 3G2 G3 G 2 G3 G2 D G3
Logic Diagram
Gray Code Binary Code
G0
A
G1
B
G2
C
G3 D
Fig. 2.41 : Gray code to binary code converter
Combinational Logic 2.39
2.19 DECODERS
Decoder is a digital device that converts coded information into another code or non-coded form.
It is a multi-input multi-output logic circuit. The number of outputs is greater than the number of
inputs (n : 2n). The encoded information is presented as ‘n’ inputs producing 2n possible outputs as
shown in Figure 2.42.
If the number of inputs and outputs are equal in a digital system, then it can be called as code
converters. (BCD to XS-3 code, Binary to BCD code, Gray to Binary Code converters, etc.)
n DECODER 2n
data outputs
inputs
Inputs Outputs
X Y D0D1 D2 D3
0 0 1 0 0 0
0 1 0 1 0 0
1 0 0 0 1 0
1 1 0 0 0 1
2.20 ENCODERS
An encoder is a digital circuit that performs the inverse operation of a decoder. It is a combinational
logic circuit, that output logic circuit, that output lines generate the binary code corresponding to the
input value.
It has 2n input lines and ‘n’ output lines. The octal-to-binary encoder has 8(23) inputs, one for each
of the octal digits and three (n = 3) outputs that generate the corresponding binary number. It is
assumed that only one input has a value of 1 at any given time; otherwise the circuit has no meaning.
2.20.1 Octal-to-Binary encoder
The octal-to-binary encoder truth table is given in Table 2.12. The encoder can be implemented
with OR gates whose inputs are determined directly from the truth table. Output z is equal to 1 when
the input octal digit is 1 or 3 or 5 or 7. Output y is 1 for octal digits 2, 3, 6 or 7 and output x is 1 for
digits 4, 5, 6 or 7. These conditions can be expressed by the following output Boolean functions:
z = D1 + D3 + D5 + D7
y = D2 + D3 + D6 + D7
x = D4 + D5 + D6 + D7
2.44 Digital Principles and System Design
The octal-to-binary encoder is implemented for these Boolean functions using OR gates. The
octal-to-binary encoder is shown in Figure 2.47.
TABLE 2.12 : Truth Table
Inputs Outputs
D0 D1 D2 D3 D4 D5 D6 D7 x y z
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 1 0 0
0 0 0 0 0 1 0 0 1 0 1
0 0 0 0 0 0 1 0 1 1 0
0 0 0 0 0 0 0 1 1 1 1
Inputs Outputs
D0 D1 D2 D3 X Y V
0 0 0 0 X X 0
1 0 0 0 0 0 1
X 1 0 0 0 1 1
X X 1 0 1 0 1
X X X 1 1 1 1
Although the Table 2.13 has only five rows, when each don’t care condition is replaced first by
0 and then by 1, we obtain all 16 possible input combinations. For example the third row in the table
with X100 represents minterms 0100 and 1100. The don’t care condition is replaced by 0 and 1 as
shown in Table 2.14.
TABLE 2.14: Modified Truth Table
Inputs Outputs
D0 D1 D2 D3 X Y V
0 0 0 0 X X 0
1 0 0 0 0 0 1
0 1 0 0
1 1 0 0 0 1 1
0 0 1 0
0 1 1 0
1 0 1 0 1 0 1
1 1 1 0
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1 1 1 1
1 0 1 1
1 1 0 1
1 1 1 1
2.46 Digital Principles and System Design
For x For y
D2D3 D2D3
00 01 11 10 00 01 11 10
D2D1 D0D1
00 X 1 1 1 00 X 1 1 0
01 0 1 1 1 01 1 1 1 0
11 0 1 1 1 11 1 1 1 0
10 0 1 1 1 10 0 1 1 0
x = D2 + D3 y = D3 + D1 D 2
For V
D2 D3
D0 D1 00 01 11 10
00 0 1 1 1
01 1 1 1 1
11 1 1 1 1
10 1 1 1 1
V = D0 + D1 + D2 + D3
The simplified Boolean expressions for the priority encoder are obtained from the K-maps as
follows:
x = D2 + D3
y = D3 + D1 D 2
v = D0 + D1 + D2 + D3
The priority encoder is implemented in Figure 2.48 according to the above Boolean functions.
Combinational Logic 2.47
2.21 MULTIPLEXERS
‘m’ control signals
Multiplex means “many into one”. A multiplexer is
a combinational circuit with many inputs but only one
output. By applying control signals, we can steer any
input to the output. It has ‘n’ input signals, ‘m’ control
signals and 1 output signal. Multiplexer is called as data ‘n’ input MUX 1 output
selector or because the output bit depends on the input signals signal
data bit that is selected. The block diagram of multiplexer
is shown in Figure 2.49.
Fig. 2.49
1. Y = I0 iff S1 = 0 , S0 = 0
Y = I 0 S 1 S 0 I 0 11 I 0
2. Y = I1 iff S1 = 0, S0 = 1
Y = I1 S 1 S0 I1 , when S1S0 = 01
3. Y = I2 iff S1 = 1 , S0 = 0
Y = I 2 S1 S 0 I 2 when S1S0 = 10
4. Y = I3 iff S1 = S0 = 1
Y = I3S1S0 = I3 when S1S0 = 11
1
The final expression for the data output,
Y = I 0 S 1 S 0 I1 S 1S0 I 2 S1 S 0 I 3 S1S0
Using this expression, the 4-to-1 multiplexer can be implemented using gates as shown in
Figure 2.51.
Combinational Logic 2.49
0 0 1 1 0 D6
0 0 1 1 1 D7
0 1 0 0 0 D8
0 1 0 0 1 D9
0 1 0 1 0 D10
0 1 0 1 1 D11
0 1 1 0 0 D12
0 1 1 0 1 D13
0 1 1 1 0 D14
0 1 1 1 1 D15
1 X X X X 1
2.22 DEMULTIPLEXERS
Demultiplex means “one into many”. A demultiplexer is a combinational logic circuit with one
input and many outputs. By applying control signal, we can steer the input signal to one of the output
lines. Figure 2.54 shows the block diagram of demultiplexer. It has 1 input signal, ‘m’ control signals
and ‘n’ output signals.
2.52 Digital Principles and System Design
The select inputs (Control Signals) determine to which output the data input will be connected.
As the serial data is changed to parallel data, i.e., the input caused to appear on one of the ‘n’ output
lines, the demultiplexer is called data distributor or serial-to-parallel converter.
2.22.1 1-to-4 Demultiplexer
A 1-to-4 demultiplexer has a single input (D), 4 outputs (Y0Y1Y2Y3) and two select lines (S1S0).
The truth table of the 1 to 4 demultiplexer is shown in Table 2.17.
When S1S0 = 00, the data input is connected to output Y0.
Y0 S 1 S 0 D D
When S1S0 = 01, the data input is connected to output Y1
Y1 S 1S0 D D
When S1S0 = 10 , the data input is connected to output Y2
Y2 S1 S 0 D D
When S1S0 = 11, the data input is connected to output Y3
Y3 = S1S0D = D
Using these expressions, a 1-to-4 demultiplexer is implemented using AND gates as shown in
Figure 2.55.
TABLE 2.17 : Truth Table
Data Input Select Inputs Outputs
D S1 S0 Y3 Y2 Y1 Y0
D 0 0 0 0 0 D
D 0 1 0 0 D 0
D 1 0 0 D 0 0
D 1 1 D 0 0 0
Combinational Logic 2.53
Implementation Table
I0 I1 I2 I3
A 0 1 2 3
A 4 5 6 7
0 1 A A
I0 = 0, I1 = 1, I2 = A, I3 = A
Multiplexer Implementation
Implementation Table
I0 I1 I2 I3 I4 I5 I6 I7
A 0 1 2 3 4 5 6 7
A 8 9 10 11 12 13 14 15
1 1 0 A A 0 0 A
Multiplexer Implementation
Solution:
ABD C C ACD B B BCD A A AD CD
ABDC ABDC ACDB ACDB BCDA BCDA ABD ABD CDA CDA
0 1 2 3 4 5 6 7
A
A 8 9 10 11 12 13 14 15
0 1 0 1 A 1 A 1
MUX Implementation
0 I0
1
I1
I2
I3
y=F
A I4 8 to 1
I5 MUX
I6
I7
S2 S1 S0
B
C
D
Combinational Logic
2.57 Example 2.7: Design a combinational logic using a suitable multiplexer to realize the
CD CD CD CD
CD
AB 00 01 11 10
AB 00
0 1 3 2
01 1
AB
4 5 7 6
11 1
AB
12 13 15 14
10 1
AB 8 9 11 10
0 1 2 3 4 5 6 7
A
A 8 9 10 11 12 13 14 15
0 0 A 0 1 0 0 0
2.58 Digital Principles and System Design
Multiplexer Implementation
0 I0
I1
I2 8 to 1
A
I3 MUX F
y
1 I4
I5
I6
I7
S2 S1 S0
B
C
D
Example 2.8: Implement F(A, B, C, D) = (1, 3, 4, 11, 12, 13, 14, 15) using 8 1 multiplexer.
Solution
Implenetation Table:
D0 D1 D2 D3 D4 D5 D6 D0
0 1 2 3 4 5 6 7
A
A 8 9 10 11 12 13 14 15
0 A 0 1 1 D D D
Multiplexer Implementation
0 D0
D1
D2
D3 8 to 1
1 y=F
D4 MUX
D5
D6
A D7
S2 S1 S0
B
C
D
Combinational Logic 2.59
2.24.4 VHDL
VHDL is an international IEEE standard specification language (IEEE 1076-1993) for describing
digital hardware used by industry worldwide. VHDL stands for “VHSIC Hardware Description
Language”. VHSIC stands for “Very High Speed Integrated Circuit”. VHDL enables hardware modeling
from the gat eto system level. It provides a mechanism for digital design and reversable design
documentation.
In the mid 1980s, the U.S. Department of Defence (DOD) and the IEEE sponsored the
development of VHDL.
In July 1983, a team of Intermetrics, IBM and Texas Instruments were awarded a contract to
develop VHDL.
In August 1985, the final version of the language under government contract was released:
VHDL Version 7.2.
In December 1987, VHDL became IEEE standard 1076-1987 and in 1988 an ANSI standard.
In September 1993, VHDL was restandardized to clarify and enhance the language.
VHDL has been accepted as a Draft International Standard by the IEC.
The HDL texts provide high portability among platforms and design tools.
They have the flexibility to model very complex systems down to very primitive circuits.
Combining with the synthesis, a new design methodology is emerged which reduces design
cycle and costs.
The entity describes the interface to the outside world. It specifies the number of parts, the direction
of the ports and the types of the ports.
The name of the entity is mux. The entity has 7 ports in the port clause. 6 ports are of mode ‘in’
and one port is of mode ‘out’. The four data input ports (a, b, c, d) are of type ‘bit’. The two multiplexer
select inputs. (S0, S1) are also of type ‘bit’. The output port is of type ‘bit’.
2.26.2 Architecture
All entities that can be simulated have an architecture description. The architecture describes the
behaviour of the entity. A single entity can have multiple architectures. One architecture might be
behavioural while another might be a structural description of the design. The syntax of a VHDL
architecture definition is,
architecture architecturename of entityname is
type declarations
signal declarations
constant declarations
function definitions
procedures definitions
begin
concurrent-statement
....
concurrent-statement
end architecture-name ;
An architecture for the counter device is,
architecture data flow of mux is
signal select : integer;
begin
select < = 0 WHEN S0 = 0 AND S1 = 0 ELSE
1 WHEN S0 = 1 AND S1 = 0 ELSE
2 WHEN S0 = 0 AND S1 = 1 ELSE
3;
condition
x < = a AFTER 0.5 NS WHEN select = 0 ELSE
b AFTER 0.5 NS WHEN select = 1 ELSE
c AFTER 0.5 NS WHEN select = 2 ELSE
d AFTER 0.5 NS ;
end data flow;
Combinational Logic 2.65
In this example,
architecture name = dataflow
entity name = mux
The architecture ‘dataflow’ describes the underlying functionality of the entity ‘mux’ and contains
the statements that model the behaviour of the entity.
2.26.3 Configuration
A configuration statement is used to bind a component instance to an entity- architecture pair. A
configuration can be considered like a parts list for a design. It describes which behaviour to be used
for each entity, much like a parts list that describes which part to use for each part in the design. The
syntax of configuration declaration is,
Configuration configuration_name of entity_name is
for architecture_name
for instance_name : entity_name use entity
library_name . entity_name
(architecture_name) ;
end for;
for instance_name : entity_name use configuration
library_name . configuration_name ;
end for;
end for;
end configuration_name ;
2.26.4 Package
A VHDL package is a file containing definitions of objects that can be used in other programs.
The kind of objects that can be put into a package include signal, type, constant, function, procedure
and component declarations.
The primary purpose of a package is to encapsulate elements that can be shared among two or
more design units. A package is a common storage area used to hold data to be shared among a
number of entities. Declaring data inside of a package allows the data to be referenced by other
entities; thus the data can be shared.
2.66 Digital Principles and System Design
attached can be used during simulation. Data such as the disk file name of the model, loading
information, driving capability, resistance, capacitance, physical location and So on can be attached
to objects. The user-defined attributes can be assigned to the following list of objects:
Entity Type and subtype
Architecture Constant
Configuration Signal
Procedure Variable
Function Component
Package Label
Table 2.18 lists predefined attributes with examples.
TABLE 2.18 : Predefined Attributes
2.26.7 Generic
A generic is a general mechanism that passes information to an entity. For instance, if an entity is
a gate level model with a rise and a fall delay, values for the rise and fall delays could be passed into
the entity with generics. The syntax of a VHDL generic declaration within an entity declaration is,
entity entity-name is
generic (constant-names : constant-type ;
.....
constant-names : constant-type);
Port (signal-names : mode signal-type ;
.....
signal-names : mode signal-type) ;
end entity-name;
Combinational Logic 2.71
The following is an example of an entity for an AND gate that has 3 generics associated with it
entity and is
generic (rise, fall : time; load : integer);
port (a , b : in bit;
c : out bit);
end and
This entity allows to pass in a values for the rise and fall delays, as well as the loading device that
has on its output.
2.26.8 Process
A process is a collection of “sequential” statements that executes in parallel with other concurrent
statements and other processes. A VHDL process statement can be used anywhere that a concurrent
statement can be used. The syntax of a VHDL process statement is given below:
Process (signal-names , signal-name , . . . . . , signal-name)
type declarations
variable declarations
constant declarations
function definitions
procedure definitions
begin
sequential-statement
.....
sequential-statement
end process;
A process statement has a declaration section and a statement part. In the declaration section,
types, variables, constants, subprograms and so on can be cleared. The statement part contains only
sequential statements. Sequential statements consist of CASE statements, IF THEN ELSE statements,
LOOP statements and so on.
2.26.9 Bus
In VHDL, a bus is a special kind of signal that may have its drivers turned off.
2.72 Digital Principles and System Design
2.27 LIBRARY
A VHDL ‘library’ is a place where the VHDL compiler stores information about a particular
design project, including intermediate files that are used in the analysis, simulation and synthesis of
the design. The designer can specify the name of a library using a ‘library clause’ at the beginning of
the design file. For example, the IEEE library is specified as,
Library ieee ;
A design can use a package by including a ‘use clause’ at the beginning of the design file. For
example, to use all of the definitions in the IEEE standard 1164 package, we can specify as
use ieee . std_logic_1164 . all ;
where, ‘ieee’ is the name of a library
‘std_logic_1164’ is the file name, contains the desired definitions ‘all’ talls the compiler to use all
of the definitions in this file.
Instead of ‘all’, we can write the name of a particular object to use just its definition, for example,
use ieee . std_logic_1164 . std_ulogic
bit real
bit_vector severity_real
boolean string
character time
integer
(i) IF Statement
The IF statement starts with the keyword ‘IF’ and ends with the keywords ‘END IF’. There are
also two optional clauses: ELSIF and ELSE. The ESLIF (if-then- else) clause is repeatable-more than
one ELSIF clause is allowed; but the ELSE clause is optional and only one is allowed. The syntax of
IF statement is,
if statement : : =
if condition then
sequence of statements
[ elsif condition then
sequence of statements
[else
sequence of statements]
end if;
2.76 Digital Principles and System Design
Example
1. If (X < 10) then
a : = b;
end if;
2. If (day = Sunday) then
weekend : = TRUE;
elsif (day = Saturday) then
weekend : = TRUE;
else
weekday : = TRUE;
end if;
(ii) CASE Statement
The CASE statement is used whenever a single expression value can be used to select between a
number of actions. The syntax of a VHDL CASE statement is,
Case expression is
when choices = > sequential-statements
...
when choices = > sequential-statements
end case;
This statement evaluates the given expression, finds a matching value in one of the choices, and
executes the corresponding sequential-statements. One or more sequential statements can be written
for each set of choices. The choices may take the form of a single value or of multiple values separated
by vertical bars (1). Prime-number-detector architecture using CASE statement is shown below:
architecture prime 8_arch of prime is
begin
process(N)
begin
case CONV_INTEGER (N) is
when 1 = > F < = ‘1’ ;
when 2 = > F < = ‘1’ ;
when 3 | 5 | 7 | 11 | 13 = > F < = ‘1’ ;
when others = > F < = ‘0’;
end case;
end process;
end prime 8_arch;
Combinational Logic 2.77
(iii) Loop Statement
The Loop Statement is used whenever an operation needs to be repeated. Loop statements are
used when powerful iteration capability is needed to implement a model. Following is the syntax of
Loop statement:
loop
sequential-statement
.....
sequential-statement
end loop;
Example
for I in 1 to 10 loop
I_squared (I): <$E=> I * I;
end loop;
The EXIT statement allows to exit or jump out of a Loop Statement currently in execution. This
causes execution to halt at the location of the EXIT Statement. Execution continues at the statement
following the Loop Statement.
exit;
exit when a < = b ;
exit loop_label when X = Z;
The ASSERT statement checks the value of a boolean expression for true or false. If the value is
true, the statement does nothing. If the value is false, the ASSERT statement outputs a user-specified
text string to the standard output to the terminal
assert_statement : : =
assert condition
[REPORT expression]
[SEVERITY expression];
2.78 Digital Principles and System Design
WAIT statement is used to suspend a process for a specified time period. It is used for specifying
clock inputs to synthesis tools. The options available to the WAIT Statement are:
WAIT ON signal changes
WAIT UNTIL an expression is true
WAIT FOR a specific amount of time
process
begin
XT < = ‘0’ ; YT < = ‘0’ ;
wait for 10 ns;
end process;
A
B D
C
Fig. 2.59: 3 input OR gate
library IEEE;
use IEEE . Std_logic_1164 . all;
entity or 3 1S
port (X, Y, Z : in STD_LOGIC;
D : out STD_LOGIC);
end or 3;
architecture Synth of or 3 is
begin
D < = X or Y or Z;
end Synth:
A
Y
B
Fig. 2.60: 3 input XOR
A
Y
B
The VHDL program for 2-input XNOR gate using the built-in ‘xnor’ operator is given below. The
‘xnor’ operator can be overloaded to work with any types. In this example two STD_LOGIC type
values are XNOR’ed together to form the final result.
library IEEE;
use IEEE . STD_logic_1164 . all;
entity xnor2 is
generic (delay : time);
port (A, B : in STD_LOGIC;
Y : out STD_LOGIC);
end entity xnor2;
architecture better of xnor2 is
begin
Y < = A xnor B after delay;
end architecture better;
Combinational Logic 2.81
2.33.4 Decoder
There are several ways to approach the design of decoders in VHDL. The most primitive approach
would be two write a structural equivalent of a decoder logic circuit. Figure 2.62 shows the inputs
and outputs of 2-to-4 decoder and Figure 2.63 shows the gate-levelcircuit. The input code word I0, I1
represents an integer in the range 0 3 [00, 01, 10, 11]. The output code word Y3, Y2, Y1, Y0 has Yi
equal to 1 if and only if the input code word is the binary representation of ‘i’ and the enable input EN
is 1. If EN = 0, all of the outputs are 0. The VHDL structural program for 2-to-4 decoder is given
below. The components ‘and’ and ‘inv’ are assumed to already exist in the target technology.
I0 Y0
I1 2-to-4 Y1
Decoder
EN Y2
Y3
I0
Y0
Y1
I1
Y2
Y3
EN
entity V2to4dec is
port (I0, I1, EN : in STD_LOGIC;
Y0, Y1, Y2, Y3 : ut STD_LOGIC);
end V2to4dec;
2.33.5 MULTIPLEXER
The logic symbol of 4-to-1 multiplexer is shown in Figure 2.64 and the logic diagram is shown in
Figure 2.65. The input lines are I0, I1, I2 and I3. The select lines are S0 and S1. The one output line is Y. The
truth table of 4-to-1 multiplexer is given in Table 3.10. The boolean function of 4-to-1 multiplexer is,
Y I 0 S1 S0 I1 S1S0 I 2 S1 S0 I 3 S1S0
Table: 3.10 Truth Table
Select Lines Output
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
Fig. 2.64: Logic Symbol 1 1 I3
Combinational Logic 2.83
I0
I1
I2
Library IEEE;
use IEEE . Std_logic_1164 . all;
entity mux is
port (
S : in STD_LOGIC_VECTOR (1 downto 0); — Select inputs
I0, I1, I2, I3 : in STD_LOGIC_VECTOR (1 to 8); — Data bus
inputs
Y : out STD_LOGIC_VECTOR (1 to 8) — Data bus output
);
end mux;
I0
I1
I2
I3
I4
I5
I6
I7
I8
The behavioural VHDL program for a 9-input parity checker is given below:
Library IEEE;
use IEEE . Std_logic_1164 . all;
entity parity is
port (I : in STD_LOGIC_VECTOR (1 to 9);
EVEN, ODD : out STD_LOGIC );
architecture parity 1 of parity is
begin
process (I)
variable p : STD_LOGIC;
begin
p : = I(1)
for j in 2 to 9 loop
if I(j) = ‘1’ then p : = not p ; end if;
end loop;
ODD < = p ;
EVEN < = not p ;
end process;
end parity 1;
Combinational Logic 2.85
2.33.7 Comparator
The 8 bit comparator receives two 9bit numbers A and B as inputs and the outputs are A = B and
A > B. The logic symbol of 8-bit comparator (74682) is shown in Figure 2.67. The top half of the
circuit checks the two 8 bit numbers for equality. The bottom half of the circuit compares the two
input 8 bit numbers and asserts A > B if [A7 A0] > [B7 B0 ] . The 74682 does not provide less than
(A < B) output. However, any desired condition, including and can be obtained as shown in
Figure 2.68.
VHDL has comparison operators for all of its built-in types. Equality (=) and inequality (/=)
operators apply to equal size and structure and the operands are compared component by component.
The other comparison operators (> , < > = , < = ) apply only to integer types, enumerated types (such
as STD_LOGIC) and one dimensional arrays of integer type. The VHDL program that produces all of
the comparison outputs for comparing two 8bit unsigned integers is given.
INPUT A INPUT B
library IEEE;
use IEEE . Std_logic_1164 . all
entity compare is
port (
A, B : in STD_LOGIC_VECTOR (7 downto 0);
EQ, NE, GT, GE, LT, LE : out STD_LOGIC
);
end compare;
The addition and subtraction operations combined into one circuit is called as binary adder-
subtractor. This is done by including an XOR gates with each full adder. The mode input M controls
the operation of the circuit. When M = 0, the circuit is an adder and when M = 1, the circuit becomes
a subtractor. Each XOR gate receives input M and one of the inputs of B(B0 B3). When M = 0, B
0 = B. The full adders receive the value of B, the input carry is 0 and the circuit performs addition
operation (A + B), when M = 1, B 1 = B and Cin 0 = 1. The B inputs are all complemented
Combinational Logic 2.87
and 1 is added through the input carry. The circuit performs the operation A + (2’s complement of B)
i.e., A B. The logic diagram of 4 bit binary adder-subtractor is shwon in Figure 2.69 and the logic
symbol is shown in Figure 2.70.
B3 B2 B1 B0
A3 A2 A1 A0
M
S3 S2 S1 S0
Fig. 2.69: 4 bit adder/subtractor
The IEEE_std_logi_arith package defines two new array types, SIGNED and UNSIGNED, and a
set of comparison functions for operands of type INTEGER, SIGNED or UNSIGNED. The package
also defines addition and subtraction operations for the same kind of operands as well as STD_LOGIC
and STD_ULOGIC for 1-bit operands.
T = 9 bit result of A + C
Library IEEE;
use IEEE . Std_logic_1164 . all;
use IEEE . Std_logic_orith . all;
entity addsub is
port (
A, B : in UNSIGNED (7 downto 0);
C : in SIGNED (7 downto 0);
D : in STD_LOGIC_VECTOR (7 downto 0);
S : out UNSIGNED (8 downto 0);
T : out SIGNED (8 downto 0);
U : out SIGNED (7 downto 0);
V : out STD_LOGIC-VECTOR (8 downto 0)
);
end addsub;
7. What is decoder?
A decoder is a multiple input, multiple-output logic circuit which converts coded inputs into
coded outputs, where the input and output codes are different. In a binary decoder n-inputs
produce 2n outputs. Usually, a decoder is provided with enable inputs to activate decoded
output.
9. What will be the maximum number of outputs for a decoder with a 6-bit data word?
26=64
10. What is a data selector? or what is multiplexer? or Why is MUX called as data detector?
• Multiplexer is a digital switch. Particularly, it has 2" input lines and n selection lines whose bit
combinations determine which input line is selected and routed onto available only single
output line.
• Hence, multiplexer is a selector of one out of several data sources available at its input lines,
to connect it to output line. Simply it is a 'many into one' device and also called 'data selector'.
MCQ QUESTIONS
7. A combinational circuit that selects one from many inputs are ____________
a) Encoder
b) Decoder
c) Demultiplexer
d) Multiplexer
Answer: d. Multiplexer
9. Which combinational circuit is renowned for selecting a single input from multiple inputs &
directing the binary information to output line?
a) Data Selector
b) Data distributor
c) Both data selector and data distributor
d) Demultiplexer
Answer: a. Data Selector
13. If two inputs are active on a priority encoder, which will be coded on the output?
a) The higher value
Combinational Logic 2.98
c) a < b
d) a = b
Answer: b.a-b
18. In magnitude comparator, if two numbers are not equal then binary variable will be
a) 0
b) 1
c) A
d) B
Answer: a.0
22. In what aspect, HDLs differ from other computer programming languages?
a) No aspect; both are same
b) HDLs describe hardware rather than executing a program on a computer
c) HDLs describe software and not hardware
d) Other computer programming languages have more complexity
Answer: b. HDLs describe hardware rather than executing a program on a computer
23. If A and B are the inputs of a half adder, the sum is given by __________
a) A AND B
b) A OR B
c) A XOR B
d) A EX-NOR B
Answer: c. A XOR B
25. How many AND, OR and EXOR gates are required for the configuration of full adder?
a) 1, 2, 2
b) 2, 1, 2
c) 3, 1, 2
d) 4, 0, 1
Answer: b.2,1,2
2.101 Digital Principles and System Design
26. For subtracting 1 from 0, we use to take a _______ from neighbouring bits.
a) Carry
b) Borrow
c) Input
d) Output
Answer: b. Borrow
REVIEW QUESTIONS
1. Distinguish between a half-adder and a full-adder.
2. Distinguish between a half-subtractor and a full-subtractor.
3. Realize a half-adder using (a) only NAND gates and (b) only NOR gates.
4. Realize a half-subtractor using (a) only NAND gates and (b) only NOR gates.
5. Realize a full-adder using (a) only NAND gates and (b) only NOR gates.
6. Realize a full-subtractor using (a) only NAND gates and (b) only NOR gates.
7. Distinguish between a serial adder and a parallel adder.
8. With the help of a block diagram explain the working of a serial adder.
9. Give the implementation of a 4-bit ripple adder using half-adder(s)/full-adder(s).
10. Realize a look-ahead-carry adder.
11. With the help of a logic diagram explain a parallel adder/subtractor using 2's complement
system.
12. Explain the working of a BCD adder.
13. Realize a single bit comparator.
14. Realize a 2-bit comparator.
15. Realize a 4-bit comparator.
16. Write notes on code converters.
17. Write notes on parity bit generators.
18. Distinguish between an encoder and a decoder.
19. With the help of a logic diagram and a truth table, explain an octal-to-binary encoder.
20. With the help of a gate level logic diagram and a truth table, explain a decimal -to-BCD
encoder.
21. Explain a keyboard encoder using diode matrix.
22. With the help of a logic diagram and a truth table, explain a 3-line to 8-line decoder.
23. With the help of a logic diagram and a truth table, explain a BCD-to-decimal decoder.
24. Write notes on BCD-to-7 segment decoders.
25. Distinguish between a multiplexer and a demultiplexer.
26. Discuss a few applications of multiplexers.
Combinational Logic 2.104
27. With the help of logic diagram and function table explain (a) a 4-input multiplexer and (b)
an 8-input multiplexer.
28. Explain how a 4-variable function can be realized using an 8:1 mux.
29. Show an arrangement to obtain a 16-input multiplexer from two 8-input multiplexers.
30. With the help of a logic diagram and truth table explain (a) a 1-line to 4-line demultiplexer
and (b) a 1-line to 8-line demultiplexer.
Synchronous Sequential Logic 3.1
UNIT III
3.1 INTRODUCTION
In combinational logic circuits, the outputs
at any instant of time depend only on the
input signals present at that time as shown in
Figure 3.1.
Fig. 3.1: Combinational Circuit
The logic circuits whose outputs at any instant of time depend not only on the present inputs but
also on the past outputs are called sequential logic circuits. Figure 3.2 shows the block diagram of
sequential logic circuit.
1
3.2 Digital Principles and System Design
The rotary channel selected knob on an old-fashioned TV is like a combinational circuit. Its
output selects a channel based only on its current input the position of the knob. The channel-up and
channel-down push buttons on a TV is like a sequential circuit. The channel selection depends on the
past sequence of up/down pushes.
Combinational Sequential
Synchronous Asynchronous
Inputs Outputs
S R Qn + 1 Q n+ 1 State
0 0 Qn Qn No change
0 1 0 1 Reset
1 0 1 0 Set
1 1 X X Forbidden
The SR flip-flop can be also implemented using NAND gates. The inputs of this flip-flop are S
and R .
3.4 Digital Principles and System Design
When S = R = 0, Outputs Qn + 1 = Q n = 1.
S Q
Q
R
Fig. 3.7: NAND based SR flip-flop
Inputs Outputs
S R Qn + 1 Q n State
0 0 X X Forbidden
0 1 1 0 Set
1 0 0 1 Reset
1 1 Qn Qn No change
The characteristic equation is an algebraic expression for the binary information of the characteristic
table. This equation is derived from K-map. This equation specifies the value of the next state as a
function of the present state and the inputs.
Synchronous Sequential Logic 3.5
TABLE 3.4: Characteristic Table
Q S R Qn + 1
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 Forbidden
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 Forbidden
SR 00 01 11 10
Q
0 X 1
1 1 X 1
Characteristic equation: Qn S QR
EN
R Q
R
S Q
EN
Q
R
Fig. 3.8 : Clocked S-R flip-flop
3.6 Digital Principles and System Design
The characteristic table and characteristic equation of clocked SR flip-flop are same as the
characteristic table (Table 3.4) and characteristic equation of SR flip-flop. Note that the CP input is
not included in Table 3.4. The table must be interpreted as: Given the present state Q and the inputs
S and R, the application of a single pulse in the EN input causes the flip-flop to go to the next state Qn+1.
3.7 D FLIP-FLOP
To eliminate the undesirable condition of the indeterminate state in the RS flip-flop is to ensure
the inputs S and R are never made equal to 1 at the same time. This is done by D flip-flop. The D
(delay) flip-flop has one input called delay input and clock pulse input. The D flip-flop using SR flip-
flop is shown in Figure 3.12(a) and the graphic symbol is shown in Figure 3.12(b).
D
Q 0 1
0 0 1
Characteristic equation: Qn + 1 = D 1 0 1
Synchronous Sequential Logic 3.9
3.8 JK FLIP-FLOP
JK means Jack Kilby, Texas Instrument (TI) Engineer, who invented IC in 1958. JK flipflop has
two inputs J(set) and K(reset). A JK flip-flop can be obtained from the clocked SR flipflop by
augmenting two AND gates as shown in Figure 3.13. The data input J and the output Q are applied
to the first AND gate and its ouput (J Q ) is applied to the S input of SR flipflop. Similarly, the data
input K and the output Q are applied to the second AND gate and its output (KQ) is applied to the R
input of SR flip-flop.
JK
00 01 11 10
Q
0 0 0 1 1
1 1 0 0 1
Characteristic equation: Qn J Q K Q
Synchronous Sequential Logic 3.11
3.9 T FLIP-FLOP
The T(Toggle) flipflop is a modification of the JK flipflop. It is obtained from JK flip-flop by
connecting both inputs J and K together, i.e., single input. Regardless of the present state, the flip flop
complements its output when the clock pulse occurs while input T = 1.
When T = 0, Qn + 1 = Qn, i.e., the next state is the same as the present state and no change occurs.
When T = 1, Qn Q n , i.e., the next state is the complement of the present state.
The symbol and truth table of T flip-flop is shown in Figure 3.14.
T Qn + 1 State
0 Qn No change
1 Q Complement
Characteristic Equation: Qn T Q T Q
When the clock pulse has a positive edge, the master acts according to its J - K inputs, but the
slave does not respond, since it requires a negative edge at the clock input.
When the clock input has a negative edge, the slave flip-flop copies the master outputs. But the
master does not respond since it requires a positive edge at its clock input.
The clocked master-slave J - K flipflop using NAND gates is shown in Figure 3.16.
J Q
CLK
K Q
Master Slave
3.11.1 SR Flipflop
TABLE 3.10 (a) : Characteristic Table TABLE 3.10 (b) : Modified Table
Present Inputs Next Present Next Inputs Inputs
State State State State
Qn S R Qn + 1 Qn Qn + 1 S R S R
0 0 0 0 0 0 0 0
0 0 1 0 0 X
0 0 0 1
0 1 0 1
0 1 1 X 0 1 1 0 1 0
1 0 0 1 1 0 0 1 0 1
1 0 1 0
1 1 0 0
1 1 0 1 X 0
1 1 1 X 1 1 1 0
Synchronous Sequential Logic 3.13
The excitation table for SR flipflop is derived from the characteristic table. Table 3.10(a) shows
the characteristic table of SR flipflop and rearrangement of columns is shown in Table 3.10(b).
Table 3.11 presents the excitation table for SR flipflop. It consists of present state (Qn), next state
(Qn + 1) and a column for each input to show how the required transition is achieved. There are 4
possible transitions from present state to next state. The required input conditions for each of the four
transitions are derived from the information available in the characteristic table. The symbol X denotes
the don’t care condition, it does not matter whether the input is 1 or 0.
TABLE 3.11: Excitation Table
Present Next Inputs
State State
Qn Qn + 1 S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
3.11.2 J - K flipflop
Table 3.12(a) represents the characteristic table of JK flipflop and Table 3.12(b) represents the
rearrangement of the characteristic table. The required input conditions for each of the four transitions
are derived from the information available in the characteristic table. The excitation table for JK
fliplop is shown in Table 3.13.
TABLE 3.12 (a) : Characteristic Table TABLE 3.12 (b) : Modified Table
3.11.4 T flipflop
The characteristic table and excitation table for the T flipflop are shown in Table 3.16 and Table
3.17 respectively.
TABLE 3.16: Characteristic Table TABLE 3.17: Excitation Table
Present Input Next State Present Next State Input
State State
Qn T Qn + 1 Qn Qn + 1 T
0 0 0 0 0 0
0 1 1 0 1 1
1 0 1 1 0 1
1 1 0 1 1 0
Synchronous Sequential Logic 3.15
3.12 REALIZATION OF ONE FLIP-FLOP USING OTHER FLIP-FLOPS
It is possible to implement a flip-flop circuit using any other flip-flop. The realization of one
flipflop using other flipflops is implemented by the use of characteristic tables and excitation tables.
The examples are:
D flipflop using SR flipflop
D flipflop using JK flipflop
D flipflop using T flipflop
T flipflop using SR flipflop
T flipflop using JK flipflop
T flipflop using D flipflop
JK flipflop using SR flipflop
JK flipflop using D flipflop
1 0 X 1 1 0
S=D RD
3.16 Digital Principles and System Design
JK JK
Qn 00 01 11 10 Qn 00 01 11 10
0 0 0 1 1 0 X X 0 0
1 X 0 0 X 1 0 1 1 0
S J Qn R = KQn
Synchronous Sequential Logic 3.17
1 1 0
D TQn TQ n
T Qn
3.18 Digital Principles and System Design
D
T D
Flip-Flop Q
D D
Qn 0 1 Qn 0 1
0 0 1 0 X X
1 X X 1 1 0
J=D K= D
Outputs
Next
Inputs Memory
State
Decoder Elements
y = (A + B) x
(a) Draw the logic diagram of the circuit
(b) Tabulate the state table
(c) Draw the state diagram
Solution
Figure 3.23 shows the Mealy synchronous sequential circuit for the given input and output
functions. It consists of two D flip flops A and B, an input x and an output y.
D inputs determine the flipflop’s next state; D = Q(t+1).
Therefore the next-state equations are:
A(t+1) = A(t) x(t) + B(t) x(t)
B(t+1) = B t A t x t
The LHS of equation denotes the next state of the flip flop and the RHS of equation is a Boolean
expression that specifies the present state and input conditions that make the next state equal to 1.
State Table
The state table of the circuit of the circuit is obtained by the following procedure
A circuit with ‘m’ flip flops and ‘n’ inputs needs 2m+n rows in the state table. In this example, m
= 2, n = 1 and 2m+n = 23 = 8 rows are needed. Eight binary combinations from 000 to 111 are
listed under the present state and input columns.
The next state section has m(2) columns, one for each flip flop. The binary values for the next
state are derived directly from the state equations. The next state of flip flop A must satisfy the
state equation, A(t + 1) = Ax + Bx
The next state of flip flop B must satisfy the state equation, B(t + 1) = A x
The output section has as many columns as there are output variables. This example has one
output (y). Therefore one column is needed. Its binary value is derived from the circuit or from
the output equation, y A B x
The state table is given in Table 3.22.
Table 3.22: State Table
Present Input Next State Output
State
A B x A(t+1) = Ax + Bx B(t+1) = A x Y = (A + B) x
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 0 0 1
0 1 1 1 1 0
1 0 0 0 0 1
1 0 1 1 0 0
1 1 0 0 0 1
1 1 1 1 0 0
Synchronous Sequential Logic 3.23
The above state is slightly changed with only three sections: present state, next state and output.
The input conditions are enumerated under the next state and output sections. The state table of Table
3.22 is repeated in Table 3.23 using the second form.
Table 3.23: Second form of the state table
Present Next state Output
state
x=0 x=1 x=0 x=1
A B
A B A B y Y
0 0 0 0 0 1 0 0
0 1 0 0 1 1 1 0
1 0 0 0 1 0 1 0
1 1 0 0 1 0 1 0
State Diagram
The state diagram provides the same information as the state table and is obtained directly from
table 3.23. The binary number inside each circle identifies the state of the flip-flops. The directed
lines are labelled with two binary numbers separated by a slash. The input value during the present
state is labelled first and the number after slash gives the output during the present state. For example,
the directed line from state 00 to 01 is labelled 1/0, meaning that when the sequential circuit is in the
present state 00 and the input is 1, the output is 0. A directed line connecting a circle with itself
indicates that no change of state occurs. The state diagram is shown in Figure 3.24.
3.24 Digital Principles and System Design
Example 3.2
Analyze the synchronous Mealy machine in Figure 3.25 in obtain its state diagram.
Solution
The given synchronous Mealy machine consists of two D flip flops, one input and one output.
The flip flop input functions are,
D A Y Y x
D B X Y Y
The circuit output function is,
Z Y Y X
State Equations
Y t YY x
Y t x YY
Synchronous Sequential Logic 3.25
State Table
Table 3.24 : State Table
Present state Input Next State Output
y1 y2 x Y1 t +1 =Y 1Y2 X Y2 t +1 = x+ y1 y2 Z = Y1Y2 x
0 0 0 0 0 0
0 0 1 0 1 0
0 1 0 1 1 0
0 1 1 0 1 0
1 0 0 0 0 0
1 0 1 0 1 0
1 1 0 0 0 0
1 1 1 0 1 1
Table 3.25 : Second form of the state table
Present state Next state Output
x=0 x=1 x=0 x=1
Y1 Y2 Y1 Y2 Y1 Y2 Z Z
0 0 0 0 0 1 0 0
0 1 1 1 0 1 0 0
1 0 0 0 0 1 0 0
1 1 0 0 0 1 0 1
State Diagram
Q J K Qn+1
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 1
1 1 1 0
Here, Q = A or B and Qn+1 = A(t+1) or B(t+1)
Table 3.27 : State Table
Present Input Flip flop Inputs Next state
state
A B x JA = B KA = B x JB = x KB = A x A(t+1) B(t+1)
0 0 0 0 0 1 0 0 1
0 0 1 0 0 0 1 0 0
0 1 0 1 1 1 0 1 1
0 1 1 1 0 0 1 1 0
1 0 0 0 0 1 1 1 1
1 0 1 0 0 0 0 1 0
1 1 0 1 1 1 1 0 0
1 1 1 1 0 0 0 1 1
Table 3.28 : Second form of the State table
Present State Next State
x=0 x=1
A B A B A B
0 0 0 1 0 0
0 1 1 1 1 0
1 0 1 1 1 0
1 1 0 0 1 1
3.28 Digital Principles and System Design
State Diagram
The state diagram of the Moore Model sequential circuit is shown in Figure 3.28. Since the
circuit has no outputs, the directed lines out of the circles are marked with one binary number only to
designate the value of input x.
B B+x
JA A
x
A
x A x
1 KA Y
B
A A+ x B
JB
x B
B
1 KB
CLK
Fig. 3.29 : Sequential Circuit
Example 3.5
Analyze the synchronous Moore machine shown in Figure 3.31 to obtain its state diagram.
Solution: Using the assigned variable Y1 and Y2 for the two JK flip flops, we can write the four
excitation input equations and the single Moore output equation as follows:
JA = Y2x ; KA = Y ; JB = x
KB = x ; Z = y y
State Table:
To obtain the next-state values of a sequential circuit with J-K flip flops, use the JK flip flop
characteristic table given in Table 3.31.
Table 3.31: State Table
Present Input Flip Flop inputs Next State Output
State
y1 y2 x JA = Y2x KA = y JB = x KB= x Y1 (t+1) Y2(t+1) Z = y1 y2
0 0 0 0 1 0 1 0 0 0
0 0 1 0 1 1 0 0 1 0
0 1 0 0 0 0 1 0 0 0
0 1 1 1 0 1 0 1 1 0
1 0 0 0 1 0 1 0 0 1
1 0 1 0 1 1 0 0 1 1
1 1 0 0 0 0 1 1 0 1
1 1 1 1 0 1 0 1 1 1
Synchronous Sequential Logic 3.31
Table 3.32 : Second form of state table
Present state Next state Output
x=0 x=1 x=0 x=1
y1 y2 y1 y2 y1 y2 Z Z
0 0 0 0 0 1 0 0
0 1 0 0 1 1 0 0
1 0 0 0 0 1 1 1
1 1 1 0 1 1 1 1
The type of flip flop to be used may be included in the design specifications or may depend on
what is available to the designer. Many digital systems are constructed with JK flip flops because they
are the most versatile available. The selection of flip flops is given as follows:
Flip Flop Application
JK General Applications
D Applications requiring transfer of data
(Ex: Shift Registers)
T Applications involving complementation
(Ex: Binary Counters)
Bx Bx
A 00 01 11 10 A 00 01 11 10
0 1 0 X X X X
1 X, X X X 1 1
J A Bx KA = Bx
3.38 Digital Principles and System Design
Bx Bx
00 01 11 10 00 01 11 10
A A
0 1 X X 0 X X 1
1 1 X X 1 X X 1
JB = x KB = Ax + A x A x
Logic diagram
Bx
JA A
x
A
Bx A
KA
x
JB B
AX B
B
KB
CLK
Step 3: K map simplification for flip flop input functions and circuit output function
Expression for DA
Bx
00 01 11 10
A
0 1
1 1 1 1
D A A B B x
Expression for DB
Bx
00 01 11 10
A
0 1 1
1 1 1
DB Ax B x AB x
Expression for y
Bx
00 01 11 10
A
0 1
1 1
Y Bx
Step 4: Logic Diagram
The simplified functions are:
D A AB Bx
D B A x Bx A B x
Y Bx
The logic diagram of sequential circuit with D flip flops is shown in Figure 3.40
Synchronous Sequential Logic 3.41
AB
DA Q A
x A
Bx
Q A
Ax
DB Q B
Bx
B
Q
ABx
CLK
Bx
A
Fig. 3.40 : Logic diagram with D flip flops
B B
0 1 0 1
A A
0 0 1 0 1 0
1 1 0 1 0 1
T A AB A B A B T B A B A B A B
Synchronous Sequential Logic 3.43
Expression for Y
B
0 1
A
0 1 1
1 0 0
Y A
AB
A
TA
A
Y
TB B
AB
B
B
CLK
(a) With decision symbol (b) With decision and conditional output symbol
Fig. 3.47: ASM Blocks
Fig. 3.48: Standard State diagram notation for the ASM block in Fig. 3.47(b)
Each block in the ASM chart describes the state of the system during one clock pulse interval. The
operations within the state and conditional boxes in Figure 3.49 are executed with a common clock
pulse while the system is in state T1. The same clock pusle also transfers the system controller to one
of the next states, T2, T3 or T4 as dictated by the binary values of E and F. The equivalent state diagram
is shown in Figure 3.50.
3.46 Digital Principles and System Design
Data shifting techniques and methods for constructing the four different types of registers are
discussed in the following sections.
Figure 3.52 illustrates entry of the four bits 1010 into the register, beginning with the right most
bit. The register is initially clear. The 0 is put onto the data input line, making D = 0 for FF0. When the
first clock pulse is applied, FF0 is reset, thus storing the 0.
Next the second bit, which is a 1, is applied to the data input, making D = 1 for FF0 and D = 0 for
FF1 because the D input of FF1 is connected to the Q0 output. When the second clock pulse occurs,
the 1 on the data input is shifted into FF0, causing FF0 to set; and the 0 that was in FF0 is shifted into
FF1.
3.48 Digital Principles and System Design
The third bit, a 0 is now put onto the data-input line, and a clock pulse is applied. The 0 is entered
into FF0, the 1 stored in FF0 is shifted into FF1, and the 0 stored in FF1 is shifted into FF2.
FF0 FF1 FF2 FF3
Data 0 0 0 0 Data
input D0 Q0 D1 Q1 D2 Q2 D3 Q3 output
1 2 3 4
CLK
CLK 1
CLK 2
rd
FF0 FF1 FF2 FF3
3 data 0 1 0 0
bit = 0 D0 Q0 D1 Q1 D2 Q2 D3 Q3
1 2 3 4 After CLK 3
CLK 3
th
FF0 FF1 FF2 FF3
4 data 1 0 1 0
bit = 1 D0 Q0 D1 Q1 D2 Q2 D3 Q3
1 2 3 4 After CLK 4,
the 4-bit
number is completely
stored in register
CLK 4
Fig. 3.53: Four bits (1010) being entered serially into the register
The last bit, a 1, is now applied to the data input, and a clock pulse is applied. This time the 1 is
entered into FF0, the 0 stored in FF0 is shifted into FF1, the 1 stored in FF1 is shifted into FF2, and
the 0 stored in FF2 is shifted into FF3. This completes the serial entry of the four bits into the shift
register, where they can be stored for any length of time as long as the flip-flops have dc power.
Synchronous Sequential Logic 3.49
To get the data out of the register, the bits must be shifted out serially and taken off the Q3 output
as Figure 3.54 illustrates. After CLK4 in the data-entry operations just described, the right-most bit 0,
appears on the Q3 output. When clock-pulse CLK5 is applied the second bit appears on the Q3 output.
Clock pulse CLK6 shifts the third bit to be output, and CLK7 shifts the fourth bit to the output. Notice
that while the original four bits are being shifted out, more bits can be shifted in. All zeros are shown
being shifted in.
FF0 FF1 FF2 FF3
Data 1 0 1
input Q0 Q1 Q2 Q3 0 1st data bit
D0 D1 D2 D3
1 2 3 4
After CLK 4
register contains
1010
CLK
Fig. 3.54 : Four bits (1010) being serially-shifted out of the register and replaced by all zeros.
3.22.3 Serial In Parallel Out shift Register
In this shift register, data bits are entered into the register in the same as serial-in serial-out shift
register. But the output is taken in parallel. Once the data are stored, each bit appears on its respective
output line and all bits are available simultaneously instead of on a bit-by-bit.
3.50 Digital Principles and System Design
Fig. 3.55: Four Bits 1111 being serially entered into shift-right register
Synchronous Sequential Logic 3.51
When SHIFT/ L O A D is high, gates G1, G2, G3 are disabled and gates G4, G5, G6 are enabled.
This allows the data bits to shift left from one stage to the next. The OR gates at the D-inputs of the
flip-flops allow either the parallel data entry operation or shift operation, depending on which AND
gates are enabled by the level on the SHIFT/ L O A D input.
parallel in parallel out register, there is simultaneous entry of all data bits and the bits appear on
parallel outputs simultaneously. Figure 3.58 shows this type of register.
Parallel data inputs
X0 X1 X2 X3
FF0 FF1 FF2 FF3
Serial
data D0 Q0 D1 Q1 D2 Q2 D3 Q3
input
1 2 3 4
Q3
CLK
Q0 Q1 Q2 Q3
Parallel outputs
Q3 Q2 Q1 Q0
FF3 FF2 FF1 FF0
Clear Q Q Q Q
D D D D
CLK
S1 MUX MUX MUX MUX
S0 3 2 1 0 3 2 1 0 3 2 1 0 3 2 1 0
Serial Input Serial Input
for shift-right for shift-left
I3 I2 I1 I0
Parallel inputs
Bi-direction Shift Register: When mode control M = 1, the AND gates G1 through G4 are enabled
and the data at D8 is shifted to the right when the clock pulses are applied, and thus it acts as a shift-
right register. When M = 0, the AND gates G5 through G8 are enabled allowing the data at D1 to be
shifted to the left, and thus it acts as a shift- left register. M should be changed only when CLK = 0,
otherwise the data stored in the register may be altered. The 4-bit bi-directional shift register is shown
in Figure 3.60.
Shift-right
serial input
fmax . M H z.
t p
Counters can also be designed to have a number of States in their sequence that is less than the
maximum of 2n. The resulting sequence is called a truncated sequence.
One common modulus for counters with truncated sequences is ten, called MOD 10.
n N
n = 4 = Number of flipflops
Counters with 10 states in their sequence are called decade counters. A decade counter with a
count sequence of zero (0000) through nine (1001) is a BCD decade counter. It must recycle back to
0000 state after the 1001 state. To make the counter recycle after the count of nine (1001) is to decode
count ten (1010) with a NAND gate and connect the output (0) of the NAND gate to the clear (CLR)
inputs of the flipflops as shown in Figure 3.68. The timing diagram of decade counter is shown in
Figure 3.69.
In this counter the clock signal is connected in parallel to clock inputs of both the flipflops FF0
and FF1. The output of FF0 (Q0) is connected to J1 and K1 inputs of the second flipflop FF1. Assume
that the counter is initially in the binary 0 states i.e., both flipflops are RESET. When positive edge of
the first clock pulse is applied, FF0 will toggle because J0 = K0 = 1, whereas FF1 output will remains
zero because J1 = K1 = 0. After first clock pulse Q0 = 1 and Q1 = 0.
When the leading edge of CLK 2 occurs, FF0 will toggle and Q0 will go Low. Since FF1 has a
HIGH (Q0 = 1) on its J1 and K1 inputs at the triggering edge of this clock pulse, the flipflop toggles and
Q1 goes HIGH. Thus after CLK2, Q0=0 and Q1=1.
When the positive edge of CLK3 occurs, FF0 again toggles to the SET state (Q0=1) and FF1
remains SET (Q1=0) because its J1 and K1 inputs and both LOW (Q0 = 0). After this triggering edge,
Q0 = 1 and Q1 = 1.
Finally, at the positive edge of CLK4, Q0 and Q1 go LOW because they both have a toggle condition
on their J and K inputs. i.e., Q0 = Q1 = 0. The counter has now recycled to its original state.
Figure 3.70 shows a 2 bit synchronous binary counter and Figure 3.71 shows the timing diagram
for the counter.
3.60 Digital Principles and System Design
High
FF0 FF1 Q1 FF2
Q0
J0 J1 J2 Q2
1 2 3
K0 K1 K2
CLK
CLOCK Pulse Q2 Q1 Q0
Initially 0 0 0
1 0 0 1
2 0 1 0
3 0 1 1
4 1 0 0
5 1 0 1
6 1 1 0
7 1 1 1
8 (recycles) 0 0 0
Fig. 3.73: Timing Diagram
3.62 Digital Principles and System Design
Q2 changes state both times, it is preceded by the unique condition in which both Q0 and Q1 are
HIGH. This condition is detected by the AND gate and applied to the J2 and K2 inputs of FF2. Whenever
Q0 = Q1 = 1, the output of the AND gate makes the J2 = K2 = 1 and FF2 toggles on the following clock
pulse. Otherwise the J2 and K2 inputs of FF2 are held LOW by the AND gate input and FF2 does not
change state.
High
FF0 FF1 FF2 FF3
J0 Q0 J1 Q1 J2 Q2 J3 Q3
1 2 3 4
K0 K1 K2 K3
CLK
J K
J K Q Q
J K Q Q
J K QQQ QQ
High
FF0 FF1 FF2 FF3
J0 Q0 J1 J2 J3
Q1 Q2 Q3
1 2 3 4
Q3
K0 K1 K2 K3
CLK
When UP/DOWN = 1, it will enable AND gates 1 and 3 and disable AND gates 2 and 4. This
allows the Q0 and Q1 outputs through the AND gates to the J and K inputs of the following flipflops,
so that the counter counts up as pulses are applied. When UP/DOWN = 0, the reverse action takes
place.
J K Q U P Q D O W N
J K Q Q U P Q Q D O W N
UP
Q1 UP
1
High 3
FF0 FF1 FF2
J0 J1 J2 Q2
Q0 Q1
UP/DOWN 1 2 3
Q0 Q1
K0 K1 K2 Q2
DOWN 2 4
Q0 DOWN
CLK
Fig. 3.78: 3 Bit (MOD 8) UP/DOWN Synchronous Counter
3.25 MODULUS-N-COUNTERS
The counter with ‘n’ flipflops has maximum MOD number 2n. Find the number of flipflops (n)
required for the desired MOD number (N) using the equation,
n N
(i) For example, a 3 bit binary counter is a MOD 8 counter. The basic counter can be modified to
produce MOD numbers less than 2n by allowing the counter to skin those are normally part of counting
sequence.
n=3
N=8
2n = 23 = 8 = N
(ii) MOD 5 Counter:
2n = N
2n = 5
22 = 4 less than N.
23 = 8 > N (5)
3 flipflops are required.
Synchronous Sequential Logic 3.65
(iii) MOD 10 Counter:
n N
, l e s s t h a n N ;
N .
For example, MOD-10 counter reaches state 10 (1010). i.e., QQ QQ The outputs Q
and Q are connected to the NAND gate and the output of NAND gate goes LOW and resetting all
flipflops to zero. Therefore MOD-10 counter counts from 0000 to 1001 and then recycles to the zero
value. The MOD-10 counter circuit is shown in Figure 3.79.
High
FF0 FF1 FF2 FF3
J0 J1 J2 J3
Q0 Q1 Q2 Q3
CLK 1 2 3 4
K0 K1 K2 K3
CLR
1 2 3 4
Q0 Q1 Q2
FF0 FF1 FF2 FF3 Q3
D0 Q D1 Q D2 Q D3 Q
CLK 1 2 3 4
J QQ K QQ
For J1 For K1
Q1Q0 Q1 Q0
Q2 00 01 11 10 Q2 00 01 11 10
0 0 1 X X 0 X X 1 0
1 0 1 X X 1 X X 1 0
J Q K Q
3.70 Digital Principles and System Design
For J0 For K0
Q1Q0 Q1Q0
Q2 00 01 11 10 Q2 00 01 11 10
0 1 X X 1 0 X 1 1 X
1 0 X X 1 1 X 1 1 X
J Q K Q
Step 5: Circuit Diagram
J K
J Q K Q
J QQ K QQ
Example 3.11: Design a MOD-10 synchronous counter using JK flipflops. Write excitation table and
state table.
Solution n N
n ; 4 flipflops are required.
Step 1: State Diagram
Synchronous Sequential Logic 3.71
Step 2: State Table
Present State Next State
a b
b c
c d
d e
e f
f g
g h
h i
i j
j a
Step 3: Transition Table
Present State Next State
q3 q2 q1 q0 Q3 Q2 Q1 Q0
0 0 0 0 0 0 0 1
0 0 0 1 0 0 1 0
0 0 1 0 0 0 1 1
0 0 1 1 0 1 0 0
0 1 0 0 0 1 0 1
0 1 0 1 0 1 1 0
0 1 1 0 0 1 1 1
0 1 1 1 1 0 0 0
1 0 0 0 1 0 0 1
1 0 0 1 0 0 0 0
Step 4: Excitation Table
Present State Next State Excitation Inputs
q3 q2 q1 q0 Q3 Q 2 Q1 Q0 J3 K3 J2 K2 J1 K1 J0 K0
0 0 0 0 0 0 0 1 0 X 0 X 0 X 1 X
0 0 0 1 0 0 1 0 0 X 0 X 1 X X 1
0 0 1 0 0 0 1 1 0 X 0 X X 0 1 X
0 0 1 1 0 1 0 0 0 X 1 X X 1 X 1
0 1 0 0 0 1 0 1 0 X X 0 0 X 1 X
0 1 0 1 0 1 1 0 0 X X 0 1 X X 1
0 1 1 0 0 1 1 1 0 X X 0 X 0 1 X
0 1 1 1 1 0 0 0 1 X X 1 X 1 X 1
1 0 0 0 1 0 0 1 X 0 0 X 0 X 1 X
1 0 0 1 0 0 0 0 X 1 0 X 0 X X 1
3.72 Digital Principles and System Design
q1q0 q1q0
q3q2 00 01 11 10 q3q2 00 01 11 10
00 0 0 0 0 00 X X X X
01 0 0 1 0 01 X X X X
11 X X X X 11 X X X X
10 X X X X 10 0 1 X X
J q qq K q
For J2 For K2
q1q0 q1q0
q3q2 00 01 11 10 q3q2 00 01 11 10
00 0 0 1 0 00 X X X X
01 X X X X 01 0 0 1 0
11 X X X X 11 X X X X
10 0 0 X X 10 X X X X
J qq K qq
For J1 For K1
q1q0
q1q0
q3q2 00 01 11 10 q3q2 00 01 11 10
00 0 1 X X 00 X X 1 0
01 0 1 X X 01 X X 1 0
11 X X X X 11 X X X X
10 0 0 X X 10 X X X X
J q q K q
Synchronous Sequential Logic 3.73
For J0 For K0
q1q0 q1q0
q3q2 00 01 11 10 q3q2 00 01 11 10
00 1 X X 1 00 X 1 1 X
01 1 X X 1 01 X 1 1 X
11 X X X X 11 X X X X
10 1 X X X 10 X 1 X X
J K
Step 6: Circuit Diagram J K
J qq K q
J qq K qq
J q qq K q
High
FF0 FF1 FF2 FF3
J0 Q0 J1 Q1 J2 Q2 J3 Q3
1 2 3 4
K0 K1 K2 K3 Q3
CLK
Q0 Q1 Q2 Q3
Example 3.12: Design a synchronous 3-bit gray code up counter with the help of excitation table.
Solution: Gray code sequence: 000, 001, 011, 010, 110, 111, 101, 100.
Step 1: State Diagram
Fig. 3.86
3.74 Digital Principles and System Design
Q0 Q0 Q0
Q2Q1 0 1 Q2Q1 0 1 Q2Q1 0 1
00 0 0 00 X X 00 0 1
01 1 0 01 X X 01 X X
11 X X 11 0 0 11 X X
10 X X 10 1 0 10 0 0
J2 = Q1 Q K2 = Q Q J1 = Q Q0
Q0 Q0 Q0
Q2Q1 0 1 Q2Q1 0 1 Q2Q1 0 1
00 X X 00 1 X 00 X 0
01 0 0 01 X 0 01 1 X
11 0 1 11 1 X 11 X 0
10 X X 10 X 0 10 1 X
K QQ J Q Q Q Q K QQ Q Q
Q Q = Q Q
Step 5: Circuit Diagram
J Q Q K Q Q
J Q Q K QQ
J Q Q K Q Q
K0 Q0 K1 Q1 K2 Q2
CLK
Fig. 3.87 : 3 bit Gray code up counter
3.76 Digital Principles and System Design
Fig. 3.88
For J2 For K2
Q1Q0 Q1Q0
CQ2 00 01 11 10 CQ2 00 01 11 10
00 1 0 0 0 00 X X X X
01 X X X X 01 1 0 0 0
11 X X X X 11 0 0 1 0
10 0 0 1 0 10 X X X X
For J1 For K1
Q1Q0
Q1Q0
CQ2 00 01 11 10 CQ2 00 01 11 10
00 1 0 X X 00 X X 0 1
01 1 0 X X 01 X X 0 1
11 0 1 X X 11 X X 1 0
10 0 1 X X 10 X X 1 0
J C Q C Q K C Q C Q
For J0 For K0
Q1Q0 Q1Q0
CQ2 00 01 11 10 CQ2 00 01 11 10
00 1 X X 1 00 X 1 1 X
01 1 X X 1 01 X 1 1 X
11 1 X X 1 11 X 1 1 X
10 1 X X 1 10 X 1 1 X
J K
Step 5: Circuit Diagram
C =U P / D O W N
J K
J C Q C Q K C Q C Q
J C QQ C Q Q K C QQ C Q Q
1 2 3
K0 Q0 K1 Q1 K2 Q2
CLK
Fig. 3.90
Step 2: State Table
Present State Next State
3 0
2 3
1 2
0 1
Step 3: Transition Table
Present State Next State
Q1 Q0 Q1 Q0
1 1 0 0
1 0 1 1
0 1 1 0
0 0 0 1
Step 4: Excitation Table
Excitation Table for Excitation Table for
T flipflop down counter
Q(t) Q(t + 1) T Present State Next State Excitation Inputs
0 0 0 Q1 Q0 Q1 Q0 T1 T0
0 1 1 1 1 0 0 1 1
1 0 1 0 1 1 0 1 1
1 1 0 0 0 0 1 0 1
3.80 Digital Principles and System Design
T Q T0 = 1
Step 6: Circuit Diagram
Example 3.15: Design a synchronous counter using JK flip-flops to count the following sequence:
“1- 3 - 15 - 5 - 8 - 2 - 0 - 12 - 6 - 9”.
1111
0110
1100 0101
0000 1000
0010
Synchronous Sequential Logic 3.81
Q1Q0 Q1Q0
Q3Q2 00 01 11 10 Q3Q2 00 01 11 10
00 X X X X 00 X 0 0 X
01 X X X X 01 X 1 X X
11 1 X 1 X 11 X X 0 X
10 1 1 X X 10 X 0 X X
J Q K Q Q
Synchronous Sequential Logic 3.83
Step 5: Circuit Diagram
J0 Q0 J1 Q1 J2 Q2 J3 Q3
K0 Q0 K1 Q1 K2 Q2 K3 Q3
CLK
3.84 Digital Principles and System Design
Example 3.16: Using D flip flops design a synchronous counter which counts in the sequence, 000,
001, 010, 011, 100, 101, 110, 111, 000.
Solution:
Step 1: State Diagram
000 001
111 010
110 011
101
100
Q1Q0 Q1Q0
Q2 00 01 11 10 Q2 00 01 11 10
0 0 0 1 0 0 0 1 0 1
1 1 1 0 1 1 0 1 0 1
D2 Q2 Q1 Q2 Q0 D1 Q1Q0 Q1 Q0
Q1 Q0
For D0
Q1Q0
Q2 00 01 11 10
0 1 0 0 1
D0 Q0
1 1 0 0 1
3.86 Digital Principles and System Design
D0 Q0
D1 Q1 Q 0
D2 Q2 Q1 Q2 Q0
Q2 Q0
D0 Q0 D1 Q1 D2 Q2
Q1 Q0
1 2 3
Q0 Q1 Q2
Q 2 Q1
CLK
Example 3.17: Using RS-FFs design a parallel counter which counts in the sequence.
Q Q(t+1) S R S R Q Q’
0 0 0 X 0 0 N C
0 1 1 0 0 1 0 1
1 0 0 1 1 0 1 0
1 1 X 0 1 1 Indeterminate
Step 1: State Diagram
000
010
111
001
101
110
Step 3: K-Map
S1 R1
BC BC
A 00 01 11 10 A 00 01 11 10
0 1 X 0 X X X
1 X X X 1 X 1
BC BC
A 00 01 11 10 A 00 01 11 10
0 1 1 X 0 X 1
1 X 1 1 X 1 1
S2 B' R2 B
S3 R3
BC BC
A 00 01 11 10 A 00 01 11 10
0 1 X 0 1 X X
1 X X 1 1 X 1
A
S1
B’C’
A’
R1
AB
B
S2
B’
R2
C
S3
C’
R3
CLK
J0 Q0 1 J1 Q1 3 J2 Q2 5 J3 Q3
CLK
K0 Q0 K1 Q1 K2 Q2 K3 Q3
2 4 6
CDOWN
control inputs. When the CUP line is held at 1 while the CDOWN line is at 0, the lower AND gates (2, 4
and 6) will be disabled and their outputs are zero. So, it will have no effect on the outputs of OR gates.
Also, the upper AND gates (1, 3 and 5) will be enabled, i.e., it will allow QA to pass through the OR
gate and into the clock input of the B flip-flop. Similarly, the QB and QC output will be gated into the
clock input of flip-flops C and D respectively. Thus, as input pulses are applied, the counter will count
up and follow a natural binary counting sequence from 0000 to 1111.
With CUP = 0, CDOWN = 1, the upper AND gates (1, 3 and 5) are disabled and the lower AND gates
(2, 4 and 6) are enabled, allowing Q ,Q and Q , to pass through to the clock inputs of the following
flip-flops. Thus, for this condition, the counter will count down as input pulses are applied.
When the control inputs are both 0 or 1, the counter will not count up or count down because the
clock inputs of B, C and D will be held constant at either 0 or 1. The flip-flop (FF0) will keep toggling
because it is always being clocked. These conditions are not normally used.
TABLE 3.52 : Truth Table of 4-bit up-down counter
COUNT-UP Mode COUNT-DOWN Mode
States QD QC QB QA States QD QC QB QA
0 0 0 0 0 15 1 1 1 1
1 0 0 0 1 14 1 1 1 0
2 0 0 1 0 13 1 1 0 1
3 0 0 1 1 12 1 1 0 0
4 0 1 0 0 11 1 0 1 1
5 0 1 0 1 10 1 0 1 0
6 0 1 1 0 9 1 0 0 1
7 0 1 1 1 8 1 0 0 0
8 1 0 0 0 7 0 1 1 1
9 1 0 0 1 6 0 1 1 0
10 1 0 1 0 5 0 1 0 1
11 1 0 1 1 4 0 1 0 0
12 1 1 0 0 3 0 0 1 1
13 1 1 0 1 2 0 0 1 0
14 1 1 1 0 1 0 0 0 1
15 1 1 1 1 0 0 0 0 0
0 0 0 0 0 15 1 1 1 1
Synchronous Sequential Logic 3.91
3.29 HDL FOR SEQUENTIAL LOGIC CIRCUITS
3.29.1 S-R Latch
S-R latch using NOR gates is one of the sequential logic circuit. Two NOR gates are cross coupled
so that the output of NOR gate 1 is connected to one of the inputs of NOR gate 2 and vice versa. The
latch has two inputs S (set) and R (Reset) and two outputs Q and QN. Figure 3.93 shows the S-R latch
using NOR gates and HDL program for S-R latch is given.
S R Q QN
0 0 Last Q Last QN
0 1 0 1
1 0 1 0
1 1 1 1
library IEEE;
use IEEE . std_logic_1164 . all;
entity srlatch is
port (S, R : in STD_LOGIC;
Q, QN : buffer STD_LOGIC);
end srlatch
3.29.2 D-Latch
Figure 3.94 shows a ‘D’ latch with truth table. The input conditions (00, 11) of SR latch can be
avoided by making them complement of each other. This modified SR latch is known as D-latch. The
control input of a ‘D’ latch labeled as C or CLK or ENABLE (EN). The behavioural program in
VHDL for D latch is given below:
3.92 Digital Principles and System Design
C D Q QN
1 0 0 1
1 1 1 0
0 X last Q last QN
library IEEE;
use IEEE . Std_logic_1164 . all;
entity dlatch is
port (C, D : in STD_LOGIC;
Q, QN : buffer STD_LOGIC);
end dlatch;
3.29.3 D flip-flop
CLK D Q
0 0
1 1
0 X last Q
entity Dff is
port (CLK, CLR, D, PR : in STD_Logic;
Q, QN : out STD_LOGIC);
end Vff;
Right/
Left
Data in G3 G7 G4 G8
G1 G5 G2 G6
D Q3
D D D
Q0 Q1 Q2
3 4
1 2
Q0
CLK
The VHDL program for bi-directional shift register is given. In this program two processes are
used:
current process
nxt process
(i) Current Process:
Process current is used to keep track of the current value of the shifter. It is a process that has a
single WAIT statement and a single signal assignment statement. When the CLK signal has a rising
edge occur, the signal assignment statement is activated and the next calculated value of shifter
(SHIFT_VAL) is written to the signal that holds the current state of the shift register (DOUT).
(ii) nxt Process:
Process nxt is used to calculate the next value of SHIFT_VAL to be written into DOUT. LOAD is
the highest priority input and if equal to ‘1’ causes SHIFT_VAL to receive the value of DIN. Otherwise,
signal LEFT_RIGHT is tested to see of the shift register is shifting left or right.
library IEEE;
use IEEE . Std_logic_1164 . all;
package SHIFT_TYPES is
subtype BIT 4 is STD_LOGIC_VECTOR (3 downto 0);
end SHIFT_TYPES;
Synchronous Sequential Logic 3.95
use WORK . shift_types.all;
library IEEE;
use IEEE . Std_logic_1164.all;
entity shifter is
port (DIN : in BIT 4;
CLK, LOAD, LEFT_RIGHT : in STD_LOGIC;
DOUT : inout BIT 4);
end shifter;
CURRENT : Process
begin
wait until CLK’ event and CLK = ‘1’;
DOUT < = SHIFT_VAL;
end process;
end Synth;
3.96 Digital Principles and System Design
3.29.5 COUNTERSS
The most popular MSI counter is the 74163, a synchronous 4-bit binary counter. A logic symbol
is shown in Figure 3.97 and the logic diagram is shown in Figure 3.98.
This counter can be synchronously present to any 4-bit binary number by applying the proper
levels to the parallel dat ainputs. When a LOW is applied to the LOAD input, the counter will assume
the state of the data inputs on the next clock pulse. Thus, the counter sequence can be started with any
4-bit binary number. The state table for this counter is given in Table 3.53.
Also, there is an active_LOW clear input (CLR), which synchronously resets all flip-flops in the
counter. There are two enable inputs, ENP and ENT. These inputs must be HIGH for the counter to
sequence through its binary states. When at least one input is LOW, the counter is disabled. The ripple
clock output (RCO) goes HIGH, when the counter reaches a terminal count of 15 (TC = 15).
Inputs
A B C D
CLR
LOAD
74163 TC = 15 RCO
ENT
ENP
CLK
QA QB QC QD
Outputs
Each D input is driven by a 2-input multiplexer consisting of an OR gate and two AND gates. The
multiplexer output is 0 if the CLR input is asserted. Otherwise the top AND gate passes the data input
(A, B, C or D) to the output if LOAD is asserted. If neither CLR nor LOAD is asserted, the bottom
AND gate passes the output of an XNOR gate to the multiplexer output.
The XNOR gates perform the counting function. One input of each XNOR is the corresponding
count bit (QA, QB, QC or QD); the other input is ‘1’, which complements the count bit, if and only if
both enables ENP and ENT are asserted and all of the lower-order count bits are 1. The ripple carry
out (RCO) signals indicates a carry from the msb position and is 1 when all of the count bits are 1 and
ENT is asserted.
Synchronous Sequential Logic 3.99
The VHDL program for 4-bit synchronous binary counter is given below. this program uses the
IEEE.Std_logic_arith.all library, which includes the UNSIGNED type. This library includes
definitions of ‘+’ and ‘’ operators that perform unsigned addition and subtraction on UNSIGNED
operands. In this program an internal signal IQ to hold the counter value.
library IEEE;
use IEEE . Std_logic_1164 . all;
use IEEE . Std_logic_arith . all;
entity counter is
port (CLK CLR_L, LOAD_, ENP, ENT : in STD_LOGIC;
D : in UNSIGNED (3 downto 0);
Q : out UNSIGNED (3 downto 0);
RCO : out STD_LOGIC);
end counter;
When both the inputs K and J are low the output does not change
When both the inputs K and J are high it is possible to set or reset the Flip-flop (ie) the output
toggle on the next positive clock edge.
8. What is the operation of T flip-flop?
T flip-flop is also known as Toggle flip-flop.
When T=0 there is no change in the output.
When T=1 the output switch to the complement state (ie) the output toggles.
9. Define race around condition.
In JK flip-flop output is fed back to the input. Therefore change in the output results change in
the input. Due to this in the positive half of the clock pulse if both J and K are high then output
toggles continuously. This condition is called race around condition’.
10. What is edge-triggered flip-flop?
The problem of race around condition can solved by edge triggering flip flop. The term edge
triggering means that the flip-flop changes state either at the positive edge or negative edge of
the clock pulse and it is sensitive to its inputs only at this transition of the clock.
11. What is a master-slave flip-flop?
A master-slave flip-flop consists of two flip-flops where one circuit serves as a master and the
other as a slave.
12. Explain the flip-flop excitation tables for RS FF.
In RS flip-flop there are four possible transitions from the present state to the next state.
They are,
_0_0 transition: This can happen either when R=S=0 or when R=1 and S=0.
_0_1 transition: This can happen only when S=1 and R=0.
_1_0 transition: This can happen only when S=0 and R=1.
_1_1 transition: This can happen either when S=1 and R=0 or S=0 and R=0.
13. Explain the flip-flop excitation tables for JK flip-flop
In JK flip-flop also there are four possible transitions from present state to next state. They are,
_0_0 transition: This can happen when J=0 and K=1 or K=0.
_0_1 transition: This can happen either when J=1 and K=0 or when J=K=1.
3.102 Digital Principles and System Design
_1_0 transition: This can happen either when J=0 and K=1 or when J=K=1.
_1_1 transition: This can happen when K=0 and J=0 or J=1.
14. Explain the flip-flop excitation tables for D flip-flop
In D flip-flop the next state is always equal to the D input and it is independent of the present
state. Therefore D must be 0 if Qn+1 has to 0, and if Qn+1 has to be 1 regardless the value of
Qn.
15. Explain the flip-flop excitation tables for T flip-flop
When input T=1 the state of the flip-flop is complemented; when T=0, the state of the Flip-flop
remains unchanged. Therefore, for 0_0 and 1_1 transitions T must be 0 and for 0_1 and 1_0
transitions must be 1.
16. Define sequential circuit?
In sequential circuits the output variables dependent not only on the present input variables but
they also depend up on the past history of these input variables.
17. Give the comparison between combinational circuits and sequential circuits.
Combinational circuits Sequential circuits Memory unit is not required Memory unity is
required. Parallel adder is a combinational circuit Serial adder is a sequential circuit
18. What do you mean by present state?
The information stored in the memory elements at any given time defines the present state of the
sequential circuit.
19. What do you mean by next state?
The present state and the external inputs determine the outputs and the next state of the
sequential circuit.
20. State the types of sequential circuits?
1. Synchronous sequential circuits
2. Asynchronous sequential circuits
21. Define synchronous sequential circuit
In synchronous sequential circuits, signals can affect the memory elements only at discrete
instant of time.
Synchronous Sequential Logic 3.103
MCQ QUESTIONS
1. An SR-latch is created using only two NOR gates with S and R inputs feeding one NOR gate
each. If both S and R inputs are set to one, the outputs will be
a. Q and Q' both 1
b. No change in circuit output
c. Q and Q' both 0
d. Q and Q' complementary to each other
Answer: c. Q and Q' both 0
2. You are having a D flip-flop, which you want to use as a J-K flip-flop. The input of the D flip-
flop in terms of external inputs J and K can be written as (Consider Qn is the output of the D
flip-flop)
a. D = JQn + KQn
b. D = J’Qn + K’Qn
c. D = JQ’n + K’Qn
d. D = JQ’n + KQ’n
Answer: c. D = JQ’n + K’Qn
3. You are having a D flip-flop, which you want to use as a S-R flip-flop. The input of the D flip-
flop in terms of external inputs S and R can be written as (Consider Qn is the output of the D
flip-flop)
a. D = S + RQn
b. D = S + R’Qn
c. D = S’ + RQn
d. D = S’ + R’Qn
Answer: b. D = S + R’Qn
Synchronous Sequential Logic 3.103
5. The logic function depicting the behavior of the complementary output of T flip-flop is given
by
a. Q’ = T XOR Q
b. Q’ = T XNOR Q
c. Q’ = T OR Q
d. Q’ = T NOR Q
Answer: b. Q’ = T XNOR Q
8. How many clock pulses will be required to completely load serially a 5-bit shift register?
a. 2
b. 3
c. 4
d. 5
Answer: d. 5
11. How many flip-flops are required to make a MOD-32 binary counter?
a. 3
b. 4
c. 5
d. 6
Answer: c. 5
Synchronous Sequential Logic 3.105
13. Synchronous counters eliminate the delay problems encountered with asynchronous counters
because the:
a. input clock pulses are applied only to the first and last stages
b. input clock pulses are applied only to the last stage
c. input clock pulses are not used to activate any of the counter stages
d. input clock pulses are applied simultaneously to each stage
Answer: d. input clock pulses are applied simultaneously to each stage
14. What is the difference between combinational logic and sequential logic?
a. Combinational circuits are not triggered by timing pulses, sequential circuits are triggered
by timing pulses.
b. Combinational and sequential circuits are both triggered by timing pulses.
c. Neither circuit is triggered by timing pulses.
d. None of the above
Answer: a. Combinational circuits are not triggered by timing pulses, sequential circuits
are triggered by timing pulses.
15. How many different states does a 3-bit asynchronous counter have?
a. 2
b. 4
c. 8
d. 16
Answer: c. 8
3.106 Digital Principles and System Design
16. A 4-bit up/down binary counter is in the DOWN mode and in the 1100 state. To what state
does the counter go on the next clock pulse?
a. 1101
b. 1011
c. 1111
d. 0000
Answer: b. 1011
17. The terminal count of a 3-bit binary counter in the DOWN mode is ________.
a. 000
b. 111
c. 101
d. 010
Answer: a. 000
19. Which of the following describes the operation of a positive edge-triggered D flip-flop?
a. If both inputs are HIGH, the output will toggle.
b. The output will follow the input on the leading edge of the clock.
c. When both inputs are LOW, an invalid state exists.
d. The input is toggled into the flip-flop on the leading edge of the clock and is passed to the
output on the trailing edge of the clock.
Answer: b. The output will follow the input on the leading edge of the clock.
Synchronous Sequential Logic 3.107
21. What is a shift register that will accept a parallel input, or a bidirectional serial load and internal
shift features, called?
a. tristate
b. end around
c. universal
d. conversion
Answer: c. universal
22. A bidirectional 4-bit shift register is storing the nibble 1101. Its input is HIGH. The nibble
1011 is waiting to be entered on the serial data-input line. After three clock pulses, the shift
register is storing ________.
a. 1101
b. 0111
c. 0001
d. 1110
Answer: b. 0111
23. How can parallel data be taken out of a shift register simultaneously?
a. Use the Q output of the first FF.
b. Use the Q output of the last FF.
c. Tie all of the Q outputs together.
d. Use the Q output of each FF.
Answer: d. Use the Q output of each FF.
3.108 Digital Principles and System Design
25. If an 8-bit ring counter has an initial state 10111110, what is the state after the fourth clock
pulse?
a. 11101011
b. 00010111
c. 11110000
d. 00000000
Answer: a. 11101011
Synchronous Sequential Logic 3.109
REVIEW QUESTIONS
1) Explain the synchronous counter design procedure and also design Mod-7 counter using JK flip
flop.
2) (i) Implement JK flip flop using D flip flop.
(ii) How the race condition can be avoided in a flip flop?
3) Design a sequence detector that detects a sequence of three or more consecutive 1’s in a string
of bits coming through an input line and produces an output whenever this sequence is detected.
4) Design a binary counter using T flip flops to count in the following sequences:
(i) 000,001,010,011,100,101,111,000 (ii) 000,100, 111, 010, 011, 000
5) Explain the operation of JK, SR, T and D Flip flops with a neat diagram. Also discuss their
characteristic equation and excitation table.
6) Design a MOD-10 synchronous counter using JK flip flops. Write the execution table and state
table.
7) Design and implement mod-5 synchronous counter using JK flip flop and also draw the timing
diagram.
8) Implement T-flip flop and JK flip flop using D flip flop.
9) A sequential circuit with 2 D-flip-flops A and B and input X and output Y is specified by the
following next state and output equations. A(t+1)=AX+BX; B(t+1)=A′X ; Y=(A+B)X′;
i)Draw the logic diagram of the circuit. ii) Derive the state table. iii) Derive the state diagram.
10) A sequential circuit with 2 D-flip-flops A and B and input X and output Z is specified by the
following next state and output equations. A(t+1)=A’+B; B(t+1)=B′X ; Z=A+B′;
i)Draw the logic diagram of the circuit. ii) Derive the state table. iii) Derive the state diagram.
11) Design a synchronous sequential circuit using JK for the given state diagram.
3.110 Digital Principles and System Design
12) Design a synchronous sequential circuit using JK for the given state diagram.
UNIT IV
4.1 INTRODUCTION
In synchronous sequential circuits, memory elements are clocked flipflops. In asynchronous
sequential circuits, memory elements are either unclocked flipflops (latches) or time delay elements.
Asynchronous means without a synchronizing clock to control the state transitions of a sequential
circuit. The inputs and present state change after the internal delay of the circuit elements. Because no
synchronizing clock is used, asynchronous circuits are usually faster than synchronous circuits. The
comparison between synchronous and asynchronous sequential circuits is given in Table 4.1.
TABlE 4.1: Comparison between Synchronous and Asynchronous Sequential Circuits
Sl. No. Synchronous Sequential Circuits Asynchronous Sequential Circuits
1. Memory elements are clocked Memory elements are either unclocked
flipflops. flipflops or time delay elements.
2. The operating speed of clock depends Because of absence of clock, it can
on time delays involved. operate faster than asynchronous
Therefore synchronous circuits sequential circuits.
can operate slower than asynchronous.
3. The change in input signals can affect The change in inputs signals can affect
memory elements upon activation of memory elements at any instant of time.
clock signal.
4. Easier to design. More difficult to design.
4.2 TYPES OF ASYNCHRONOUS SEQUENTIAL CIRCUITS
Asynchronous Sequential Circuits are typically classified into two main groups:
Fundamental Mode Asynchronous Sequential Circuits
Pulse Mode Asynchronous Sequential Circuits
4.2.1 Fundamental Mode
In the fundamental mode, only one input is allowed to change at a time and the inputs are considered
to be levels, (0 or 1). Input level changes can occur no faster than allowed by the slowest propagation
path in the circuit.
4.2 Digital Principles and System Designs
y1
x Y1
y2
Y2
x y1 y2 xy1 xy 2 xy 1 Y 1 = xy 1 xy 2 Y 2 = x y 1 xy 2
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 1
0 1 0 0 0 0 0 0
0 1 1 0 1 0 1 1
1 0 0 0 0 1 0 1
1 0 1 0 0 1 0 1
1 1 0 1 0 0 1 0
1 1 1 1 0 0 1 0
y2 y2
xy1 0 1 xy1 0 1
00 0 1 00 0 1
01 0 1 01 0 1
11 1 1 11 0 0
10 0 0 10 1 1
y2
xy1 0 1
a a b
b c b
c c d
d a d
Example 4.2: Derive the transition table and primitive flow table for the given circuit shown in
Figure 4.4.
Boolean Expressions
X t X I X I I X X I
X t X I I X
Z X I
Table 4.5 illustrates the present state, next state and output variables.
TABLE 4.5 : Next State Table
X1 X0 X1 I0 X1 (t + 1) = X0 I1 + I0 X1 X0 (t + 1) = X I I0+ X X 0 I 0 + X 0 I1 Z = X0I1
0 0 0 0 0 0 0
0 0 0 1 0 1 0
0 0 1 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 0 1 0 1 0
0 1 1 0 1 1 1
0 1 1 1 1 1 1
1 0 0 0 0 0 0
1 0 0 1 1 0 0
1 0 1 0 0 0 0
1 0 1 1 1 0 0
1 1 0 0 0 0 0
1 1 0 1 1 0 0
1 1 1 0 1 1 1
1 1 1 1 1 1 1
I1 I0 I1 I0
X1X0 00 01 11 10 X1X0 00 01 11 10
00 0 0 0 0 00 0 1 0 0
01 0 0 1 1 01 0 1 1 1
11 0 1 1 1 11 0 0 1 1
10 0 1 1 0 10 0 0 0 0
Asynchronous Sequential Logic 4.7
Transition Table:
TABLE 4.6 : Transition Stable
I1 I0
00 01 11 10
X1X0
00 00 01 00 00
01 00 01 11 11
11 00 10 11 11
10 00 10 10 00
Primitive Flow Table:
TABLE 4.7 : Primitive Flow Table
I 1 I0
X1X0 00 01 11 10
a a b a a
b a b c c
c a d c c
d a d d a
Pulse mode asynchronous sequential circuits relay on input pulses rather than levels. They allow
only one input variable to change at a time. They can be implemented by employing a basic flip-flop
commonly referred to as an SR Latch. We will first explain the operation of the SR latch with NOR
gates and NAND gates. We will then proceed to give examples of analysis of pulse mode asynchronous
sequential circuits that employ SR latches.
The SR latch has two inputs S and R and two cross-coupled NOR gates or two cross-coupled
NAND gates. The SR latch with NOR gates is shown in Figure 4.5. In order to analyze the circuit by
the transition-table method, redraw the circuit, as shown in Figure 4.6.
4.8 Digital Principles and System Design
Y= S y R
= (S + y) R
= SR + Ry
TABLE 4.8 : Output Values
S R y SR Ry Y = SR+ Ry
0 0 0 0 0 0
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 1 0 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 0 0 0
Asynchronous Sequential Logic 4.9
TABLE 4.9 : Transition table
y
SR 0 1
00 0 1
01 0 0
11 0 0
10 1 1
S R S R S R R = S
S R S when SR = 0
Y S R Ry S Ry
The SR latch with NAND gates is shown in Figure 4.7(a) and (b).
Solution:
Procedure
1. Derive the Boolean functions for S1 , R1 , S2 and R2 inputs.
2. Check whether SR = 0 for each NOR latch or whether S R for each NAND latch. If this
condition is not satisfied, there is a possibility that the circuit may not operate properly.
3. Evaluate Y S Ry for each NOR latch or
Y S R y for each NAND latch.
4. Construct maps for Y and Y2 .
5. Plot the value of Y = Y1Y2 in the map. Circle all stable states where Y = y. The resulting map is
the transition table.
Step 1: Boolean functions for S and R inputs in each table:
S x y R x y
S x x R x y
Asynchronous Sequential Logic 4.11
Step 2: Check whether the condition SR = 0 is satisfied to ensure proper operator of NOR latches.
S R x y x x x x y x x x
S R x y x y x x x y x x
Step 3: Evaluate Y1 and Y 2 .
Y S R y
x y x x y x y x y y
x y x y x y
Y S R y
x x x y y
x x x y y
x x x y y y
TABLE 4.12
Y1Y 2 Y1Y2
x1x2 00 01 11 10 x1x2 00 01 11 10
00 0 0 0 0 00 0 1 0 0
01 0 0 1 1 01 0 1 1 0
11 0 1 1 1 11 1 1 1 1
10 0 1 1 1 10 0 1 0 0
Map for Y1 Map for Y2
Y1Y 2
x1x2 00 01 11 10
00 00 01 00 00
01 00 01 11 10
11 01 11 11 11
10 00 11 10 10
4.8 RACES
Races exist in asynchronous sequential circuits when two or more binary state variables change
during a state transition.
Races are classified as:
(i) Non-critical races
(ii) Critical races.
4.9 CYCLES
Races can be avoided by directing the circuit through intermediate unstable states with a unique
state-variable change. When a circuit goes through a unique sequence of unstable states, it is said to
have a cycle.
Figure 4.12 illustrates the occurrence of cycles. The state variable starts with y1y2 = 00 and then
change the input from 0 to 1. The transition table Figure 4.12(a) gives a unique sequence that terminates
in a total stable state 101. The transition table Figure 4.12(b) shows that even though the state variables
change from 00 to 11, the cycle provides a unique transition from 00 to 01 and then to 11. The cycle
should terminate with a stable state. If the cycle does not terminate with a stable state, the circuit will
keep going from one unstable state to another, making the entire circuit unstable. This is illustrated in
Figure 4.12(c).
x x x
y1y2 0 1 y1y2 0 1 y1y2 0 1
00 00 01 00 00 01 00 00 01
01 11 01 11 01 11
11 10 11 11 11 10
10 10 10 10 10 01
(a) State transition (b) State transition (c) Unstable state
00 01 11 1 10 00 01 11 1 00 11 10
Fig. 4.12 : Cycles
The transition diagram with addition binary state (d = 10) is shown in Figure 4.14. State ‘d’ is
adjacent to both ‘a’ and ‘c’. Now the transition from a to c will go through ‘d’. This causes the binary
variables to change from 00 10 11, which satisfy the condition that only one binary variable
changes during each state transition, thus avoiding the critical race.
Table 4.16 Flow Table Table 4.17 : Multiple row state assignment
00 01 11 10 00 01 11 10
a b a d a a1 = 000 b1 a1 d1 a1
b b d b a a2 = 111 b2 a2 d2 a2
c c a b c b1 = 001 b1 d2 b1 a1
d c d d c b2 = 110 b2 d1 b2 a2
c1 = 011 c1 a2 b1 c1
c2 = 100 c2 a1 b2 c2
d1 = 010 c1 d1 d1 c1
d2 = 101 c2 d2 d2 c2
Asynchronous Sequential Logic 4.17
In the multiple row assignment, the change from one stable state to another will always cause a
change of only one binary state variable. Each stable state has two binary assignments with exactly
the same output. At any given time, only one of the assignments is in use. For example, if we start
with state a1 and input 01 and then change the input to 11, 01, 00 and back to 01, the sequence of
internal states will be a1, d1, c1 and a2. Although the circuit starts in state a1 and terminates in states a2,
as far as the input-output relationship is concerned, the two states a1 and a2 are equivalent to state “a”
of the original flow table.
0 0 0 1 a a b c c
0 0 1 0 b a b c d
0 1 0 0 c a b c c
1 0 0 0 d d b c d
4.18 Digital Principles and System Design
0 0 0 1 a a Q R R
0 0 1 0 b Q b S T
0 1 0 0 c R S c c
1 0 0 0 d d T U d
0 0 1 1 Q a b
0 1 0 1 R a c c
0 1 1 0 S b c
1 0 1 0 T b d
1 1 0 0 U c
Inputs (XY)
States Output
00 01 11 10
1 1 7 4 11
2 2 5 4 01
3 7 3 11 10
4 2 3 4 00
5 6 5 9 11
6 6 7 11 01
7 1 7 14 10
8 8 12 4 01
9 7 9 13 01
10 7 10 4 10
11 8 10 11 00
12 6 12 9 11
13 8 14 13 11
14 12 14 11 00
4.20 Digital Principles and System Design
1 1 7 4 11
2 2 5 4 01
3 7 3 4 10
4 2 3 4 00
5 6 5 9 11
6 6 7 4 01
7 1 7 14 10
9 7 9 13 01
13 2 14 13 11
14 5 14 4 00
Solution: For this design one does not need to obtain a primitive flow table, merger diagram, reduced
primitive flow table, transition diagram since, Figure 4.15cannot be reduced to less than two states.
For two states, one state variable is required which will be called y. Assigning the state code 0 to state
`a’ and state code 1 to state `b’ and output Z = y. The K-map for the next state and external outputs can
be drawn using the state diagram. The logic diagram is shown in Figure 4.16.
TABLE 4.25
AB inputs
Present Next State Output
State 00 01 11 10 Z
a a a b a 0
b b a b b 1
a0
b1
TABLE: 4.26: State Table
Next State
Present Output
State 00 01 11 10 Z
0 0 0 1 0 0
1 1 0 1 1 1
Asynchronous Sequential Logic 4.23
AB
y 00 01 11 10
0 0 0 1 0
1 1 0 1 1
Y A B y A yB
Stable State A
When the input state x1x2 = 00, the output must be 0 for stable state A , since x=0 when x1 = 0.
4.24 Digital Principles and System Design
When the input state is changed from x1x2 = 00 to x1x2 = 01, the circuit must become unstable,
since only one stable state is permitted in each row of a primitive flo table and eventually reach an
other stable state, say B . In the next state section of the primitive flow table an uncircled B is placed
in the first row, second column and a circled B is placed in the second row, second column. The
output z = 0 for stable state B , since x1 = 0.
When the input state is changed from x1x2 = 00 to x1x2 = 10, another row of C is needed. An
uncircled C is placed in the first row, third column and the circled C is placed in the third row, third
column of the next-state section. The output z = 0, since z = 1 if x2 changes while x1 = 1.
When the input state is changed from x1x2 = 00 to x1x2 = 11, a dash () is placed in the first row,
fourth column of the next section, since the inputs x1x2 never change simultaneously. Now the primitive
flow table appears as shown in Table 4.27.
Table 4.28: Primitive Flow Table
A A B C 0
B A B D 0
C C 0
D D 0
Stable State B
Whe the input state is x1x2 = 01, the output must be 0 for stable state B , since x1 = 0.
When the input state is changed from x1x2 = 01 to x1x2 = 00, the circuit must first become unstable
and then reach a stable state. Since stable state A is already exists in the first column of the next-state
section, an uncircled A is placed in the second row, first column.
When the input state is changed from x1x2 = 01 to x1x2 = 11, a stable state must appear in the fourth
column of the next-state section of the primitive flow table. Thus, an internal change to a stable state
D is needed. The output z = 0 for stable state D , since x2 did not change but remained at the value
x2 = 1.
When the input state is changed from x1x2 = 10, a dash () is placed in the second row, third
column of the next-state section, since both input variable x1, x2 cannot change simultaneously. Now
the primitive flow table appears as shown in Table 4.28.
Asynchronous Sequential Logic 4.25
Stable State C
When the input state is changed from x1x2 = 10 to x1x2 = 11, then a stable state with a 1 output must
be reached in the fourth column of the next- state section of the primitive flow table. This cannot be
state D , since the output is to become 1 when x2 changes while x1 = 1. Thus a stable state with a 1
output in the fourth column is needed. This necessitates a fifth row for present state E to be added in
the primitive flow table. The uncircled E is placed in the third row, fourth column and circled E is
placed in the fifth row, fourth column. The output z = 1 for stable state E .
When the input is changed from x1x2 = 10 to x1x2 = 00 the circuit must first become unstable and
thenr each a stable state. Since stable state A is already exists in the first column of the next-state
section, an uncircled A is placed in the third row, first column.
When the input is changed from x1x2 = 10 to x1x2 = 01, a dash () is placed in the third row, second
column, since both inputs x1x2 never change simultaneously. Now the primitive flow table appears
shown in Table 4.29.
Table 4.30: Primtive Flow Table
Present Next State Output (z)
State Input state (x1x2) Input state (x1x2)
00 01 10 11 00 01 10 11
A A B C 0
B A B D 0
C A C E 0
D B F D 0
E E 1
F F 1
4.26 Digital Principles and System Design
Stable State D
When the input state is changed from x1x2 = 11 to x1x2 = 10, then a stable state with a 1 output must
be reached in the third column of the next-state section of the primitive flow table. Since the only
stable state in the third column thus far has a 0 output, another row is added to the table for a stable
state F along with its 1 output.
When the input state is changed from x1x2 = 11 to x1x2 = 01, an uncircled B is placed in the fourth
row, second column.
When the input is changed from x1x2 = 11 to x1x2 = 00, a dash (–) a placed in the fourth row, first
column, since both inputs x1x2 never change simultaneously. Now the primitive flow table appears as
shown in Table 4.30.
The remaining entries in the last two rows are determined by similar reasons as mentioned above.
The completed primitive flow table is shown in Table 4.31.
Table 4.31: Primitive Flow Table
Present Next State Output (z)
State Input state (x1x2) Input state (x1x2)
00 01 10 11 00 01 10 11
A A B C 0
B A B D 0
C A C E 0
D B F D 0
E B F E 1
F A F E 1
Example 4.7
Obtain the primitive flow table for an asynchronous sequential circuit that has two inputs x, y and
one output z. The inputs x and y never change or are 1 simultaneously. An output z = 1 is to occur only
during the input state xy = 01 and then if and only if the input state xy = 01 is preceded by the input
sequences xy = 01, 00, 10, 00, 10, 00. (Nov. 2004)
Solution
Input Sequence Stable State
01 A
00 B
10 C
00 D
10 E
00 F
Asynchronous Sequential Logic 4.27
Stable state A is placed in the first row, second column of the next-state section of the primitive
flow table for the input state xy = 01, assumed that the output z = 0.
When the input state is changed from xy = 01 to xy = 00, a second row must be added for stable
state B . An uncircled B is placed in the first row, first column and a circled B is placed in the
second row, first column.
The input states xy = 10 and xy = 11 cannot follow the input state xy = 01, since the inputs xy never
change or are 1 simultaneously.
Next in input state of xy = 10 results in the circuit entering stable state C . This state signifies that
the input sequence xy = 01, 00, 10 has been applied.
Next an input state of xy = 00 results in the circuit entering stable state D . This state signifies that
the input sequence is xy = 01, 00, 10, 00.
Similarly, stable state E and F are placed in the primitive flow table as shown in Table 4.32.
Stable state G is introduced with an associated 1 output.
Table 4.32: Primitive Flow Table
Present Next State Output (z)
State Input state (xy) Input state (xy)
00 01 10 11 00 01 10 11
A B A 0
B B C 0
C D C 0
D D E 0
E F E 0
F F G 0
G G 1
a a, 0 b, 0 1
b a, 0 c, 0 0
c a, 0 a, Z1 0
The transition table with state assignment is shown in Table 4.36. For race- free state assignment,
an extra state ‘d’ is added. The binary code assignment for the states as follows: a 00, b 01,
c 11, d 10
TABLE 4.36: Transition Table
Present State Next State/Output Z1 Output Z2
y1 y2 X1 X2 Z2
0 0 00, 0 01, 0 1
0 1 00, 0 11, 0 0
1 1 00, 0 00, 1 0
1 0 00, 0 00, 0 0
Two state variables are reqired and y 1 and y2 are choosen. For these two state variables, two
memory storage devices are required. J-K flipflops can be used as T flipflops for the memory storage
devices.
The composite excitation inputs T1 and T 2 are obtained by using excitation table for T flipflop
from the transition table of Table 4.36.
Remember the excitation table for T flipflops as shown in Table 4.37. By using the present state
and reset state, flipflop inputs T1 and T4 are obtained as shown in Table 4.38.
TABLE 4.37: Excitation Table
Q(t) Q(t + 1) T
0 0 0
0 1 1
1 0 1
1 1 0
Asynchronous Sequential Logic 4.31
01 1 0
11 1 1
10 0 0
T y x y y x y y x y y x (hazard free equation)
(iii) Map for Z1
y1 y2 X1 X2
00 0 0
01 0 0
11 0 1
10 0 0 Z y y x
Fig. 4.18: K map simplications
4.32 Digital Principles and System Design
The logic diagram for pulse mode asynchronous sequential circuit using positive edge triggered T
flipflops is drawn by using of the following equations:
T y x y x y x , T y x y y x y y x
Z y y x , Z y y
Q(t) Q(t + 1) S R
0 0 0 X
0 1 1 0
1 0 0 1
1 1 X 0
TABLE 4.41: State assignment and excitation tables
Present Next States Flip-flop inputs
States X2 X5 Xr
PQR X2 X5 Xr S1R1 S2R2 S3R3 S1R1 S2R2 S3R3 S1R1 S2R2 S3R3
For S1
X2 X5 Xr
QR QR QR
P 00 01 11 10 P 00 01 11 10 P 00 01 11 10
0 0 0 1 1 0 0 1 1 1 0 0 0 0 0
1 X X X X 1 X X X X 1 0 0 0 0
S X Q X R Q
4.34 Digital Principles and System Design
For R1:
X2 X5 Xr
QR QR QR
00 01 11 10 P 00 01 11 10 P 00 01 11 10
P
0 X X 0 0 0 X 0 0 0 0 X X X X
1 0 0 0 0 1 0 0 0 0 1 1 1 1 1
R X
For S2
X2 X5 Xr
QR QR QR
P 00 01 11 10 00 01 11 10 P 00 01 11 10
P
0 0 1 0 0 0 1 0 X X 0 0 0 0 0
1 0 1 X X 1 1 1 X X 1 0 0 0 0
S X QR X P R
For R2:
X2 X5 Xr
QR QR
QR
P 00 01 11 10 00 01 11 10 P 00 01 11 10
P
0 X 1 1 1 0 0 X 0 0 0 X X 1 1
1 1 0 0 0 1 0 0 0 0 1 X X 1 1
R X Q R PQ X r
For S3:
X2 X5 Xr
QR QR QR
P 00 01 11 10 00 01 11 10 00 01 11 10
P P
0 1 0 X 0 0 1 X X 1 0 0 0 0 0
1 0 X X 1 1 1 X X 1 1 0 0 0 0
S X P Q R P Q X
Asynchronous Sequential Logic 4.35
For R3:
X2 X5 Xr
QR QR QR
00 01 11 10 P 00 01 11 10 P 00 01 11 10
P
0 0 1 0 X 0 0 0 0 0 0 X 1 1 X
1 X 0 0 0 1 0 0 0 0 1 X 1 1 X
R X PQR Xr
Fig. 4.20: K map simplification
Figure 4.20shows the K-map simplification for SR flipflop inputs. The input equations are:
S X Q X R Q R X r
S X QR X P R R X Q R PQ X r
S X PQ R P Q X R X P Q R X r
The output equation is, Z = PQR.
The logic diagram for pulse mode asynchronous sequential circuit using S-R flipflops is shown in
Figure 4.21.
4.14 HAZARDS
Hazard is an unwanted transient i.e., spike or glitch that occurs due to unequal path or unequal
path or unequal propagation delays through a combinational circuit.
Types of hazards:
There are three types of hazards:
Static hazard, Dynamic hazard, Essential hazard.
11 1 0
10 0 0
f A B BC
CD CD
AB 00 01 11 10 AB 00 01 11 10
00 1 1 00 1 1
01 1 1 1 1 01 1 1 1 1
11 1 11 1
10 1 1 1 10 1 1 1
F AB B D ACD ACD
F AB B D ACD AC D BCD A B C
Example 4.11: Implement the switching function f x1 ,x2 ,x3 x1 x2 x 2 x3 by a static hazard free 2
level AND-OR gate network. (Nov. 2004)
Solution: The K-map and AND-OR circuit are shown in Fig. 4.25for the switching function
F x1 x2 x 2 x3 with hazards.
x2x3
00 01 11 10
x1
0 1
1 1 1 1
F x1 x2 x 2 x3 AND-OR circuit
Hazards in combinational circuits can be removed by covering anytwo minterms that may produce
a hazard with product term common to both. The removal of hazards requires the addition of redundant
gates to the circuit. The hazard free circuit obtained by adding extra gate in the circuit generates the
product terms x1x3 as shown in Fig. 4.26.
x2x3
00 01 11 10
x1
0 1
1 1 1 1
F x1 x2 x 2 x3 AND-OR circuit
Example 4.12: Find a static and dynamic hazard free realization for the following function uisng
(i) NAND gates
(ii) NOR gates.
f(a, b, c, d) = m(1, 5, 7, 14, 15)
Solution:
cd
ab 00 01 11 10
00 1
01 1 1
11 1 1
10
a’
c’
F
d
a’
b
c’
b
c
d
a’
c’
F
d
a’
b
c’
b
c
d
a’
c’
d F
a’
b
c’
b
c
d
4.42 Digital Principles and System Design
Example 4.13: Implement the switching function F = m(1, 3, 5, 7, 8, 9, 14, 15) by a static hazard free
2 level AND-OR gate network.
Solution:
CD
AB 00 01 11 10
A
00 1 1
B
01 1 1 F
C
11 1 1
D
10 1 1
F AD ABC ABC
CD
AB 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1 1
B
F
C
19. What are the steps for the design of asynchronous sequential circuit?
1. Construction of a primitive flow table from the problem statement.
2. Primitive flow table is reduced by eliminating redundant states using the state Reduction
3. State assignment is made
4. The primitive flow table is realized using appropriate logic elements.
20. Define primitive flow table.
It is defined as a flow table which has exactly one stable state for each row in the table. The
design process begins with the construction of primitive flow table.
21. What are the types of asynchronous circuits?
1. Fundamental mode circuits
2. Pulse mode circuits
22. What are races?
When 2 or more binary state variables change their value in response to a change in an input
variable, race condition occurs in an asynchronous sequential circuit. In case of unequal delays, a
race condition may cause the state variables to change in an unpredictable manner.
23. Define non critical race.
If the final stable state that the circuit reaches does not depend on the order in which the state
variable changes, the race condition is not harmful and it is called a non critical race.
24. Define critical race?
If the final stable state depends on the order in which the state variable changes, the race
condition is harmful and it is called a critical race.
25. What is a cycle?
A cycle occurs when an asynchronous circuit makes a transition through a series of unstable
states. If a cycle does not contain a stable state, the circuit will go from one unstable to stable to
another, until the inputs are changed.
26. List the different techniques used for state assignment.
1. Shared row state assignment
2. One hot state assignment.
Asynchronous Sequential Logic 4.47
MCQ QUESTIONS
1. The race in which the stable state depends on an order is called
a)critical race
b)non-critical race
c)identical race
d)defined race
Answer: a. critical race
2. Asynchronous circuits are useful in application where the input signals may
a)change at any time
b)never change
c)both (a) & (b)
d)continuously change
Answer: c. both (a) & (b)
5. A condition occurs when an asynchronous sequential circuit changes two or more binary state
variables is known as---
a)deadlock condition
b)running condition
c)race condition
d)livelock
Answer: c. race condition
10. The race in which the stable state does not depend on an order is called
a)critical race
b)non-critical race
c)identical race
d)defined race
Answer: b. non-critical race
11. Asynchronous sequential logic circuits are used when a primary need is
a)time
b)pressure
c)speed
d)accuracy
Answer: c. speed
13. The table having one stable state in each row is called
a)transition table
b)state table
Asynchronous Sequential Logic 4.51
c)flow table
d)primitive flow table
Answer: d. primitive flow table
17. Which mechanism allocates the binary value to the states in order to reduce the cost of the
combinational circuits?
a. State Reduction
b. State Minimization
4.52 Digital Principles and System Design
c. State Assignment
d. State Evaluation
Answer: c. State Assignment
d)None of these
Answer: a. Karnaugh map
25. To make the 2-level realization of the function=A’B+AC free from static-1 logic hazard,what
should you do?
a)Implement the function in multi-level form
b)Add a product term BC to F, and implement accordingly
4.54 Digital Principles and System Design
26. Two states are said to be equal if they have the same
a)inputs
b)next state
c)output
d)mid state
Answer: c. output
29. Which of the following is/are not true for an asynchronous sequential circuit?
a)The speed of the circuit dependson the delay of the flipflops
b)the number of flipflops required is more than that for a synchronous sequential circuit.
Asynchronous Sequential Logic 4.55
c)Both a & b
d)None of the above
Answer: c. Both a & b
30. An asynchronous sequential circuit is said to have reached a stable state when
a) All the inputs of the delay elements have appeared on the outputs of the delay elements
b) Atleast one of the input of the delay elements have appeared on the outputs of the delay
elements
c)The inputs of the delay elements have stabilized
d)None of these
Answer: a. All the inputs of the delay elements have appeared on the outputs of the
delay element
4.56 Digital Principles and System Design
REVIEW QUESTIONS
3) Discuss in detail the procedure for reducing the flow table with an example.
4) Reduce the number of states in the following state diagram. Tabulate the reduced state table and
draw the reduced state diagram.
5) Construct a circuit with inputs A and B to give an output Z=1 when AB=11 but only if A
becomes 1 before B, by drawing total state diagram, primitive flow table and output map in
which transient state is included.
6) Design an asynchronous sequential circuit that has two inputs X2 and X1 and one output z.
When x1= 0, the output Z is 0. The first change in X2 that occurs while X1 is 1 will cause output
Z to be 1. The output Z will remain until X 1 returns to zero
Asynchronous Sequential Logic 4.57
7).An asynchronous network has two inputs and one output. The input sequence X1X2 =00,
01,11causes the output to become 1.The next input change then causes the output to return to
0. No other input sequence will produce a 1 output. Construct the state diagram using primitive
flow table
8).Design a circuit with inputs A and B to give an output Z equal to 1 when AB=11 but only
if A becomes 1 before B, by drawing total state Diagram, primitive flow table and output
map in which transient state is Included.
Memory and Programmable Logic 5.1
UNIT V
A memory unit is a collection of storage cells with associated circuits needed to transfer information
in and out of the device. A memory unit stores binary information in group of bits called words. A
word in memory is an entity of bits that move in and out of storage as a unit. A word is a group of 1’s
and 0’s and may represent a number, an instruction, one or more alphanumeric characters or any other
binary-coded information. A group of 8 bits is called a byte. The byte can be split into two 4-bit units
that are called nibbles. The capacity of a memory unit is the total number of bytes that can be stored.
Suppose the memory capacity is 1024 8, it means that the number of words is 1024 and the number
of bits per word is 8.
Each word stored in a memory location is represented by an address.
5.2 MEMORY UNIT
The communication between a memory and its environment is achieved through data input/output
lines, address selection lines and control lines that specify the direction of transfer. A block diagram
of the memory unit is shown in Figure 5.1. The ‘n’ data input lines provide the information to be
stored in memory and the ‘n’ data output lines supply the information coming out of memory. The ‘K’
address lines specify the particular word chosen among the many variable. The two control inputs
(read and write) specify the direction of transfer desired. The write input causes binary data to be
transferred into the memory and the read input causes binary data to be transferred out of memory.
Data units go into the memory and come out of the memory on a set of lines called data bus. The
data bus is bi-directional, which means that data can go in either direction. For a write or a read
operation, an address is selected by placing a binary code representing the desired address on a set of
lines called the address bus. The address code is decoded internally and the appropriate address is
selected. The number of lines in the address bus depends on the capacity of the memory. For example,
a 16 bit address code can select 65536 locations (216) in the memory. The block diagram of memory
operation is shown in Figure 5.2.
Address Memory
Address Decoder Data
Bus Array Bus
n:2n
Enable R/W
Fig. 5.2: Block diagram of memory operation
1. Address code 101 is placed on the address bus and address 5 is selected.
2. Read command is applied.
3. The contents of address 5 is placed on the data bus and shifted into data register.
Memory
RAM ROM
Random Access Read-Only
Memory Memory
SRAM DRAM
Static RAM Dynamic RAM
Bipolar MOS MOS
If CS and R / W are low, then it is a write operation. In write operation, data on the Din input is
written into the addressed cell while the output will remain in the high impedance state. For read
operation CS signal must be low and R / W signal must be high. In read operation, data from addressed
cell appears at the output while the input buffer is disabled.
When CS is high both input and output buffers are disabled and the chip is electrically
disconnected. This makes the IC to operate in power down mode.
A 1 can be rewritten by pulsing the Q2 (write input) emitter high. Large number of these memory
cells are organized on a row and column basis to form a memory chip.
Row line
CS
In DRAM memory cell, a bit of data is stored as charge on storage capacitor, where the presence
or absence of charge determines the value of the stored bit 1 or 0. The DRAM cell includes a MOSFET
and a storage capacitor (Cs) as shown in Figure 5.11. When column line and row line go high, the
MOSFET conducts and charges the capacitor. When column and row lines go low, the MOSFET
opens and the capacitor retains its charge. In this way it stores 1 bit.
5.10.1 Operation
The DRAM cell consists of 3 tri-state buffers: Input buffer, Output buffer and Refresh buffer.
Input and output buffers are enabled and disabled by controlling R/W line. When R/W = 0 , input
buffer is enabled and output buffer is disabled. When R/W = 1, input buffer is disabled and output
buffer is enabled.
(i) Write Operation
The write operation is illustrated in Figure 5.12. To enable write operation R/W line is made
low, which enables input buffer and disables output buffer. To write a 1 into the cell, the DIN line is
high and MOSFET is turned ON by a high on the Row line. This allows the capacitor to charge to a
positive voltage. When 0 is to be stored, a low is applied to the DIN line. The capacitor remains
uncharged or if it is storing a 1, it discharges. When the Row line is made Low, the transistor turns
OFF and disconnects the capacitor from the data line, thus storing the charge (1 or 0) on the capacitor.
(ii) Read Operation: To read data from the cell, the R/W line is made high, which enables output
buffer and disables input buffer. Then Row line is made high. It turns MOSFET ON and connects the
capacitor to the DOUT line through output buffer. Read operation is shown in Figure 5.13.
Memory and Programmable Logic 5.11
Next, the seven bit column address is applied to the address inputs and CAS (Column Address
Strobe) latches the remaining 7 bits into the column address latch. Then the 7 bit Row address and the
5 .1 2 Digital Principles and System Design
7 bit column address are decoded to select the appropriate memory cell in the 128 128 dynamic
memory array for a Read or Write operation.
Row Row
Address Address
Latch Decoder
Column Column
Address Address
Latch Decoder
5.11 ROM
It is a Read Only Memory. ROM is a memory device in which permanent binary information is
stored. The binary information must be specified by the designer and is then embedded in the unit to
form the required interconnection pattern. Once the pattern is established, it stays within the unit even
when power is turned off and on again, i.e., it is non- volatile memory. The ROMs are classified as
follows:
(i) Masked ROM or ROM
(ii) Programmed ROM (PROM)
(iii) Erasable PROM (EPROM)
(iv) Electrically Erasable PROM (EEPROM)
+ VCC + VCC
Storing a 1 Storing a 0
Fig. 5.18 : MOS ROM cell
5 .1 4 Digital Principles and System Design
A typical TTL ROM IC 74187 is shown in Figure 5.20. It is a 16 pin, 1024 bits, 256 words of 4
bits each ROM. The memory cells are organized in a 32 32 matrix. Five of the eight address lines
(A0 A4 ) are decoded by the row decoder to select one of the 32 rows. Three of the eight address
lines (A5 A7) are decoded by the column decoder to select four of the 32 columns. The result of this
structure is that when an 8 bit address code (A0 A7) is applied, a 4 bit data word appears on the data
outputs when the chip enable lines ( E 0 and E 1 ) are LOW to enable the output buffers.
Memory and Programmable Logic 5.15
5.14 PROM
Programmable ROM (PROM) can be programmed electrically by the user but cannot be
reprogrammed. A PROM uses some type of fusing process to store bits, in which a memory link is
burned open on left intact to represent a 0 or a 1. The using process is irreversible; once a PROM is
programmed, it cannot be changed.
The fusible links are manufactured into the PROM between the cathode of each diode and its
column line as shown in Figure 5.21. In the programming process, a sufficient current is injected
through the fusible link to burn it open to create a stored 0. The link is left intact for a stored 1.
In Bipolar PROM, the fusible links are connected between the emitter of each cell’s BJT and its
column line as shown in Figure 5.22.
5 .1 6 Digital Principles and System Design
In MOS PROM, the fusible links are connected between the source of each cell’s MOSFET and
its column line as shown in Figure 5.23.
5.15 EPROM
An EPROM is an erasable PROM. EPROMs can be reprogrammed by the user with a special
EPROM programmer. We can erase the stored data in EPROM.
An EPROM uses an array of N-channel enhancement type MOSFET with an isolated gate structure.
The isolated transistor gate (floating gate) has no electrical connections and can store an electrical
charge for indefinite periods of time. The data bits in this type of array are represented by the presence
or absence of a stored gate charge. Erasure of a data bit is a process that removes the gate charge.
Figure 5.25 shows the basic structure and symbol of a typcial EPROM cell.
Consider the programming of an EPROM with 1s as initial values in all the cells. To program or
store a 0 in a such a cell, the floating gate must be charged. For this, a high voltage of about 16 to 20
volts is applied between the source and drain, and a voltage of about 25 to 50 volts is applied to the
control gate for a specified amount of time (50 ms per address location). Due to high electric field
established by the positive control gate voltage, the high energy electrons penetrate the thin insulating
SiO2 and reach the floating gate. Thus the charge is stored on the floating gate. Since more negative
charge accumulates on the floating gate, the electric field strength is reduced and thereby further
accumulation is inhibited. Programming actually involves selecting the desired cell gates and repeatedly
5 .1 8 Digital Principles and System Design
injecting charge onto the floating gate until a sufficient amount of charge is trapped. Since the gate is
surrounded by SiO2, there is no discharge path available. Therefore, the charge remains trapped on
the floating gate for an indefinite period of time. Now the cell is programmed for a logic 0.
To program a different data, all cells in the EPROM must be erased. This is done by electrically or
ultraviolet light.
Thus EPROMs are classified as: Ultraviolet Erasable PROM (UV PROM)
Electrically Erasable PROM (EE PROM)
5.16 UV EPROM
The UVPROM has a transparent quartz lid on the
package. The stored data is erased by exposure of the
memory arry chip to high-intensity ultraviolet radiation
through the quartz window on top of the package for 15
to 20 minutes. The positive charge stored on the gate is
neutralized after several minutes of exposure time.
It is not possible to erase selective information, when
erased the entire information is lost. The chip can be
reprogrammed many times.
Fig. 5.26 : UV EPROM Chip
5.17 EEPROM
EEPROM (Electrically Erasable PROM) can be both erased and programmed by the application
of controlled electric pulses to the IC in the circuit and thereby changes can be made in the selected
memory locations without disturbing the correct data in other memory locations. EEPROM is non-
volatile memory.
Data is stored as charge or no charge on an insulated layer or an insulated floating gate in the
device. The insulating layer is made very thin. Therefore, a voltage as low as 20 to 25 volts can be
used to move charges accross the thin barrier in either direction for programming or erasing.
EEPROMs are small in size and flexible. With EEPROM, the programs can be altered remotely.
Memory and Programmable Logic 5.19
5.18 MEMORY CYCLES AND TIMING WAVE FORMS
5.18.1 Read Cycle
The timing wave form for SRAM read cycle is shown in Figure 5.27. The timing wave form and
timing parameters for SRAM read cycle are identical to ROM read cycle. The timing parameters for
read operation in a static RAM are given below:
tAA Access time from address. Assuming that OE and CS are already asserted, or will be soon
enough not to make a difference, this is how long it takes to get stable output data after a change
in address.
tACS Access time from chip select. Assuming that the address and OE are already stable, or will be
soon enough not to make a difference, this is how long it takes to get stable output data after CS
is asserted. Often this parameter is identical to tAA, but sometimes it’s longer is SRAMs with a
“power-down” mode and shorter in SRAMs without one.
tOE Output-enable time. This is how long it takes for the three-stage output buffers to leave the
high-impedance state when OE and CS are both asserted. This parameter is normally less than
tACS, so it is possible for the RAM to start accessing data internally before OE is asserted
tOZ Output-disable time. This is how long it takes for the three-state outut buffers to enter the high-
impedance state after OE or CS is negated.
tOH Output-hold time. This parameter specifies how long the output data remains valid after a
change in the address inputs.
tAH Address hold time after write. Analogous to tAS, all address inputs must be held stable unit this
time after CS or WE is negated.
tCSW Chip-select setup before end of write. CS must be asserted at least this long before the end of
the write cycle in order to select a cell.
tWP Write-pulse width. WE must be asserted at least this long to reliably latch data into the selected
cell.
tDS Data setup time before end of write. All of the data inputs must be stable at this time before
the write cycle ends. Otherwise, the data may not be latched.
tDH Data hold time after end of write. Analogous to tDS, all data inputs must be held stable until
this time after the write cycle ends.
tAH
Linear decoding or partial decoding technique is used in small memory systems. In this decoding,
address line A15 is directly connected to CS of EPROM and after inversion using a NOT gate, it is
connected to CS of RAM. Therefore, when the status of A15 line is 0, EPROM gets selected, otherwise
RAM gets selected. The status of other address lines is not considered. Let the address assigned to
EPROM and RAM are
A12 A11
When A19 ( E 0 ) = 1 , RAM 2 is enabled using a NOT gate; RAM 1 is disabled; (A0 A18) access
each of the RAM 2 address.
Control & EN
Bus
Fig. 5.34: 1M 4 RAM using 512 K 4 RAM
F1 F2
Fig. 5.35 : 4 2 ROM
128 Fuses
F1 F2 F3 F4
Fig. 5.36 : 32 4 ROM
Example 5.5: Implement the following Boolean functions using ROM
F1 (A1 , A0 ) = (1 , 2)
F2 (A1 , A0 ) = (0 , 1 , 3)
5 .2 8 Digital Principles and System Design
Solution: A0
2x4
Decoder
A1
F1 F2
Fig. 5.37 : ROM circuit
Example 5.6: Design a combinational circuit for 3 bit binary to excess-3 code converter using ROM.
Solution: Truth Table for Binary to Excess 3 code converter.
Inputs Outputs
A2 A1 A0 B3 B2 B1 B0
0 0 0 0 0 1 1
0 0 1 0 1 0 0
0 1 0 0 1 0 1
0 1 1 0 1 1 0
1 0 0 0 1 1 1
1 0 1 1 0 0 0
1 1 0 1 0 0 1
1 1 1 1 0 1 0
A0
A1 3x8
Decoder
A2
B3 B2 B1 B0
Fig. 5.38 : Binary to Excess 3 code converter
Memory and Programmable Logic 5.29
Example 5.7: Implement the following Boolean function using ROM (PROM)
F1 = m (1, 2, 3) ; F2 = m (0, 1, 3).
A B
F1 F2
Fig. 5.39 : PROM circuit
A A B B A A B B
Fusible link
Y1 Y1=A+B
Y2 Y2=A+B
Y3 Y3=A+B
Figure 5.57(a) shows an AND array consists of AND gates connected to a programmable matrix
with fusible links at each cross point of a row and column. The array can be programmed by blowing
fuses to eliminate variables from the output function as shown in Figure 5.41(b).
A A B B A A B B
Fusible link
Y1 Y1=AB
Y2 Y2=AB
Y3 Y3=AB
Figure 5.45 shows the convenient and array logic symbols for multiple-input AND gate and NOT
gate.
PROMs are used for code conversions, generating bit patterns for characters and as look-up tables
for arithmetic functions.
As a PLD, PROM consists of an fixed AND-array and a programmable OR array. The AND array
is really an n-to-2n decoder and the OR array is simply a collection of programmable OR gates. The
OR array is also called the memory array. The decoder serves as a minterm generator. The n-variable
minterms appear on the 2n lines at the decoder output. The 2n outputs are connected to each of the `m’
gates in the OR array via programmable fusible links. Figure 5.46 illustrates a 2n m PROM.
2n word lines
n
n-to-2
‘n’ input Programmable ‘m’ output
Decoder
lines OR array lines
(AND array)
f1 x, y,z m 0,1,2,5,7
BC
A 00 01 11 10
0 0 1 3 2
1 1 1 1
4 5 7 6
F1 AB AC
BC
A 00 01 11 10
1
0 0 1 3 2
1 1
1 4 5 7 6
F2 AC BC
Step 3: PLA Program Table:
Product Inputs Outputs
Term A B C F1 F2
AB 1 1 0 1
AC 2 1 1 1 1
BC 3 1 1 1
T T T/C
In the PLA program table, first column lists the product terms numerically as 1, 2, 3. The second
column (Inputs) specifies the required paths between AND gates and inputs. For each product term,
the inputs are marked with 1, 0 or (dash). If a variable in the product term appears in its normal form
(unprimed), the corresponding input variable is marked with a 1. If it appears complemented (primed),
the corresponding input variable is marked with a 0. If the variable is absent in the product term, it is
marked with a dash.
The third column (outputs) specifies the paths between the AND gates and the OR gates. The output
variables the marked with 1’s for all those product terms that formulate the function. For example,
F1 AB AC
5 .3 6 Digital Principles and System Design
So F1 is marked with 1’s for product terms 1 and 2 and with a dash for product term 3. Each
product term that has a 1 in the output column requires a path from the corresponding AND gate to the
output OR gate. Those marked with a dash specify no connection.
Under each output variable, write T or C. The T (true) specifies that the fuse across the output
inverter remains intact and a C (complement) specifies that the corresponding fuse be blown. The
PLA circuit is shown in Figure 5.49.
Inputs (A, B, C) n=2
Product terms (1, 2, 3) k=3
Outputs (F1, F2) m=2
F1 = m (1, 2, 4, 6) ; F2 = m (0, 1, 6, 7)
F3 = m (2 , 6)
Solution: Step 1: Truth Table for given functions:
A B C F1 F2 F3
0 0 0 0 1 0
0 0 1 1 1 0
0 1 0 1 0 1
0 1 1 0 0 0
1 0 0 1 0 0
1 0 1 0 0 0
1 1 0 1 1 1
1 1 1 0 1 0
Memory and Programmable Logic 5.37
Step 2: K map Simplification:
BC
A 00 01 11 10
0 1 1
0 1 3 2
1 1 1
4 5 7 6
F1 ABC AC BC
BC
00 01 11 10
A
1 1
0
0 1 3 2
1 1
1
4 5 7 6
F2 A B AB
BC
A 00 01 11 10
0 1
0 1 3 2
1 1
4 5 7 6
F3 = BC
AC 2 1 0 1
BC 3 1 0 1 1
AB 4 0 0 1
AB 5 1 1 1
T T T T/C
5 .3 8 Digital Principles and System Design
Example 5.11: Implement the combinational circuit with a PLA having 3 inputs, 4 product terms and
2 outputs for the functions:
1 1 1 1 F1 AC AB BC
BC
A 00 01 11 10
0 1 1
1 1 1 F 2 B C AC ABC
With this simplification, the total number of product terms is 6. But we require only 4 product
terms. Therefore find out the K map simplification for F 1 and F 2 .
BC
A 00 01 11 10
0 0 0 0
1 0 F 1 B C AC A B
BC
A 00 01 11 10
0 0 0
1 0 0 F 2 AC BC ABC
Now select the functions F 1 and F 2 , since the common product terms are BC , AC , AB , ABC
Step 3: PLA Program Table:
Product Inputs Outputs
Term A B C F1 F2
BC 1 0 0 1 1
AC 2 0 0 1 1
AB 3 0 0 1
ABC 4 1 1 1 1
C T T/C
F1 B C A C A B ; F2 B C A C ABC
5 .4 0 Digital Principles and System Design
Example 5.13: Design a BCD-to-Excess 3 code converter with PLA circuit. (May 2006)
Solution: Step 1: Truth Table for BCD to XS-3 code converter:
Decimal BCD Code Excess-3 Code
B3 B2 B1 B0 E3 E2 E1 E0
0 0 0 0 0 0 0 1 1
1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
Step 2: K map Simplification:
For E3
B1B0
B3B2 00 01 11 10
00
01 1 1 1
11 X X X X
10 1 1 X X
E3 = B3 + B2 B0 + B2 B1
For E2
B1B0
00 01 11 10
B3B2
00 1 1 1
01 1
11 X X X X
10 1 X X
E2 B2 B1 B 0 B 2 B0 B 2 B1
Memory and Programmable Logic 5.43
For E1
B1B0
B3B2 00 01 11 10
00 1 1
01 1 1
11 X X X X
10 1 X X
E1 B1 B 0 B1 B0
For E0
B1B0
B3B2 00 01 11 10
00 1 1
01 1 1
11 X X X X
10 1 X X X
E0 B 0
Step 3: PLA Program Table
Product terms Inputs Outputs
B3 B2 B1 B0 E3 E2 E1 E0
B3 1 1 1
B2B0 2 1 1 1
B2B1 3 1 1 1
B2 B1 B 0 4 1 0 0 1
B 2 B0 5 0 1 1
B 2 B1 6 0 1 1
5 .4 4 Digital Principles and System Design
B1 B 0 7 0 0 1 1
B1 B 0 8 1 1 1
B0 9 1 0 1
T T T T T/C
Step 4: Draw the PLA circuit with 4 inputs, 9 product terms and 4 outputs.
Z1 abde abcde bc de
Z2 a ce
Z3 bc de cde bd
Solution:
a b c d e Z1 Z2 Z3 Z4
abde 1 1 0 0 1 1
abcde 2 0 0 0 0 0 1
bc 3 1 1 1 1
de 4 1 1 1 1
ace 5 0 0 1 1 1
cde 6 0 0 0 1
bd 7 1 1 1
ce 8 1 1 1
5 .4 6 Digital Principles and System Design
1 2 3 4 5 6 7 8
z1
z2
z3
z4
Solution:
1. Simplifying the given Boolean functions to a minimum number of terms using K-map.
For W
CD
AB 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1 1
W ABD ABC AC
For X
CD
AB 00 01 11 10
00 1 1
01 1 1
11 1 1 1
10 1 1
X ABD ABC AC BC D W BC D
For Y
CD
00 01 11 10
AB
00 1 1
01
11 1 1
10 1 1 1
Y ABC BC D AC
For Z
CD
AB 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1
Z ABD BCD BD
Memory and Programmable Logic 5.49
II. PAL Program Table
AND Inputs
Product Term Outputs
A B C D W
ABD 1 0 0 0
ABC 2 0 1 1 W
AC 3 1 0
W 4 1
BC D 5 1 1 0 X
6
ABC 7 0 0 1
BC D 8 0 1 0 Y
AC 9 1 0
ABD 10 0 0 1
BCD 11 0 0 1 Z
BD 12 1 0
w
III. PAL Diagram
A W Y X Y Z W XY WY Z
For B
YZ
WX 00 01 11 10
00 1 1
01 1 1
11 1 1 1
10 1 1
B W Y X Y Z W XY WY Z XY Z A XY Z
For C
YZ
WX 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1
C X Y Z WX Y W X Z W X Z W X Z W XY Z
Memory and Programmable Logic 5.51
For D
YZ
WX 00 01 11 10
00 1 1
01 1 1
11 1 1
10 1
D X Z X YZ W X Z
WY 1 1 0
XYZ 2 0 0 0 A
W XY 3 0 1 1
WY Z 4 0 1 0
A 5 1
XY Z 6 1 1 0 B
XYZ 7 1 0 0
WX Y 8 1 1 0
WX Z 9 0 1 0 C
W XZ 10 0 0 1
W XY Z 11 1 0 1 0
XZ 12 1 0
XYZ 13 0 0 1 D
W XZ 14 0 0 1
5 .5 2 Digital Principles and System Design
5.37 EAPROM:
EAPROM stands for Electronically Alterable Programmable Read-Only Memory. It is a type of PROM whose
contents can be changed. It acts as a non-volatile storage device, and its individual bits can be re-programmed
during the course of system operation.
5.55 Digital Principles and System Design
1. Explain ROM
A read only memory (ROM) is a device that includes both the decoder and the OR gates within a
single IC package. It consists of n input lines and m output lines. Each bit Combination of the
input variables is called an address. Each bit combination that comes out of the output lines is
called a word. The number of distinct addresses possible with n input variables is 2n.
2. What are the types of ROM?
1. PROM
2. EPROM
3. EEPROM
3. Explain PROM.
PROM (Programmable Read Only Memory) it allows user to store data or program. PROMs use
the fuses with material like nichrome and polycrystalline. The user can blow these fuses by pass
in around 20 to 50 mA of current for the period 5 to 20 μs. The blowing of fuses is called
programming of ROM. The PROMs are one time programmable. Once programmed, the
information is stored permanent.
4. Explain EPROM.
EPROM (Erasable Programmable Read Only Memory) EPROM use MOS circuitry. They store
1’s and 0’s as a packet of charge in a buried layer of the IC chip. We can erase the stored data in
the EPROMs by exposing the chip to ultraviolet light via its quartz window for 15 to 20 minutes.
It is not possible to erase selective information. The chip can be reprogrammed.
5. Explain EEPROM.
EEPROM (Electrically Erasable Programmable Read Only Memory). EEPROM also use MOS
circuitry. Data is stored as charge or no charge on an insulated layer or an insulated floating gate
in the device. EEPROM allows selective erasing at the register level rather than erasing all the
information since the information can be changed by using electrical signals.
6. Define address and word:
In a ROM, each bit combination of the input variable is called on address. Each bit combination
that comes out of the output lines is called a word.
Memory and Programmable Logic 5.56
MCQ QUESTIONS
1. A PLA is similar to a ROM in concept except that ____________
a) It hasn’t capability to read only
b) It hasn’t capability to read or write operation
c) It doesn’t provide full decoding to the variables
d) It hasn’t capability to write only
Answer: c. It doesn’t provide full decoding to the variables
4. The complex programmable logic device contains several PLD blocks and __________
a) A language compiler
b) AND/OR arrays
c) Global interconnection matrix
d) Field-programmable switches
Answer: c. Global interconnection matrix
5.63 Digital Principles and System Design
8. How many 16K * 4 RAMs are required to achieve a memory with a capacity of 64K and a word
length of 8 bits?
a) 2
b) 4
c) 6
d) 8
Answer: d. 8
11. The memory which is used for storing programs and data currently being processed by the CPU
is called __________
a) PROM
b) Main Memory
c) Non-volatile memory
d) Mass memory
Answer: a. PROM
5.65 Digital Principles and System Design
21. What does the term “random access” mean in terms of memory?
a) Any address can be accessed in systematic order
b) Any address can be accessed in any order
c) Addresses must be accessed in a specific order
d) Any address can be accessed in reverse order
Answer: b. Any address can be accessed in any order
23. Which of the following has the capability to store the information permanently?
a) RAM
b) ROM
c) Storage cells
d) Both RAM and ROM
Answer: b. ROM
26. PLDs with programmable AND and fixed OR arrays are called __________
a) PAL
b) PLA
c) APL
d) PPL
Answer: a. PAL
27. When both the AND and OR are programmable, such PLDs are known as __________
a) PAL
b) PPL
c) PLA
d) APL
Answer: c. PLA
5.69 Digital Principles and System Design
REVIEW QUESTIONS
1. Explain in detail about the programmable Logic Array and Programmable Array Logic.
2. Design a 16-bit RAM array (4X4 RAM) and explain the operation.
3. Explain Field Programmable Gate Array (FPGA).
4. Design a switching circuit that converts a 4-bit binary code into a 4-bit gray code using
ROM array.
5. Implement the following using PLA A(x,y,z)=∑(1,2,4,6); B(x,y,z)=∑(0,1,6,7);
C(x,y,z)=∑(2,6)
6. A combinational logic circuit is defined by the following function f1(a,b,c)=∑(0,1,6,7)
f2(a,b,c)=∑(2,3,5,7). Implement the circuit with a PAL having three inputs, three product
terms and two outputs.
7. The following messages have been coded in even parity hamming code and transmitted
through a noisy channel. Decode the messages, assuming that at most a single error has
occurred in each code word. (i) 1001001; (ii) 0111001
8. Write a detailed note on sequential programmable devices.
9. Design and implement 3-bit binary to gray code converter using PLA.
10. Illustrate with neat sketch and describe the categories of RAM.
11. Explain about error detection and correction using hamming codes.
12. Implement the following function using PAL F1(A,B,C)=∑(1,2,4,6);
F2(A,B,C)=∑(0,1,6,7); F3(A,B,C)=∑(1,2,3,5,7)
13. Design a combinational circuit using ROM that accepts a three bit binary number and
output is a binary number equal to the square of the input number.
14. The hamming code 101101101 is received. Correct it if any errors. There are four parity
bits and odd parity is used.
15. Define Memory and discuss the operation & types of RAM and ROM.
16. Elaborate the construction of sequential programmable devices in detail.
17. Explain ASIC in detail.
5.71 Digital Principles and System Design
19. Implement the two following Boolean function using 8x2 PROM.
F1(x,y,z) = F2(x,y,z)=
Discuss the operation of memory decoding and elaborate its application as address multiplexing
and coincident decoding circuit.
Appendix 2 9
REFERENCES
1. Morris Mano.M, Digital Design, Prentice Hall of India Pvt. Ltd., New Delhi, 2003.
3. John.F.Wakerly, Digital Design Principles and Practices, 3rd Edition, Pearson Education, New
Delhi, 2002.
4. Thomas.L.Floyd, Digital Fundamentals, 8th Edition, Pearson Education, Inc, New Delhi, 2003.
6. Charles.H.Roth, Jr, Fundamentals of Logic Design, 4th edition, Jaico Publishing House, 2002.
7. Donald.P.Leach, Albert Paul Malvino, Digital Principles and Applications, 5th Edition, Tata
McGraw-Hill, 2003.
11. Jain. R.P, Modern Digital Electronics, Tata McGraw Hill, 2003.
13. Salivahanan.S, Arivazhagan.S, Digital Circuits and Design, Vikas Publishing House Pvt. Ltd.,
2004.
15. Millman.J, Taub.H, Pulse, Digital and Switching Waveforms, McGraww Hill, 1965.
16. Hall.D.V, Micro Processor and Digital Systems, McGraw Hill, 1980.
19. Donald D. Givone, Digital Principles and Design, Tata McGraw-Hill, 2003.
(i)