Fundamentals of Digital Circuits-Anand Kumar
Fundamentals of Digital Circuits-Anand Kumar
Fundamentals of Digital Circuits-Anand Kumar
DIGITAL CIRCUITS
FOURTH EDITION
A. Anand Kumar
Principal
K.L. University College of Engineering
K.L. University
Green Fields, Vaddeswaram
Guntur District
Andhra Pradesh
Delhi-110092
2016
FUNDAMENTALS OF DIGITAL CIRCUITS, Fourth Edition
A. Anand Kumar
© 2016 by PHI Learning Private Limited, Delhi. All rights reserved. No part of this book may be
reproduced in any form, by mimeograph or any other means, without permission in writing from the
publisher.
ISBN-978-81-203-5268-1
The export rights of this book are vested solely with the publisher.
Published by Asoke K. Ghosh, PHI Learning Private Limited, Rimjhim House, 111, Patparganj
Industrial Estate, Delhi-110092 and Printed by Mohan Makhijani at Rekha Printers Private Limited,
New Delhi-110020.
To
the memory of
My parents
Shri A. Nagabhushanam and Smt. A. Ushamani
(Freedom Fighters)
CONTENTS
1 INTRODUCTION ...............................................................................................1–27
1.1 DIGITAL AND ANALOG SYSTEMS ................................................................................ 1
1.2 LOGIC LEVELS AND PULSE WAVEFORMS .................................................................. 3
1.3 ELEMENTS OF DIGITAL LOGIC ..................................................................................... 5
1.4 FUNCTIONS OF DIGITAL LOGIC .................................................................................... 5
1.4.1 Arithmetic Operations ............................................................................................ 5
1.4.2 Encoding ................................................................................................................ 6
1.4.3 Decoding ................................................................................................................ 7
1.4.4 Multiplexing .......................................................................................................... 7
1.4.5 Demultiplexing ...................................................................................................... 8
1.4.6 Comparison ............................................................................................................ 8
1.4.7 Code Conversion ................................................................................................... 8
1.4.8 Storage .................................................................................................................... 8
1.4.9 Counting ................................................................................................................ 9
1.4.10 Frequency Division ................................................................................................ 9
1.4.11 Data Transmission .................................................................................................. 9
1.5 DIGITAL INTEGRATED CIRCUITS ............................................................................... 10
1.5.1 Levels of Integration ............................................................................................ 10
1.6 MICROPROCESSORS ..................................................................................................... 11
v
vi CONTENTS
Reflecting over 40 years of experience in the classroom, the fourth edition of this comprehensive
textbook on digital circuits is developed to provide a solid grounding in the foundations of basic
design techniques of digital systems. Using a student-friendly writing style, the text introduces the
students to digital concepts in a simple and lucid manner with an emphasis on practical treatment
and real-world applications. A large number of typical examples have been worked out, so that the
students can understand the related concepts clearly. Most of the problems in the book are
classroom tested. The book blends basic digital electronic theory with the latest developments in
digital technology. The text is, therefore, suitable for use as course material by undergraduate
students of electronics and communication engineering, electrical and electronics engineering,
computer science and engineering, electronics and computers engineering, instrumentation
engineering, telecommunications engineering, biomedical engineering, and information
technology. As there is no specific prerequisite to understand the book except for an elementary
knowledge of basic electronics, it can also be used by students of polytechnics and undergraduate
and postgraduate science students pursuing courses in electronics and computer science. It can also
be used by AMIE, grad IETE and MCA students.
Systems can be analog or digital. Analog and digital systems are compared and various
digital systems are introduced in Chapter 1.
The switching devices used in digital systems are generally two-state devices. So, it is
natural to use binary numbers in digital systems. Human beings can interpret and understand data
which are available in decimal form. Binary data can be represented concisely using the octal and
hexadecimal notations. For this reason, decimal, binary, octal, and hexadecimal number systems,
conversion of numbers from one system to another and arithmetic operations in those systems are
discussed in Chapter 2.
xxiii
xxiv PREFACE
To provide easy communication between man and machine, and also for ease of use in
various devices and for transmission, decimal numbers, symbols, and letters are coded in various
ways. Several codes and arithmetic operations involving some of those codes are presented in
Chapter 3.
The basic building blocks used to construct combinational circuits are logic gates. Various
logic gates and the functions performed by them are described in Chapter 4.
The logic designer must determine how to interconnect the logic gates in order to convert
the circuit input signals to the desired output signals. The relationship between the input and
output signals can be described mathematically using Boolean algebra. Chapter 5 introduces the
basic laws and theorems of Boolean algebra. It also deals with how to convert algebra to logic and
logic to algebra. Starting from a given problem statement, the first step in designing a
combinational logic circuit is to derive a table or formulate algebraic logic equations which
describe the circuit for the realization of the output function. The logic equations which describe
the circuit output must generally be simplified. The simplification of logic equations using
Boolean algebraic methods is presented in Chapter 5.
The simplification of complex functions cannot be performed by the algebraic methods.
More systematic methods of simplification of logic expressions, such as the Karnaugh map
method and the Quine-McClusky method are introduced in Chapter 6.
Various types of digital circuits used for processing and transmission of data such as
arithmetic circuits, comparators, code converters, parity checkers/generators, encoders, decoders,
multiplexers, and demultiplexers are discussed in detail in Chapter 7. Generally, large digital
systems are designed using IC modules. Modular design using ICs is also discussed in Chapter 7.
Hazards may occur in digital systems. Various hazards and hazard free realization are also
discussed in that chapter.
Logic design using Programmable Logic Devices (PLDs) has got many advantages over
design using fixed function ICs. Logic design using various combinational PLDs (ROMs, PALs,
PLAs, and PROMs) is discussed in Chapter 8.
A single threshold gate can be used in place of many logic gates to realize a Boolean
expression. Synthesis of threshold and non-threshold functions using threshold gates is discussed
in Chapter 9.
The basic memory element used in the design of sequential circuits is called flip-flop.
Various types of latches and flip-flops, their parameters and the conversion of one flip-flop into
another are discussed in Chapter 10.
The flip-flops can be interconnected to make registers for data storage and shifting. Various
types of shift registers are described in Chapter 11.
The counter is a very widely used digital circuit. The flip-flops can be interconnected with
gates to form counters. Asynchronous, synchronous, and ring counters and sequence generators
are discussed in Chapter 12.
The systematic design of sequential machines is very essential. The design procedures
of synchronous sequential machines using state diagrams and state tables are outlined in
Chapter 13.
Sequential circuits (machines) are of two types—Mealy type and Moore type. Minimization
of completely specified sequential machines using the partition tehcnique and incompletely
specified machines using merger tables and merger graphs are discussed in Chapter 14.
PREFACE xxv
The algorithmic state machine (ASM) is the other name of the synchronous sequential
machine. Special flow charts that have been developed to define digital hardware algorithms
called ASM charts are discussed in Chapter 15.
Most of the gates, flip-flops, counters, shift registers, arithmetic circuits, encoders,
decoders, etc. are available in several digital logic families. The TTL, ECL, IIL, MOS, and
CMOS class of logic families are introduced in Chapter 16.
Data processing requires conversion of signals from analog to digital form and from digital
to analog form. Various types of analog to digital (A/D) and digital to analog (D/A) converters are
discussed in Chapter 17.
Modern data processing systems require the permanent or semi-permanent storage of large
amounts of data. Both semiconductor and magnetic memories for this purpose are discussed in
Chapter 18.
Timing circuits are very essential in digital circuit analysis and also display devices find
wide applications. Timing circuits and display devices are discussed in Chapter 19.
The fourth edition of this book includes VERILOG programs in addition to VHDL
programs at the end of chapters. It also presents short questions with answers, review questions,
fill in the blanks with answers, multiple choice questions with answers and exercise problems at
the end of each chapter.
I express my profound gratitude to all those without whose assistance and cooperation, the
fourth edition of this book would not have been successfully completed. I thank my former
colleagues Mr. N.S. Rane, who patiently drew all the figures in the first edition of this book in
corel, and Mr. L. Krishnananda, who typed most of the portions of the original manuscript. I also
thank Smt. S. Uma Maheswari for typing the additional matter in the revision of this book.
I thank Mr. B. Murali Krishna, Mr. T. Narendra Babu, and Mr. M. Venkateswara Rao,
Assistant Professors, K.L. University College of Engineering, K.L. University, Vijayawada for
helping me to include VHDL programs. I specially thank Mr. B. Murali Krishna for helping me to
include VERILOG programs also.
I am grateful to Mr. Burugupalli Venugopala Krishna, President and Mr. B. Ravi Kumar,
Vice President, Sasi Educational Society, Velivennu, West Godavari (Dt), Andhra Pradesh for
encouraging and providing me with all the facilities for bringing out the second edition of this
book.
I thank Mr. Koneru Satyanarayana, President, Mr. Koneru Lakshman Havish and
Mr. Koneru Raja Harin, Vice Presidents and Smt. Koneru Siva Kanchana Latha, Secretary of
Koneru Lakshmaniah Education Foundation (KLEF), K.L. University, Vijayawada, Andhra
Pradesh for their constant support.
I thank Dr. K. Raja Rajeswari former Professor and Head, ECE Department and
Dr. K.S. Lingamoorthy, former Professor and Head, EEE Department of Andhra University
College of Engineering, Visakhapatnam for their encouragement.
I express my sincere appreciation to my brother Mr. A. Vijaya Kumar and to my friends,
Dr. K. Koteswara Rao, Chairman, Gowtham Educational Society, Gudivada, Krishna (Dt),
Andhra Pradesh and Mr. Y. Ramesh Babu and Smt. Y. Krishna Kumari of Detroit for their
constant encouragement.
I thank my publisher PHI Learning and their staff, in particular Mr. Darshan Kumar, former
senior editor who meticulously edited the manuscript for the first edition and Mr. Sudarshan Das,
xxvi PREFACE
former senior editor who made the second edition possible. I am also thankful to Mr. Ajai Kumar
Lal Das, Assistant Production Manager, Ms Shivani Garg, Senior Editor, and Ms Babita Misra,
Editorial Coordinator for bringing out the third and fourth editions of the book in short time.
Finally, I am deeply indebted to my wife, Smt. A. Jhansi, without whose cooperation and
support this project would not have materialized. I appreciate my sons Dr. A. Anil Kumar and Mr.
A Sunil Kumar and daughters-in-law Dr. A. Anureet Kaur and Smt. A. Apurupa and grand-
daughters Khushi Arekapudi, Shreya Arekapudi, and Krisha Arekapudi for their constant words
of encouragement.
The author will gratefully acknowledge suggestions from both students and teachers for
further improvement of this book.
A. Anand Kumar
SYMBOLS, NOTATIONS
xxvii
ABBREVIATIONS
Even though digital techniques have a number of advantages, they have only one major drawback.
THE REAL WORLD IS ANALOG
Most physical quantities are analog in nature, and it is these quantities that are often the inputs and
outputs and continually monitored, operated and controlled by a system. When these quantities
INTRODUCTION 3
are processed and expressed digitally, we are really making a digital approximation to an inherently
analog quantity. Instead of processing the analog information directly, it is first converted into
digital form and then processed using digital techniques. The results of processing can be converted
back to analog form for interpretation. Because of these conversions, the processing time increases
and the system becomes more complex. In most cases, these disadvantages are outweighed by
numerous advantages of digital techniques. However, there are situations where use of only analog
techniques is simpler and more economical. Both the analog and digital techniques can be employed
in the same system to advantage. Such systems are called hybrid systems. But the tendency today
is towards employing digital systems because the economic benefits of integration are of overriding
importance.
The design of digital systems may be roughly divided into three stages—SYSTEM DESIGN,
LOGIC DESIGN, and CIRCUIT DESIGN. System design involves breaking the overall system
into subsystems and specifying the characteristics of each subsystem. For example, the system
design of a digital computer involves specifying the number and type of memory units, arithmetic
units and input-output devices, as well as specifying the interconnection and control of these
subsystems. Logic design involves determining how to interconnect basic logic building blocks to
perform a specific function. An example of logic design is determining the interconnection of
logic gates and flip-flops required to perform binary addition. Circuit design involves specifying
the interconnection of specific components such as resistors, diodes and transistors to form a gate,
flip-flop or any other logic building block. This book is largely devoted to a study of logic design
and the theory necessary for understanding the logic design process.
response as a voltage of 0.4 V or 0.6 V or 0.8 V. Similarly, a voltage of 2 V gives the same
response as a voltage of 2.8 V or 3.6 V or 4.7 V or 5 V.
In digital circuits and systems, the voltage levels are normally changing back and forth
between the HIGH and LOW states. So, pulses are very important in their operation. A pulse may
be a positive pulse or a negative pulse. A single positive pulse is generated when a normally LOW
voltage goes to its HIGH level and then returns to its normal LOW level as shown in Figure 1.1a.
A single negative pulse is generated when a normally HIGH voltage goes to its LOW level and
then returns to its normal HIGH level as shown in Figure 1.1b.
As indicated in Figure 1.1, a pulse has two edges: a leading edge and a trailing edge. For a
positive pulse, the leading edge is a positive going transition (PGT or rising edge) and the trailing
edge is a negative going transition (NGT or falling edge), whereas for a negative pulse, the leading
edge is a negative going transition (NGT) and the trailing edge is a positive going transition (PGT).
The pulses shown in Figure 1.1 are ideal, because the rising and falling edges change instantaneously,
i.e. in zero time. Practical pulses do not change instantaneously from LOW to HIGH or from
HIGH to LOW.
A non-ideal pulse is shown in Figure 1.2. It has finite rise and fall times. The time taken by
the pulse to rise from LOW to HIGH is called the rise time and the time taken by the pulse to go
from HIGH to LOW is called the fall time. Because of the nonlinearities that commonly occur at
the bottom and top of the pulse, the rise time is defined as the time taken by the pulse to rise from
10% to 90% of the pulse amplitude, and the fall time is defined as the time taken by the pulse to
fall from 90% to 10% of the pulse amplitude. The duration of the pulse is usually indicated by
pulse width tw which is defined as the time between the 50% points on the rising and falling edges.
Most waveforms encountered in digital systems are composed of a series of pulses and can
be classified as periodic waveforms and non-periodic waveforms. A periodic waveform is one
which repeats itself at regular intervals of time called the period, T. A non-periodic waveform, of
course, does not repeat itself at regular intervals and may be composed of pulses of different
widths and/or differing time intervals between the pulses. The reciprocal of the period is called the
frequency of the periodic waveform. Another important characteristic of the periodic pulse waveform
is its duty cycle which is defined as the ratio of the ON time (pulse width tw) to the period of the
pulse waveform. Thus,
1 t
f= and duty cycle = w
T T
sum term (S) and a carry output term (CO). Figure 1.3a is a block diagram of an adder. It illustrates
the addition of the binary equivalents of 8 and 6 with a carry input of 1, which results in a binary
sum term 5 and a carry output term 1.
The arithmetic operation subtraction can be performed by a digital logic circuit called the
subtractor. Its function is to subtract the subtrahend (A) from the minuend (B) considering the
borrow input (BI) and to generate a difference term (D) and a borrow output term (BO). Since
subtraction is equivalent to addition of a negative number, subtraction can be performed by using
an adder. Figure 1.3b is a block diagram of a subtractor. It illustrates the subtraction of the binary
equivalent of 8 from the binary equivalent of 3 with a borrow input of 1, which results in a binary
difference term 5 and a borrow output term 1.
The arithmetic operation multiplication can be performed by a digital logic circuit called the
multiplier. Its function is to multiply the multiplicand (A) by the multiplier (B) and generate the
product term (P). Since multiplication is simply a series of additions with shifts in the positions of
the partial products, it can be performed using an adder. Figure 1.4a is a block diagram of a
multiplier. It illustrates the multiplication of 6 by 4, which results in the product term 24.
The arithmetic operation division can be performed by a digital logic circuit called the divider.
Division can also be performed by an adder itself, since division involves a series of subtractions,
comparisons and shifts. Its function is to divide the dividend (A) by the divisor (B) and generate a
quotient term (Q) and a remainder term (R). Figure 1.4b is a block diagram of a divider. It illustrates
the division of the binary equivalent of 30 by the binary equivalent of 4, which results in a binary
quotient term 7 and a remainder term 2.
1.4.2 Encoding
Encoding is the process of converting a familiar number or symbol to some coded form. An encoder
is a digital device that receives digits (decimal, octal, etc.), or alphabets, or special symbols and
INTRODUCTION 7
converts them to their respective binary codes. In the octal-to-binary encoder shown in Figure 1.5a,
a HIGH level on a given input corresponding to a specific octal digit produces the appropriate
3-bit code (ABC) on the output levels. The figure illustrates encoding of the octal digit 6 to
binary 110.
1.4.3 Decoding
Decoding is the inverse operation of encoding. A decoder converts binary-coded information
(ABC) to unique outputs such as decimal, octal digits, etc. In the binary-to-octal decoder shown in
Figure 1.5b, a combination of specific levels on the input lines produces a HIGH on the
corresponding output line. The figure illustrates decoding of the binary 110 to octal digit 6.
0 0
1 1
Octal
2 A HIGH HIGH A 2
Binary Binary Octal
digit 3
Encoder B HIGH HIGH B
Decoder
3
4 output input 4 digit
inputs
C LOW LOW C
outputs
5 5
HIGH HIGH
6 6
7 7
6 Æ 110 110 Æ 6
(a) The encoder (b) The decoder
Figure 1.5 The encoder and the decoder.
1.4.4 Multiplexing
Multiplexing means sharing. It is the process of switching information from several lines on to a
single line in a specified sequence. A multiplexer or data selector is a logic circuit that accepts
several data inputs and allows only one of them to get through to the output. It is an N-to-1 device.
In the multiplexer shown in Figure 1.6a, if the switch is connected to input A for time t1, to input
B for time t2, to input C for time t3 and to input D for time t4, the output of the multiplexer will be
as shown in the figure. This figure illustrates a 4-to-1 multiplexer.
1.4.5 Demultiplexing
Demultiplexing operation is the inverse of multiplexing. Demultiplexing is the process of switching
information from one input line on to several output lines. A demultiplexer is a digital circuit that
takes a single input and distributes it over several outputs. It is a 1-to-N device. In the demultiplexer
shown in Figure 1.6b, if the switch is connected to output A for time t1, to output B for time t2, to
output C for time t3 and to output D for time t4, the output of the demultiplexer will be as shown in
the figure. The figure illustrates a 1-to-4 demultiplexer.
1.4.6 Comparison
A logic circuit used to compare two quantities and give an output signal indicating whether the
two input quantities are equal or not, and if not, which of them is greater, is called a comparator.
Figure 1.7a shows the block diagram of a comparator. The binary representations of the quantities
A and B to be compared are applied as inputs to the comparator. One of the outputs, A < B, A = B
or A > B goes HIGH, depending on the magnitudes of the input quantities. The figure illustrates
comparison of 8 and 4, and the result is HIGH (8 > 4).
1.4.8 Storage
Storage and shifting of information is very essential in digital systems. Digital circuits used
for temporary storage and shifting of information (data), are called registers. Registers are
made up of storage elements called flip-flops. Figure 1.8a shows the shifting or loading of
data into a register made up of four flip-flops. After each clock pulse, the input bit is shifted
into the first flip-flop and the content of each flip-flop is shifted to the flip-flop to its right.
Figure 1.8b shows the shifting out of data from the register. The content of the last flip-flop is
shifted out and lost.
INTRODUCTION 9
1.4.9 Counting
The counting operation is very important in digital systems. A logic circuit used to count the
number of pulses inputted to it, is called a counter. The pulses may represent some events. In order
to count, the counter must remember the present number, so that it can go to the next proper
number in the sequence when the next pulse comes. So, storage elements, i.e. flip-flops are used to
build counters too. Figure 1.9a shows the block diagram of a counter.
hand, in serial transmission, the information is transmitted bit-by-bit. So, only one connecting line
is sufficient between the transmitter and the receiver. Hence, serial transmission is simpler and
cheaper, but slower. The principal trade-off between parallel and serial transmissions is, therefore,
one of speed versus circuit simplicity. Figure 1.10a shows parallel data transmission of 8 bits and
Figure 1.10b shows serial data transmission.
Small scale integration (SSI): The least complex digital ICs with less than 12 gate circuits on a
single chip. Logic gates and flip-flops belong to this category.
Medium scale integration (MSI): With 12 to 99 gate circuits on a single chip, the more complex
logic circuits such as encoders, decoders, counters, registers, multiplexers, demultiplexers, arithmetic
circuits, etc. belong to this category.
Large scale integration (LSI): With 100 to 9999 gate circuits on a single chip, small memories
and small microprocessors fall in this category.
Very large scale integration (VLSI): ICs with complexities ranging from 10,000 to 99,999
gate circuits per chip fall in this category. Large memories and large microprocessor systems, etc.
come in this category.
Ultra large scale integration (ULSI): With complexities of over 100,000 gate circuits per
chip, very large memories and microprocessor systems and single-chip computers come in this
category.
Digital ICs can also be categorized according to the principal type of the electronic component
used in their circuitry. They are:
(a) Bipolar ICs—which use BJTs.
(b) Unipolar ICs—which use MOSFETs.
Several integrated-circuit fabrication technologies are used to produce digital ICs. Presently,
digital ICs are fabricated using TTL, ECL, IIL, MOS and CMOS technologies. Each differs from
the other in the type of circuitry used to provide the desired logic operation. While TTL, ECL and
IIL use bipolar transistors as their main circuit elements, MOS and CMOS use MOSFETs as their
main circuit elements. These technologies are also called logic families. Several sub-families of
these main logic families are also available.
1.6 MICROPROCESSORS
A microprocessor is an LSI/VLSI device that can be programmed to perform arithmetic and logic
operations and other functions in a prescribed sequence for the movement and processing of data.
Microprocessors are available in word lengths of 4, 8, 16, 32 and 64 bits. Presently, 128-bit
microprocessors are being used in some prototype computers. The 4-bit processors are virtually
obsolete. Because of their small size, low cost and low power consumption, microprocessors have
revolutionized the digital computer system technology. The microprocessor is used as the central
processing unit in microcomputer systems. The speed of the microprocessor determines the
maximum speed of a microcomputer.
The arrangement of circuits within the microprocessor (called its architecture) permits the
system to respond correctly to each of the many different instructions. In addition to arithmetic
and logic operations, the microprocessor controls the flow of signals into and out of the computer,
routing each to its proper destination in the required sequence to accomplish a specific task. The
interconnections or paths along which signals flow are called buses. Figure 1.11 shows a block
diagram of the microprocessor.
12 FUNDAMENTALS OF DIGITAL CIRCUITS
Arithmetic &
logic unit
Control
unit
Memory unit: In addition to the instructions and data received from the input unit, the memory
stores the results of arithmetic and logic operations received from the arithmetic and logic unit. It
also supplies information to the output unit.
Control unit: This unit takes instructions from the memory unit one at a time and interprets
them. It then sends the appropriate signals to all the other units to cause the specific instruction to
be executed.
Arithmetic and logic unit: All arithmetic calculations and logical decisions are performed in
this unit. It then sends the results to the memory unit to be stored there.
Output unit: This unit takes data from the memory unit and prints out, displays or otherwise
presents information to the operator.
Minicomputers are larger than microcomputers and are widely used in industrial control
systems, research laboratories, etc. They are generally faster and possess more processing
capabilities than microcomputers.
Mainframes are the largest computers. These maxicomputers include complete systems of
peripheral equipment such as magnetic tape units, magnetic disk units, card punchers and readers
(now obsolete), keyboards, printers and many more. Applications of mainframes range from
computation-oriented science and engineering problem-solving to data-oriented business
applications, where emphasis is on monitoring and updating of large quantities of data and
information.
REVIEW QUESTIONS
VHDL PROGRAMS
1. VHDL PROGRAM FOR 4:2 ENCODER USING BEHAVIORAL MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Encoder is
Port ( DATA : in STD_LOGIC_VECTOR (3 downto 0);
MSG : out STD_LOGIC_VECTOR (1 downto 0));
end Encoder;
SIMULATION OUTPUT:
entity Decoder is
Port ( MSG : in STD_LOGIC_VECTOR (1 downto 0);
DATA : out STD_LOGIC_VECTOR (3 downto 0));
end Decoder;
SIMULATION OUTPUT:
component Encoder is
Port ( DATA : in STD_LOGIC_VECTOR (3 downto 0);
MSG : out STD_LOGIC_VECTOR (1 downto 0));
end component;
24 FUNDAMENTALS OF DIGITAL CIRCUITS
component Decoder is
Port ( MSG : in STD_LOGIC_VECTOR (1 downto 0);
DATA : out STD_LOGIC_VECTOR (3 downto 0));
end component;
RTL SCHEMATIC:
SIMULATION OUTPUT:
INTRODUCTION 25
VERILOG PROGRAMS
SIMULATION OUTPUT:
default:DECOUT=4’bxxxx;
endcase
endmodule
RTL SCHEMATIC:
SIMULATION OUTPUT:
2
NUMBER SYSTEMS
largest number we can count using three bits is 111. Put a 1 to the left and continue; we get, 1000,
1001, 1010, 1011, 1100, 1101, 1110, 1111. The maximum count we can get using four bits is
1111. Continue counting with 5, 6, . . . bits as shown in Table 2.1.
2n–1 ones.
1¥2+0=2
2¥2+0=4
4¥2+1=9
9 ¥ 2 + 0 = 18
18 ¥ 2 + 1 = 37
37 ¥ 2 + 1 = 75
The above steps can be written down as follows:
Copy down the extreme left bit, i.e. MSB = 1
Multiply by 2, add the next bit (1 ¥ 2) + 0 = 2
Multiply by 2, add the next bit (2 ¥ 2) + 0 = 4
Multiply by 2, add the next bit (4 ¥ 2) + 1 = 9
Multiply by 2, add the next bit (9 ¥ 2) + 0 = 18
Multiply by 2, add the next bit (18 ¥ 2) + 1 = 37
Multiply by 2, add the next bit (37 ¥ 2) + 1 = 75
The result is, 1 0 0 1 0 1 12 = 7510
table of powers of 2. In this method, known as the sum-of-weights method, the set of binary weight
values whose sum is equal to the decimal number is determined. To convert a given decimal
integer number to binary, first obtain the largest decimal number which is a power of 2 not exceeding
the given decimal number and record it. Subtract this number from the given number and obtain
the remainder. Once again obtain the largest decimal number which is a power of 2 not exceeding
this remainder and record it. Subtract this number from the remainder to obtain the next remainder.
Repeat the above process on the successive remainders till you get a 0 remainder. The sum of
these powers of 2 expressed in binary is the binary equivalent of the original decimal number. In a
similar manner, this sum-of-weights method can also be applied to convert decimal fractions to
binary. To convert a decimal mixed number to binary, convert the integer and fraction parts
separately into binary. In general, the sum-of-weights method can be used to convert a decimal
number to a number in any other base system.
Second method: In this method, the decimal integer number is converted to the binary integer
number by successive division by 2, and the decimal fraction is converted to binary fraction by
successive multiplication by 2. This is also known as the double-dabble method. In the successive
division-by-2 method, the given decimal integer number is successively divided by 2 till the
quotient is zero. The last remainder is the MSB. The remainders read from bottom to top give
the equivalent binary integer number. In the successive multiplication-by-2 method, the given
decimal fraction and the subsequent decimal fractions are successively multiplied by 2, till the
fraction part of the product is 0 or till the desired accuracy is obtained. The first integer obtained
is the MSB. Thus, the integers read from top to bottom give the equivalent binary fraction. To
convert a mixed number to binary, convert the integer and fraction parts separately to binary
and then combine them.
In general, these methods can be used for converting a decimal number to an equivalent
number in any other base system by just replacing 2 by the base b of that number system. That is,
any decimal number can be converted to an equivalent number in any other base system by the
sum-of-weights method, or by the double-dabble method—repeated division-by-b for integers
and repeated multiplication-by-b for fractions.
EXAMPLE 2.8 Convert 163.87510 to binary.
Solution
The given decimal number is a mixed number. We, therefore, convert its integer and fraction
parts separately.
The integer part is 16310
The largest number, which is a power of 2, not exceeding 163 is 128.
128 = 27 = 100000002
The remainder is
163 – 128 = 35
The largest number, which a power of 2, not exceeding 35 is 32.
32 = 25 = 1000002
The remainder is
35 – 32 = 3
NUMBER SYSTEMS 35
Reading the remainders from bottom to top, the result is 5210 = 1101002.
36 FUNDAMENTALS OF DIGITAL CIRCUITS
Now, in the 2’s column, a 1 cannot be subtracted from a 0; so, borrow a 1 from the 4’s
column. But the 4’s column has a 0. So, borrow a 1 from the 8’s column, making the 8’s
column 0, and bring it to the 4’s column. It becomes 10 in the 4’s column. Keep one 1 in
the 4’s column and bring the second 1 to the 2’s column making it 10 in the 2’s column.
Therefore,
In the 2’s column 10 – 1 = 1
In the 4’s column 1–1=0
In the 8’s column 0–0=0
Hence, the result is 0010.0112.
Most digital computers do subtraction by the 2’s complement method, but some do it by
the 1’s complement method. The advantage of performing subtraction by the complement
method is reduction in the hardware. Instead of having separate digital circuits for addition
and subtraction, only adding circuits are needed. That is, subtraction is also performed by
adders only. Instead of subtracting one number from the other, the complement of the
subtrahend is added to the minuend.
In sign-magnitude form, an additional bit called the sign bit is placed in front of the number.
If the sign bit is a 0, the number is positive. If it is a 1, the number is negative. For example,
= + 41
Sign bit Magnitude
= – 41
Sign bit Magnitude
Under the sign-magnitude system, a great deal of manipulation is necessary to add a positive
number to a negative number. Thus, though the sign-magnitude number system is possible, it is
impractical.
2.3.1 Representation of Signed Numbers Using the 2’s (or 1’s) Complement Method
The 2’s (or 1’s) complement system for representing signed numbers works like this:
1. If the number is positive, the magnitude is represented in its true binary form and a sign
bit 0 is placed in front of the MSB.
2. If the number is negative, the magnitude is represented in its 2’s (or 1’s) complement
form and a sign bit 1 is placed in front of the MSB.
That is, to represent the numbers in sign 2’s (or 1’s) complement form, determine the 2’s (or 1’s)
complement of the magnitude of the number and then attach the sign bit.
The 2’s (or 1’s) complement operation on a signed number will change a positive number to
a negative number and vice versa. The conversion of complement to true binary is the same as the
process used to convert true binary to complement. The representation of + 51 and – 51 in both 2’s
and 1’s complement forms is shown below:
EXAMPLE 2.20 Each of the following numbers is a signed binary number. Determine the
decimal value in each case, if they are in (i) sign-magnitude form, (ii) 2’s complement form,
and (iii) 1’s complement form.
(a) 01101 (b) 010111 (c) 10111 (d) 1101010
Solution
Given number Sign-magnitude form 2’s complement form 1’s complement form
01101 + 13 + 13 + 13
010111 + 23 + 23 + 23
10111 –7 –9 –8
1101010 – 42 – 22 – 21
To subtract using the sign 2’s (or 1’s) complement method, represent both the subtrahend
and the minuend by the same number of bits. Take the 2’s (or 1’s) complement of the subtrahend
including the sign bit. Keep the minuend in its original form and add the 2’s (or 1’s) complement
of the subtrahend to it.
The choice of 0 for positive sign, and 1 for negative sign is not arbitrary. In fact, this choice
makes it possible to add the sign bits in binary addition just as other bits are added. When the sign
bit is a 0, the remaining bits represent magnitude, and when the sign bit is a 1, the remaining bits
represent 2’s or 1’s complement of the number. The polarity of the signed number can be changed
simply by performing the complement on the complete number.
Table 2.2 lists all possible 4-bit singed binary numbers in the three representations. The
equivalent decimal number is also shown for reference. Note that the positive numbers in all three
representations are identical and have 0 in the leftmost position. The singed 2’s complement system
has only one representation for 0, which is always positive. The other two systems have either a
positive or a negative 0 which is something not encountered in ordinary arithmetic. Note that all
negative numbers have a 1 in the leftmost bit position: This is the way we distinguish them from
the positive numbers. With four bits, we can represent 16 binary numbers. In the signed magnitude
and the 1’s complement representations, there are eight positive numbers and eight negative numbers
including two zeros. In the 2’s complement representation, there are eight positive numbers including
one zero and eight negative numbers.
Special case in 2’s complement representation: Whenever a signed number has a 1 in the sign
bit and all 0s for the magnitude bits, the decimal equivalent is –2n, where n is the number of bits in
the magnitude. For example, 1000 = –8 and 10000 = –16.
Characteristics of the 2’s complement numbers: The 2’s complement numbers have the
following properties:
1. There is one unique zero.
2. The 2’s complement of 0 is 0.
3. The leftmost bit cannot be used to express a quantity. It is a sign bit. If it is a 1, the
number is negative and if it is a 0, the number is positive.
44 FUNDAMENTALS OF DIGITAL CIRCUITS
4. For an n-bit word which includes the sign bit, there are (2n–1 – 1) positive integers, 2n–1
negative integers and one 0, for a total of 2n unique states.
5. Significant information is contained in the 1s of the positive numbers and 0s of the negative
numbers.
6. A negative number may be converted into a positive number by finding its 2’s complement.
Methods of obtaining the 2’s complement of a number: The 2’s complement of a number can
be obtained in three ways as given below.
1. By obtaining the 1’s complement of the given number (by changing all 0s to 1s and 1s to
0s) and then adding 1.
2. By subtracting the given n-bit number N from 2n.
3. Starting at the LSB, copying down each bit up to and including the first 1 bit encountered,
and complementing the remaining bits.
EXAMPLE 2.21 Express – 45 in 8-bit 2’s complement form.
Solution
+45 in 8-bit form is 00101101.
NUMBER SYSTEMS 45
First method
Obtain the 1’s complement of 00101101 and then add 1.
Positive expression of the given number 00101101
1’s complement of it 11010010
Add 1 +1
Thus, the 2’s complement form of – 45 is 11010011
Second method
Subtract the given number N from 2n
2n = 100000000
Subtract 45 = – 00101101
Thus, the 2’s complement form of – 45 is 11010011
Third method
Copy down the bits starting from LSB up to and including the first 1, and then complement
the remaining bits.
Original number 00101101
Copy up to the first 1 bit 1
Complement the remaining bits 1101001
Thus, the 2’s complement form of – 45 is 11010011
EXAMPLE 2.22 Express –73.75 in 12-bit 2’s complement form.
Solution
+ 73.75 = N = 01001001.1100
First method
Positive expression of the given number 01001001 .1100
1’s complement of it 10110110 .0011
Add 1 +1
Thus, the 2’s complement of –73.75 is 10110110 .0100
Second method
28 = 1 0 0 0 0 0 0 0 0 . 0 0 0 0
Subtract 73.75 =– 01001001 .1100
Thus, the 2’s complement of –73.75 is 10110110 .0100
Third method
Original number 01001001 .1100
Copy up to the first 1 bit 100
Complement the remaining bits 10110110 .0
Thus, –73.75 in 2’s complement form is 10110110 .0100
the result will be only of 4 bits. Carry, if any, from the fourth bit will overflow. This is called the
modulus arithmetic. For example: 1100 + 1111 = 1011.
In the 2’s complement subtraction, add the 2’s complement of the subtrahend to the minuend.
If there is a carry out, ignore it. Look at the sign bit, i.e. MSB of the sum term. If the MSB is a 0,
the result is positive and is in true binary form. If the MSB is a 1 (whether there is a carry or no
carry at all) the result is negative and is in its 2’s complement form. Take its 2’s complement to
find its magnitude in binary.
EXAMPLE 2.23 Subtract 14 from 46 using the 8-bit 2’s complement arithmetic.
Solution
+14 = 00001110
–14 = 11110010 (In 2’s complement form)
+46 00101110
–14 fi +11110010 (2’s complement form of – 14)
+32 00100000 (Ignore the carry)
There is a carry, ignore it. The MSB is 0. So, the result is positive and is in normal binary
form. Therefore, the result is + 00100000 = + 32.
EXAMPLE 2.24 Add – 75 to + 26 using the 8-bit 2’s complement arithmetic.
Solution
+75 = 01001011
–75 = 10110101 (In 2’s complement form)
+26 00011010
–75 fi +10110101 (2’s complement form of – 75)
–49 11001111 (No carry)
There is no carry, the MSB is a 1. So, the result is negative and is in 2’s complement form.
The magnitude is 2’s complement of 11001111, that is, 00110001 = 49. Therefore, the result
is – 49.
EXAMPLE 2.25 Add – 45.75 to + 87.5 using the 12-bit 2’s complement arithmetic.
Solution
+87 .5 01010111 .1000
–45 .75 fi + 1 1 0 1 0 0 1 0 . 0 1 0 0 (– 45.75 in 2’s complement form)
+41 .75 0 0 1 0 1 0 0 1 . 1 1 0 0 (Ignore the carry)
There is a carry, ignore it. The MSB is 0. So, the result is positive and is in normal binary
form. Therefore, the result is + 41.75
EXAMPLE 2.26 Add 27.125 to – 79.625 using the 12-bit 2’s complement arithmetic.
Solution
+27.125 00011011 .0010
– 7 9 . 6 2 5 fi + 1 0 1 1 0 0 0 0 . 0 1 1 0 (– 79.625 in 2’s complement form)
–52.500 1 1 0 0 1 0 1 1 . 1 0 0 0 (No carry)
NUMBER SYSTEMS 47
There is no carry. The MSB is a 1 indicating that the result is negative and is in its 2’s complement
form. The 2’s complement of 11001011.1000 is 00110100.1000. Therefore, the result is – 52.5.
EXAMPLE 2.27 Add – 31.5 to – 93.125 using the 12-bit 2’s complement arithmetic.
Solution
–93 .125 1 0 1 0 0 0 1 0 . 1 1 1 0 (– 93.125 in 2’s complement form)
– 3 1 . 5 0 0 fi + 1 1 1 0 0 0 0 0 . 1 0 0 0 (– 31.5 in 2’s complement form)
–124 .625 1 0 0 0 0 0 1 1 . 0 1 1 0 (Ignore the carry)
There is a carry, ignore it. The MSB is a 1. So, the result is negative and is in its 2’s complement
form. The 2’s complement of 1000 0011.0110 is 0111 1100.1010. Therefore, the result is
– 124.625.
EXAMPLE 2.28 Add 47.25 to 55.75 using the 2’s complement method.
Solution
47 .25 00101111 .0100
55 .75 fi +00110111 .1100
103 .00 01100111 .0000 (No carry)
There is no carry. The MSB is a 0. Therefore, the result is positive and is in its true binary
form. Hence, it is equal to + 103.0.
EXAMPLE 2.29 Add + 40.75 to – 40.75 using the 12-bit 2’s complement arithmetic.
Solution
+40 .75 00101000 .1100
– 4 0 . 7 5 fi + 1 1 0 1 0 1 1 1 . 0 1 0 0 (– 40.75 in 2’s complement form)
00 .00 0 0 0 0 0 0 0 0 . 0 0 0 0 (Ignore the carry)
There is a carry, ignore it. The result is 0.
Method of obtaining the 1’s complement of a number: The 1’s complement of a number
is obtained by simply complementing each bit of the number, that is, by changing all the 0s to
1s and all the 1s to 0s. We can also say that the 1’s complement of a number is obtained by
subtracting each bit of the number from 1. This complemented value represents the negative of
the original number. This system is very easy to implement in hardware by simply feeding all
bits through inverters. One of the difficulties of using 1’s complement is its representation of
zero. Both 00000000 and its 1’s complement 11111111 represent zero. The 00000000 is called
positive zero and the 11111111 is called negative zero.
EXAMPLE 2.30 Represent – 99 and – 77.25 in 8-bit 1’s complement form.
Solution
We first write the positive representation of the given number in binary form and then
complement each of its bits to represent the negative of the number.
(a) +99=01100011
–99=10011100 (In 1’s complement form)
(b) +77 .25=01001101 .0100
– 7 7 . 2 5 = 1 0 1 1 0 0 1 0 . 1 0 1 1 (In 1’s complement form)
48 FUNDAMENTALS OF DIGITAL CIRCUITS
To write the negative number in sign 2’s complement form, put a 1 in the MSB position
and write the 15-bit 2’s complement form of the magnitude in the other 15-bit positions.
(a) The given number + 1 0 0 1 0 1 0 in 15-bit form is + 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0
In 16-bit sign magnitude form it is 0000000001001010
In 16-bit sign 1’s complement form it is 0000000001001010
In 16-bit sign 2’s complement form it is 0000000001001010
(b) The given number – 1 1 1 1 0 0 0 0 in 15-bit form is – 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0
In 16-bit sign magnitude form it is 1000000011110000
In 16-bit sign 1’s complement form it is 1111111100001111
In 16-bit sign 2’s complement form it is 1111111100010000
(c) The given number – 1 1 0 0 1 1 0 0 . 1 in 15-bit form is – 0 0 0 1 1 0 0 1 1 0 0 . 1 0 0 0
In 16-bit sign magnitude form it is 1000 11001100.1000
In 16-bit sign 1’s complement form it is 1111 00110011.0111
In 16-bit sign 2’s complement form it is 1111 00110011.1000
(d) The given number + 1 0 0 0 0 0 0 1 1 . 1 1 1 in 15-bit form is 0 0 1 0 0 0 0 0 0 1 1 . 1 1 10
In 16-bit sign magnitude form it is 0001000 00 011.1110
In 16-bit sign 1’s complement form it is 0001000 00 011.1110
In 16-bit sign 2’s complement form it is 0001000 00 011.1110
EXAMPLE 2.39 Perform N1 + N2, N1 + (– N2) for the following 8-bit numbers expressed
in 2’s complement representation. Verify your answers by using decimal addition and
subtraction
(a) N1 = 0 0 1 1 0 0 1 0, N2 = 1 1 1 1 1 1 0 1
(b) N1 = 1 0 0 0 1 1 1 0, N2 = 0 0 0 0 1 1 0 1
Solution
Since the given 8-bit numbers are in 2’s complement form, if the MSB is a 0, the number is
positive and the remaining bits give the magnitude of the positive number. If the MSB is a 1,
the number is negative and 2’s complement of the remaining bits give the magnitude of the
negative number. So, perform the addition and subtraction using 2’s complement method.
The arithmetic operations and the verification of the answers using decimal addition and
subtraction are performed as given below.
(a) Given N1 = 0 0 1 1 0 0 1 02 = + 0 1 1 0 0 1 0 = + 5 010, and
N2 = 1 1 1 1 1 1 0 12 = – 0 0 0 0 0 1 1 = – 310
N1 + N2 = 00110010 +50+
+ 11111101 –3
00101111=+47 +47
There is a carry. Ignore it. The MSB is a 0. So, answer is positive and the remaining bits
indicate the magnitude in normal binary. It is + 47.
N1 + (– N2) = 0 0 1 1 0 0 1 0 +50+
+00000011 + 3
00110101 =+53 +53
There is no carry. The MSB is a 0. So, the answer is positive and is in true binary form. It is
+ 53.
NUMBER SYSTEMS 51
The augend is positive and the addend is negative and is in its 2’s complement form. In the
sum term there is a carry. Ignore it. The answer is all 0s. It is 0. The decimal addition is
shown above.
(iii) 111001 fi 1 1 1 0 0 1 = – 0 0 1 1 1 = – 7+
–001010 + 1 1 0 1 1 0 = – 0 1 0 1 0 = –10
101111 = –17 –17
The minuend is negative and the subtrahend is positive. Take the 2’s complement of the
subtrahend and add it to the minuend. In the sum term there is a carry. Ignore it. The sign bit
is a 1. So, the answer is negative. Take its 2’s complement and put a minus sign. It is –17.
The decimal subtraction is shown above.
(iv) 101011 fi 101011 = –10101 = –21 –
–
–100110 +011010 = –11010 = –26
000101 = +5 +5
Both the minuend and the subtrahend are negative and are in 2’s complement form. Since the
subtrahend is to be subtracted from the minuend, take the 2’s complement of the subtrahend
and add it to the minuend. In the sum term there is a carry. Ignore it. The sign bit is a 0. So, the
answer is positive and is in true binary form. It is + 5. The decimal subtraction is shown above.
(b) Given that the binary numbers listed have a sign bit and if negative, numbers are in 1’s
complement form. So, if MSB = 0, the number is positive and the remaining bits give its
magnitude. If the MSB = 1, the number is negative and the remaining bits give the 1’s
complement of the magnitude. Therefore,
1 0 1 0 1 1 =– 1 0 1 0 0 = –20 1 1 1 0 0 0=– 0 0 1 1 1=– 7
0 0 1 1 1 0 =+ 0 1 1 1 0 = +14 1 1 0 0 1 0=– 0 1 1 0 1 = –13
1 1 1 0 0 1 =– 0 0 1 1 0=–6 0 0 1 0 1 0=+ 0 1 0 1 0 = +10
1 0 1 0 1 1 =– 1 0 1 0 0 = –20 1 0 0 1 1 0=– 1 1 0 0 1 = –25
The arithmetic operations in 1’s complement form and their verifications are given below.
(i) 101011 = –10100 = –20 +
+111000 = –00111 = – 7
100011 –27
1
100100 = –27
Both the augend and addend are negative and are in 1’s complement form. In the sum term
there is a carry. Add it to the LSB. The sign bit is a 1. So, the answer is negative. Take its 1’s
complement and put a minus sign. Answer = –110112 = –27. The decimal addition is also
shown above.
(ii) 0 0 1 1 1 0 = + 0 1 1 1 0 = +14 +
+ 1 1 0 0 1 0 = – 0 1 1 0 1 = –13
000000 1
1
000001 = +1
NUMBER SYSTEMS 53
The augend is positive and the addend is negative and is in its 1’s complement form. In the
sum term there is a carry. Add it to the LSB. The sign bit is a 0. So, the answer is positive and
is in true binary form. It is +1. The decimal addition is also shown above.
(iii) 1 1 1 0 0 1 fi 1 1 1 0 0 1 = – 0 0 1 1 0 = – 6+
–001010 + 1 1 0 1 0 1 = – 0 1 0 1 0 = –10
101110 –16
1
101111 = –16
The minuend is negative and is in 1’s complement form. The subtrahend is positive.
Take the 1’s complement of the subtrahend and add it to the minuend. In the sum term
there is a carry. Add it to the LSB. The sign bit is a 1. So, the answer is negative. Take its
1’s complement and put a minus sign. It is –16. The decimal subtraction is also shown
above.
(iv) 101011 fi 101011 = –10100 = –20 –
–100110 +011001 = –11001 = –25
000100 + 5
1
000101 = +5
Both the minuend and the subtrahend are negative and are in 1’s complement form. Take the
1’s complement of the subtrahend and add it to the minuend. The sum term has a carry. Add
it to the LSB. The sign bit is a 0. So, the answer is positive and is in normal binary form. It is
+5. The decimal subtraction is also shown above.
EXAMPLE 2.41 Perform the subtraction with the following unsigned binary numbers
(a) by taking the 2’s complement of the subtrahend and (b) by taking the 1’s complement of
the subtrahend.
(i) 11010 – 10000
(ii) 11010 – 1101
(iii) 100 – 11000
(iv) 1010100 – 1010100
Solution
(a) Subtraction of the given unsigned binary numbers using 2’s complement method
(i) 11010 fi 11010 = 26
–10000 +10000 (2’s complement) = –16
01010 (Ignore the carry) +10
= + 0 1 0 1 0 = +10 (Result is positive = +10)
There is a carry. Ignore it. The MSB is 0. Hence, the answer is positive and is in true binary
form.
So it is + 0 1 0 1 0 = + 10
54 FUNDAMENTALS OF DIGITAL CIRCUITS
There are many formats of floating point numbers, each computer having its own. Some use
two words for the mantissa, and one for the exponent; others use one and half words for the
mantissa, and a half word for the exponent. On some machines the programmer can select from
several formats, depending on the accuracy desired. Some use excess-n notation for the exponent,
some use 2’s complement, some even use sign-magnitude for both the mantissa and the exponent.
To convert the given decimal fraction to octal, successively multiply the decimal fraction
and the subsequent decimal fractions by 8 till the product is 0 or till the required accuracy is
obtained. The first integer from the top is the MSD. The integers to the left of the octal point read
downwards give the octal fraction.
EXAMPLE 2.46 Convert 378.9310 to octal.
Solution
Conversion of 37810 to octal
Successive division Remainders
8 378
8 47 ≠ 2
8 5 Ω 7
0 Ω 5
somewhat more difficult to interpret than the octal number system, it has become the most popular
means of direct data entry and retrieval in digital systems. The hexadecimal number system is a
positional-weighted system. The base or radix of this number system is 16, that means, it has 16
independent symbols. The symbols used are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Since
its base is 16 = 24, every 4 binary digit combination can be represented by one hexadecimal digit.
So, a hexadecimal number is 1/4th the length of the corresponding binary number, yet it provides
the same information as the binary number. A 4-bit group is called a nibble. Since computer words
come in 8 bits, 16 bits, 32 bits and so on, that is, multiples of 4 bits, they can be easily represented
in hexadecimal. The hexadecimal system is particularly useful for human communications with
computers. By far, this is the most commonly used number system in computer literature. It is
used both in large and small computers.
(c) 56547 = 5 ¥ 73 + 6 ¥ 72 + 5 ¥ 71 + 4 ¥ 70
= 5 ¥ 343 + 6 ¥ 49 + 5 ¥ 7 + 4 ¥ 1 = 204810
204810 = 2048 + 0 + 0 + 0 + 0 + 0 + 0 + 0+ 0+ 0 + 0 + 0
= 1 0 0 0 0 0 0 0 0 0 0 02
(d) 12213 = 1 ¥ 33 + 2 ¥ 32 + 2 ¥ 31 + 1 ¥ 30
= 1 ¥ 27 + 2 ¥ 9 + 2 ¥ 3 + 1 ¥ 1 = 5210
5210 = 32 + 16 + 0 + 4 + 0 + 0 = 1 1 0 1 0 02
EXAMPLE 2.64 List the first 20 numbers in base 3, base 5, base 7 and base 12 systems.
Solution
The first 20 numbers in different bases are given in Table 2.5.
Base Base
Decimal 3 5 7 12 Decimal 3 5 7 12
0 0 0 0 0 10 101 20 13 A
1 1 1 1 1 11 102 21 14 B
2 2 2 2 2 12 110 22 15 10
3 10 3 3 3 13 111 23 16 11
4 11 4 4 4 14 112 24 20 12
5 12 10 5 5 15 120 30 21 13
6 20 11 6 6 16 121 31 22 14
7 21 12 10 7 17 122 32 23 15
8 22 13 11 8 18 200 33 24 16
9 100 14 12 9 19 201 34 25 17
EXAMPLE 2.65 (a) A person on Saturn possessing 18 fingers has a property worth
(1,00,000)18. He has three daughters and two sons. He wants to distribute half the money
equally to his sons and the remaining half to his daughters equally. How much will his each
son and each daughter get in Indian currency.
(b) An Indian started on an expedition to Saturn with rupees 1,00,000. The expenditure on
Saturn will be in the ratio of 1 : 2 : 7 for food, clothing and travelling. How much will he be
spending on each item in the currency of Saturn.
Solution
(a) (1,00,000)18 = 1 ¥ 185 = (1,889,568)10
Half this money = 1,889,568/2 = Rs. 9,44,784
Each son will get 9,44,784/2 = Rs. 4,72,392
Each daughter will get 9,44,784/3 = Rs. 3,14,928
(b) Amount of money available in Indian currency Rs. (1,00,000)10
The amount spent on food, clothing and travelling is in the ratio of 1 : 2 : 7. So
the amount spent on food = Rs. 10,000 = 1CFA18
66 FUNDAMENTALS OF DIGITAL CIRCUITS
or b=8
Therefore, the above equation is valid in base 8 system.
33
(c) = 11
3
Let the base be b. Converting to decimal,
3b + 3 = 3(b + 1) = 3b + 3.
It is valid for any value of b. Since the largest digit in the number is 3. The base can be
anything greater than 3.
(d) Let the base be b. Expressing in decimal,
2b + 3 + 4b + 4 + b + 4 + 3b + 2 = 2b2 + 2b + 3
or b2 – 4b – 5 = 0
or b=5
The relation is therefore valid in base 5 system.
(e) Let the base be b. Expressing in decimal,
3b 2 + 2 1
=b+2+
2b b
Solving for b, we get b = 4.
(f) Let the base be b. Expressing in decimal, 4b + 1 = 5.
Squaring both sides,
4b + 1 = 25
or b=6
Therefore, the base is 6.
6. How do you convert a decimal number into a number in any other system with base b?
A. A decimal integer part can be converted into any other system by using the sum of weights
method or by repeated division by b. In repeated division by b, the remainders are read from
bottom to top. A decimal fraction part can be converted into any other system by using the sum
of weights method or by repeated multiplication by b. In repeated multiplication by b, the integers
to the left of the radix point are read from top to bottom.
7. What do you mean by a bit?
A. A binary digit is called a bit.
8. What do you mean by a nibble?
A. Each 4-bit binary group is called a nibble.
9. What do you mean by a byte?
A. Each 8-bit binary group is called a byte.
10. Define word.
A. A group of bits processed by a digital system at a time is called a word.
11. What do you mean by word length?
A. The number of bits used to make a word is called word length.
12. What is the easiest way to convert large decimal numbers into binary and vice versa?
A. The easiest way to convert large decimal numbers into binary and vice versa is via the hexadecimal
system.
13. What is the easiest way to convert octal numbers to hexadecimal and vice versa?
A. The easiest way to convert octal numbers to hexadecimal and vice versa is via the binary system.
14. How is subtraction performed by complement method?
A. Subtraction in any number system with base b can be performed by using b’s complement method
or (b – 1)’s complement method.
15. How are negative numbers represented?
A. Negative numbers can be represented in (a) sign-magnitude form or (b) 1’s ((b – 1)’s) complement
form or (c) 2’s (b’s) complement form.
16. Explain the sign magnitude representation of numbers.
A. In the sign magnitude representation of numbers, the MSB is used to represent sign (0 for positive
and 1 for negative) and the remaining bits represent the magnitude in straight binary form.
17. What is 1’s complement representation method?
A. In 1’s complement representation, the positive numbers are represented exactly in the same form
as straight binary representation whereas the negative numbers are represented by subtracting
equivalent positive number from (2n – 1), where n is the number of bits used, or by complementing
each bit of its positive equivalent.
18. What is 2’s complement representation method?
A. In 2’s complement representation, the positive numbers are represented exactly in the same way
as in straight binary representation, but the negative numbers are represented by subtracting the
equivalent positive number from 2n where n is the number of bits used or by adding 1 to its 1’s
complement form.
19. How do you obtain the 1’s ((b – 1)’s) complement of a number?
A. The 1’s ((b – 1)’s) complement of a number can be obtained by subtracting each bit (digit) of the
number from 1(b – 1). The 1’s complement of a binary number can be simply obtained by
complementing each bit, i.e. by changing the 0s to 1s and 1s to 0s.
NUMBER SYSTEMS 69
REVIEW QUESTIONS
1. The ______ or ______ of a number system indicates the number of unique symbols used in that
system.
2. In a ______, the values attached to the symbols depend on their location with respect to the radix
point.
3. The ______ separates the integer and fraction parts.
4. The extreme right digit in any number is the ______ and the extreme left digit is the ______.
5. A binary digit is called a ______.
NUMBER SYSTEMS 71
1. Knowledge of binary number system is required for the designers of computers and other digital
systems because
(a) it is easy to learn binary number system
(b) it is easy to learn Boolean algebra
(c) it is easy to use binary codes
(d) the devices used in these systems operate in binary
2. A binary number with n bits all of which are 1s has the value
(a) n2 – 1 (b) 2n (c) 2(n–1) (d) 2n – 1
3. If 41 = 5, the base (radix) of the number system is
(a) 5 (b) 6 (c) 7 (d) 8
4. The number of bits required to assign binary roll numbers to a class of 60 students is
(a) 5 (b) 6 (c) 7 (d) 8
5. The radix of the number system if 302/20 = 12.1 is
(a) 3 (b) 4 (c) 5 (d) 6
72 FUNDAMENTALS OF DIGITAL CIRCUITS
PROBLEMS
2.1 Subtract the following decimal numbers by the 9’s and 10’s complement methods.
(a) 274 – 86 (b) 93 – 615 (c) 574.6 – 279.7 (d) 376.3 – 765.6
2.2 Convert the following binary numbers to decimal.
(a) 1011 (b) 1101101 (c) 1101.11 (d) 1101110.011
2.3 Convert the following decimal numbers to binary.
(a) 37 (b) 28 (c) 197.56 (d) 205.05
2.4 Add the following binary numbers.
(a) 11011 + 1101 (b) 1011 + 1101 + 1001 + 1111
(c) 10111.101 + 110111.01 (d) 1010.11 + 1101.10 + 1001.11 + 1111.11
2.5 Subtract the following binary numbers.
(a) 1011 – 101 (b) 10110 – 1011 (c) 1100.10 – 111.01 (d) 10001.01 – 1111.11
2.6 Multiply the following binary numbers.
(a) 1101 ¥ 101 (b) 11001 ¥ 10 (c) 1101.11 ¥ 101.1 (d) 10110 ¥ 10.1
74 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
1. VHDL PROGRAM FOR NINE’S COMPLEMENT USING DATA FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity NINES_COMPLEMENT is
Port ( Number, Nine : in STD_LOGIC_VECTOR (3 downto 0);
Y : out STD_LOGIC_VECTOR (3 downto 0));
end NINES_COMPLEMENT;
architecture Behavioral of NINES_COMPLEMENT is
begin
Y <= (Nine - Number);
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity TENS_COMPLEMENT is
Port ( Number ,Nine : in STD_LOGIC_VECTOR (3 downto 0);
Y : out STD_LOGIC_VECTOR (3 downto 0));
end TENS_COMPLEMENT;
architecture Behavioral of TENS_COMPLEMENT is
SIGNAL M : STD_LOGIC_VECTOR (3 downto 0);
begin
M <= (Nine - Number);
Y <= (M+1);
end Behavioral;
SIMULATION OUTPUT:
Y <= (M+Number1);
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity binary_addition is
port ( a : in std_logic_vector (3 downto 0);
b : in std_logic_vector (3 downto 0);
y : out std_logic_vector (3 downto 0));
end binary_addition;
architecture behavioral of binary_addition is
begin
y <= (a + b) ;
end behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
NUMBER SYSTEMS 81
VERILOG PROGRAMS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
output [15:0] Y;
wire [15:0] M1,M2;
assign M1 = Nine - Number2;
assign M2 = M1+1;
assign Y = (Number1+M2);
endmodule
SIMULATION OUTPUT:
output [3:0] y;
assign y = ((~a)+1);
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
NUMBER SYSTEMS 85
SIMULATION OUTPUT:
3
BINARY CODES
weight. For each group of four bits, the sum of the weights of those positions where the binary
digit is 1 is equal to the decimal digit which the group represents. 8421, 2421, 84-2-1 are weighted
codes. Non-weighted codes are codes which are not assigned with any weight to each digit position,
i.e. each digit position within the number is not assigned fixed value. Excess-3(XS-3) code and
Gray code are non-weighted codes. There are several weighted codes.
pure binary, in the sense that it requires more bits. For example, the decimal number 14 can be
represented as 1110 in pure binary but as 0001 0100 in 8421 code. Another disadvantage of the
BCD code is that, arithmetic operations are more complex than they are in pure binary. There
are six illegal combinations 1010, 1011, 1100, 1101, 1110 and 1111 in this code, i.e. they are
not part of the 8421 BCD code system. A disadvantage of the 8421 code is that, the rules of
binary addition and subtraction do not apply to the entire 8421 number but only to the individual
4-bit groups.
EXAMPLE 3.8 Perform the following subtractions in XS-3 code using the 10’s complement
method.
(a) 597 – 239 (b) 354 – 672
Solution
(a) 10’s complement of 239 = 761
XS-3 code of 239 = 0101 0110 1100
2’s complement of 239 in XS-3 code = 1010 1001 0100
XS-3 code of 597 = 1000 1100 1010
597 597
fi
–239 +761 (10’s complement of 239)
358 358 (Ignore carry)
358 (Corrected difference in decimal)
1000 1100 1010 (597 in XS-3)
+1010 1001 0100 (2’s complement of 239 in XS-3)
0010 0101 1110 (Propagate carry)
+1 +1
1 0011 0101 1110 (Ignore carry)
+0011 +0011 –0011 (Correct 1110 by subtracting 0011 and
0110 1000 1011 correct 0101 and 0011 by adding 0011)
(Corrected difference in XS-3 code = 358)
(b) 10’s complement of 672 = 328
XS-3 code of 672 = 1001 1010 0101
2’s complement of 672 in XS-3 code = 0110 0101 1011
XS-3 code of 354 = 0110 1000 0111
354 354
fi
–672 +328 (10’s complement of 672)
–318 682 (No carry)
No carry. So, the result is negative and is in its 10’s complement form. The 10’s complement
of 682 is 318. So, the answer is – 318.
0110 1000 0111 (354 in XS-3)
+0110 0101 1011 (2’s complement of 672 in XS-3)
1100 1101 0010 (Propagate carry)
+1
1100 1110 0010 (Correct 0010 by adding 0011 and correct
–0011 –0011 +0011 1110 and 1100 by subtracting 0011)
1001 1011 0101 (No carry)
The sum is the XS-3 form of 682. There is no carry. So, the result is negative and is in the 2’s
complement form. The 2’s complement of the sum is 0110 0100 1011 in XS-3 code (31810). So,
the answer is – 318.
96 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 3.9 Encode the decimal digits 0, 1, 2, . . ., 9 by means of weighted codes 3321,
4221, 731–2, 631–1, 5311, 74–2–1 and 7421.
Solution
The encoding is shown in Table 3.2.
if the brushes are on the sector 010 and almost ready to enter the 110 sector and if the 4’s brush is
slightly ahead, the position would be indicated by 110 instead of 010 resulting in a very small
error. Figure 3.2 illustrates this operation.
where the symbol ≈ stands for the Exclusive OR (X-OR) operation explained below.
The conversion procedure is as follows:
1. Record the MSB of the binary as the MSB of the Gray code.
2. Add the MSB of the binary to the next bit in binary, recording the sum and ignoring the
carry, if any, i.e. X-OR the bits. This sum is the next bit of the Gray code.
3. Add the 2nd bit of the binary to the 3rd bit of the binary, the 3rd bit to the 4th bit, and so
on.
4. Record the successive sums as the successive bits of the Gray code until all the bits of the
binary number are exhausted.
Another way to convert a binary number to its Gray code is to Exclusive OR (i.e. to take the
modulo sum of) the bits of the binary number with those of the binary number shifted one position
to the right. The LSB of the shifted number is discarded and the MSB of the Gray code number is
the same as the MSB of the original binary number.
EXAMPLE 3.10 Convert the binary 1001 to the Gray code.
Solution
(a) Binary 1 0 0 1
ΩΩ ΩΩ ΩΩ ΩΩ
Gray 1 1 0 1
(b) Binary 1001
Shifted binary 100
Gray 1101
Method I. As shown in (a), record the 8’s bit ‘1’ (MSB) of the binary as the 8’s bit of the Gray
code. Then add the 8’s bit of the binary to the 4’s bit of the binary (1 + 0 = 1). Record the sum
as the 4’s bit of the Gray code. Add the 4’s bit of the binary to the 2’s bit of the binary (0 + 0 =
0). Record the sum as the 2’s bit of the Gray code. Add the 2’s bit of the binary to the 1’s bit of
the binary (0 + 1 = 1). Record the sum as the 1’s bit of the Gray code. The resultant Gray code
is 1101.
Method II. As shown in (b), write the given binary number and add it to the same number
shifted one place to the right. Record the MSB of the binary, i.e. 1 as the MSB of the Gray code.
Add the subsequent columns (0 + 1 = 1; 0 + 0 = 0; 1 + 0 = 1) and record the corresponding sums as
the subsequent significant bits of the Gray code. Ignore the bit shifted out. The resultant Gray code
is 1101.
digit is encoded with the Gray code pattern of the decimal digit that is greater by 3. It has a unit
distance between the patterns for 0 and 9. Table 3.4 shows the XS-3 Gray code for decimal digits
0 through 9.
Table 3.4 The XS-3 Gray code for decimal digits 0–9
Decimal digit XS-3 Gray code Decimal digit XS-3 Gray code
0 0 0 1 0 5 1 1 0 0
1 0 1 1 0 6 1 1 0 1
2 0 1 1 1 7 1 1 1 1
3 0 1 0 1 8 1 1 1 0
4 0 1 0 0 9 1 0 1 0
3.5.1 Parity
The simplest technique for detecting errors is that of adding an extra bit, known as the parity bit, to
each word being transmitted. There are two types of parity—odd parity and even parity. For odd
parity, the parity bit is set to a 0 or a 1 at the transmitter such that the total number of 1 bits in the
word including the parity bit is an odd number. For even parity, the parity bit is set to a 0 or a 1 at
the transmitter such that the total number of 1 bits in the word including the parity bit is an even
number. Table 3.5 shows the parity bits to be added to transmit decimal digits 0 through 9 in the
8421 code.
Table 3.5 Odd and even parity in the 8421 BCD code
When the digital data is received, a parity checking circuit generates an error signal if the
total number of 1s is even in an odd-parity system or odd in an even-parity system. This parity
check can always detect a single-bit error but cannot detect two or more errors within the same
word. In any practical system, there is always a finite probability of the occurrence of single error.
The probability that two or more errors will occur simultaneously, although non-zero, is substantially
smaller. Odd parity is used more often than even parity because even parity does not detect the
situation where all 0s are created by a short-circuit or some other fault condition.
If the code possesses the property by which the occurrence of any single-bit error transforms
a valid code word into an invalid one, it is said to be an error-detecting (single bit) code. In
general, to obtain an N bit error-detecting code, no more than half of the possible 2N combinations
of digits can be used. Thus, to obtain an error-detecting code for 10 decimal digits, at least 5 binary
digits are to be used. The code words are chosen in such a manner that in order to change one valid
code word into another valid code word, at least two digits must be complemented. A code is an
error-detecting code, if and only if its minimum distance is two or more. The distance between two
words is defined as the number of digits that must change in a word so that the other word results.
For example, the distance between 0011 and 1010 is 2, and the distance between 0111 and 1000
is 4.
EXAMPLE 3.13 In an even-parity scheme, which of the following words contain an error?
(a) 10101010 (b) 11110110 (c) 10111001
Solution
(a) The number of 1s in the word is even (4). Therefore, there is no error.
(b) The number of 1s in the word is even (6). Therefore, there is no error.
(c) The number of 1s in the word is odd (5). So, this word has an error.
EXAMPLE 3.14 In an odd-parity scheme, which of the following words contain an error?
(a) 10110111 (b) 10011010 (c) 11101010
Solution
(a) The number of 1s in the word is even (6). So, this word has an error.
(b) The number of 1s in the word is even (4). So, this word has an error.
(c) The number of 1s in the word is odd (5). Therefore, there is no error.
both rows and columns. This scheme makes it possible to correct any single error occurring in a
data word and to detect any two errors in a word. The parity row is often called a parity word. Such
a block parity technique, also called word parity, is widely used for data stored on magnetic tapes.
For example, six 8-bit words in succession can be formed into a 6 ¥ 8 block for transmission.
Parity bits are added so that odd parity is maintained both row-wise and column-wise and the
block is transmitted as a 7 ¥ 9 block as shown in Table A. At the receiving end, parity is checked
both row-wise and column-wise and suppose errors are detected as shown in Table B. These
single-bit errors detected can be corrected by complementing the error bit. In Table B, parity
errors in the 3rd row and 5th column mean that the 5th bit in the 3rd row is in error. It can be
corrected by complementing it.
Two errors as shown in Table C can only be detected but not corrected. In Table C, parity
errors are observed in both columns 2 and 4. It indicates that in one row there are two errors.
Table A
0 1 0 1 1 0 1 1 0
1 0 0 1 0 1 0 1 1
0 1 1 0 1 1 1 0 0
1 1 0 1 0 0 1 1 0
1 0 0 0 1 1 0 1 1
0 1 1 1 0 1 1 1 1
Parity row Æ 0 1 1 1 0 1 1 0 0
≠ Parity column
Table B
0 1 0 1 1 0 1 1 0
1 0 0 1 0 1 0 1 1
0 1 1 0 0 1 1 0 0 ¨ Parity error in 3rd row
1 1 0 1 0 0 1 1 0
1 0 0 0 1 1 0 1 1
0 1 1 1 0 1 1 1 1
0 1 1 1 0 1 1 0 0
≠ Parity error in 5th column
Table C
0 10110110
1 00101011
0 11011100
1 00000110
1 00011011
0 11101111
0 11101100
≠ ≠
Parity errors in 2nd and 4th columns
EXAMPLE 3.15 The block of data shown in Table 3.6a is to be stored on a magnetic
tape. Create the row and column parity bits for the data using odd parity.
BINARY CODES 103
Solution
The parity bit 0 or 1 is added column-wise and row-wise such that the total number of 1s in
each column and row including the data bits and parity bit is odd as shown in Table 3.6b.
error-detecting property that there are exactly two 1s in each code group. This code is used for
storing data on magnetic tapes. The 2-out-of-5 code is a non-weighted code. It also has exactly
two 1s in each code group. This code is used in the telephone and communication industries. At
the receiving end, the receiver can check the number of 1s in each character received. The shift-
counter code, also called the Johnson code, has the bit patterns produced by a 5-bit Johnson counter.
The 51111 code is similar to the Johnson code but is weighted.
5 0 4 3 2 1 0
0 0 1 0 0 0 0 1
1 0 1 0 0 0 1 0
2 0 1 0 0 1 0 0
3 0 1 0 1 0 0 0
4 0 1 1 0 0 0 0
5 1 0 0 0 0 0 1
6 1 0 0 0 0 1 0
7 1 0 0 0 1 0 0
8 1 0 0 1 0 0 0
9 1 0 1 0 0 0 0
The 7-bit Hamming code for the decimal digits coded in BCD and XS-3 codes is shown in
Table 3.11. The minimum distance of the 7-bit Hamming code for BCD code is 3 as observed
from that table.
Table 3.11 The 7-bit hamming code for the decimal digits coded in BCD and XS-3 codes
P1 P2 D3 P4 D5 D6 D7 P1 P2 D3 P4 D5 D6 D7
0 0 0 0 0 0 0 0 1 0 0 0 0 1 1
1 1 1 0 1 0 0 1 1 0 0 1 1 0 0
2 0 1 0 1 0 1 1 0 1 0 0 1 0 1
3 1 0 0 0 0 1 1 1 1 0 0 1 1 0
4 1 0 0 1 1 0 0 0 0 0 1 1 1 1
5 0 1 0 0 1 0 1 1 1 1 0 0 0 0
6 1 1 0 0 1 1 0 0 0 1 1 0 0 1
7 0 0 0 1 1 1 1 1 0 1 1 0 1 0
8 1 1 1 0 0 0 0 0 1 1 0 0 1 1
9 0 0 1 1 0 0 1 0 1 1 1 1 0 0
At the receiving end, the message received in the Hamming code is decoded to see if any
errors have occurred. Bits 1, 3, 5, 7, bits 2, 3, 6, 7, and bits 4, 5, 6, 7 are all checked for even parity.
If they all check out, there is no error. If there is an error, the error bit can be located by forming a
BINARY CODES 107
Third group is 1 1 1 0 1 1 0
1, 3, 5, 7 (1110) Æ error Æ put a 1 in the 1’s position. c1 = 1
2, 3, 6, 7 (1110) Æ error Æ put a 1 in the 2’s position. c2 = 1
4, 5, 6, 7 (0110) Æ no error Æ put a 0 in the 4’s position. c3 = 0
The error word is c3c2c1 = 011 = 310. So, complement the 3rd bit (from left). Therefore, the
correct code is 1 1 0 0 1 1 0
Fourth group is 0 0 1 1 0 1 1
1, 3, 5, 7 (0101) Æ no error Æ put a 0 in the 1’s position. c1 = 0
2, 3, 6, 7 (0111) Æ error Æ put a 1 in the 2’s position. c2 = 1
4, 5, 6, 7 (1011) Æ error Æ put a 1 in the 4’s position. c3 = 1
The error word is c3c2c1 = 110 = 610. So, complement the 6th bit (from left). Therefore, the
correct code is 0 0 1 1 0 0 1. So the decoded message is 1101001, 0011001, 1100110, 0011001.
Alphanumeric codes are codes used to encode the characters of alphabet in addition to the decimal
digits. They are used primarily for transmitting data between computers and its I/O devices such
as printers, keyboards and video display terminals. Because the number of bits used in most
alphanumeric codes is much more than those required to encode 10 decimal digits and 26 alphabetic
characters, these codes include bit patterns for a wide range of other symbols and functions as
well. The most popular modern alphanumeric codes are the ASCII code and the EBCDIC code.
Abbreviations
ACK Acknowledge EM End of medium NAK Negative acknowledge
BEL Bell ENQ Enquiry NUL Null
BS Backspace EOT End of transmission RS Record separator
CAN Cancel ESC Escape SI Shift in
CR Carriage return ETB End of transmission block SO Shift out
DC1 Direct control 1 ETX End of text SOH Start of heading
DC2 Direct control 2 FF Form feed STX Start text
DC3 Direct control 3 FS Form separator SUB Substitute
DC4 Direct control 4 GS Group separator SYN Synchronous idle
DEL Delete idle HT Horizontal tab US Unit separator
DLE Data link escape LF Line feed VT Vertical tab
straight binary sequence for representing characters, this code uses BCD as the basis of binary
assignment. Table 3.13 shows the EBCDIC code.
MSD (Hex)
0 1 2 3 4 5 6 7 8 9 A B C D E F
0 NUL DLE DS SP & [ ] \ 0
1 SOH DC1 SOS / a j ~ A J 1
2 STX DC2 FS SYN b k s B K S 2
3 ETX DC3 c l t C L T 3
4 PF RES BYP PN d m u D M U 4
5 HT NL LF RS e n v E N V 5
LSD (Hex)
6 LC BS EOB YC f o w F O W 6
7 DEL IL PRE EOT g p x G P X 7
8 CAN h q y H Q Y 8
9 EM i r z I R Z 9
A SMM CC SM ∆ ! I :
B VT ◊ $ , #
C FF IFS DC4 < * % @
D CR IGS ENQ NAK ( ) – ‘
E SO IRS ACK + ; > =
F SI IUS BEL SUB I ’ ? ’
29. How XS-3 code can be used for mathematical operations even though it is a non-weighted code?
A. XS-3 code is a sequential code. Hence, it can be used for mathematical operations even though it
is a non-weighted code.
30. What is an XS-3 code?
A. An XS-3 code is a BCD code in which each binary code word is the corresponding 8421 code
plus 0011.
31. How is addition performed in XS-3 code?
A. To add in XS-3, add the XS-3 numbers by adding the 4-bit groups in each column starting
from the LSD. If there is no carry out from the addition of any of the 4-bit groups, subtract
0011 from the sum term of those groups (because when two decimal digits are added in XS-3
and there is no carry, the result is in excess-6). If there is a carry out, add 0011 to the second
term of those groups (because when there is a carry, the 6 invalid states are skipped and the
result is in normal binary).
32. How is subtraction performed in XS-3?
A. To subtract in XS-3, subtract the XS-3 numbers by subtracting each 4-bit group of the subtrahend
from the corresponding 4-bit group of the minuend starting from the LSD. If there is no borrow
from the next 4-bit group, add 0011 to the difference term of such groups (because when decimal
digits are subtracted in XS-3 and there is no borrow, the result is in normal binary). If there is a
borrow, subtract 0011 from the difference term (because taking a borrow is equivalent to adding
6 invalid states, so, the result is in excess-6).
33. In practice how is subtraction performed in 8421 BCD and XS-3 codes?
A. In practice subtraction is performed in 8421 BCD and XS-3 codes by the 9’s complement method
or the 10’s complement method.
34. What is a Gray code?
A. A Gray code is a non-weighted, reflective, unit distance code. In fact it is the most popular of the
unit distance codes.
35. What is the minimum distance of BCD and XS-3 codes?
A. The minimum distance of both BCD and XS-3 codes is one.
36. Why is the Gray code not suitable for mathematical operations?
A. The Gray code is not suitable for mathematical operations because it is not a sequential code.
37. What do you mean by a reflective code?
A. A reflective code is a code in which the n least significant bits for 2n through 2n+1 – 1 are the
mirror images of those for 0 through 2n – 1.
38. How do you obtain an N-bit Gray code from an N – 1 bit Gray code?
A. An N-bit Gray code can be obtained from an N – 1 bit Gray code by reflecting the N – 1 bit code
about an axis at the end of the code and putting the MSB of 0 above the axis and the MSB of 1
below the axis.
39. Is the Gray code a BCD code?
A. No. The Gray code is not a BCD code.
40. What is the reason for the popularity of the Gray code?
A. One main reason for the popularity of the Gray code is its ease of conversion to and from binary.
116 FUNDAMENTALS OF DIGITAL CIRCUITS
67. How many bits are required to be reserved for storing 100 numbers of a group of people, assuming
that no name occupies more than 20 characters (including space). Assume ASCII code.
A. 100 ¥ 20 ¥ 7 = 14,000 bits.
68. What is the number of bits used in ASCII and EBCDIC codes?
A. ASCII is a 7-bit code and EBCDIC is an 8-bit code. ASCII uses a straight binary sequence for
representing characters but EBCDIC uses BCD as the basis of binary assignment.
REVIEW QUESTIONS
17. ______ are the codes in which each successive code word differs from the preceding one in only
one bit position.
18. Cyclic codes are also called ______ codes.
19. ______ code is a natural binary code.
20. Each one of the 4-bit BCD codes have ______ illegal states.
21. XS-3 code is a ______ code.
22. ______ is a reflective code.
23. A ______ is a code in which the n least significant bits for 2n through 2n+1 – 1 are the mirror
images of those for 0 through 2n – 1.
24. The ______ is an extra bit added to each word being transmitted.
25. The two types of parity are (a) ______ and (b) ______.
26. ______ parity is used more often than ______ parity.
27. The ______ between two words is defined as the number of digits that must change in a word so
that the other word results.
28. For a code to be an error detecting code, the minimum distance between two code words must be
______.
29. Simple parity cannot detect ______ errors in the same word.
30. For a code to be a single bit error correcting code, the minimum distance of that code must be
______.
31. ______ codes can, not only detect errors but also correct them.
32. The minimum distance required for a code is ______ for detecting double error.
33. The distance between code words 10010 and 10101 is ______.
34. A single parity bit attached to 8421 code makes its minimum distance ______.
35. A minimum of ______ parity bits are required for generating hamming code for single error
correction in 8421 code.
36. The two popular alphanumeric codes are (a) ______ and (b) ______.
37. ASCII is a ______ digit code and EBCDIC is a ______ digit code.
38. In the Hamming code to each group of m data bits, k parity bits located at positions ______ are
added to form an (m + k) bit code word.
39. The minimum distance of both BCD and XS-3 codes is ______.
40. Block parity can ______ any single error in a data word and ______ any two errors in a data
word.
1. The code used in digital systems to represent decimal digits, letters, and other special characters
such as +, –, ., *, etc. is
(a) hexadecimal (b) octal (c) natural BCD (d) ASCII
2. The codes in which each successive code word differs from the preceding one in only one bit
position are called
(a) BCD codes (b) sequential codes
(c) self-complementing codes (d) cyclic codes
120 FUNDAMENTALS OF DIGITAL CIRCUITS
PROBLEMS
3.1 Express the following decimal numbers in (i) 8421 BCD code, (ii) XS-3 code, (iii) 2421 code,
(iv) 5211 code (v) 642-3 code and (vi) 84-2-1 code.
(a) 286 (b) 807 (c) 429.5 (d) 158.7
3.2 Express the following 8421 BCD numbers as decimals.
(a) 1000 0100 0110 (b) 0110 0111 1001.1000
(c) 0110 1001 0111.0101 (d) 1000 0110 0000.1000
3.3 Express the following XS-3 numbers as decimals.
(a) 1010 1100 0110 (b) 0101 1011 0111.1001
(c) 1001 1100 1010.0111 (d) 0111 0100 1011.1000
3.4 Add the following in (i) BCD and (ii) XS-3 codes.
(a) 275 + 493 (b) 109 + 778 (c) 88.7 + 265.8 (d) 204.6 + 185.56
3.5 Subtract the following in (i) BCD and (ii) XS-3 codes.
(a) 920 – 356 (b) 79 – 27 (c) 476.7 – 258.9 (d) 634.6 – 328.7
3.6 Convert the following decimal numbers to Gray code.
(a) 8 (b) 23 (c) 96 (d) 246
3.7 Convert the following binary numbers to Gray code.
(a) 1011 (b) 101010110101 (c) 110110010 (d) 100001
3.8 Convert the following Gray codes to binary
(a) 1111 (b) 101110 (c) 100010110 (d) 11100111
3.9 Convert the following numbers into Gray code numbers.
(a) 9610 (b) 4516 (c) 2348 (d) 8512
3.10 Which of the following words contain an error for odd parity?
(a) 10100101 (b) 11011001 (c) 10101110 (d) 1010
3.11 Which of the following words contain an error for even parity?
(a) 10010101 (b) 10101101 (c) 11001100 (d) 1011
3.12 Convert the following decimal numbers to (i) 2 out of 5, (ii) shift counter and (iii) 51111 codes.
(a) 28 (b) 14 (c) 69 (d) 356
3.13 Convert the following decimal numbers to (i) biquinary and (ii) ring counter codes.
(a) 6 (b) 4 (c) 8 (d) 25
3.14 Construct a 7-bit single error correcting code to represent the decimal digits by using XS-3 code
words.
(a) Using even parity checks (b) Using odd parity checks
3.15 Detect and correct errors, if any, in the even parity Hamming code words and write the correct
code.
(a) 1100110 (b) 0011101 (c) 0111110 (d) 1010111
3.16 The message below was coded in the Hamming code and transmitted through a noisy channel.
Decode the message assuming that a single bit error has occurred in each code word 1011001,
0111001, 1100011, 1010111.
3.17 Code the following in (i) ASCII and (ii) EBCDIC.
(a) BIRTH (b) AK47
BINARY CODES 123
3.18 (a) Generate a 4-bit Gray code directly using the mirror image property.
(b) Generate a Hamming code for the given 11-bit message word 100, 0110, 0101 and rewrite
the entire message in Hamming code.
3.19 Generate the weighted codes for the decimal digits using the weights.
(a) 3, 3, 2, 1 (b) 4, 4, 3, –2
3.20 Consider the following four codes.
VHDL PROGRAMS
1. VHDL PROGRAM FOR 7-BIT EVEN PARITY HAMMING CODE USING DATA
FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity SEVEN_BIT_HAMMING_CODE is
Po rt ( DATA : in STD_LOGIC_VECTOR (3 downto 0);
— D3 D5 D6 D7
— DATA (0) DATA (1) DATA (2) DATA (3)
ENCODED_MESSAGE: out STD_LOGIC_VECTOR (6 downto 0));
end SEVEN_BIT_HAMMING_CODE;
SIMULATION OUTPUT:
BINARY CODES 125
2. VHDL PROGRAM FOR 12-BIT EVEN PARITY HAMMING CODE USING DATA
FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity TWELVE_BIT_HAMMING_CODE is
Port ( DATA : in STD_LOGIC_VECTOR (7 downto 0);
ENCODED_MESSAGE : out STD_LOGIC_VECTOR (11 downto 0));
end TWELVE_BIT_HAMMING_CODE;
— D3 D5 D6 D7 D9 D10 D11 D12
— DATA(0) DATA(1) DATA(2) DATA(3) DATA(4) DATA(5) DATA(6) DATA(7)
SIMULATION OUTPUT:
3. VHDL PROGRAM FOR 15-BIT EVEN PARITY HAMMING CODE USING DATA
FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
126 FUNDAMENTALS OF DIGITAL CIRCUITS
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity FIFTEEN_BIT_HAMMING_CODE is
Port ( DATA : in STD_LOGIC_VECTOR (10 downto 0);
ENCODED_MESSAGE : out STD_LOGIC_VECTOR (14 downto 0));
end FIFTEEN_BIT_HAMMING_CODE;
— D3 D5 D6 D7 D9 D10 D11 D12
— DATA(0) DATA(1) DATA(2) DATA(3) DATA(4) DATA(5) DATA(6) DATA(7)
DATA(4),DATA(5),DATA(6),DATA(7),DATA(8), DATA(9),DATA(10));
end Behavioral;
SIMULATION OUTPUT:
end Binary_To_Gray;
architecture Behavioral of Binary_To_Gray is
begin
gray(3) <= bin(3);
gray(2) <= bin(2) xor bin(3);
gray(1) <= bin(1) xor bin(2);
gray(0) <= bin(0) xor bin(1);
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR BINARY-TO-GRAY CONVERSION USING DATA
FLOW MODELING
module binary_gray (bin,gray);
input [3:0] bin;
output [3:0] gray;
assign gray[3] = bin[3];
assign gray[2] = bin[2] ^ bin[3];
assign gray[1] = bin[1] ^ bin[2];
assign gray[0] = bin[0] ^ bin[1];
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
3. VERILOG PROGRAM FOR 7-BIT EVEN PARITY HAMMING CODE USING DATA
FLOW MODELING
module Hamming_7_Code( input Data1,Data2,Data3,Data4,output [6:0]
ENCODED_MSG);
// 1 2 3 4 5 6 7
// P1, P2, D1, P3, D2, D3, D4
wire P1;
wire P2;
wire P3;
assign P1 = (Data1^Data2^Data4);
assign P2 = (Data1^Data3^Data4);
assign P3 = (Data2^Data3^Data4);
assign ENCODED_MSG = {P1,P2,Data1,P3,Data2,Data3,Data4};
endmodule
SIMULATION OUTPUT:
130 FUNDAMENTALS OF DIGITAL CIRCUITS
4. VERILOG PROGRAM FOR 12-BIT EVEN PARITY HAMMING CODE USING DATA
FLOW MODELING
module Hamming_12_Code( input [7:0] DATA, output [11:0]
ENCODED_MSG);
wire P1,P2,P4,P8;
assign P1 = (DATA[0]^DATA[1]^ DATA[3]^DATA[4]^DATA[6]);
assign P2 = (DATA[0]^DATA[2]^ DATA[3]^DATA[5]^DATA[6]);
assign P4 = (DATA[1]^DATA[2]^ DATA[3]^DATA[7]);
assign P8 = (DATA[4]^DATA[5]^ DATA[6]^DATA[7]);
assign ENCODED_MSG =
{P1,P2,DATA[0],P4,DATA[1],DATA[2],DATA[3],P8,DATA[4],DATA[5],DATA[6],DATA[7]};
endmodule
SIMULATION OUTPUT:
DATA[6]^DATA[7]^DATA[8]^DATA[9]^DATA[10]);
assign ENCODED_MSG =
{P1,P2,DATA[0],P4,DATA[1],DATA[2],DATA[3],P8,DATA[4],
DATA[5],DATA[6],DATA[7],DATA[8],DATA[9],DATA[10]};
endmodule
SIMULATION OUTPUT:
4
LOGIC GATES
4.1 INTRODUCTION
Logic gates are the fundamental building blocks of digital systems. The name logic gate is derived
from the ability of such a device to make decisions, in the sense that it produces one output level
when some combinations of input levels are present, and a different output level when other
combinations of input levels are present. There are just three basic types of gates—AND, OR and
NOT. The fact that computers are able to perform very complex logic operations, stems from the
way these elementary gates are interconnected. The interconnection of gates to perform a variety
of logical operations is called logic design.
Logic gates are electronic circuits because they are made up of a number of electronic devices
and components. They are constructed in a wide variety of forms. They are usually embedded in
large-scale integrated circuits (LSI) and very large-scale integrated circuits (VLSI) along with a
large number of other devices, and are not easily accessible or identifiable. Each gate is dedicated
to a specific logic operation. Logic gates are also constructed in small-scale integrated circuits
(SSI), where they appear with few others of the same type. In these integrated devices, the inputs
and outputs of all the gates are accessible, that is, external connections can be made to them just
like discrete logic gates.
Inputs and outputs of logic gates can occur only in two levels. These two levels are termed
HIGH and LOW, or TRUE and FALSE, or ON and OFF, or simply 1 and 0.
A table which lists all the possible combinations of input variables and the corresponding
outputs is called a truth table. It shows how the logic circuit’s output responds to various
combinations of logic levels at the inputs.
In this book, we use level logic, a logic in which the voltage levels represent logic 1 and
logic 0. Level logic may be positive logic or negative logic. A positive logic system is the one in
132
LOGIC GATES 133
which the higher of the two voltage levels represents the logic 1 and the lower of the two voltage
levels represents the logic 0. A negative logic system is the one in which the lower of the two
voltage levels represents the logic 1 and the higher of the two voltage levels represents the
logic 0. In transistor-transistor logic (TTL, the most widely used logic family), the voltage levels
are + 5 V and 0 V. In the following discussion in this chapter, logic 1 corresponds to + 5 V and
logic 0 to 0 V.
The logic symbol and the truth table of a three-input AND gate are shown in Figure 4.2.
With the input variables to the AND gate represented by A, B, C, . . ., the Boolean expression
for the output can be written as X = A ◊ B ◊ C . . ., which is read as ‘X is equal to A and B and C . . .’
or ‘X is equal to ABC . . .’, or ‘X is equal to A dot B dot C . . .’.
134 FUNDAMENTALS OF DIGITAL CIRCUITS
4.2.1 Realization of AND Gate (DL AND Gate and RTL AND Gate)
Discrete AND gates may be realized by using diodes (Diode logic) or transistors (Resistor transistor
logic) as shown in Figures 4.3a and 4.3b respectively. The inputs A and B to the gates may be
either 0V or + 5V.
In the diode AND gate, when A = + 5 V and B = + 5 V, both the diodes D1 and D2 are OFF.
So, no current flows through R and, therefore, no voltage drop occurs across R. Hence, the output
X ª 5 V. When A = 0 V or B = 0 V or when both A and B are equal to 0 V, the corresponding diode
D1 or D2 is ON or both diodes are ON and act as short-circuits (ideal case), and, therefore, the
output X ª 0 V. In practical circuits, X = 0.6 V or 0.7 V which is treated as logic 0.
The IC 7408 contains four two-input AND gates, the IC 7411 contains three three-input
AND gates, and the IC 7421 contains two four-input AND gates.
LOGIC GATES 135
The logic symbol and the truth table of a three-input OR gate are shown in Figure 4.5.
The symbol for the OR operation is ‘+’. With the input variables to the OR gate represented
by A, B, C . . . , the Boolean expression for the output can be written as X = A + B + C + . . . . This
is read as ‘X is equal to A or B or C or . . . ’, or ‘X is equal to A plus B plus C plus . . .’. Discrete
OR gates may be realized by using diodes or transistors.
In the diode OR gate, when A = 0 V and B = 0 V, both the diodes D1 and D2 are OFF. No
current flows through R, and so, no voltage drop occurs across R. Hence, the output voltage X = 0 V.
When either A = + 5 V or B = + 5 V or when both A and B are equal to + 5 V, the corresponding
diode D1 or D2 is ON or both D1 and D2 are ON and act as short-circuits (ideal case) and, therefore,
output X ª 5 V. In practice, X = + 5 V – diode drop = + 5 V – 0.7 V = 4.3 V, which is regarded
as logic 1.
In the transistor OR gate, when A = 0 V and B = 0 V, both the transistors T1 and T2 are OFF.
Transistor T3 gets enough base drive from + 5 V through R and, therefore, it will be ON. The
output voltage, X = Vce(sat) ª 0 V. When either A = + 5 V or B = + 5 V or when both A and B are
equal to + 5 V, the corresponding transistor T1 or T2 is ON or both T1 and T2 will be ON and,
therefore, the voltage at the collector of T1 is = Vce(sat) ª 0 V. This cannot forward bias the
base-emitter junction of T3 and, therefore, it will remain OFF. Hence, the output voltage will be
X = 5 V (logic 1 level).
The truth table for the above OR gate circuits is as shown below.
The symbol for NOT operation is ‘–’ (bar). When the input variable to the NOT gate is
represented by A and the output variable by X, the expression for the output is X = A. This is read
as ‘X is equal to A bar’. A discrete NOT gate may be realized using a transistor. The IC 7404
contains six inverters.
The logic symbol and truth table for a three-input NAND gate are shown in Figures 4.9a and
4.9b, respectively.
Bubbled OR gate: Looking at the truth table of a two-input NAND gate, we see that the output
X is 1 when either A = 0 or B = 0 or when both A and B are equal to 0, i.e. if either A = 1 or B =
1 or both A and B are equal to 1. Therefore, the NAND gate can perform the OR function. The
corresponding output expression is, X = A + B. So, a NAND function can also be realized by first
inverting the inputs and then ORing the inverted inputs. Thus, a NAND gate is a combination of
two NOT gates and an OR gate (see Figure 4.10a). Hence, from Figures 4.8a and 4.10a, we can
express the output of a two-input NAND gate as
X = AB = A + B
The OR gate with inverted inputs (Figure 4.10a) is called a bubbled OR gate. So, a NAND
gate is equivalent to a bubbled OR gate whose truth table is shown in Figure 4.10b. A bubbled OR
LOGIC GATES 139
gate is also called a negative OR gate. Since its output assumes the HIGH state even if any one of
its inputs is 0, the NAND gate is also called an active-LOW OR gate.
NAND gate as an inverter: A NAND gate can also be used as an inverter by tying all its input
terminals together and applying the signal to be inverted to the common terminal (Figure 4.11a),
or by connecting all its input terminals except one, to logic 1 and applying the signal to be inverted
to the remaining terminal as shown in Figure 4.11b. In the latter form, it is said to act as a controlled
inverter.
Bubbled NAND gate: The bubbled NAND gate is equivalent to OR gate as shown in Figure 4.12.
Realization of NAND gate ( DTL NAND gate): A discrete two-input NAND gate (Diode
transistor logic) is shown in Figure 4.13a. When A = + 5 V and B = + 5 V, both the diodes D1 and
D2 are OFF. The transistor T gets enough base drive from the supply through R and, therefore, T
is ON and the output X = VCE(sat) ª 0 V. When A = 0 V or B = 0 V or when both A and B are equal
to 0 V, the transistor T is OFF and, therefore, output ª + 5 V. The truth table is as shown in
Figure 4.13b.
The IC 7400 contains four two-input NAND gates; the IC 7410 contains three three-input
NAND gates; the IC 7420 contains two four-input NAND gates; and the IC 7430 contains one
eight-input NAND gate.
The logic symbol and truth table for a three-input NOR gate are shown in Figures 4.15a and
4.15b, respectively.
Bubbled AND gate: Looking at the truth table of a two-input NOR gate, we see that the output X
is 1 only when both A and B are equal to 0, i.e. only when both A and B are equal to 1. That means,
a NOR gate is equivalent to an AND gate with inverted inputs and the corresponding output
expression is, X = AB. So, a NOR function can also be realized by first inverting the inputs and
then ANDing those inverted inputs. Thus, a NOR gate is a combination of two NOT gates and an
AND gate (see Figure 4.16a). Hence, from Figures 4.14a and 4.16a, we can see that the output of
a two-input NOR gate is, X = A + B = AB .
LOGIC GATES 141
The AND gate with inverted inputs (Figure 4.16a) is called a bubbled AND gate. So, a NOR
gate is equivalent to a bubbled AND gate whose truth table is shown in Figure 4.16b. A bubbled
AND gate is also called a negative AND gate. Since its output assumes the HIGH state only when
all its inputs are in LOW state, a NOR gate is also called an active-LOW AND gate.
NOR gate as an inverter: A NOR gate can also be used as an inverter, by tying all its input
terminals together and applying the signal to be inverted to the common terminal (Figure 4.17a) or
by connecting all its input terminals except one to logic 0, and applying the signal to be inverted to
the remaining terminal as shown in Figure 4.17b. In the latter form it is said to act as a controlled
inverter.
X
X X X
0
(a) NOR gate as an inverter (b) NOR gate as a controlled inverter
Figure 4.17 NOR gate as an inverter.
Bubbled NOR gate: The bubbled NOR gate is equivalent to an AND gate as shown in
Figure 4.18.
Realization of NOR gate ( RTL NOR gate): A discrete two-input NOR gate (Resistor transistor
logic) is shown in Figure 4.19a. When A = 0 V and B = 0 V, both transistors T1 and T2 are OFF;
so, no current flows through R and, therefore, no voltage drop occurs across R. Hence, the output
voltage X ª + 5 V (logic 1). When either A = + 5 V or B = + 5 V or when both A and B are equal
to + 5 V, the corresponding transistor T1 or T2 or both T1 and T2 are ON. Therefore, X is at
VCE(sat) with respect to ground and equal to 0 V (logic 0). The truth table is shown in Figure 4.19b.
The IC 7402 contains four two-input NOR gates; the IC 7427 contains three three-input
NOR gates; and the IC 7425 contains two four-input NOR gates.
The implication of the concept of universal gates is as follows. The cost of a large digital
system such as a computer will be less if the variety of logic gates is reduced. Experience has shown
that the cost of a digital system depends on the variety and not so much on the multiplicity of
components. Most digital systems use only one type of gate—NAND or NOR to produce any Boolean
function and consequently secure economic advantage by mass producing one universal gate.
142 FUNDAMENTALS OF DIGITAL CIRCUITS
Three or more variable X-OR gates do not exist. When more than two variables are to be
X-ORed, a number of two-input X-OR gates will be used. The X-OR of a number of variables
assumes a l state only when an odd number of input variables assume a 1 state.
The Boolean expression whose value is equal to 1 only when an odd number of its variables
are equal to 1 is called an odd function.
LOGIC GATES 143
1. A ≈1= A
Proof: A ≈ 1 = A ◊ 1 + A ◊ 1 = A ◊ 0 + A = A
2. A ≈ 0 = A
Proof: A ≈ 0 = A ◊ 0 + A ◊ 0 = A ◊ 1 + 0 = A
3. A ≈ A = 0
Proof: A ≈ A = A ◊ A + A ◊ A = 0 + 0 = 0
4. A ≈ A = 1
Proof: A ≈ A = A ◊ A + A ◊ A = A + A = 1
5. AB ≈ AC = A(B ≈ C)
Proof: AB ≈ AC = AB ◊ AC + AB ◊ AC = AB( A + C ) + ( A + B) AC
= ABC + A BC = A(BC + BC) = A(B ≈ C)
6. If A ≈ B = C, then A ≈ C = B, B ≈ C = A, A ≈ B ≈ C = 0
Proof: A ≈ B ≈ C = (A ≈ B) ≈ (A ≈ B) = (A ≈ B) ◊ (A ≈ B) + (A ≈ B) ◊ (A ≈ B) = 0 + 0 = 0
Proof: A ≈ C = A ≈ (A ≈ B) = A ◊ (A ≈ B) + A ◊ (A ≈ B) = A(AB + A B) + A(A B + AB)
= AB + AB = B (A + A) = B ◊ 1 = B
Proof: B ≈ C = B ≈ (A ≈ B) = B ◊ A ≈ B + B (A ≈ B) = B ◊ (AB + A B) + B (A B + AB)
= AB + A B = A (B + B) = A
The logic symbol and truth table of a two-input X-NOR gate are shown in Figures 4.21a and
4.21b, respectively. If the input variables are represented by A and B and the output variable by X,
the expression for the output of this gate is written as
X = A B = AB + A B = A ≈ B = AB + AB
and read as ‘X is equal to A ex-nor B’.
Three or more variable X-NOR gates do not exist. When a number of variables are to be X-
NORed, a number of two-input X-NOR gates can be used. The X-NOR of a number of variables
assumes a 1 state, only when an even number (including zero) of input variables assume a 0 state.
The Boolean expression whose value is equal to 1 only when an even number of its variables
are equal to 1 is called an even function.
There will be many situations in digital circuit design, where the passage of a logic signal is
either enabled or inhibited depending on the conditions present at one or more control inputs.
EXAMPLE 4.1 Find the logical equivalent of the following expressions.
(a) A ≈ 0 (b) A ≈ 1 (c) A 0 (d) A 1
(e) 1 ≈ A (f) 0 ≈ A
Solution
(a) A ≈ 0 = A ◊ 0 + A ◊ 0 = A ◊ 1 + A ◊ 0 = A + 0 = A
(b) A ≈ 1 = A ◊ 1 + A ◊ 1 = A ◊ 0 + A ◊ 1 = 0 + A = A
(c) A 0 = A ◊ 0 + A ◊ 0 = A ◊ 1 + A ◊ 0 = A + 0 = A
146 FUNDAMENTALS OF DIGITAL CIRCUITS
(d) A 1 = A ◊ 1 + A ◊ 1 = A ◊ 0 + A ◊ 1 = 0 + A = A
(e) 1 ≈ A = 1 ◊ A + 1 ◊ A = 1 ◊ A + 0 ◊ A = A + 0 = A
(f) 0 ≈ A = 0 ◊ A + 0 ◊ A = 0 ◊ A + 1 ◊ A = 0 + A = A
EXAMPLE 4.2 Show that A ≈ B = A B + AB and construct the corresponding logic
diagrams.
Solution
The truth tables constructed below show that A ≈ B = A B + AB. The corresponding logic
diagrams are also shown in Figure 4.23.
A B AeB A B A B AB AB AB + AB AB + AB
0 0 1 0 0 1 1 0 1 1 1
0 1 0 0 1 1 0 0 0 0 0
1 0 0 1 0 0 1 0 0 0 0
1 1 1 1 1 0 0 1 0 1 1
B AB
A
A AeB AB + AB
=
B B
B
A AB
A
EXAMPLE 4.5 Derive a logic expression that equals 1 only when the two binary numbers
A1A0 and B1B0 have the same value. Draw the logic diagram and construct the truth table to
verify the logic.
Solution
The numbers A1A0 and B1B0 have the same value when their MSBs (A1 and B1) coincide and
their LSBs (A0 and B0) coincide. So, we must AND the coincidence (A1 B1) with the
coincidence (A0 B0). Therefore, the desired logic expression is (A1 B1) (A0 B0). The
logic diagram and truth table are shown in Figure 4.26. Four variables can combine in 16 ways.
EXAMPLE 4.8 For a two-input AND gate, determine its output waveform in relation to
input waveforms of Figure 4.28a.
Solution
The output waveform X is shown in Figure 4.28b.
EXAMPLE 4.9 If the three waveforms A, B, and C shown in Figure 4.29a are applied to
a three-input AND gate, determine the resulting output waveform.
Solution
The output waveform X is shown in Figure 4.29b.
EXAMPLE 4.10 For a two-input OR gate, determine its output waveform in relation to
the inputs A and B shown in Figure 4.30a.
Solution
The output waveform is shown in Figure 4.30b.
EXAMPLE 4.11 For a three-input OR gate, determine its output waveform in proper relation
to the inputs A, B and C shown in Figure 4.31a.
Solution
The output waveform is shown in Figure 4.31b.
EXAMPLE 4.12 If the waveform shown in Figure 4.32a is applied to an inverter, determine
the resulting output waveform.
Solution
The output waveform is shown in Figure 4.32b.
EXAMPLE 4.13 The waveforms A and B shown in Figure 4.33a are applied to a two-
input NAND gate. Determine the output waveform.
Solution
The output of a NAND gate is LOW only when all its inputs are HIGH. The output waveform
is shown in Figure 4.33b.
EXAMPLE 4.14 The waveforms A, B and C shown in Figure 4.34a are applied to a three-
input NAND gate. Determine the output waveform.
LOGIC GATES 151
Solution
The output waveform is shown in Figure 4.34b.
EXAMPLE 4.15 For the two-input NAND gate operating as a negative OR gate, determine
the output waveform when the input waveforms A and B are as shown in Figure 4.35a.
Solution
The output of an active-LOW OR gate is HIGH, if either A is LOW or B is LOW or both A
and B are LOW. The output waveform is shown in Figure 4.35b.
EXAMPLE 4.16 If the waveforms A and B shown in Figure 4.36a are applied to a two-
input NOR gate, determine the resulting output waveform.
Solution
The output of a NOR gate is HIGH only when all its inputs are LOW. The output waveform
is shown in Figure 4.36b.
EXAMPLE 4.17 The waveforms A and B shown in Figure 4.37a are applied to an active-
LOW AND gate. What is the output waveform?
152 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
The NOR gate is an active-LOW AND gate. The output of an active-LOW AND gate is
HIGH, only when all its inputs are LOW. The output waveform is shown in Figure 4.37b.
EXAMPLE 4.18 If the waveforms A and B shown in Figure 4.38a are applied to a two-input
X-OR gate, determine the output waveform.
Solution
The output of an X-OR gate is HIGH, only when the inputs are not equal. The output waveform
is shown in Figure 4.38b.
EXAMPLE 4.19 If the three waveforms A, B and C, shown in Figure 4.39a, are to be
X-ORed, determine the output waveform.
Solution
The X-OR output of a number of variables is HIGH, only when an odd number of input
variables are HIGH. The output waveform is shown in Figure 4.39b.
EXAMPLE 4.20 If the waveforms A and B shown in Figure 4.40a are applied to a two-input
X-NOR gate, determine the output waveform.
Solution
The output of an X-NOR gate is HIGH, only when the inputs are equal. The output waveform
is shown in Figure 4.40b.
EXAMPLE 4.21 If the waveforms A, B, and C shown in Figure 4.41a are X-NORed,
determine the output waveform.
Solution
The X-NOR output of a number of variables is HIGH, only when an even number of input
variables (including 0) are LOW. The output waveform is shown in Figure 4.41b.
EXAMPLE 4.22 Determine the output waveform for the circuit shown in Figure 4.42c,
when the inputs A and B shown in Figure 4.42a are applied to it.
Solution
The output waveform Y in proper time relationship to inputs A and B is shown in Figure 4.42b.
When both the inputs are HIGH, or both the inputs are LOW, the output is LOW. The output
is HIGH only when one of the inputs is HIGH. So, it is an X-OR operation. It is an
anti-coincidence circuit.
154 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
1. Draw the logic symbols, construct the truth tables, and with the help of circuit diagrams explain
the working of the following gates:
(i) AND (ii) OR (iii) NOT (iv) NAND
(v) NOR
2. Show an arrangement to X-OR and X-NOR the inputs A, B, C and D.
(a) if and only if both inputs are HIGH (b) if and only if both the inputs are LOW
(c) if one of the inputs is LOW (d) if one of the inputs is HIGH
LOGIC GATES 161
53. For the gate shown in the figure, the output will be HIGH
(a) if both inputs are HIGH (b) if one of the inputs is HIGH
(c) if one of the input is LOW (d) if and only if both the inputs are LOW
54. For the gate shown in the figure, the output will be LOW
(a) if one of the inputs is LOW (b) if and only if both the inputs are LOW
(c) if and only if both inputs are HIGH (d) if one of the inputs is HIGH
55. For the gate shown in the figure, the output will be LOW
(a) if one of the inputs is HIGH (b) if both the inputs are LOW
(c) if and only if both inputs are HIGH (d) if and only if both the inputs are LOW
56. Which of the gates shown in the figure is an AND gate
(a) (b)
(c) (d)
PROBLEMS
VHDL PROGRAMS
1. VHDL PROGRAM FOR AND GATE USING DATA FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity ANDGATE is
Port (A, B: in STD_LOGIC;
Y: out STD_LOGIC);
end ANDGATE;
architecture Behavioral of ANDGATE is
begin
Y <= A AND B;
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
LOGIC GATES 165
SIMULATION OUTPUT:
SIMULATION OUTPUT:
166 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
10. VHDL PROGRAM IN STRUCTURAL MODELING FOR X-OR GATE USING NAND
GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity XORGATE is
Port (A, B: in STD_LOGIC;
Y: out STD_LOGIC);
end XORGATE;
architecture Behavioral of XORGATE is
component NANDGATE is
Port ( A,B : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
signal n1,n2,n3:STD_LOGIC;
begin
x1:NANDGATE port map(A,B,n1);
x2:NANDGATE port map(A,n1,n2);
x3:NANDGATE port map(B,n1,n3);
x4:NANDGATE port map(n2,n3,Y);
end Behavioral;
LOGIC GATES 169
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR AND GATE USING DATA FLOW MODELING
module and_gate(
input a,b,
output y
);
assign y = a & b;
endmodule
SIMULATION OUTPUT:
170 FUNDAMENTALS OF DIGITAL CIRCUITS
endmodule
SIMULATION OUTPUT:
assign y = ~a;
endmodule
SIMULATION OUTPUT:
endmodule
SIMULATION OUTPUT:
endmodule
SIMULATION OUTPUT:
endmodule
172 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
endmodule
SIMULATION OUTPUT:
endmodule
module or_gate(a,b,y);
LOGIC GATES 173
input a,b;
output y;
wire N2,N3;
nand_gate G1(a,a,N2);
nand_gate G2(b,b,N3);
nand_gate G3(N2,N3,y);
endmodule
SIMULATION OUTPUT:
module and_gate(a,b,y);
input a,b;
output y;
wire N2,N3;
Nor_Gate G1(a,a,N2);
Nor_Gate G2(b,b,N3);
Nor_Gate G3(N2,N3,y);
Endmodule
174 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
endmodule
module Nor_Gate(a,b,y);
input a,b;
output y;
wire N2,N3,N4;
nand_gate G1(a,a,N2);
nand_gate G2(b,b,N3);
nand_gate G3(N2,N3,N4);
nand_gate G4(N4,N4,y);
endmodule
SIMULATION OUTPUT:
LOGIC GATES 175
module Xor_Gate(a,b,y);
input a,b;
output y;
wire N1,N2,N3;
nand_gate G1(a,b,N1);
nand_gate G2(a,N1,N2);
nand_gate G3(b,N1,N3);
nand_gate G4(N2,N3,y);
endmodule
SIMULATION OUTPUT:
5
BOOLEAN ALGEBRA
5.1 INTRODUCTION
Switching circuits are also called logic circuits, gate circuits, and digital circuits. Switching algebra
is also called Boolean algebra. Hence the terms switching expressions and Boolean expressions
mean the same thing. Boolean algebra is a system of mathematical logic. It is an algebraic
system consisting of the set of elements (0,1), two binary operators called OR and AND and one
unary operator called NOT. It is the basic mathematical tool in the analysis and synthesis of
switching circuits. It is a way to express logic functions algebraically. Any complex logic
statement can be expressed by a Boolean function. The Boolean algebra is governed by certain
well-developed rules and laws. In the applications of Boolean algebra in this book, we use
capital letters to represent the variables. Any single variable, or a function of the variables can
have a value of either a 0 or a 1. The binary digits 0 and 1 are used to represent the two voltage
levels that occur within the digital logic circuit. In this book, we follow positive logic. Hence
binary 1 represents the higher of the two voltage levels (+ 5 V), and binary 0 represents the
lower of the two voltage levels (0 V). Ideally, no other voltages ever occur at the inputs or
outputs. In actual practice, however, any voltage above some level (2 V, for example) is treated
as logic 1 (TRUE, ON, HIGH) and any voltage below some level (0.8 V, for example) is treated
as logic 0 (FALSE, OFF, LOW).
Boolean algebra differs from both the ordinary algebra and the binary number system. In
Boolean algebra, A + A = A and A ◊ A = A, because the variable A has only a logical value. It
doesn’t have any numerical significance. In ordinary algebra, A + A = 2A and A ◊ A = A2,
because the variable A has a numerical value here. In Boolean algebra, 1 + 1 = 1, whereas in the
binary number system, 1 + 1 = 10, and in ordinary algebra, 1 + 1 = 2. There is nothing like
subtraction or division in Boolean algebra. Also, there are no negative or fractional numbers in
176
BOOLEAN ALGEBRA 177
Boolean algebra. In Boolean algebra, the multiplication and addition of the variables and functions
are also only logical. They actually represent logic operations. Logical multiplication is the
same as the AND operation, and logical addition is the same as the OR operation. There are only
two constants 0 and 1 within the Boolean system, whereas in ordinary algebra, you can have
any number of constants. A variable or function of variables in Boolean algebra can assume
only two values, either a 0 or a 1, whereas the variables or functions in ordinary algebra can
assume an infinite number of values.
Thus, in Boolean algebra
If A = 1, then A π 0
If A = 0, then A π 1.
Any functional relation in Boolean algebra can be proved by the method of perfect induction.
Perfect induction is a method of proof, whereby a functional relation is verified for every possible
combination of values that the variables may assume. This can be done by forming a truth table. A
truth table shows how a logic circuit responds to various combinations of logic levels at its inputs.
5.2.2 OR Operation
The OR operation in Boolean algebra is similar to addition in ordinary algebra. In fact, it is logical
addition as performed by the OR gate. It is represented by +, ⁄, » (Union).
5.3.3 OR Laws
The four OR laws are as follows:
Law 1: A + 0 = A (Null law)
Law 2: A + 1 = 1 (Identity law)
Law 3: A+A=A
Law 4: A+A=1
Law 1: (A + B) + C = A + (B + C)
A OR B ORed with C is the same as A ORed with B OR C. This law states that the way the
variables are grouped and ORed is immaterial. The truth tables given next illustrate this law.
This law applies to single variables as well as combinations of variables. For example,
ABC(D + E) = ABCD + ABCE
AB(CD + EF) = ABCD + ABEF
The distributive property is often used in the reverse. That is, given AB + AC, we replace it
by A(B + C); and ABC + ABD by AB(C + D).
Law 2: A + BC = (A + B)(A + C)
This law states that ANDing of several variables and ORing the result with a single variable is
equivalent to ORing that single variable with each of the several variables and then ANDing the sums.
This can be proved algebraically as shown below. Also, the truth tables given next illustrate this law.
RHS = (A + B)(A + C)
= AA + AC + BA + BC
= A + AC + AB + BC
= A(1 + C + B) + BC
= A ◊ 1 + BC ( 1 + C + B = 1 + B = 1)
= A + BC
= LHS
182 FUNDAMENTALS OF DIGITAL CIRCUITS
Law 1: A + AB = A + B
This law states that ORing of a variable with the AND of the complement of that variable with
another variable, is equal to the ORing of the two variables. See the truth tables given below.
This law states that ANDing of a variable with itself is equal to that variable only.
Law 2: A+A=A
If A = 0, then A + A = 0 + 0 = 0 = A
If A = 1, then A + A = 1 + 1 = 1 = A
This law states that ORing of a variable with itself is equal to that variable only.
Algebraically, we have
A + A ◊ B = A(1 + B) = A ◊ 1 = A
Therefore,
A + A ◊ Any term = A
Law 2: A(A + B) = A
This law states that ANDing of a variable (A) with the OR of that variable (A) and another
variable (B) is equal to that variable itself (A).
Algebraically, we have
A(A + B) = A ◊ A + A ◊ B = A + AB = A(1 + B) = A ◊ 1 = A
Therefore,
A(A + Any term) = A
If a term appears in toto in another term, then the latter term becomes redundant and may be
removed from the expression without changing its value. Removal of a term is equivalent to replacing
that term by 0 if it is in a sum or by 1 if it is in a product.
Theorem 1: AB + AC + BC = AB + AC
184 FUNDAMENTALS OF DIGITAL CIRCUITS
Proof: LHS = AB + AC + BC
= AB + AC + BC(A + A)
= AB + AC + BCA + BCA
= AB(1 + C) + AC(1 + B)
= AB(1) + AC(1)
= AB + AC
= RHS
This theorem can be extended to any number of variables. For example,
AB + AC + BCD = AB + AC
LHS = AB + AC + BCD = AB + AC + BC + BCD = AB + AC + BC = AB + AC = RHS
Theorem 2: (A + B)( A + C)(B + C) = (A + B)( A + C)
Proof: LHS = (A + B)( A + C)(B + C) = (A A + AC + B A + BC)(B + C)
= (AC + BC + AB)(B + C)
= ABC + BC + AB + AC + BC + ABC = AC + BC + AB
RHS = (A + B) ( A + C)
= A A + AC + BC + AB
= AC + BC + AB = LHS
If a sum of products comprises a term containing A and a term containing A, and a third term
containing the left-out literals of the first two terms, then the third term is redundant, that is, the
function remains the same with and without the third term removed or retained.
This theorem can be extended to any number of variables. For example,
(A + B)( A + C)(B + C + D) = (A + B)(A + C)
LHS = (A + B)( A + C)(B + C)(B + C + D) = (A + B)( A + C) (B + C)
= (A + B)( A + C)
Theorem: AB + AC = (A + C)( A + B)
Proof: RHS = (A + C)( A + B)
= A A + C A + AB + CB
= 0 + AC + AB + BC
= AC + AB + BC(A + A)
= AB + ABC + AC + ABC
= AB + AC
= LHS
BOOLEAN ALGEBRA 185
It shows that the NOR gate is equivalent to a bubbled AND gate. This has also been shown
quite simply by truth tables.
This law can be extended to any number of variables or combinations of variables. For
example,
A + B + C + D + = A BC D .
It shows that the NAND gate is equivalent to a bubbled OR gate. This has also been shown
quite simply by truth tables.
This law can be extended to any number of variables or combinations of variables. For
example,
ABCD ... = A + B + C + D + ...
(A + B)(C + D)(E + F + G) = (A + B) + (C + D) + (E + F + G) = A B + C D + E FG
It may also be seen that like law 1, law 2 also permits removal of individual variables from
under a NOT sign, and transformation from a product-of-sums form to a sum-of-products form.
It may be seen that the transformations
A + B = AB
AB = A + B
can be extended to complicated expressions by the following three steps:
1. Complement the entire given function.
2. Change all the ANDs to ORs and all the ORs to ANDs.
3. Complement each of the individual variables.
4. Change all 0s to 1s and 1s to 0s.
This procedure is called demorganization or complementation of switching expressions. It is
f (A, B, C, ..., 0, 1, +, ◊)c = f ( A, B, C, ..., 1, 0, ◊, +)
EXAMPLE 5.2 Apply Demorgan’s theorem to the expression f = AB(CD + EF)(AB + CD) .
Solution
The given expression is f = AB(CD + EF)(AB + CD)
= AB + CD + EF + AB + CD
= AB + ( CD ◊ EF ) + ( AB ◊ CD )
= AB + ( C + D)(E + F) + ABCD
A second method of performing demorganization is ‘Break the line, change the sign’. For
example, if we wish to demorganize the expression AB + CDE , we can break the line between
A and B, and the line between C and D, and that between D and E and change the sign from
ANDing to ORing. This yields A + B + C + D + E .
= A + B + AB
Break the line between A and B, and that between B and AB, and change the sign between
them.
f = A ◊ B ◊ AB = AB ◊ AB = 0
Also, f = AB + A + AB = 1 + A = 1 = 0
188 FUNDAMENTALS OF DIGITAL CIRCUITS
5.4 DUALITY
We know that in a positive logic system the more positive of the two voltage levels is represented
by a 1 and the more negative by a 0. In a negative logic system the more positive of the two voltage
levels is represented by a 0 and the more negative by a 1. This distinction between positive and
negative logic systems is important because an OR gate in the positive logic system becomes an
AND gate in the negative logic system, and vice versa. Positive and negative logics thus give rise
to a basic duality in all Boolean identities. When changing from one logic system to another, 0
becomes 1 and 1 becomes 0. Furthermore, an AND gate becomes an OR gate and an OR gate
becomes an AND gate. Given a Boolean identity, we can produce a dual identity by changing all
‘+’ signs to ‘◊’ signs, all ‘.’ signs to ‘+’ signs, and complementing all 0s and 1s. The variables are
not complemented in this process.
The implication of the duality concept is that once a theorem or statement is proved, the dual
also thus stands proved. This is called the principle of duality.
[f(A, B, C, ..., 0, 1, +, ◊)]d = f(A, B, C, ..., 1, 0, ◊, +)
Relations between complement and dual
fc(A, B, C, ...) = f(A, B, C, ...) = f d (A, B, C, ...)
fd(A, B, C, ...) = f(A, B, C, ...) = fc( A, B, C, ...)
The first relation states that the complement of a function f(A, B, C, ...) can be obtained by
complementing all the variables in the dual function fd( A, B, C, ...). Likewise, the second relation
states that the dual can be obtained by complementing all the literals in f(A, B, C, ...) .
Some dual identities are given as follows:
BOOLEAN ALGEBRA 189
5.4.1 Duals
Given Expression Dual
1. 0 =1 1 =0
2. 0◊1=0 1+0=1
3. 0◊0=0 1+1=1
4. 1◊1=1 0+0=0
5. A◊0=0 A+1=1
6. A◊1=A A+0=A
7. A◊A=A A+A=A
8. A◊A=0 A+A=1
9. A◊B=B◊A A+B=B+A
10. A ◊ (B ◊ C) = (A ◊ B) ◊ C A + (B + C) = (A + B) + C
11. A ◊ (B + C) = AB + AC A + BC = (A + B) (A + C)
12. A(A + B) = A A + AB = A
13. A ◊ (A ◊ B) = A ◊ B A+A+B=A+B
14. AB = A + B A + B = AB
15. (A + B)( A + C) (B + C) = (A + B)( A + C) AB + AC + BC = AB + AC
16. (A + C)( A + B) = AB + AC AC + AB = (A + B) ( A + C)
17. A + BC = (A + B)(A + C) A( B + C) = (A B + AC)
18. (A + B)(C + D) = AC + AD + BC + BD (AB + CD) = (A + C) (A + D)(B + C)(B + D)
19. A + B = AB + AB + A B AB = (A + B)( A + B)(A + B)
20. A + B (C + DE) = A + B CDE A[B + (C ◊ D + E)] = A ◊ (B + C + D + E)
21. AB + A + AB = 0 A + B ◊ A ◊ (A + B) = 1
22. AB + AC + A BC (AB + C) = 1 (A + B)( A + C) ◊ [(A + B + C) + (A + B)C] = 0
23. ABD + ABCD = ABD (A + B + D) (A + B + C + D) = (A + B + D)
24. AB + ABC + A(B + A B) = 0 (A + B) ◊ (A + B + C) . (A + [B(A + B)]) = 1
25. A + BC(A + BC) = A + BC A ◊ [( B + C) + A ◊ ( B + C)] = A ◊ ( B + C)
(c) Look for a variable and its negation in the same term. This term can be dropped. For
example,
A ◊ B B = A ◊ 0 = 0; ABC C = AB ◊ 0 = 0
(d) Look for pairs of terms that are identical except for one variable which may be missing in
one of the terms. The larger term can be dropped. For example,
AB CD + AB C = AB C( D + 1) = AB C ◊ 1 = AB C
(e) Look for pairs of terms which have the same variables, with one or more variables
complemented. If a variable in one term of such a pair is complemented while in the
second term it is not, then such terms can be combined into a single term with that variable
dropped. For example,
AB C D + AB CD = AB C ( D + D) = AB C ◊ 1 = AB C
AB(C + D) + AB( C + D ) = AB[(C + D) + ( C + D )] = AB ◊ 1 = AB
Solution
AB = A + B
Applying redundant literal rule (RLR) to the 1st and 2nd terms of f
f = A + BC + AB + AC = A + AB + AC + BC
Applying RLR to 1st and 2nd terms, and 1st and 3rd terms
f = A + B + A + C + BC
Applying Idempotence law to 1st and 3rd terms
f = A + B + C + BC
Applying RLR to 2nd and 4th terms
f =A+ B+ C+ C
Applying idempotence law to the 3rd and 4th terms
f=A+ B+ C
EXAMPLE 5.11 Using the consensus theorem show that
f(A, B, C) = A B + B C + CA = AB + BC + CA
Solution
Applying the consensus theorem to the 1st and 2nd, 2nd and 3rd, and 3rd and 1st terms of
LHS, we get three redundant terms as A C, B A, and C B. Adding them to LHS
f = A B + B C + C A + AB + BC + CA
Now applying consensus theorem to 4th and 5th, 5th and 6th, 6th and 4th terms, the terms 3,
1, and 2 become redundant. So removing 1st, 2nd and 3rd terms, we have
f = AB + BC + CA = RHS
This is an example of f(A, B, C) = f( A, B, C), that is, by complementing all the literals the
function remains the same.
EXAMPLE 5.12 Simplify the function
f (A, B, C, D) = A B + B C + A D + CD
Solution
Applying the consensus theorem to the 2nd and 4th terms, we may add the redundant term
BD.
\ f = A B + B C + A D + CD + BD.
Applying the consensus theorem to the 3rd and 5th terms, the term A B becomes redundant.
Removing that term from f
f = B C + A D + CD + BD
Applying the consensus theorem to the 1st and 3rd terms, the term BD becomes redundant.
Removing that term from f
f = B C + A D + CD
EXAMPLE 5.13 Using the consensus theorem show that
(A + B)(B + C)(C + D)(D + A) = ( A + B)( B + C)( C + D)( D + A)
BOOLEAN ALGEBRA 193
Solution
Observe that in LHS, 1st and 4th terms contain A, A; 2nd and 1st terms contain B, B; 3rd
and 2nd terms contain C, C; 4th and 3rd terms contain D, D. So applying the consensus
theorem and adding redundant terms obtained, we get
LHS = (A + B)(B + C)(C + D)(D + A)
( B + D)(A + C)(B + D)( A + C)
Applying the consensus theorem to the 1st and 8th, 2nd and 5th, 3rd and 6th, and 4th and 7th
terms and adding the redundant terms to LHS, we get
LHS = (A + B)(B + C)(C + D)(D + A)
( B + D)(A + C)(B + D)( A + C)
( B + C)( C + D)(A + D)( A + B)
Looking at the terms of the 2nd set and 3rd set, we observe that the 1st set is redundant.
So remove it. Looking at the terms of the 3rd set, we observe that 2nd set is redundant. So
remove it. The terms of the 3rd set are identical with the RHS of the given expression. So
LHS = RHS.
EXAMPLE 5.14 Define the connective * for two valued variables A, B, and C as follows:
A * B = AB + A B
Let C = A * B, and determine which of the following is valid.
(a) A = B * C (b) B = A * C (c) A * B * C = 1
Solution
If C = A * B = AB + A B
C = AB + AB = AB + AB
(a) B * C = BC + B C = B(AB + A B) + B( AB + A B) = AB + 0 + 0 + A B = A(B + B) = A
(b) A * C = A C + AC = A(A B + AB) + A( A B + AB) = 0 + AB + AB = B(A + A) = B
(c) A * B * C = C * C (since A * B = C) = CC + CC = C + C = 1
So all the three are valid.
4. Standard sum-of-products form: This form is also called Disjunctive Canonical Form (DCF).
It is also called the Expanded Sum of Products Form or Canonical Sum-of-Products Form. In this
form, the function is the sum of a number of product terms where each product term contains all
the variables of the function either in complemented or uncomplemented form. This can be derived
from the truth table by finding the sum of all the terms that correspond to those combinations
(rows) for which ‘f ’ assumes the value 1. It can also be obtained from the SOP form algebraically
as shown below.
f(A, B, C) = AB + BC = AB (C + C) + BC(A + A)
= A BC + AB C + ABC + A BC
A product term which contains all the variables of the function either in complemented or
uncomplemented form is called a minterm. A minterm assumes the value 1 only for one combination
of the variables. An n variable function can have in all 2n minterms. The sum of the minterms
whose value is equal to 1 is the standard sum of products form of the function.
The minterms are often denoted as m0, m1, m2, ..., where the suffixes are the decimal codes
of the combinations. For a 3-variable function m0 = A B C, m1 = A BC, m2 = AB C, m3 = ABC,
m4 = A B C, m5 = A BC, m6 = AB C, and m7 = ABC. Another way of representing the function in
canonical SOP form is by showing the sum of minterms for which the function equals 1.
BOOLEAN ALGEBRA 195
Thus
f(A, B, C) = m1 + m2 + m3 + m5
Yet another way of representing the function in DCF is by listing the decimal codes of the
minterms for which f = 1.
Thus
f(A, B, C) = S m (1, 2, 3, 5)
where S m represents the sum of all the minterms whose decimal codes are given in the parenthesis.
5. Standard product-of-sums form: This form is also called Conjunctive Canonical Form
(CCF). It is also called Expanded Product-of-Sums Form or Canonical Product-of-Sums Form.
This is derived by considering the combinations for which f = 0. Each term is a sum of all the
variables. A variable appears in uncomplemented form if it has a value of 0 in the combination and
appears in complemented form if it has a value of 1 in the combination. For example, the sum
corresponding to row 4 in the above truth table (Table 2.1) is (A + B + C). This means that
wherever A is 0, (same as A = 1), B is 0 and C is 0, this term becomes 0 and being a term in a
product, the function assumes the value 0. Thus, the function f(A, B, C) = ( A + B)(A + B) is given
by the product of sums
f(A, B, C) = ( A + B + C C)(A + B + C C) = ( A + B+ C)( A + B + C)(A + B + C)(A + B + C)
A sum term which contains each of the n variables in either complemented or uncomplemented
form is called a maxterm. A maxterm assumes the value 0 only for one combination of the variables.
For all other combinations it will be 1. There will be at the most 2n maxterms. The product of
maxterms corresponding to the rows for which f = 0, is the standard or canonical product of sums
form of the function.
Maxterms are often represented as M0, M1, M2, ..., where the suffixes denote their decimal
code. Thus the CCF of f may be written as
f (A, B, C) = M0 ◊ M4 ◊ M6 ◊ M7 or simply as
f (A, B, C) = P M(0, 4, 6, 7)
where P represents the product of all maxterms whose decimal code is given within the parenthesis.
The symbol ‘Ÿ’ is also used in place of P.
6. Venn diagram form: As the algebra of sets and Boolean algebra are similar systems, Boolean
expressions can be represented by a Venn diagram in which each variable is considered as a set.
The AND operation is considered as an intersection and the OR operation is considered as a union.
Complementation corresponds to outside the set. Thus the function f = AB + BC is represented as
shown in Figure 5.1.
7. Octal designation: Look at the truth table of the function and the column in which the truth
values of the function for each combination (minterm) are indicated. If these values are indicated
in the order starting from m7 at the extreme left and proceeding to m0 at the extreme right, the
resulting string of 0s and 1s is called the characteristic vector for the function. If written as an
octal number, it becomes the octal designation for the function which is illustrated below.
m7 m6 m5 m4 m3 m2 m1 m0
0 0 1 0 1 1 1 0
Octal designation of f (A, B, C) = (0, 5, 6)8.
8. Karnaugh map: In this representation we put the truth table in a compact form by labelling
the rows and columns of a map. This is extremely useful and extensively used in the minimization
of functions of 3, 4, 5 or 6 variables. The rows and columns are assigned a binary code (Gray
code) such that two adjacent rows or columns differ in one bit only. Notice that the column on
the extreme left is adjacent to the column on the extreme right. Likewise the top row and the
bottom row are adjacent. The Karnaugh map consists of a number of squares. Each one of the
squares represents a minterm or a maxterm. Each square is called a cell. Two squares are said to
be adjacent to each other if they are physically adjacent to each other or can be made adjacent
by wrapping the map from left to right or top to bottom. Typical maps and their row and
column designations are shown in Figure 5.2. The numbers in squares represent the decimal
code of that cell. A function is represented by placing 1s in cells corresponding to the minterms
present or 0s in the cells corresponding to the maxterms present in the function. 5-variable
functions are represented on two 4-variable maps, and for 6-variable functions, four 4-variable
maps are used. For number of variables n exceeding 6, it becomes incredibly cumbersome to
use the Karnaugh maps.
Figure 5.2 Some Karnaugh maps with their row and column designations (Contd.).
BOOLEAN ALGEBRA 197
Figure 5.2 Some Karnaugh maps with their row and column designations.
= (00)(01)(10)
= M0 ◊ M 1 ◊ M 2
= P M(0, 1, 2)
The maxterm M3 is missing in the POS form. So, the SOP form will contain only the
minterm m3.
Also,
A Æ 0X = (00)(01) = M0 ◊ M1
(A + B) Æ (01) = M1
B Æ X0 = (00)(10) = M0 ◊ M2
Therefore,
A(A + B)B = P M(0, 1, 2)
EXAMPLE 5.19 Write the algebraic terms of a four-variable expression having the
following minterms.
(a) m0 (b) m5 (c) m9 (d) m14
Solution
Given minterm m0 m5 m9 m14
Binary form 0000 0101 1001 1110
Product term A B CD AB CD A B CD ABC D
EXAMPLE 5.20 Write the algebraic terms of a four-variable expression having the
following maxterms.
(a) M3 (b) M9 (c) M11 (d) M14
Solution
Given maxterm M3 M9 M11 M14
Binary form 0011 1001 1011 1110
Sum term A+B+ C+D A+B+C+D A+B+ C+D A+ B+ C+D
AB must be the output of an inverter whose input is AB, and B + C must be the output of an
inverter whose input is B + C. So, we introduce two inverters as shown below.
Now AB must be the output of a two-input AND gate whose inputs are A and B. And B + C
must be the output of a two-input OR gate whose inputs are B and C. So, we introduce an AND
gate and an OR gate as shown below.
First label all the inputs. The signals A and B feed the AND gate G1. The output of this gate
is, therefore, AB. This is the input to NOT gate G2. The output of the NOT gate G2 will, therefore,
be AB. C and D are the inputs to AND gate G4. The output of this gate is, therefore, CD. E and F
are the inputs to AND gate G6. The output of this gate is, therefore, EF. This signal EF is the input
to inverter G5. Its output is, therefore, EF. The input to inverter G7 is G. So, its output is G. Now
C, D, EF, and G are the inputs to OR gate G8. The output of the OR gate G8 will, therefore, be (C +
D + EF + G). This is the input to inverter G9. The output of G9 is, therefore, (C + D + EF + G) .
The inputs to the AND gate G3 are, AB, CD and (C + D + EF + G) . The output of G3, which is also
the output of the logic circuit is, therefore, equal to ( AB) ◊ (CD) ◊ (C + D + EF + G) .
EXAMPLE 5.22 Write the Boolean expression for the logic diagram given below and
simplify it as much as possible and draw the logic diagram that implements the simplified
expression.
Solution
Starting from the input side and writing the expressions for the outputs of the individual
gates, we can easily show that the
Output = (A + AB)(B + BC)(C + AB)
= A(1 + B)B(1 + C)(C + AB)
= AB(C + AB)
= ABC + AB
= AB(1 + C)
= AB
BOOLEAN ALGEBRA 205
The logic diagram to realize the simplified expression is just an AND gate shown below.
EXAMPLE 5.23 Draw the simplest possible logic diagram that implements the output of
the logic diagram shown below.
Solution
Starting from the input side and writing the expressions for the outputs of the individual
gates as shown in the diagram below, we have
Output = (A + A + B)(B + B + C)
= (A + A + B) + (B + B + C)
= A ◊ (A + B) + B ◊ (B + C)
= A ◊ (A + B) + B ◊ (B + C)
= AA + AB + B + BC
= A + AB + B + BC
= A(1 + B) + B(1 + C)
=A+B
206 FUNDAMENTALS OF DIGITAL CIRCUITS
The same result can be obtained by writing the output expression and substituting the values
of the inputs in it. Thus,
X = (ABC)(BCD)
= (0 ◊ 1 ◊ 0)(1 ◊ 0 ◊ 1)
= 1◊ 0
=0
Hybrid logic reduces the number of gate inputs required for realization (from 7 to 6 in this
case), but results in multilevel logic. Different inputs pass through different numbers of gates to
reach the output. It leads to non-uniform propagation delay between input and output and may
give rise to logic race. The SOP and POS realizations give rise to two-level logic. The two-level
logic provides uniform time delay between input and output, because each input signal has to pass
through two gates to reach the output. So, it does not suffer from the problem of logic race.
Since NAND logic and NOR logic are universal logic systems, digital circuits which are first
computed and converted to AOI logic may then be converted to either NAND logic or NOR logic
depending on the choice. The procedure is given as follows:
1. Draw the circuit in AOI logic.
2. If NAND hardware is chosen, add a circle at the output of each AND gate and at the
inputs to all the OR gates.
3. If NOR hardware is chosen, add a circle at the output of each OR gate and at the inputs
to all the AND gates.
4. Add or subtract an inverter on each line that received a circle in steps 2 or 3 so that the
polarity of signals on those lines remains unchanged from that of the original diagram.
208 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
(a) NAND logic: Put a circle at the output of each AND gate and at the inputs to all OR gates
as shown below.
Add an inverter to each of the lines E, F, C, D that received only one circle in the previous
step as shown below so that the polarity of these lines remains unchanged. Inverters in lines
C and D can be removed, if C and D are replaced by C and D. Line H received two circles.
So, no change is required.
Replace bubbled OR gates and NOT gates by NAND gates. Using only NAND gates, the
logic circuit can now be drawn as shown below.
BOOLEAN ALGEBRA 209
(b) NOR logic: Put a circle at the output of each OR gate and at the inputs to all AND gates
as shown below.
Add an inverter in each of the lines A, B, F, and I that received only one circle in the previous
step, so that the polarity of these lines remains unchanged. Line G received two circles. So, no
change is required.
Replace bubbled AND gates and NOT gates by NOR gates. Using only NOR gates, the logic
circuit can now be drawn as shown below. Note that the inverter in line B has been removed
assuming that B is available.
Now study the conversion of the following AOI circuit to (a) NAND logic, and (b) NOR logic.
(a)
210 FUNDAMENTALS OF DIGITAL CIRCUITS
(b)
The A/O gates and AOI gates are available in IC form. A circuit having n AND gates is said
to be n-wide. The A/O gates in which an additional variable or a combination of variables can be
included in the logic operation are called expandable gates. Some AOI gates and expandable A/O
gates available in IC form are shown in Figure 5.3.
Figure 5.3 Some AOI gates and expandable A/O gates available in IC form.
BOOLEAN ALGEBRA 211
Figure 5.4 Logic symbols of active-HIGH logic gates and their active-LOW versions.
Asserted levels: The logic signals can be active-LOW signals or active-HIGH signals. Normally
the active-HIGH signals are represented by variables with no bar over them such as CLOCK, A,
MEM, etc., whereas the active-LOW signals are represented by variables with bar over them such
as X, CLR, MEM , etc. The bar simply emphasizes that a particular signal is active-LOW. When a
signal is in its active state, it is said to be asserted. When it is not in its active state, i.e. when it is
inactive, it is said to be unasserted. The terms ‘asserted’ and ‘unasserted’ are synonymous with
‘active’ and ‘inactive’, respectively.
Negative logic: The assertion level refers to the signal level necessary to cause an event to
occur. Till now, we have assumed that logic 1 is +5 V and logic 0 is 0 V. In this notation, events
occur when inputs are +5 V, i.e. the assertion level is a 1. This is called positive logic, because a 1
is more positive than a 0. In some systems, it is convenient to define the ground level as a 1 and +5
V as a 0. That means that the assertion level is a 0. That is, the level required to do something is a
212 FUNDAMENTALS OF DIGITAL CIRCUITS
0. This is called negative logic, because a 1 is more negative than a 0. In a negative logic system,
the more positive of the two voltage levels is represented by a logic 0. An AND gate in the positive
logic system becomes an OR gate in the negative logic system and vice versa.
Active-LOW bubbles can be very useful when analyzing logic diagrams, because they can
be placed in such a way that they effectively cancel out one another. This eliminates the necessity
for writing numerous inversion bars over compound logic expressions.
The circuit shown in Figure 5.5 implements the expression D(C + A + B) . We can use Boolean
algebra to show that this expression is equivalent to DC(A + B).
The same implementation with active-LOW equivalents by replacing one NOR gate and one
inverter is shown below. Since consequent inversion bubbles cancel out as shown, it is readily
apparent in this diagram that the output is DC(A + B).
NAND and NOR gates as universal gates: We know that AND, OR, and NOT gates are the
basic building blocks of a digital computer. They are called the basic gates. Any digital circuit of
any complexity can be built using only these three gates. A universal gate is a gate which alone
can be used to build any logic circuit. So, to show that the NAND gate and the NOR gate are
universal gates, we have to show that all the three basic logic gates can be realized using only
NAND gates or using only NOR gates. The diagrams given in Figure 5.6 show the realization of
AND, OR, and NOT functions using either only NAND gates or only NOR gates.
Figure 5.6 Diagrams showing the realization of AND, OR and NOT functions using either only
NAND gates or only NOR gates (Contd.)...
BOOLEAN ALGEBRA 213
Figure 5.6 Diagrams showing the realization of AND, OR and NOT functions using either only
NAND gates or only NOR gates.
EXAMPLE 5.25 Find the values of the two-valued variables A, B, C, and D by solving
the set of simultaneous equations.
A + AB = 0
AB = AC
AB + A C + CD = CD
Solution
Given
A + AB = 0
or
( A + A)( A + B) = 0
or
(1)( A + B) = 0
or
A+B=0
i.e. A must be 0 and B must be 0. Therefore, A = 1 and B = 0.
Also
AB = AC
or
1◊0=1◊C
Therefore
C=0
Also,
AB + A C + CD = CD
214 FUNDAMENTALS OF DIGITAL CIRCUITS
or
1◊0+1◊1+0◊D=1◊D
or
1=D
Therefore, the values of A, B, C, and D are A = 1, B = 0, C = 0, and D = 1.
EXAMPLE 5.26 Prove that
(a) If A ≈ B = 0, then A = B (b) A ≈ B = A ≈ B
(c) A ≈ B = A ≈ B = A ≈ B (d) 0 ≈ A = A
(e) 1 ≈ A = A (f) A ≈ A = 0
(g) A ≈ A = 1
Solution
(a) The X-OR gate is an anti-coincidence gate. Its output is 0 when both the inputs are equal.
Therefore, if A ≈ B = 0, then A must be equal to B.
(b) A ≈ B = A B + AB
A ≈ B = A ◊ B + A ◊ B = A B + AB
\ A≈B=A≈B
(c) A ≈ B = A ◊ B + A ◊ B = AB + A B = A ≈ B
A ≈ B = A ◊ B + A ◊ B = A B + AB = A ≈ B
\ A≈B = A ≈ B = A ≈ B
(d) 0≈A=0◊A+ 0 ◊A=0+1◊A=0+A=A
(e) 1≈A=1◊A+ 1◊A=A+0◊A=A+0=A
(f) A≈A=A◊A+A◊A=0+0=0
(g) A≈A=A◊A+A◊A=A◊A+A◊A=A+A=1
EXAMPLE 5.27 Realize the X-OR function using (a) AOI logic, (b) NAND logic, and
(c) NOR logic.
Solution
(a) Using AOI logic:
= A AB + B AB
= AAB + BAB
= AAB ◊ BAB
(k) ( A + B + C) ◊ ( A + B + C) ◊ ( A + B + C) ◊ ( A + B + C)
= (A + B + C) ◊ (A + B + C) ◊ ( A + B + C) ◊ ( A + B + C)
EXAMPLE 5.30 Find the complement and the dual of the function given below and then
reduce it to a minimum number of literals in each case. f = [( ab)a][( ab)b].
Solution
EXAMPLE 5.34
(a) Implement the following function using only NOR gates F = a(b + cd) + bc .
(b) Implement the following function using only NAND gates G = (a + b) ◊ (cd + e )
(c) Give the minimum two-level SOP realization of the following switching function using
only NAND gates F = S m(0, 3, 4, 5, 7).
Solution
(a) To implement the expression using only NOR gates, the expression should have only
sum terms. The given expression in terms of sum terms is given below and its
implementation using NOR gates is shown in Figure 5.7.
(b) To implement the expression using only NAND gates the expression should be in terms
of only product terms. The given expression in terms of product terms is given below and
its implementation using only NAND gates is shown in Figure 5.8.
G = (a + b) ◊ (cd + e ) = (a + b) ◊ (cd + e) = (ab) (cd ◊ e)
(c) The minimal expression is
F = S m(0, 3, 4, 5, 7) = x y z + x yz + x y z + x y z + xyz
= x y (z + z ) + y z (x + x ) + yz(x + x )
= x y + yz + y z
= xy ◊ yz ◊ y z
220 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 5.35 Derive the Boolean expression for a two-input Ex-OR gate to realize
with two input NAND gates without using complemented variables and draw the circuit.
Solution
The Boolean expression for a two-input (A, B) Ex–OR gate is F = A B + AB. The derivation
of the expression to realize with two input NAND gates without using complemented variables
is given below. Its realization is shown in Figure 5.10.
F = A B + AB
= A B + A A + AB + B B
= A( A + B) + B(A + B)
= A ◊ AB + B ◊ AB
= A ◊ AB ◊ B ◊ AB
EXAMPLE 5.36 Derive the Boolean expression for a two-input Ex-NOR gate to realize
with two input NOR gates, without using complemented variables and draw the circuit.
Solution
We know that the Boolean expression for a two-input Ex-NOR gate is the complement of the
Boolean expression for a two input Ex-OR gate. The derivation of the expression to realize
with two input NOR gates without using complemented variables is given below. Its realization
is shown in Figure 5.11.
F = AB + AB
= AB + BB + AB + AA
= B(A + B) + A(A + B)
= B(A + B) + A(A + B)
=B+A+B+A+A+B
EXAMPLE 5.37 Redraw the circuit given in Figure 5.12 after simplification.
Solution
Y = (A ≈ B) (A + B)
= (A ≈ B)(A + B) + ( A ≈ B)( A + B)
= (A B + AB)(A + B) + (AB + A B)( A B)
= A B + AB + A B = A B + A(B + B) = A + A B
= ( A + A)( A + B) = ( A + B) = AB
So, the simplified circuit is just a two-input NAND gate.
222 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 5.38 Redraw the circuit given in Figure 5.13 after simplification.
Solution
From the logic diagram, we see that
Z = (X ≈ Y) ≈ (XY)
= ( X ≈ Y) ◊ XY + (X ≈ Y) ◊ XY
= ( X Y + XY)XY + (X Y + X Y)(X + Y)
= XY + X Y + X Y = X(Y + Y) + X Y = X + X Y
= (X + X )(X + Y) = X + Y
So, the simplified circuit is a two input OR gate.
EXAMPLE 5.40 Simplify the following expressions and implement them with NAND
gate circuits.
(a) F = A B + ABD + AB D + A CD + AB C
(b) G = BD + BC D + A B CD
Solution
The simplification of the given expressions is given below. Their implementation with NAND
gate circuits is shown in Figure 5.13.
(a) F = A B + ABD +AB D + A CD + AB C = A B + AB(D + D) + A CD + AB C
= A B + AB + A C D + AB C = A( B + B) + A C D + AB C
= A + A C D + AB C = (A + A)(A + C D) + AB C = A + C D + AB C
= (A + A)(A + B C) + CD = (A + B C) + CD = A ◊ BC ◊ CD
(b) G = BD + BC D + A B CD = B(D + CD) + A B CD = B(D +C)(D + D) + A B CD
= BD + BC + A B CD = BD ◊ BC ◊ ABCD
EXAMPLE 5.41 Express the following functions as sum of minterms and product of
maxterms:
(a) F(A, B, C, D) = BD + AD + BD
(b) F(x, y, z) = (xy + z)(xz + y)
Solution
Considering that the missing minterms in SOP form become the maxterms in POS form and
vice versa, the given expressions are expressed as sum of minterms and product of maxterms
as shown below.
(a) F = BD + AD + BD = X 0 X1 + 0XX1 + X1X1
= 0001, 0011, 1001, 1011, 0001, 0011, 0101, 0111, 0101, 0111, 1101, 1111
= S m (1, 3, 9, 11, 1, 3, 5, 7, 5, 7, 13, 15)
= S m (1, 3, 5, 7, 9, 11, 13, 15)
= PM (0, 2, 4, 6, 8, 10, 12, 14)
224 FUNDAMENTALS OF DIGITAL CIRCUITS
1. What is a literal?
A. A logical variable in complemented or uncomplemented form is known as a literal.
2. What is a binary variable?
A. Binary variable is a variable that can have only two values 0 and 1.
3. What is switching theory?
A. Switching theory is the mathematical theory of logic circuits.
4. What is Boolean algebra?
A. Boolean algebra is a system of mathematical logic which uses the letters of English alphabet to
represent variables. Any single variable or a function of the variables can have a value of either
0 or 1. In Boolean algebra there is no subtraction or division. Only logical addition and logical
multiplication are performed. There are no fractions or negative numbers. It is algebra of binary
variables.
5. What are the basic operations in Boolean algebra?
A. The basic operations in Boolean algebra are as follows.
(a) AND operation. It is the same as logical multiplication. It is denoted by ‘◊◊ ’ or « or Ÿ or no
symbol at all.
BOOLEAN ALGEBRA 225
REVIEW QUESTIONS
1. State and prove (a) commutative, (b) associative, (c) distributive, (d) Redundant literal rule,
(e) idempotence, and (f) absorption laws of Boolean algebra.
2. State and prove (a) consensus theorem, (b) transposition theorem, and (c) De Morgan’s theorem.
3. What are the steps followed in the reduction of Boolean expressions?
4. How do you convert AOI logic to (a) NAND logic and (b) NOR logic.
5. Show that both NAND gate and NOR gate are universal gates.
6. Realize X-OR operation using (a) Only NAND gates, (b) only NOR gates, and (c) AOI logic.
7. Draw logic diagrams to realize the following expressions (a) A ≈ B ≈ C ≈ D and (b) A B C D.
8. How do you find the complement of an expression?
9. How do you find the dual of an expression?
10. How do you Demorganize an expression?
1. The basic operations in Boolean algebra are (a) ______, (b) ______, and (c) ______.
2. Every logical operation in a Boolean expression represents a ______.
3. The hybrid form of realization is a combination of both ______ and ______ forms.
4. On logic diagrams, a bubble at the input indicates ______.
5. An OR gate in positive logic system becomes ______ in negative logic system.
6. An AND gate in positive logic system becomes ______ in negative logic system.
7. The commutative laws say that ______.
8. The associative laws say that ______.
9. The distributive laws say that ______.
10. The redundant literal rule says that ______.
11. The idempotence laws say that ______.
12. The absorption laws say that ______.
13. The consensus theorem states that ______.
14. The consensus theorem is also called ______ theorem.
15. The transposition theorem states that ______.
16. The De Morgan’s theorem states that ______.
17. The Shannon’s Expansion theorem states that ______.
18. The interconnection of gates to perform a variety of logical operations is called ______.
19. The terms asserted and unasserted are synonymous with ______ and ______ respectively.
20. The assertion level refers to the ______ level necessary to cause an event to occur.
21. Hybrid logic is a ______ logic. It leads to ______ propagation delay and may give rise to ______.
22. SOP and POS realizations give rise to ______ logic. It leads to ______ time delay between input
and output. So it does not suffer from the problem of ______.
23. A logic expression form most suitable for realization using only NAND gates is ______.
24. A logic expression form most suitable for realization using only NOR gates is ______.
BOOLEAN ALGEBRA 229
PROBLEMS
(o) ABC + AB + BC = AB
5.8 Apply De Morgan’s theorem to each of the following expressions.
(a) P(Q + R) (b) (P + Q)(R + S)
6.1 INTRODUCTION
We have seen how Boolean expressions can be simplified algebraically, but being not a systematic
method we can never be sure whether the minimal expression obtained is the real minimal or not.
The effectiveness of algebraic simplification depends on our familiarity with, and ability to apply
Boolean algebraic rules, laws and theorems. The Karnaugh map (K-map) method, on the other
hand, is a systematic method of simplifying the Boolean expressions. The K-map is a chart or a
graph, composed of an arrangement of adjacent cells, each representing a particular combination
of variables in sum or product form. Like a truth table, it is a means of showing the relationship
between the logic inputs and the desired output. Although a K-map can be used for problems
involving any number of variables, it becomes tedious for problems involving five or more variables.
Usually it is limited to six variables. An n variable function can have 2n possible combinations of
product terms in SOP form, or 2n possible combinations of sum terms in POS form. Since the
K-map is a graphical representation of Boolean expressions, a two-variable K-map will have 22 = 4
cells or squares, a three variable map will have 23 = 8 cells or squares, and a four variable map will
have 24 = 16 cells, and so on.
Any Boolean expression can be expressed in a standard or canonical or expanded sum (OR)
of products (AND) form—SOP form—or in a standard or canonical or expanded product (AND)
of sums (OR) form—POS form. A standard SOP form is one in which a number of product terms,
each one of which contains all the variables of the function either in complemented or
non-complemented form, are summed together. A standard POS form is one in which a number of
sum terms, each one of which contains all the variables of the function either in complemented or
non-complemented form, are multiplied together. Each of the product terms in the standard SOP
form is called a minterm and each of the sum terms in the standard POS form is called a maxterm.
232
MINIMIZATION OF SWITCHING FUNCTIONS 233
For simplicity, the minterms and maxterms are usually represented as binary words in terms of 0s
and 1s, instead of actual variables. For minterms, the binary words are formed by representing
each non-complemented variable by a 1 and each complemented variable by a 0, and the decimal
equivalent of this binary word is expressed as a subscript of lower case m, i.e. m0, m2, m5, m7, etc.
For maxterms, the binary words are formed by representing each non-complemented variable by a
0 and each complemented variable by a 1, and the decimal equivalent of this binary word is
expressed as a subscript of the upper-case letter M, i.e. M0, M1, etc. Any given function which is
not in the standard form, can always be converted to standard form by unreducing, that is, expanding
the function.
A standard SOP form can always be converted to a standard POS form, by treating the
missing minterms of the SOP form as the maxterms of the POS form. Similarly, a standard POS
form can always be converted to a standard SOP form, by treating the missing maxterms of the
POS form as the minterms of the corresponding SOP form.
The first column indicates the minterm designation, the second column indicates the input
combinations, and the last column indicates the presence or absence of that minterm in the output
expression. A 1 in the output column indicates that the output contains that particular minterm in
its sum and a 0 in that column indicates that the particular minterm does not appear in the expression
for output. Such information about the two-variable expression can also be indicated by a two-
variable K-map.
234 FUNDAMENTALS OF DIGITAL CIRCUITS
Two 2-squares adjacent to each other can be combined to form a 4-square. A 4-square
eliminates 2 variables. A 4-square is called a quad.
To read the squares on the map after minimization, consider only those variables which
remain constant throughout the square, and ignore the variables which are varying. Write the
non-complemented variable if the variable is remaining constant as a 1, and the complemented
variable if the variable is remaining constant as a 0, and write the variables as a product term. In
Figure 6.4, f1 is read as A, because, along the square, A remains constant as a 0, that is, as A,
whereas B is changing from 0 to 1. f3 is read as B, because, along the square, B remains constant
as a 1, whereas A is changing from 0 to 1. f5 is read as a 1, because, no variable remains constant
throughout the square, which means that the output is a 1 for any combination of inputs.
236 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 6.5 Example 6.2: K-map in SOP form, and logic diagram.
The main criterion in the design of a digital circuit is that its cost should be as low as possible.
To design a circuit with the least cost, the expression used to realize that circuit must be minimal.
Since the cost is roughly proportional to the number of gate inputs in the circuit, an expression is
considered minimal only if it corresponds to the least possible number of gate inputs. There is no
guarantee that the minimal expression obtained from the K-map in the SOP form is the real minimal.
To obtain the real minimal expression, we obtain the minimal expressions for any problem in both
the SOP and POS forms by using the K-maps and then take the minimal of these two minimals.
We know that the 1s on the K-map indicate the presence of minterms in the output expression,
whereas the 0s indicate the absence of minterms. Since the absence of a minterm in the SOP
expression means the presence of the corresponding maxterm in the POS expression of the same
problem, when a SOP expression is plotted on the K-map, 0s or no entries on the K-map represent
the maxterms. To obtain the minimal expression in the POS form, consider the 0s on the K-map
and follow the procedure used for combining 1s. Also, since the absence of a maxterm in the POS
expression means the presence of the corresponding minterm in the SOP expression of the same
problem, when a POS expression is plotted on the K-map, 1s or no entries on the K-map represent
the minterms.
the squares corresponding to the maxterms which are not present in the expression. The decimal
designation of the squares for maxterms is the same as that for the minterms. A two-variable
K-map and the associated maxterms are shown in Figure 6.6.
Figure 6.9 Example 6.4: K-map in POS form and logic diagram.
In the given expression, the maxterm M2 is absent. This is indicated by a 1 on the K-map.
The corresponding SOP expression is S m2 or A B. This realization is the same as that for the
POS form.
The binary numbers along the top of the map indicate the condition of B and C for each
column. The binary number along the left side of the map against each row indicates the condition
of A for that row. For example, the binary number 01 on top of the second column in Figure 6.10a
MINIMIZATION OF SWITCHING FUNCTIONS 239
indicates that the variable B appears in complemented form and the variable C in non-complemented
form in all the minterms in that column. The binary number 0 on the left of the first row indicates
that the variable A appears in complemented form in all the minterms in that row. Similarly, the
binary number 01 on top of the second column in Figure 6.10b indicates that the variable B appears
in non-complemented form and the variable C in complemented form in all the maxterms in that
column. The binary number 0 on the left of the first row indicates that the variable A appears in
non-complemented form in all the maxterms in that row. Observe that the binary numbers along
the top of the K-map are not in normal binary order. They are, in fact, in the Gray code. This is to
ensure that two physically adjacent squares are really adjacent, i.e. their minterms or maxterms
differ by only one variable.
EXAMPLE 6.5 Map the expression f = A BC + A BC + AB C + AB C + ABC.
Solution
In the given expression, the minterms are: A BC = 001 = m1; A BC = 101 = m5; AB C = 010
= m2; AB C = 110 = m6; ABC = 111 = m7. So the expression is f = S m (1, 5, 2, 6, 7) =
S m (1, 2, 5, 6, 7). The corresponding K-map is shown in Figure 6.11.
(maxterms) adjacent to each other, in order to combine them into larger squares. Combining of
adjacent squares in a K-map containing 1s (or 0s) for the purpose of simplification of a SOP (or
POS) expression is called looping. Some of the minterms (maxterms) may have many adjacencies.
Always start with the minterm (maxterm) with the least number of adjacencies and try to form
as large a square as possible. The larger squares must form a geometric square or rectangle.
They can be formed even by wrapping around, but cannot be formed by using diagonal
configurations. Next consider the minterm (maxterms) with next to the least number of adjacencies
and form as large a square as possible. Continue this till all the minterms (maxterms) are taken
care of. A minterm (maxterm) can be combined any number of times if it helps in reduction, i.e.
A minterm (maxterm) can be part of any number of squares if it is helpful in reduction. Read the
minimal expression from the K-map, corresponding to the squares formed. There can be more
than one minimal expression.
Two squares are said to be adjacent to each other (since the binary designations along the top
of the map and those along the left side of the map are in Gray code), if they are physically
adjacent to each other, or can be made adjacent to each other by wrapping around. For squares to
be combinable into bigger squares it is essential but not sufficient that their minterm designations
must differ by a power of two.
From the above, we can outline the generalized procedure to simplify the Boolean expressions
as follows:
1. Plot the K-map and place 1s (0s) corresponding to the minterms (maxterms) of the SOP
(POS) expression.
2. Check the K-map for 1s (0s) which are not adjacent to any other 1 (0). They are isolated
minterms (maxterms). They are to be read as they are because they cannot be combined
even into a 2-square.
3. Check for those 1s (0s) which are adjacent to only one other 1 (0) and make them pairs
(2 squares).
4. Check for quads (4 squares) and octets (8 squares) of adjacent 1s (0s) even if they contain
some 1s (0s) which have already been combined. They must geometrically form a square
or a rectangle.
5. Check for any 1s (0s) that have not been combined yet and combine them into bigger
squares if possible.
6. Form the minimal expression by summing (multiplying) the product (sum) terms of all
the groups.
m3, the variables B and C are changing, and A remains constant as a 0. Algebraically, we have
f5 = m0 + m1 + m2 + m3 = A B C + A BC + AB C + ABC
= A B( C + C) + AB(C + C)
= A B + AB = A( B + B) = A
Figure 6.13 Some possible combinations of minterms in a three-variable K-map (SOP form).
f3 is read as C + B, because in the 4-square formed by m0, m2, m6, and m4, the variables A and B
are changing, whereas the variable C remains constant as a 0. So it is read as C. In the 4-square
formed by m0, m1, m4 and m5, A and C are changing but B remains constant as a 0. So it is read as
B. So, the resultant expression for f3 is the sum of these two, i.e. C + B.
f1 is read as B C + A B + A C, because in the 2-square formed by m0 and m4, A is changing from
a 0 to a 1, whereas B and C remain constant as a 0. So, it is read as B C. In the 2-square formed by m0
and m1, C is changing from a 0 to a 1, whereas A and B remain constant as a 0. So, it is read as A B.
In the 2-square formed by m0 and m2, B is changing from a 0 to a 1 whereas A and C remain constant
as a 0. So, it is read as A C. Therefore, the resultant SOP expression is, B C + AB + B C.
Some possible maxterm groupings and the corresponding minimal POS expressions read
from the K-map are shown in Figure 6.14.
Figure 6.14 Some possible combinations of maxterms in a three-variable K-map (POS form).
In Figure 6.14a, along the 4-square formed by M1, M3, M7 and M5, A and B are changing
from a 0 to a 1, whereas C remains constant as a 1. So it is read as C. Along the 4-square formed
242 FUNDAMENTALS OF DIGITAL CIRCUITS
by M3, M2, M7 and M6, variables A and C are changing from a 0 to a 1, but B remains constant as
a 1. So it is read as B. The minimal expression is the product of these two terms, i.e. f1 = ( C)( B).
In Figure 6.14b, along the 2-square formed by M4 and M6, variable B is changing from a 0
to a 1, while variable A remains constant as a 1 and variable C remains constant as a 0. So, read it
as A + C. Similarly, the 2-square formed by M7 and M6 is read as A + B, while the 2-square
formed by M2 and M6 is read as B + C. The minimal expression is the product of these three sum
terms, i.e. f2 = ( A + C)( A + B)( B + C).
EXAMPLE 6.7 Reduce the expression f = S m (0, 2, 3, 4, 5, 6) using mapping and implement
it in AOI logic as well as in NAND logic.
Solution
The SOP K-map and its reduction, and the implementation of the minimal expression using
AOI logic and the corresponding NAND logic are shown in Figures 6.15a, b, and c respectively.
In the SOP K-map shown in Figure 6.15a, the reduction is done as per the following steps:
1. m5 has only one adjacency m4, so combine m5 and m4 into a 2-square. Along this 2-square
A remains constant as 1 and B remains constant as 0 but C varies from 0 to 1. So read it
as A B.
2. m3 has only one adjacency m2. So combine m3 and m2 into a 2-square. Along this 2-square
A remains constant as 0 and B remains constant as 1 but C varies from 1 to 0. So read it
as AB.
3. m6 can form a 2-square with m2 and m4 can form a 2-square with m0, but observe that by
wrapping the map from left to right m0, m4, m2, m6 can form a 4-square. Out of these m2
and m4 have already been combined but they can be utilized again. So make it. Along
this 4-square, A is changing form 0 to 1 and B is also changing form 0 to 1 but C is
remaining constant as 0. So read it as C.
4. Write all the product terms in SOP form. So the minimal SOP expression is
fmin = A B + AB + C = AB + AB + C = AB ◊ AB ◊ C = AB ◊ AB ◊ C
Figure 6.15 Example 6.7: K-map in SOP form, and logic diagrams.
Solution
The K-map and its reduction, and the implementation of the minimal expression using AOI
logic and the corresponding NOR logic are shown in Figures 6.16a, b, and c respectively.
In the POS K-map shown in Figure 6.16a the reduction is done as per the following steps:
1. M4 has only one adjacency M0. So combine M4 and M0 into a 2-square. Along this
2-square, A varies from 0 to 1 but B and C remain constant as 0. So read it as (B + C).
2. M7 has only one adjacency M3. So combine M7 and M3 into a 2-square. Along this
2-square, A varies from 0 to 1, but B and C remain constant as 1. So read it as ( B + C).
3. M0, M1, M3, and M2 form a geometric rectangle. So make it a 4-square. Along this
4-square, B and C vary from 0 to 1, but A remains constant as 0. So read this 4-square
as A.
4. Write all the sum terms in POS form. So the minimal POS expression is
EXAMPLE 6.9 Obtain the real minimal expression for f = S m (1, 2, 4, 6, 7) and implement
it using universal gates.
Solution
In the given SOP expression, minterms m0, m3, and m5 are missing. They, therefore, become
the maxterms for the POS expression. So in POS form f = P M(0, 3, 5).
To obtain the real minimal expression, obtain the minimal expressions in both the SOP
and POS forms and then take the minimal of those two minimals. The K-maps in SOP and
POS forms, their minimization, and the minimal expressions obtained from them are shown
in Figures 6.17a and b respectively.
In the SOP K-map shown in Figure 6.17a, the minimization is done as per the following steps:
1. m1 has no adjacency. So it cannot be a part of a bigger square. So read it as it is, i.e as ABC.
2. m4 has only one adjacency m6. So make a 2-square with m4 and m6 and read it as A C.
3. m2 has only one adjacency m6. So make a 2-square with m2 and m6 and read it as B C.
4. m7 has only one adjacency m6. So make a 2-square with m7 and m6 and read it as AB
(observe that m6 has been combined thrice).
5. Write all the product terms in SOP form.
So the minimal SOP expression is
fmin = A BC + A C + B C + AB
In the POS K-map no two maxterms are adjacent to each other. So no minimization is possible
and they are to be read as they are. M0 is read as (A + B + C). M3 is read as (A + B + C). M5 is read
as ( A + B + C). So the POS expression is f = (A + B + C)(A + B + C)( A + B + C). The SOP form
requires 13 gate inputs, whereas the POS form requires 12. So, the POS form is preferred. Thus,
the real minimal expression is
fmin = (A + B + C)(A + B + C)( A + B + C) = (A + B + C) + (A + B + C) + (A + B + C)
The logic diagram corresponding to the minimal expression using NOR gates is shown in
Figure 6.17c.
EXAMPLE 6.10 Show the truth table for each of the following functions and find its
simplest POS form
(a) f (X, Y, Z) = XY + XZ
(b) f (X, Y, Z) = X + Y Z
Solution
The truth tables for the functions, the POS expressions obtained from them, the corresponding
K-maps, their simplification and the simplest POS forms are shown in Figures 6.18a and b
respectively. In the truth table, 0s represent maxterms and 1s represent minterms. The simplest
POS form can be found by using either K-map or algebraically. The minimal expressions
from K-map are
(i) fmin = X(Y + Z) (ii) fmin = ( X + Y)( X + Z)
Algebraically we have
(i) fmin = XY + XZ = X(Y + Z) (ii) fmin = X + Y Z = ( X + Y)( X + Z)
Squares which are physically adjacent to each other or which can be made adjacent by
wrapping the map around from left to right or top to bottom can be combined to form bigger
squares. The bigger squares (2 squares, 4 squares, 8 squares, etc.) must form either a geometric
square or rectangle. For the minterms or maxterms to be combinable into bigger squares, it is
necessary but not sufficient that their binary designations differ by a power of 2.
246 FUNDAMENTALS OF DIGITAL CIRCUITS
Some possible 2-squares are: m0, m1; m0, m2; m0, m4; m0, m8; m13, m12; m13, m5; m13, m9;
m13, m15; m10, m11; m10, m8; m10, m14; m10, m2; etc.
Some possible 4-squares are: m0, m1, m3, m2; m0, m4, m12 m8; m0, m1, m4, m5; m0, m4,m2,
m6; m0, m1, m8, m9; m5, m7, m13, m15; m0, m2, m8, m10; etc.
Some possible 8-squares are: m0, m1, m3, m2, m8, m9, m11, m10; m0, m4, m12, m8, m2, m6, m14,
m10; m4, m5, m7, m6, m12, m13, m15, m14; m1, m3, m5, m7, m13, m15, m9, m11; etc.
EXAMPLE 6.11 Reduce using mapping the expression f = S m(2, 3, 6, 7, 8, 10, 11, 13, 14).
Solution
On the SOP K-map shown in Figure 6.20 the minimization is done as per the following
steps:
1. Start with the minterm with the least number of adjacencies. The minterm m13 has no
adjacency. Keep it as it is and read as AB CD.
2. The m8 has only one adjacency, m10. Expand m8 into a 2-square with m10 and read the
2-square as A BD.
3. The m7 has two adjacencies, m6 and m3. Observe that, m7, m6, m2, and m3 form a geometric
square. Hence m7 can be expanded into a 4-square with m6, m3 and m2. Read this 4-square
as AC.
4. The m11 has 2 adjacencies, m10 and m3. Observe that, m11, m10, m3, and m2 form a
geometric square on wrapping the K-map from top to bottom. So expand m11 into a
4-square with m10, m3 and m2. Note that m2 and m3 have already become a part of the
4-square m7, m6, m2, and m3. But if m11 is expanded only into a 2-square with m10, only
one variable is eliminated. So m2 and m3 are used again to make another 4-square with
m11 and m10 to eliminate two variables. Read this 4-square as BC.
5. Now only m14 is left uncovered. It can form a 2-square with m6 or m10 but that eliminates
only one variable. Don’t do that. See whether it can be expanded into a larger square.
Observe that, m2, m6, m14, and m10 form a rectangle. So m14 can be expanded into a
4-square with m2, m6, and m10. This eliminates two variables. Read this 4-square as CD.
6. Write all the product terms in SOP form. Therefore, the reduced expression is
fmin = AB CD+ A BD + AC + BC + C D (18 inputs)
fmin = BD + A C + AD = BD ◊ AC ◊ AD
The implementation of the minimal expression using NAND logic is shown in Figure 6.21c.
In the SOP K-map shown in Figure 6.21a, the reduction is done as per the following steps:
Looking at the map you feel like making one 4-square with m0, m1, m3, m2 and another
4-square with m1, m5, m13, m9 but do not do that. It will be a blunder. Proceed systematically
as follows:
1. There are no isolated 1s.
2. There are no 1s which can be combined only into 2-squares. So make no 2-squares.
3. m10 can form a 4-square with m0, m2, m8. Make it and read it as BD.
4. m12 can form a 4-square with m8, m9, m13. Make it and read it as A C.
5. m7 can form a 4-square with m5, m1, m3. Make it and read it as AD.
6. Write all the product terms in SOP form.
So the minimal SOP expression is
fmin = BD + A C + AD
In the POS K-map shown in Figure 6.21b, the reduction is done as per the following steps:
1. There are no isolated 0s.
2. M4 can form a 2-square only with M6. Make it and read it as (A + B + D).
3. M11 can form a 2-square only with M15. Make it and read it as ( A + C + D).
248 FUNDAMENTALS OF DIGITAL CIRCUITS
4. Only M14 is left. It can form a 2-square with M15 or M6. If you make it with M15, read it
as ( A + B + C).
5. Write all the sum terms in POS form.
So the minimal POS expression is
fmin = (A + B + D)( A + C + D)( A + B + C)
EXAMPLE 6.13 Reduce using mapping the expression f = P M(2, 8, 9, 10, 11, 12, 14)
and implement the real minimal expression in universal logic.
Solution
The given expression in the SOP form is f = S m (0, 1, 3, 4, 5, 6, 7, 13, 15). The K-maps for
the SOP and POS forms, their reduction, and the reduced expressions obtained from them
are shown in Figures 6.22a and b respectively. The SOP form requires 12 gate inputs, whereas
the POS form requires only 10 gate inputs. So the POS form is more economical. The
implementation of the minimal expressions using NOR gates is given in Figure 6.22c. Now
In the SOP K-map shown in Figure 6.22a, the reduction is done as per the following steps:
1. There are no isolated 1s.
2. There are no 1s which can be combined only into 2-squares. So make no 2-squares.
3. m6 can form a 4-square with m7, m5, m4. Make it and read it as AB.
4. m15 can form a 4-square with m13, m5, m7. Make it and read it as BD.
5. m0 can form a 4-square with m1, m4 , m5. Make it and read it as A C.
6. Only m3 is left. It can make a 4-square with m1, m5 , m7. Make it and read it as AD.
7. Write all the product terms in SOP form.
So the minimal SOP expression is
fmin = AB + BD + A C + AD
In the POS K-map shown in Figure 6.22b, the reduction is done as per the following steps:
1. There are no isolated 0s.
MINIMIZATION OF SWITCHING FUNCTIONS 249
2. M2 can form a 2-square with only M10. Make it and read it as (B + C + D).
3. M12 and M14 can form a 4-square with M8, M10. Make it and read it as (A + D).
4. M9, and M11 can form a 4-square with M8 and M10. Make it and read it as ( A + B).
5. Write all the sum terms in POS form.
So the minimal POS expression is
fmin = (B + C + D)(A + D)(A + B)
EXAMPLE 6.14 Reduce using mapping the following expression and implement the real
minimal expression in universal logic.
f = S m(0, 2, 4, 6, 7, 8, 10, 12, 13, 15)
Solution
The given expression in the POS form is f = P M(1, 3, 5, 9, 11, 14). The K-maps for the SOP
and POS forms, their minimization, and the minimal expressions obtained from them are
shown in Figures 6.23a and b respectively. They are:
SOP minimal is
fmin = CD + A D + BD + ABD + BCD
POS minimal is
fmin = (B + D)(A + C + D)( A + B + C + D)
The SOP form requires 17 gate inputs, whereas the POS form requires only 12 gate inputs.
So the POS form is more economical. The implementation of the minimal expression using POS
logic is shown in Figure 6.23c.
Now
fmin = (B + D)(A + C + D)( A + B + C + D) = (B + D) + (A + C + D) + (A + B + C + D)
which cannot be covered by any other prime implicant is called an essential prime implicant
(EPI). The prime implicant whose each 1 is covered at least by one EPI is called a redundant prime
implicant (RPI). A prime implicant which is neither an essential prime implicant nor a redundant
prime implicant is called a selective prime implicant (SPI).
The function mapped in Figure 6.24 has a unique MSP comprising EPIs given by
F(A, B, C, D) = ACD + ABC + A CD + AB C
The RPI ‘BD’ may be included without changing the function but the resulting expression
would not be in minimal sum of products (MSP) form.
In Figure 6.25 representing F(A, B, C, D) = S m(0, 4, 5, 10, 11, 13, 15) SPIs are marked by
dotted squares. This shows that the MSP form of a function need not be unique.
For the function mapped in Figure 6.25, the MSP form is obtained by including two EPIs
and selecting a set of SPIs to cover the remaining uncovered minterms 5, 13, 15. These can be
covered in the following ways.
(a) (4, 5) and (13, 15) ... AB C + ABD
(b) (5, 13) and (13, 15) ... B CD + ABD
(c) (5, 13) and (15, 11) ... B CD + ACD
\ F(A, B, C, D) = A CD + A BC ... EPIs + AB C + ABD
or F(A, B, C, D) = A CD + A BC ... EPIs + B CD + ABD
MINIMIZATION OF SWITCHING FUNCTIONS 251
6.4.2 False Prime Implicants, Essential False Prime Implicants, Redundant False
Prime Implicants and Selective False Prime Implicants
The maxterms are called false minterms. The prime implicants obtained by using the maxterms are
called false prime implicants (FPIs). The FPI which contains at least one 0 which cannot be covered
by any other FPI is called an essential false prime implicant (EFPI).
The function
F(A, B, C, D) = S m (0, 1, 2, 3, 4, 8, 12)
= P M(5, 6, 7, 9, 10, 11, 13, 14, 15)
Fmin = ( B + C)( A + C)( A + D)( B + D)
In the mapping shown in Figure 6.26 all the FPIs are EFPIs as each of them contains at least
one 0 which cannot be covered by any other FPI.
The four FPIs in Figure 6.27 (A + B + C), (A + C + D), ( A + C + D), ( A + B + C) are all
essential FPIs because each one of them contains at least one 0 which cannot be covered by any
252 FUNDAMENTALS OF DIGITAL CIRCUITS
other FPI. The four corner 0s form the largest cluster of adjacent 0s, which is an FPI whose 0s are
covered by essential FPIs and hence is a redundant false prime implicant (RFPI).
Look at Figure 6.28 which maps
F(A, B, C, D) = S m(0, 4, 5, 10, 11, 13, 15)
= P M(1, 2, 3, 6, 7, 8, 9, 12, 14)
The function has in all seven FPIs marked in Figure 6.28. The FPI (A + C) is an essential FPI
as it contains 0s at locations 2 and 7 which cannot be covered by any other FPI. The remaining six
FPIs are all SFPIs. As the EFPI covers the 0s at locations 2, 3, 6, 7 we must now select a minimal
set of SFPIs to cover the remaining five 0s at locations 1, 8, 9, 12, 14. The answer is not unique.
One possible solution comprising EFPI and three SFPIs is
F(A, B, C, D) = (A + C)(A + B + D)( A + B + C)( A + B + D)
EXAMPLE 6.15 (a) Differentiate between a prime implicant and a non-prime implicant,
and an essential prime implicant and a non-essential prime implicant.
(b) Reduce the following function using K-map and identify prime implicants and essential
prime implicants:
F = S m(0, 1, 2, 3, 6, 7, 13, 15)
(c) Reduce the following function using K-map and identify the prime implicant and non-prime
implicant.
F = S m(2, 3, 6, 7, 10, 11, 12)
Solution
(a) A prime implicant is a square or rectangle made up of the bunch of adjacent minterms. It
is also called a subcube. A non-prime implicant is a minterm which does not have any adjacent
minterms, i.e. which cannot form a part of a bigger square. An essential prime implicant is a
prime implicant which contains at least one 1 which cannot be covered by any other prime
implicant. A non-essential prime implicant is a selective prime implicant. It is neither essential
nor redundant. It may or may not appear in the minimal expression.
(b) The K-map for F = S m(0, 1, 2, 3, 6, 7, 13, 15) shown in Figure 6.29a has three essential
prime implicants (EPIs), and one redundant prime implicant (RPI). The three essential prime
implicants cover all the minterms. So the minimal expression is
fmin = A B + AC + ABD (10 gate inputs)
MINIMIZATION OF SWITCHING FUNCTIONS 253
(c) The K-map for F = S m(2, 3, 6, 7, 10, 11, 12) shown in Figure 6.29b has two essential
prime implicants and one non-prime implicant. All the three together cover all the minterms.
So the minimal expression is
fmin = BC + AC + AB CD
EXAMPLE 6.16 Reduce the following expression in SOP and POS forms using mapping:
f = S m(0, 2, 3, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21, 26, 27)
Solution
The given expression in POS form is
f = P M(1, 4, 5, 6, 7, 8, 9, 14, 15, 22, 23, 24, 25, 28, 29, 30, 31)
The real minimal expression is the minimal of the SOP and POS forms. In the SOP K-map
shown in Figure 6.31, the reduction is done as per the following steps:
1. There are no isolated 1s.
2. m12 can go only with m13. Form a 2-square which is read as ABC D.
3. m0 can go with m2, m16 and m18. So, form a 4-square which is read as B C E.
4. m20, m21, m17 and m16 form a 4-square which is read as A BD.
5. m2, m3, m18, m19, m10, m11, m26, and m27 form an 8-square which is read as CD.
6. Write all the product terms in SOP form.
So the minimal SOP expression is
fmin = ABC D + B C E + A BD + CD (16 inputs)
In the POS K-map shown in Figure 6.32, the reduction is done as per the following steps:
1. There are no isolated 0s.
MINIMIZATION OF SWITCHING FUNCTIONS 255
2. M1 can go only with M5 or M9. Make a 2-square with M5, which is read as (A + B +
D + E).
3. M4 can go with M5, M7, and M6 to form a 4-square, which is read as (A + B + C).
4. M8 can go with M9, M24, and M25 to form a 4-square, which is read as ( B + C + D).
5. M28 can go with M29, M24, and M25 to form a 4-square, which is read as ( A + B + D).
6. M30 can make a 4-square with M31, M29, and M28 or with M31, M14, and M15 or with M31,
M22 and M23. Don’t do that. Note that it can make an 8-square with M31, M23, M22, M6,
M7, M14 and M15, which is read as ( C + D).
7. Write all the sum terms in POS form. So the minimal POS expression is
Fmin = (A + B + D + E)(A + B + C)( B + C + D)( A + B + D)( C + D) (20 inputs)
The SOP form requires a less number of gate inputs. The real minimal expression is, therefore,
fmin = ABCD + B C E + A BD + CD
EXAMPLE 6.17 Minimize in SOP and POS forms on the map the 5-variable function
F = S m(0, 1, 4, 5, 6, 13, 14, 15, 22, 24, 25, 28, 29, 30, 31)
Implement the minimal expression using NAND logic.
Solution
The given function in POS form is
F = P M(2, 3, 7, 8, 9, 10, 11, 12, 16, 17, 18, 19, 20, 21, 23, 26, 27)
The K-maps in SOP and POS forms, their minimization, and the minimal expressions obtained
from them are shown in Figures 6.33a and b respectively. The SOP form requires 16 gate
inputs, whereas the POS form requires 20 gate inputs. So the SOP form gives the real minimal,
and hence it is implemented in NAND logic as shown in Figure 6.33c.
SOP minimal is
EXAMPLE 6.18 Simplify the Boolean function using K-map in SOP and POS forms:
F = S m(0, 1, 2, 4, 7, 8, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31)
Solution
The given function in POS form is
F = P M(3, 5, 6, 9, 10, 11, 13, 19, 21, 22, 23, 25, 26, 27, 29)
The K-maps in SOP and POS forms, their minimization and the minimal expressions
obtained from them are shown in Figures 6.34a and b respectively. The SOP form requires
20 gate inputs and the POS form requires 26 gate inputs. So the SOP form gives the real
minimal.
SOP minimal is
fmin = D E + BCD + B C E + B C D + ACDE
POS minimal is
fmin = ( C + D + E)(B + C + D + E)( A + B + C + D)( B + C + D)( B + D + E)(C + D + E)
MINIMIZATION OF SWITCHING FUNCTIONS 257
Some possible 2-squares are: m0, m16; m10, m42; m16, m48; m7, m23; m7, m39; m23, m55; m47,
m63; etc.
Some possible 4-squares are: m0, m16, m32, m48; m0, m1, m32, m33; m32, m33, m48, m49; etc.
Some possible 8-squares are: m1, m3, m17, m19, m33, m35, m49, m51; m0, m2, m16, m18, m32,
m34, m48, m50; m39, m38, m47, m46, m55, m54, m63, m62; etc.
The squares are read by dropping out the variables which change. Some possible groupings
shown in Figure 6.35 are as follows.
m5, m21 = A CD EF(A = C = E = 0, D = F = 1, B = 0 or 1)
m4, m12, m36, m44 = BD E F(B = E = F = 0, D = 1, A and C are a 0 or a 1)
m45, m47, m41, m43, m61, m63, m57, m59 = ACF(A = C = F = 1, B, D, and E are a 0 or a 1)
m0, m1, m2, m3, m16, m17, m18, m19, m32, m33, m34, m35, m48, m49, m50, m51 = CD(C = D = 0,
A, B, E, and F are a 0 or a 1).
The real minimal expression is the minimal of the SOP and POS forms.
In the SOP K-map shown in Figure 6.36 the reduction is done as per the following steps:
1. There are no isolated 1s.
2. m7 has only one adjacency m39. It can form a 2-square with m39. Read it as B CDEF.
3. m13 can make a 4-square with m29, m45, m61. Read it as CD EF.
4. m31 can make a 4-square with m29, m63, m61. Read it as BCDF.
5. m55 can make an 8-square with m53, m61, m63, m37, m39, m45, m47. Read it as ADF.
6. m0 can make a 16-square with m2, m16, m18, m8, m10, m24, m26, m32, m34, m40, m42, m48,
m50, m56, m58. Read it as D F.
7. Write all the product terms in SOP form.
So the minimal SOP expression is
fmin = B CDEF + CD EF + BCDF + ADF + D F (23 inputs)
In the POS K-map shown in Figure 6.37, the reduction is done as per the following steps:
1. There are no isolated 0s.
2. M15 has only two adjacencies M14 and M11. It can make a 2-square with any one of them.
Make a 2-square of M15, M14. Read it as (A + B + C + D + E).
3. M5 can make a 4-square with M4, M20, M21 or with M1, M17, M21. Do not take a decision yet.
4. M4 can be expanded into a 16-square with M6, M12, M14, M20, M22, M28, M30, M36, M38,
M44, M46, M52, M54, M60, and M62. Read it as ( D + F).
260 FUNDAMENTALS OF DIGITAL CIRCUITS
5. M1 can be expanded into a 16-square with M3, M9, M11, M17, M19, M25, M27, M33, M35,
M41, M43, M49, M51, M57, and M59. Read it as (D + F).
6. Only M5, M21, and M23 are left uncovered. M21, and M23 can form a 4-square with M20,
M22 or with M17, M19 which are already taken care of. Form a 4-square of M21, M23, M17
and M19. Read it as (A + B + C + F).
7. Only M5 is left. Make a 4-square; say with M4, M20, and M21. Read it as (A + C + D + E).
8. Write all the sum terms in POS form.
So the minimal POS expression is
fmin = (A + B + C + D + E)( D + F)(D + F)(A + B + C + F)(A + C + D + E) (22 inputs)
The POS form is thus less expensive. So the real minimal expression is the POS form.
system, the binary states 0000, 0001, 0010, 1101, 1110, and 1111 are unspecified and never occur.
These are called don’t cares. Similarly in 8421 code, the binary states 1010, 1011, 1100, 1101,
1110, and 1111 are invalid and the corresponding outputs are don’t cares. The don’t care terms are
denoted by d, X or f. During the process of design using an SOP map, each don’t care is treated as
a 1 if it is helpful in map reduction; otherwise it is treated as a 0 and left alone. During the process
of design using a POS map, each don’t care is treated as a 0 if it is useful in map reduction,
otherwise it is treated as a 1 and left alone.
A standard SOP expression with don’t cares can be converted into a standard POS form by
keeping the don’t cares as they are, and writing the missing minterms of the SOP form as the
maxterms of the POS form. Similarly, to convert a POS expression with don’t cares into an SOP
expression, keep the don’t cares of the POS expression as they are and write the missing maxterms
of the POS expression as the minterms of the SOP expression.
EXAMPLE 6.20 Reduce the expression f = S m(1, 5, 6, 12, 13, 14) + d(2, 4) and implement
the real minimal expression in universal logic.
Solution
The given expression written in the POS form is f = P M(0, 3, 7, 8, 9, 10, 11, 15). P d(2, 4).
The K-maps in the SOP and POS forms, their reduction and the minimal expressions obtained
from them are shown in Figures 6.38a and b respectively. The POS form is less expensive,
because it requires less number of gate inputs (9 compared to 10 required for the SOP form).
The implementation of the minimal expression using universal logic is shown in Figure 6.38c.
SOP minimal is
fmin = B C + B D + A CD
POS minimal is
fmin = (B + D)( A + B)( C + D) = (B + D) + (A + B) + (C + D)
Solution
The K-maps in SOP form for the given three Boolean expressions (6.21a, b, and c), their
minimization and the minimal expressions obtained from them are shown in Figures 6.39a,
b, and c respectively. The EPIs and SPIs are indicated only for illustration. The minimal
expressions are:
(a) Fmin = AB C + A CD + BD + AC D
(b) Fmin = A D + BCD + AB C
(c) Fmin = W X + YZ
EXAMPLE 6.23 (a) Design a logic circuit using minimum number of basic gates for the
following Boolean expression f = ( A B C D) + A B CD + ( A BC D) + ( A BCD) + ( AB C D) +
( AB CD) + ( ABC D) + (A B CD) + (AB CD) + (AB CD) + (ABC D).
(b) Reduce the following expression using K-map: F = ( BA + AB + A B).
(c) Find the output of a four variable K-map, when all the cells are filled with logic LOW.
(d) Indicate the essential false prime implicants in the K-map for part (a).
Solution
(a) The given expression is in algebraic form and it is in SOP form. In terms of minterms,
it is
f = S m(0, 1, 2, 3, 4, 5, 6, 9, 12, 13, 14)
The K-map for this SOP function, its minimization, the minimal expression in SOP form
264 FUNDAMENTALS OF DIGITAL CIRCUITS
obtained from it and the corresponding logic diagrams in AOI logic and universal logic are
shown in Figures 6.41a, b, and c respectively. The EPIs are shown only for illustration. The
minimal expression is
fmin = A B + CD + B D = AB ◊ CD ◊ BD
(b) The given expression is in the SOP form. It is a two-variable function. In terms of minterms,
it is
f = S m(0, 1, 2)
The K-map for this function, its minimization, the minimal expression in SOP form obtained
from it, and the corresponding logic diagram are shown in Figure 6.42. The minimal expression
is
fmin = A + B
(c) When all the cells of a four variable K-map are filled with logic LOW, the output is logic
LOW.
EXAMPLE 6.24 (a) Simplify the Boolean expression using K-map F = A + AB + AB D +
A BD + C.
(b) Obtain the simplified expression using K-map F = A BD + A B CD + ABD + AB CD.
(c) Obtain the simplified expression using K-map F = ABD + A CD + AB + AC D + A BD.
MINIMIZATION OF SWITCHING FUNCTIONS 265
Solution
The given Boolean expressions are in SOP form. Expand them into standard SOP form.
Write the expressions in terms of minterms and simplify the expressions using K-maps. The
given expressions are expressed in minterms as
(a) Given
F = A + AB + AB D + A BD + C = 0XXX + 11XX + 11X0 + 10X0 + XX1X
So the minterms are: 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1100, 1101,1110,
1111, 1100, 1110, 1000, 1010, 0010, 0011, 0110, 0111, 1010, 1011, 1110, 1111.
So
F = S m(0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 12, 14, 8, 10, 2, 3, 6, 7, 10, 11, 14, 15)
= S m(0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15)
(b) Given
F = A BD + A B CD + ABD + AB CD = 00X0 + 0000 + 01X1 + 1101
So the minterms are: 0000, 0010, 0000, 0101, 0111, 1101.
So
F = S m(0, 2, 5, 7, 11)
(c) Given
F = ABD + A CD + AB + AC D + A BD = 11X1 + 0X00 + 01XX + 0X10 + 10X1
So the minterms are: 1101, 1111, 0000, 0100, 0100, 0101, 0110, 0111, 0010, 0110, 1001,
1011.
So
F = S m(13, 15, 0, 4, 4, 5, 6, 7, 2, 6, 9, 11) = S m(0, 2, 4, 5, 6, 7, 9, 11, 13, 15)
The K-maps for the above three Boolean expressions in SOP form, their minimization and
the minimal expressions obtained from them are shown in Figures 6.43a, b, and c respectively.
The minimal expressions are:
(a) Fmin = A + B + C + D
(b) Fmin = A BD + ABD + A BCD
(c) Fmin = A D + BD + AD
EXAMPLE 6.25 Reduce the following expression to the simplest possible POS and SOP
forms.
f = S m(6, 9, 13, 18, 19, 25, 27, 29, 31) + d (2, 3, 11, 15, 17, 24, 28)
Solution
The given expression is in the SOP form. In the POS form it is
f = P M(0, 1, 4, 5, 7, 8, 10, 12, 14, 16, 20, 21, 22, 23, 26, 30) ◊ P d(2, 3, 11, 15, 17, 24, 28)
The K-maps in SOP and POS forms, their reduction and the minimal expressions obtained
from them are shown in Figures 6.44 a and b respectively. The minimal expressions are:
SOP minimal is
fmin = BE + B CD + A BD E
POS minimal is
fmin = (D + E)( B + E)(A + B + E)( A + B + C)
of providing uniform time delay between input signals and the output. But the disadvantage is that
the minimal expression obtained by either SOP reduction or POS reduction may not be the actual
minimal. In fact, the actual minimal may be obtained by manipulating the minimals of SOP and
POS forms into a hybrid form. For example, the minimal of the expression S m(0, 1, 3, 4, 5, 6, 7,
13, 15) in the SOP form is given by f = A C + AD + AB + BC (12 inputs). But this can be written
as f = A( C + D + B) + BC (9 inputs).
Also, the expression ABC + ABD + ACD + BCD is in minimum SOP form and requires 16
inputs. It can, however, be reduced by factoring to: AB(C + D) + CD(A + B) and implemented as
shown in Figure 6.45 with 12 inputs.
Figure 6.45 shows that we have reduced the number of inputs from 16 to 12. Note, however,
that the C input to the OR gate must go through three levels of logic before reaching the output,
whereas the C input to the AND gate must only go through two levels. This can result in a critical
timing problem called logic race. Assume, for example, that each gate has a 10-ns delay and that
A = 0, B = 0, C = 1, and D = 1. Gate G2 will not AND since A and B are zero; gate G4 will not AND
since A + B = 0. Next assume that A and B go high at precisely the same instant when C and D go
low. Gate G1 will continue to provide a 1 to G2 for 10 ns after C and D go low because of its
propagation delay, and for that 10 ns all three inputs to G2 will be high causing a 10-ns pulse to be
outputted by G5. At the end of this narrow pulse, G1 output will go low, blocking G2; since C and
D are already 0, G5 output will go low. Had two-level logic been used, this logic race and its
resulting pulse would not have occurred.
In hybrid logic circuits, the input signals will pass through different numbers of gates to
reach the output. Even though hybrid logic results in a minimal circuit, it may provide a critical
timing problem called logic race which results in unwanted narrow pulses. The two-level logic is
free from logic race.
necessary to expand the expression algebraically into its minterms (maxterms). Instead, the
expansion into minterms (maxterms) can be accomplished in the process of entering the terms of
the expression on the K-map.
For example, let us enter on K-map the expression A BCD + A CD + BC + A.
(a) A BCD is minterm m3. Enter it as it is.
(b) A C D corresponds on the K-map to locations where A = C = D = 0 and are independent
of B. That is, intersections of rows 1 and 2 with column 1 (m0 and m4).
(c) BC corresponds on the K-map to locations where B = 0, C = 1 and are independent of A
and D. That is, intersections of rows 1 and 4 with columns 3 and 4 (m2, m3, m10, and m11).
(d) A corresponds on the K-map to locations where A = 1 and are independent of B, C, and
D. That is, complete rows 3 and 4 (m8, m9, m10, m11, m12, m13, m14, and m15).
The entries on the K-map are shown in Figures 6.46a, b, c, and d. The complete mapping is
shown in Figure 6.46e.
Figure 6.46 Mapping of (a) A B CD, (b) A C D, (c) B C, (d) A, and (e) A B CD + A C D + B C + A.
(c) (A + C) corresponds on the K-map to locations where A = 0 and C = 1, and are independent
of B and D. That is, the intersection of rows 1 and 2 with columns 3 and 4 (M2, M3, M6,
and M7).
Hence the given expression can be mapped as P M(0, 1, 2, 3, 4, 5, 2, 3, 6, 7), i.e. P M(0, 1,
2, 3, 4, 5, 6, 7). The mapping is shown in Figure 6.47.
EXAMPLE 6.26 Make a K-map of the following expression and obtain the minimal SOP
and POS forms.
f = AB + A C + C + AD + A BC + ABC
Solution
Obtain the expression in the standard SOP form by expansion. The expression can also be
expanded directly on the K-map. Each of the terms can be directly mapped as shown in
Figure 6.48.
AB = ABXX(1 1 X X), i.e. A = 1, B = 1; C and D can be a 0 or a 1, i.e. the entire third row
(m12, m13, m14, and m15).
A C = AX CX(1 X 0 X), i.e. A = 1, C = 0; B and D can be a 0 or a 1, i.e. the intersections
of the third and fourth rows with the first and second columns (m8, m9 and m12, m13).
C = XXCX(X X 1 X), i.e. C = 1, A, B, and D can be a 0 or a 1, i.e. the entire third and
fourth columns (m2, m3, m6, m7 and m10, m11, m14, m15).
AD = AXXD(1 X X 1), i.e. A = 1, D = 1; B and C can be a 0 or a 1, i.e. the intersection of
the third and fourth rows with the second and third columns (m9, m11 and m13, m15).
A BC = A BCX (1 0 1 X), i.e. A = 1, B = 0, C = 1; D can be a 0 or a 1, i.e. the intersection
of the fourth row with the third and fourth columns (m10 and m11).
ABC = ABCX (1 1 1 X), i.e. A = 1, B = 1, C = 1; D can be a 0 or a 1, i.e. the intersection
of the third row with the third and fourth columns (m14 and m15).
By expansion on the map we see that f = (2, 3, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15). So the POS
expression is f = (0, 1, 4, 5).
The K-maps in SOP and POS forms, the minimal expressions obtained from them, and the
logic diagram corresponding to the minimal of those minimals are shown in Figures 6.48a,
b, and c respectively. Both the SOP and POS forms give the same minimal expression.
270 FUNDAMENTALS OF DIGITAL CIRCUITS
SOP minimal is
fmin = A + C
POS minimal is
fmin = A + C
We want to design a minimal circuit to get the above outputs. If we design the circuit by
obtaining the minimal expressions for f1 and f2 separately, we may not get the overall minimal
circuit. Suppose the groupings on the individual K-maps are as shown in Figure 6.50; the minimal
expressions for the outputs would require 15 gate inputs for realization. Here,
f1min = A C + BC + AB (9 inputs); f2min = A B + B C (6 inputs)
(Total 15 inputs)
BC BC
A 00 01 11 10 A 00 01 11 10
0 1 3 2 0 1 3 2
0 1 1 1 0 1
4 5 7 6 4 5 7 6
1 1 1 1 1 1 1 1
f1min = BC + AB + AC f2min = AB + BC
Figure 6.50 One way of grouping f1 and f2.
f1min = BC + AB + AC f2min = AB + BC
Figure 6.51 Alternative way of grouping f1 and f2.
EXAMPLE 6.27 Minimize and implement the following multiple output functions.
f1 = S m(1, 2, 3, 6, 8, 12, 14, 15)
f2 = P M(0, 4, 9, 10, 11, 14, 15)
Solution
Here f2 is in the POS form and f1 is in the SOP form. Express both f1 and f2 either in the SOP form
or in the POS form and obtain the minimal expressions. Therefore, in the SOP form, we have
f1 = S m(1, 2, 3, 6, 8, 12, 14, 15); f2 = S m(1, 2, 3, 5, 6, 7, 8, 12, 13)
First form a function f with the minterms common to both the functions, i.e. f = f1 ◊ f2.
Therefore,
f = f1 ◊ f2 = S m(1, 2, 3, 6, 8, 12)
Draw the K-maps for f1, f2 and f and form the minimal expressions for f1, f2, and f. The
K-maps for f1, f2, and f and their reductions are shown in Figure 6.53.
In f1, all the terms of f are present. We cannot make any larger square using any of these
terms. In f2, out of the three terms of f, A BD becomes part of a 4-square, so, AD is read. AC D can
also be made part of a 4-square, but it does not reduce the hardware. So it is not considered. The
circuit with the minimum gate inputs is shown in Figure 6.54.
f1 f2 f = f1 ◊ f2
0 0 0
0 1 0
1 0 0
0 X 0
X 0 0
1 X 1
X 1 1
1 1 1
X X X
The shared mintern function f has two terms AB and AC D. Out of these two, only AB is
utilized, because AC D can be merged into a bigger square.
EXAMPLE 6.29 Find the minimal expressions for the multiple output functions
f1(X1, X2, X3, X4) = P M(3, 4, 5, 7, 11, 13, 15) ◊ d(6, 8, 10, 12)
f2(X1, X2, X3, X4) = P M(2, 7, 9, 10, 11, 12, 14, 15) ◊ d(0, 4, 6, 8)
274 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
The given expressions are in the POS form. Generate the shared maxterm function using the
same rules as for the minterms. Therefore,
F = f1 ◊ f2 = P M(4, 7, 10, 11, 12, 15) ◊ d(6, 8)
The K-maps for f1, f2, and f, their reduction, and the minimal expressions obtained from
them are shown in Figure 6.56.
X3X4 X3X4 X3X4
X1X2 00 01 11 10 X1X2 00 01 11 10 X1X2 00 01 11 10
0 1 3 2 0 1 3 2 0 1 3 2
00 0 00 X 0 00
4 5 7 6 4 5 7 6 4 5 7 6
01 0 0 0 X 01 X 0 X 01 0 0 X
12 13 15 14 12 13 15 14 12 13 15 14
11 X 0 0 11 0 0 0 11 0 0
8 9 11 10 8 9 11 10 8 9 11 10
10 X 0 X 10 X 0 0 0 10 X 0 0
(a) f1 = (X2 + X3)(X3 + X4) (b) f2 = X4(X2 + X3)(X1 + X2) (c) f = (X2 + X3 + X4)
(X2 + X3 + X4)(X1 + X2 + X3)
Figure 6.56 Example 6.29: K-maps for f1, f2, and f.
None of the terms of f can be used in the minimal expressions for f1 and f2 because these
terms are combined into bigger ones in f1 and f2.
The problem may be converted to and solved in SOP form too.
EXAMPLE 6.30 Minimize the following multiple output functions using K-map.
f1(X1, X2, X3, X4) = S m(1, 2, 3, 5, 7, 8, 9) + d (12, 14)
f2(X1, X2, X3, X4) = S m(0, 1, 2, 3, 4, 6, 8, 9) + d (10, 11)
f3(X1, X2, X3, X4) = S m(1, 3, 5, 7, 8, 9, 12, 13) + d (14, 15)
Solution
The shared minterm function generated according to the rules listed in Table 6.2 is
f(X1, X2, X3, X4) = f1 ◊ f2 ◊ f3 = S m(1, 3, 8, 9)
The K-maps for f1, f2, f3, and f, their minimization, and the minimal expressions obtained
from them are shown in Figure 6.57.
Figure 6.57 Example 6.30: K-maps for f1, f2, f3, and f (Contd.)...
MINIMIZATION OF SWITCHING FUNCTIONS 275
Figure 6.57 Example 6.30: K-maps for f1, f2, f3, and f.
None of the terms in the minimal expression of the shared map is useful for overall reduction.
However, we can see that X 1X4 is common to f1 and f3.
BC BC
A 00 01 11 10 A 00 01 11 10
0 1 3 2 0 1 3 2
0 1 1 1 1 0 D+D D+DD+D D+D
4 5 7 6 4 5 7 6
1 D 1 D
BC
A 00 01 11 10
0 1 3 2
0 1 D E E
4 5 7 6
1 1 1 D
K-map
Figure 6.60 Example 6.32: K-maps.
K-map
Figure 6.61 Example 6.33: K-map.
three-variable one, each 1 on the map represents the corresponding minterm multiplied by
(D + D) (E + E). If it is a don’t care, it contains the terms X D, XD, XE, and X E. These don’t cares
may or may not be covered. They should be used to make 2n squares when covering other do care
terms. Any minterm is considered to be completely covered only if any of its variable plus its
complement present in that minterm are both covered. Other variables can be covered partially or
fully, if required or not covered at all.
EXAMPLE 6.35 Reduce by mapping:
f = A B C + A BCD + AB CD + A B CD + ABCE + ABC E + d(A BCD + A BCE)
Solution
The given problem is actually a five-variable one. Treating it as a three-variable one, we get
f = m0 + m1D + m2D + m4D + m7E + m7 E + d(m5D + m5E)
It is mapped onto a K-map and reduced as shown in Figure 6.63.
BC
A 00 01 11 10
0 1 3 2
0 1 D D
4 5 7 6
1 D XD + XE E + E
f = BD + ACD + ABC
Figure 6.63 Example 6.35: K-map.
The D’s of m1 and m4 form a 4-square with the D present in m0 and the XD of m5. The D of
m2 combines with the D present in m0 to form a 2-square. So, m0 is fully covered. The E of
m7 can combine with the XE of m5. This is not done, because there is no way to combine the
E of m7 with anything else, and so, m7 has to appear in the final expression. From the
K-map, the reduced expression is, therefore, obtained as
f = BD + A CD + ABC
EXAMPLE 6.36 Reduce by mapping:
f = m0 + m1F + m2 + m4E + m6(E + E) + m7F + m10E + m12 + m15F
+ d(m5F + m9 + m11 E + m8E)
Solution
The given problem is actually a six-variable one. The four-variable K-map and its minimization
are shown in Figure 6.64.
The minterm m6 contains E + E. Its E is used to make a 4-square with the E’s of m0, m2, and
m4. Since m6 is not fully covered, it is combined with m2 to make a 2-square. The E of m12
can be combined with the E’s of m0, m4, and m8 but this is not done because m12 cannot be
fully covered by this operation. So, m12 has to be read anyway. The minterm m0 is not fully
covered. Only E of it is used. So, combine it with m2 to form a 2-square.
From the K-map, the reduced expression is, therefore, obtained as
f = BDE + A DE + A BD + A CDF + BCDF + AB C D + AC D
280 FUNDAMENTALS OF DIGITAL CIRCUITS
CD
AB 00 01 11 10
0 1 3 2
00 1 F 1
4 5 7 6
01 E XF F 1
12 13 15 14
11 1 F
8 9 11 10
10 XE XF XE E
K-map
Figure 6.64 Example 6.36: K-map.
F = AB + CD = AB + CD = AB ◊ CD
Figure 6.65 Two-level implementation using AND-OR logic and NAND logic.
MINIMIZATION OF SWITCHING FUNCTIONS 281
F = X Y + X Y + Z = XY + XY + Z = XY ◊ XY ◊ Z
Figure 6.66 Two-level implementation using AND-OR logic and NAND logic.
The implementation of Boolean expressions with only NOR gates requires that the function
be in POS form. Implementation of the function
F = (A + B)( C + D)
with (a) OR-AND logic and (b) NOR-NOR logic is shown in Figure 6.67.
Figure 6.67 Two-level implementation using OR-AND logic and NOR logic.
Figure 6.68 Two-level implementation using OR-AND logic and NOR logic.
282 FUNDAMENTALS OF DIGITAL CIRCUITS
Similarly, the NOR outputs of ECL gates can be tied together to perform a wired NOR
function. The logic function implemented by the circuit of Figure 6.69b is
F = ( A + B) + ( C + D ) = [ (A + B)(C + D) ]
and is called an OR-AND-INVERT function.
A wired logic gate does not produce a second level gate since it is just a wire connection, but
these circuits are equivalent to two-level implementations. The first level consists of NAND
(or NOR) gates and the second level has a single AND (or OR) gate.
NOR-OR NAND-AND
OR-NAND AND-NOR
The first gate listed in each of the forms constitutes a first level in the implementation. The
second gate listed is a single gate placed in the second level. Note that any two forms listed in the
same line are duals of each other. The AND-OR and OR-AND forms are the basic two-level forms
discussed earlier. The NAND-NAND and NOR-NOR forms were also discussed earlier. The
remaining four forms are investigated below.
of the second-level gate to the outputs of the first-level gates. The circuit of Figure 6.71c is a
NOR-OR form and was shown to implement the AND-OR-INVERT function.
The OR-AND-INVERT implementation requires an expression in POS. If the complement
of the function is simplified in POS, we can implement F with the OR-AND part of the function.
When F passes through the INVERT part we obtain the complement of F, or F, in the output.
Tabular summary
Table 6.3 summarizes the procedures for implementing a Boolean function in any one of the four
two-level forms. Because of the INVERT part in each case, it is convenient to use the simplification
of F (the complement) of the function. When F is implemented in one of these forms, we obtain
the complement of the function in the AND-OR or OR-AND form. The four two-level forms
invert this function, giving an output that is the complement of F. This is the normal output F.
Table 6.3
Figure 6.72 K-map, AND-NOR and NAND-AND form, and OR-NAND and NOR-OR form.
For OR-NAND and NOR-OR realization, the function should be in OR-AND-INVERT form.
The OR-AND-INVERT forms require a simplified expression of the function in product of
sums. The complement of the function is simplified in product of sums by combining 1s on
the map. To obtain this expression first combine the 1s in the map. So
F = (A + B + C)(A + B + C)
286 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 6.38 Implement the function F with the following four two-level forms:
(a) NAND-AND (b) AND-NOR
(c) OR-AND (d) NOR-OR
F(A, B, C, D) = S m(0, 1, 2, 3, 4, 8, 9, 12)
Solution
The K-map, its minimization and the minimal expressions for F in SOP and POS forms
obtained from it are shown in Figure 6.73.
For AND-NOR and NAND-AND form implementation the function should be in
AND-OR-INVERT form. So simplify the complement of the function in sum of products by
combining the 0s in the map. So
F = AC + BD + BC
The normal output for this function can be expressed as
F = (AC + BD + BC)
which is in the AND-OR-INVERT form. The AND-NOR and NAND-AND implementations
are shown in Figure 6.74a. A NOR gate is nothing but a bubbled AND gate.
For OR-NAND and NOR-OR form implementation, the function should be in OR-AND-INVERT
form. So simplify the function F in product of sums by combining 1s on the K-map. So
F = (A + B)(C + D)(B + C)
The normal output F can now be expressed as
F = [(A + B)(C + D)(B + C)]
which is in the OR-AND-INVERT form. The implementation of this function in the
OR-NAND and NOR-OR forms is as shown in Figure 6.74b. A NAND gate is nothing but
a bubbled OR gate.
CD
AB 00 01 11 10
0 1 3 2
00 1 1 1 1
4 5 7 6
01 1 0 0 0 F = (A + B)(C + D)(B + C)
12 13 15 14 F = AC + BD + BC
11 1 0 0 0
8 9 11 10
10 1 1 0 0
A A A
C C C
B B B
F F F
D D D
B B B
C C C
AND-NOR AND-NOR NAND-AND
(a) F = (AC + BD + BC)
A A A
B B B
C C C
F F F
D D D
B B B
C C C
OR-NAND OR-NAND NOR-OR
(b) F = [(A + B)(C + D)(B + C)]
Figure 6.74 AND-NOR and NAND-AND form, and OR-NAND and NOR-OR forms.
The same result can be obtained by combining m0 and m4, and m1 and m5 in the first step and
the resulting terms in the second step. Minterms m0( A B C) and m1( A BC) are adjacent to each
other because they differ in only literal C. Similarly, minterms m4(A B C) and m5(A BC) are adjacent
to each other because they differ in only one literal C. Minterms m0( A B C) and m5(A BC) or
m1( A BC) and m4(A B C) cannot be combined, being not adjacent to each other since they differ in
more than one variable. If we consider the binary representation of minterms, m0(0 0 0) and
m1(0 0 1), i.e. 0 0 0 and 0 0 1, they differ in only one position. When combined, they result in 0 0
–, i.e. variable C is absorbed. Similarly, m4(1 0 0) and m5(1 0 1), i.e. 1 0 0 and 1 0 1 differ in only
one position. So, when combined, they result in 10 –. Now 0 0 – and 1 0 – can be combined
because they differ in only one position. The result is a – 0 –.
For the binary representation of two minterms to be different in just one position, it is necessary
(but not sufficient) that the number of 1s in those two minterms differs exactly by one. Consequently,
to facilitate the combination process, the minterms are arranged in groups according to the number
of 1s in their binary representation.
The procedure for the minimization of a Boolean expression by the tabular method may,
therefore, be described as follows.
Step 1. List all the minterms.
Step 2. Arrange all minterms in groups of the same number of 1s in their binary representation in
column 1. Start with the least number of 1s group and continue with groups of increasing number
of 1s. The number of 1s in a term is called the index of the term. The number of 1s in the binary
form of a minterm is also called its weight.
Step 3. Compare each term of the lowest index group with every term in the succeeding group.
Whenever possible, combine the two terms being compared by means of the combining theorem.
Two terms from adjacent groups are combinable, if their binary representations differ by just a
single digit in the same position; the combined terms consist of the original fixed representation
with the differing one replaced by a dash (–). Place a check mark (✓) next to every term, which has
been combined with at least one term (each term may be combined with several terms, but only a
single check is required) and write the combined terms in column 2. Repeat this by comparing
each term in a group of index i with every term in the group of index i + 1, until all possible
applications of the combining theorem have been exhausted.
Step 4. Compare the terms generated in step 2 in the same fashion; combine two terms which
differ by only a single 1 and whose dashes are in the same position to generate a new term. Two
terms with dashes in different positions cannot be combined. Write the new terms in column 3 and
put a check mark next to each term which has been combined in column 2. Continue the process
with terms in columns 3, 4 etc. until no further combinations are possible. The remaining unchecked
terms constitute the set of prime implicants of the expression. They are called prime implicants
because they are not covered by any other term with fewer literals.
Step 5. List all the prime implicants and draw the prime implicant chart. (The don’t cares if any
should not appear in the prime implicant chart).
Step 6. Obtain the essential prime implicants and write the minimal expression.
MINIMIZATION OF SWITCHING FUNCTIONS 289
Once an essential prime implicant has been selected, all the minterms it covers are checked
off. After all the essential prime implicants and their corresponding columns have been checked
off, if all the minterms are covered, the union of all the essential prime implicants yields the
minimal expression. If this is not the case, additional prime implicants are necessary. We have to
draw a reduced PI chart and find the minimal set of PIs from that.
EXAMPLE 6.39 Obtain the set of prime implicants for the Boolean expression
f = S m(0, 1, 6, 7, 8, 9, 13, 14, 15) using the tabular method.
Solution
Group the minterms in terms of the number of 1s present in them and write their binary
designations. The procedure to obtain the prime implicants is shown in Table 6.4.
Comparing the terms of index 0 with the terms of index 1 of column 1, m0(0000) is
combined with m1(0001) to yield 0, 1 (1), i.e. 000 –. This is recorded in column 2 and 0000
and 0001 are checked off in column 1. m0(0000) is combined with m8(1000) to yield 0, 8 (8),
i.e. – 000. This is recorded in column 2 and 1000 is checked off in column 1. Note that 0000
of column 1 has already been checked off. No more combinations of terms of index 0 and
index 1 are possible. So, draw a line below the last combination of these groups, i.e. below 0,
8 (8), – 000 in column 2. Now 0, 1 (1), i.e. 000 – and 0, 8 (8), i.e. – 000 are the terms in the
first group of column 2.
Comparing the terms of index 1 with the terms of index 2 in column 1, m1(0001) is combined
with m9(1001) to yield 1, 9 (8), i.e. – 001. This is recorded in column 2 and 1001 is checked off in
column 1 because 0001 has already been checked off. m8(1000) is combined with m9(1001) to
yield 8, 9 (1), i.e. 100 –. This is recorded in column 2. 1000 and 1001 of column 1 have already
been checked off. So, no need to check them off again. No more combinations of terms of index 1
and index 2 are possible. So, draw a line below the last combination of these groups, i.e. 8, 9 (1),
-– 001 in column 2. Now 1, 9 (8), i.e. – 001 and 8, 9 (1), i.e. 100– are the terms in the second group
of column 2.
292 FUNDAMENTALS OF DIGITAL CIRCUITS
Similarly, comparing the terms of index 2 with the terms of index 3 in column 1,
m6(0110) and m7(0111) yield 6, 7 (1), i.e. 011–. Record it in column 2 and check off
6(0110) and 7(0111).
m6(0110) and m14(1110) yield 6, 14 (8), i.e. –110. Record it in column 2 and check off
6(0110) and 14(1110).
m9(1001) and m13(1101) yield 9, 13 (4), i.e. 1–01. Record it in column 2 and check off
9(1001) and 13(1101).
So, 6, 7 (1), i.e. 011–, and 6, 14 (8), i.e. –110 and 9, 13 (4), i.e. 1–01 are the terms in group 3 of
column 2. Draw a line at the end of 9, 13 (4), i.e. 1–01.
Also, comparing the terms of index 3 with the terms of index 4 in column 1,
m7(0111) and m15(1111) yield 7, 15 (8), i.e. –111. Record it in column 2 and check off
7(0111) and 15(1111).
m13(1101) and m15(1111) yield 13, 15 (2), i.e. 11–1. Record it in column 2 and check off
13 and 15.
m14(1110) and m15(1111) yield 14, 15 (1), i.e. 111–. Record it in column 2 and check off
14 and 15.
So, 7, 15 (8), i.e. –111, and 13, 15 (2), i.e. 11–1 and 14, 15 (1), i.e. 111– are the terms in group 4
of column 2. Column 2 is completed now.
Comparing the terms of group 1 with the terms of group 2 in column 2, the terms 0, 1 (1), i.e.
000– and 8, 9 (1), i.e. 100– are combined to form 0, 1, 8, 9 (1, 8), i.e. –00–. Record it in group 1 of
column 3 and check off 0, 1 (1), i.e. 000–, and 8, 9 (1), i.e. 100– of column 2. The terms 0, 8 (8),
i.e. –000 and 1, 9 (8), i.e. –001 are combined to form 0, 1, 8, 9 (1, 8), i.e. –00–. This has already
been recorded in column 3. So, no need to record again. Check off 0, 8 (8), i.e. –000 and 1, 9 (8),
i.e. –001 of column 2. Draw a line below 0, 1, 8, 9 (1, 8), i.e. –00–. This is the only term in group 1
of column 3. No term of group 2 of column 2 can be combined with any term of group 3 of
column 2. So, no entries are made in group 2 of column 2.
Comparing the terms of group 3 of column 2 with the terms of group 4 of column 2, the
terms 6, 7 (1), i.e. 011–, and 14, 15 (1), i.e. 111– are combined to form 6, 7, 14, 15 (1, 8), i.e.
–11–. Record it in group 3 of column 3 and check off 6, 7 (1), i.e. 011– and 14, 15 (1), i.e. 111– of
column 2. The terms 6, 14 (8), i.e. –110 and 7, 15 (8), i.e. –111 are combined to form 6, 7, 14, 15
(1, 8), i.e. –11–. This has already been recorded in column 3; so, check off 6, 14 (8), i.e. –110 and
7, 15 (8), i.e. –111 of column 2.
Observe that the terms 9, 13 (4), i.e. 1–01 and 13, 15 (2), i.e. 11–1 cannot be combined with
any other terms. Similarly in column 3, the terms 0, 1, 8, 9 (1, 8), i.e. –00– and 6, 7, 14, 15 (1, 8),
i.e. –11– cannot also be combined with any other terms. So, these 4 terms are the prime implicants.
The terms, which cannot be combined further, are labelled as P, Q, R, and S. These form the
set of prime implicants.
EXAMPLE 6.40 Obtain the minimal expression for f = S m(1, 2, 3, 5, 6, 7, 8, 9, 12,
13, 15) using the tabular method.
Solution
The procedure to obtain the set of prime implicants is illustrated in Table 6.5.
MINIMIZATION OF SWITCHING FUNCTIONS 293
(Literals with weights 2 and 4, i.e. C and B are deleted. The lowest minterm is 1. So, literal with
weight 1 is present in non-complemented form and literal with weight 8 is present in complemented
form. So, read it as AD.)
The prime implicant chart of the expression
f = S m(1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 15)
is as shown in Table 6.6. It consists of 11 columns corresponding to the number of minterms and
5 rows corresponding to the prime implicants P, Q, R, S, and T generated. Row R contains four ×s
at the intersections with columns 2, 3, 6, and 7, because these minterms are covered by the prime
implicant R. A row is said to cover the columns in which it has ×s. The problem now is to select a
minimal subset of prime implicants, such that each column contains at least one × in the rows
corresponding to the selected subset and the total number of literals in the prime implicants selected
is as small as possible. These requirements guarantee that the number of unions of the selected
prime implicants is equal to the original number of minterms and that, no other expression containing
fewer literals can be found.
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
PIs/Minterms 1 2 3 5 6 7 8 9 12 13 15
*P Æ 5, 7, 13, 15 (2, 8) × × × ×
*Q Æ 8, 9, 12, 13 (1, 4) × × × ×
*R Æ 2, 3, 6, 7 (1, 4) × × × ×
S Æ 1, 5, 9, 13 (4, 8) × × × ×
T Æ 1, 3, 5, 7 (2, 4) × × × ×
In the prime implicant chart of Table 6.6, m2 and m6 are covered by R only. So, R is an essential
prime implicant. So, check off all the minterms covered by it, i.e. m2, m3, m6, and m7. Q is also an
essential prime implicant because only Q covers m8 and m12. Check off all the minterms covered
by it, i.e. m8, m9, m12, and m13. P is also an essential prime implicant, because m15 is covered only
by P. So check off m15, m5, m7, and m13 covered by it. Thus, only minterm 1 is not covered. Either
row S or row T can cover it and both have the same number of literals. Thus, two minimal expressions
are possible.
P + Q + R + S = BD + A C + AC + CD
or P + Q + R + T = BD + A C + AC + AD
EXAMPLE 6.41 Using the tabular method, obtain the minimal expression for
f = S m(6, 7, 8, 9) + d(10, 11, 12, 13, 14, 15)
Solution
In the given Boolean expression there are don’t cares. Treat the don’t cares as minterms and
apply the usual procedure to obtain the set of prime implicants as shown in Table 6.7.
MINIMIZATION OF SWITCHING FUNCTIONS 295
From this table, we see that the prime implicants are P Æ 8, 9, 10, 11, 12, 13, 14, 15 (1, 2, 4) and
Q Æ 6, 7, 14, 15 (1, 8). The term 6, 7, 14, 15 (1, 8) means that literals with weights 1 and 8, i.e. D
and A are deleted and the lowest designated minterm is m6(4 + 2), i.e. literals with weights 4 and
2 are present in non-complemented form. So it is read as BC. The term 8, 9, 10, 11, 12, 13, 14, 15
(1, 2, 4) means that literals with weights 1, 2, and 4, i.e. D, C, and B are deleted. The lowest
designated minterm is, therefore, m8. So, literal with weight 8 is present in non-complemented
form. So, it is read as A.
In the prime implicant chart of S (6, 7, 8, 9) + d(10, 11, 12, 13, 14, 15) shown in Table 6.8,
all the don’t care minterms are omitted.
✓ ✓ ✓ ✓
PIs/Minterms 6 7 8 9
*P Æ 8, 9, 10, 11, 12, 13, 14, 15 (1, 2, 4) × ×
*Q Æ 6, 7, 14, 15 (1, 8) × ×
As seen from the table, P and Q are both essential prime implicants. So, the minimal expression
is A + BC.
EXAMPLE 6.42 Using the Quine–McCluskey method of tabular reduction minimize the
given combinational single output function f(W, X, Y, Z) = S m(0, 1, 5, 7, 8, 10, 14, 15).
296 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
Minimization using the tabular method is as shown in Table 6.9.
Column 1 Column 2
Index Minterm Pairs
Index 0 0✓ 0, 1 (1) A
Index 1 1✓ 0, 8 (8) B
8✓ 1, 5 (4) C
Index 2 5✓ 8, 10 (2) D
10 ✓ 5, 7 (2) E
Index 3 7✓ 10, 14 (4) F
14 ✓ 7, 15 (8) G
Index 4 15 ✓ 14, 15 (1) H
None of the terms in any group of step 2 can be combined with any other term in the next group.
So all of them are prime implicants. The PI chart is shown in Table 6.10.
PIs/Minterms 0 1 5 7 8 10 14 15
A Æ 0, 1 (1) × ×
B Æ 0, 8 (8) × ×
C Æ 1, 5 (4) × ×
D Æ 8, 10 (2) × ×
E Æ 5, 7 (2) × ×
F Æ 10, 14 (4) × ×
G Æ 7, 15 (8) × ×
H Æ 14, 15 (1) × ×
We can see from the PI chart that there are no essential prime implicants and one possible minimal
combination of PIs that can cover all minterms is A, E, D, H. Therefore,
fmin = A + E + D + H = 000– + 01 – 1 + 10 – 0 + 111– = W X Y + W XZ + W X Z + WXY
Solution
Table 6.11 shows the procedure for obtaining all the prime implicants.
From Table 6.11 we see that the prime implicants are P, Q, R, S, T, U, V, and W. The prime
implicant chart is shown in Table 6.12.
✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
PIs/Minterms 0 1 2 8 9 15 17 21 24 25 27 31
*P Æ 8, 9, 24, 25 × × × ×
Q Æ 1, 9, 17, 25 × × × ×
R Æ 0, 1, 8, 9 × × × ×
S Æ 27, 31 × ×
*T Æ 15, 31 × ×
U Æ 25, 27 × ×
*V Æ 17, 21 × ×
*W Æ 0, 2 × ×
From the PI chart we observe that P,T, V, and W are the essential prime implicants because
m24 is covered by P only, m15 is covered by T only, m21 is covered by V only and m2 is covered
298 FUNDAMENTALS OF DIGITAL CIRCUITS
by W only. Delete the essential prime implicants and the columns covered by them and form the
reduced prime implicant chart as shown in Table 6.13.
PIs/Minterms 1 27
Q ×
R ×
S ×
U ×
There are four prime implicants P, Q, R, and S. Draw the prime implicant chart as shown in
Table 6.15.
MINIMIZATION OF SWITCHING FUNCTIONS 299
✓ ✓ ✓ ✓ ✓
PIs/Minterms 2 3 8 12 13
*P Æ 8, 10, 12, 14 (2, 4) × ×
*Q Æ 12, 13 (1) × ×
R Æ 2, 10 (8) ×
*S Æ 2, 3 (1) × ×
In Table 6.15 M8 is covered by P only. Further, M13 is covered by Q only and M3 is covered by S
only. Therefore, P, Q, and S are the essential prime implicants. Check them out and also check the
Maxterms covered by them. They cover all the Maxterms. So, the final expression is given by
fmin = PQS = ( A + D)( A + B + C)(A + B + C) (11 gate inputs)
EXAMPLE 6.45 Obtain the minimal POS expression for the following:
f = P M(0, 1, 4, 5, 9, 11, 13, 15, 16, 17, 25, 27, 28, 29, 31) ◊ d(20, 21, 22, 30)
Solution
The prime implicants are obtained as shown in Table 6.16.
From Table 6.16 we see that there are six prime implicants P, Q, R, S, T, and U. The prime
implicant chart is shown in Table 6.17.
Here M11, M15, and M27 are covered by P only. So P is an essential prime implicant. Also
M0, M4, and M16 are covered by R only. So, R is an essential prime implicant. The only
Maxterm left uncovered is M28. It can be covered by S or T or U. So the minimum POS
expression is given by PRS or PRT or PRU and each one requires ten gate inputs.
MINIMIZATION OF SWITCHING FUNCTIONS 301
Column 1 Column 2
Index Minterms Pairs
Index 0 0✓ 0, 4 (4) A
Index 1 4✓ 0, 16 (16) B
16 ✓ 4, 12 (8) C
Index 2 12 ✓ 16, 24 (8) D
24 ✓ 12, 28 (16) E
Index 3 19 ✓ 24, 28 (4) F
28 ✓ 19, 27 (8) G
Index 4 27 ✓ 28, 29 (1) H
29 ✓ 27, 31 (4) I
Index 5 31 ✓ 29, 31 (2) J
No term in any group of step 2 can be combined with any other term in the next group. So all
the terms in step 2 are prime implicants. The prime implicant chart is shown in Table 6.19.
✓ ✓
PIs/Minterms 0 4 12 16 19 24 27 28 29 31
A Æ 0, 4 (4) × ×
B Æ 0, 16 (16) × ×
C Æ 4, 12 (8) × ×
D Æ 16, 24 (8) × ×
E Æ 12, 28 (16) × ×
F Æ 24, 28 (4) × ×
G* Æ 19, 27 (8) × ×
H Æ 28, 29 (1) × ×
I Æ 27, 31 (4) × ×
J Æ 29, 31 (2) × ×
302 FUNDAMENTALS OF DIGITAL CIRCUITS
In the PI chart m19 can be covered only by the prime implicant G. So G is an essential PI. It
also covers m27. From the PI chart we can observe that the remaining minterms are covered
by the minimal set of prime implicants A, D, E, J. Therefore,
fmin = G + A + D + E + J = 1–011 + 00–00 + 1–000 + –1100 + 111–1
= V X YZ + V W Y Z + V X Y Z + WXY Z + VWXZ
= (VXYZ) (VWYZ) (VXYZ) (WXYZ) (VWXZ)
The above functions can be realized using AOI logic and NAND logic.
EXAMPLE 6.47 Apply branching method to simplify the following function:
f(A, B, C, D) = S m(2, 3, 4, 6, 9, 11, 12, 13)
Solution
The branching method is applied if the prime implicant chart contains no essential prime
implicants, dominated rows, and dominating columns. The PI chart is obtained using the
tabular method.
Column 1 Column 2
Index Minterm Pairs
Index 1 2 2, 3 (1) W
4 2, 6 (4) V
Index 2 3 4, 6 (2) U
6 4, 12 (8) T
9 3, 11 (8) S
12 9, 11 (2) R
Index 3 11 9, 13 (4) Q
13 12, 13 (1) P
There are eight prime implicants of equal size. The prime implicant chart is shown in
Table 6.21.
Table 6.21 Example 6.47: Prime implicant chart
PIs/Minterms 2 3 4 6 9 11 12 13
W Æ 2,3 (1) × ×
V Æ 2,6 (4) × ×
U Æ 4,6 (2) × ×
T Æ 4,12 (8) × ×
S Æ 3,11(8) × ×
R Æ 9,11 (2) × ×
Q Æ 9,13 (4) × ×
P Æ 12,13( 1) × ×
MINIMIZATION OF SWITCHING FUNCTIONS 303
From the prime implicant chart, we observe that all the minterms are covered by the prime
implicants W, U, R and P. So the minimal expression is
fmin = W + U + R + P = A BC + AB D + A BD + AB C
Branching method: Since the PI chart (Table 6.21) contains no essential prime implicants,
dominated rows, or dominating columns, the branching method can be used. For this we can select
any column. Let us select the first column with minterm 2. This minterm can be covered by either
row W or row V. Let us select row W first and remove that row and the columns covered by it, i.e.
columns corresponding to minterms 2 and 3 and write the reduced PI chart shown in Table 6.22.
PIs/Minterms 4 6 9 11 12 13
V Æ 2,6 (4) ×
U Æ 4,6 (2) × ×
T Æ 4,12 (8) × ×
S Æ 3,11(8) ×
R Æ 9,11 (2) × ×
Q Æ 9,13 (4) × ×
P Æ 12,13( 1) × ×
In Table 6.22, row V is dominated by row U and row S is dominated by row R. So remove
rows V and S. Once rows V and S are removed, column 4 dominates column 6 and column 9
dominates column 11. So remove columns 4 and 9 and draw the second reduced PI chart shown in
Table 6.23. Now U and R are the essential secondary prime implicants and together with P they
cover all the minterms. So the minimal expression is
fmin = W + U + R + P = A BC + AB D + A BD + AB C
This is one minimal expression.
PIs/Minterms 6 11 12 13
*U Æ 4,6 (2) ×
T Æ 4,12 (8) ×
*R Æ 9,11 (2) ×
Q Æ 9,13 (4) ×
*P Æ 12,13( 1) × ×
Now select row V and remove that row and the columns corresponding to minterms 2 and 6
covered by it and draw the reduced PI chart shown in Table 6.24.
304 FUNDAMENTALS OF DIGITAL CIRCUITS
PIs/Minterms 3 4 9 11 12 13
W Æ 2,3 (1) ×
U Æ 4,6 (2) ×
T Æ 4,12 (8) × ×
S Æ 3,11(8) × ×
R Æ 9,11 (2) × ×
Q Æ 9,13 (4) × ×
P Æ 12,13( 1) × ×
PIs/Minterms 3 4 9 11 12 13
T Æ 4,12 (8) × ×
S Æ 3,11(8) × ×
R Æ 9,11 (2) × ×
Q Æ 9,13 (4) × ×
P Æ 12,13( 1) × ×
EXAMPLE 6.48 Simplify the following function using the branching method:
f(A,B, C, D, E) = S m(0, 4, 12, 16, 19, 24, 28, 29, 31)
MINIMIZATION OF SWITCHING FUNCTIONS 305
Solution
Table 6.26 shows the procedure to obtain all the prime implicants. The PI chart is shown in
Table 6.27.
Table 6.26 Example 6.48
Column 1 Column 2
Index Minterm Pairs
Index 0 0 ✓ 0, 4 (4) W
Index 1 4 ✓ 0, 16 (16) V
16 ✓ 4, 12 (8) U
Index 2 12 ✓ 16, 24 (8) T
24 ✓ 12, 28 (16) S
Index 3 19 X 24, 28 (4) R
28 ✓ 28, 29 (1) Q
Index 4 29 ✓ 29, 31 (2) P
Index 5 31 ✓
PIs/Minterms 0 4 12 16 19 24 28 29 31
*X Æ 19 ×
W Æ 0, 4 (4) × ×
V Æ 0, 16 (16) × ×
U Æ 4, 12 (8) × ×
T Æ 16, 24 (8) × ×
S Æ 12, 28 (16) × ×
R Æ 24, 28(4) × ×
Q Æ 28, 29 (1) × ×
*P Æ 29, 31 (2) × ×
From the PI chart we observe that all the minterms are covered by PIs W, S, T, X, and P.
\ fmin = W + S + T + X + P = A BD E + BC D E + A CD E + A B CDE + ABCE
From the PI chart observe that PIs X and P are essential prime implicants because m19 is covered
only by X and m31 is covered only by P. So delete rows X and P and columns for m19 , m29, and m31
and write the reduced PI chart shown in Table 6.28 to apply the branching method.
306 FUNDAMENTALS OF DIGITAL CIRCUITS
PIs/Minterms 0 4 12 16 24 28
W Æ 0, 4 (4) × ×
V Æ 0, 16 (16) × ×
U Æ 4, 12 (8) × ×
T Æ 16, 24 (8) × ×
S Æ 12, 28 (16) × ×
R Æ 24, 28 (4) × ×
Q Æ 28, 29 (1) ×
In the reduced PI chart of Table 6.28, there are no essential PIs, dominated rows or dominating
columns. So the branching method can be applied. For that let us select column 0. It is covered by
rows W and V. Let us first select row W and delete this row and the columns 0 and 4 covered by
it and form Table 6.29.
PIs/Minterms 12 16 24 28
V Æ 0, 16 (16) ×
U Æ 4, 12 (8) ×
T Æ 16, 24 (8) × ×
S Æ 12, 28 (16) × ×
R Æ 24, 28 (4) × ×
Q Æ 28, 29 (1) ×
In Table 6.29 row V is dominated by row T, row U and row Q are dominated by row S. So
rows V, U and Q can be deleted. The remaining table is shown in Table 6.30.
Table 6.30
PIs/Minterms 12 16 24 28
T Æ 16, 24 (8) × ×
S Æ 12, 28 (16) × ×
R Æ 24, 28 (4) × ×
Looking at Table 6.29 we can see that T and S are secondary essential prime implicants and
together they cover all the minterms. So R is redundant. So the minimal expression is
fmin = W + S + T + X + P = A BD E + BC D E + A CD E + A B CDE + ABCE
The above procedure can be repeated by selecting row V and deleting this row and the columns
covered by it, i.e. 0 and 16 and the second minimal expression can be obtained. The minimal of
these two gives the real minimal expression.
MINIMIZATION OF SWITCHING FUNCTIONS 307
29. How many variables do a 2-square, 4-square, 8-square, 16-square etc. eliminate?
A. A 2-square eliminates one variable, a 4-square eliminates 2-variables, an 8-square eliminates
3 variables, a 16-square eliminates 4 variables and so on.
30. What is a prime implicant in K-map?
A. The bunch of 1s on the K-map which form a 2-square, 4-square, etc. is called a prime implicant
or subcube. It is called true prime implicant.
31. What is an essential prime implicant?
A. The prime implicant which contains at least one 1 which cannot be covered by any other prime
implicant is called an essential prime implicant.
32. What is a redundant prime implicant?
A. The prime implicant whose each 1 is covered by at least one EPI is called a redundant prime
implicant (RPI).
33. What is a selective prime implicant?
A. A prime implicant which is neither an essential prime implicant nor a redundant prime implicant
is called a selective prime implicant (SPI).
34. What is a false prime implicant?
A. The prime implicant made up of a bunch of 0s is called a false prime implicant.
35. PIs of a function f(W, X, Y, Z) = S m(0, 1, 3, 7, 8, 9, 11, 15) are given by the following code
groups. Which of these are EPIs?
A = (0, 1, 8, 9) B = (1, 3, 9, 11) C = (3, 7, 11, 15)
A. A and C are essential prime implicants.
36. In 5- and 6-variable K-maps when are squares in two blocks considered adjacent?
A. In 5- and 6-variable K-maps, squares in two blocks are considered adjacent if when superimposing
one block above or beside the other block, the squares coincide with one another.
37. What are “don’t cares”?
A. Combinations for which the value of the expression is not specified are called “don’t care” combinations.
38. What are incompletely specified expressions?
A. Incompletely specified expressions are those which are not specified for certain combinations.
39. How is an SOP expression with “don’t cares” converted into a POS expression and vice versa?
A. An SOP expression with “don’t cares” can be converted into POS form by keeping the “don’t
cares” as they are and writing the missing minterms of the SOP form as the maxterms of the POS
form and vice versa.
40. What is two-level logic? What is its advantage?
A. Two-level logic is one in which each input signal passes through two gates to reach the output.
The SOP and POS forms of realization give two-level logic. It provides uniform propagation
delay between the input and the output but may not yield the real minimal.
41. What is hybrid logic? What is its advantage, disadvantage?
A. Hybrid logic is one in which different input signals pass through different numbers of gates to
reach the outputs. The advantage is it results in a circuit with the least number of gate inputs, so
cost will be less. The disadvantage is that it does not produce uniform time delay and may suffer
from the problem of logic race.
42. Why is the name minterm?
A. A minterm fills with 1s the minimum possible area of the K-map, short of filling no area at all.
Hence the name minterm.
310 FUNDAMENTALS OF DIGITAL CIRCUITS
55. How are “don’t care” minterms and maxterms used in the tabular method?
A. “Don’t care” minterms and maxterms are used in the table only to obtain the set of prime implicants.
They are not used in the prime implicant chart to obtain the essential prime implicants.
56. When do you say that one row is dominating any other row?
A. Any row in a prime implicant chart is said to dominate any other row, if the first row has a × in
every column in which the second row has a ×.
57. When do you say that one column is dominating any other column?
A. Any column in a prime implicant chart is said to dominate any other column if the first column
has a × in every row in which the second column has a ×.
58. Which rows and columns can be removed while drawing the reduced prime implicant chart?
A. All dominating columns and dominated rows can be removed while drawing the reduced prime
implicant chart.
59. When is the minimal expression obtained by the branching method?
A. If the prime implicant chart has no essential prime implicants and dominated rows and dominating
columns, the minimal expressions can be obtained by the branching method.
60. How do you get all the possible minimal expressions by the tabular method?
A. In the tabular method, to get all the possible minimal expressions, multiply the sums of the rows
in the reduced prime implicant chart that take care of each minterm.
61. Does elimination of dominating columns and dominated rows end the search for a minimal
expression? If not, why not?
A. Elimination of dominating columns and dominated rows does not end the search for a minimal
expression. It is because the minimal expression can be obtained only from the final reduced
prime implicant chart.
REVIEW QUESTIONS
1. Write the procedure to expand an SOP expression into standard SOP form.
2. Write the procedure to expand a POS expression into standard POS form.
3. Write the procedure to simplify the Boolean expressions using K-maps.
4. Compare K-map and tabular methods of minimization.
5. Write the steps in the minimization using the tabular method.
6. Explain the branching method.
7. What are the limitations of K-maps.
1. The advantages of K-map are: It is a ______ method of simplifying the Boolean expressions and
it is ______.
2. The disadvantages of K-map are: It becomes tedious for problems involving ______ variables
and also this method cannot be ______.
312 FUNDAMENTALS OF DIGITAL CIRCUITS
37. The prime implicant which contains at least one 1 which cannot be covered by any other prime
implicant is called an ______.
38. The PI whose each 1 is covered by at least one EPI is called a ______.
39. A PI which is neither an EPI nor a RPI is called a ______.
40. The PI made of a bunch of 0s is called a ______.
27. For the design of a combinational circuit with four outputs using only NAND gates, the number
of K-maps required for the simplification process is
(a) 0 (b) 1 (c) 2 (d) 4
28. The AND-OR realization of a combinational circuit requires three 3-input AND gates and one
3-input OR gate. This circuit can be designed using
(a) four input NAND gates only
(b) three 3-input OR gates and one 3-input AND gate
(c) three 3-input NAND gates and one 3-input NOR gate
(d) none of the above
PROBLEMS
6.9 Reduce the following expressions using K-map and implement them in universal logic.
(a) S m(5, 6, 7, 9, 10, 11, 13, 14, 15)
(b) S m(0, 1, 2, 3, 4, 6, 8, 9, 10, 11)
(c) P M(1, 4, 5, 11, 12, 14) ◊ d(6, 7, 15)
(d) P M(3, 6, 8, 11, 13, 14) ◊ d(1, 5, 7, 10)
(e) S m(0, 1, 4, 5, 6, 7, 9, 11, 15) + d(10, 14)
(f) S m( 9, 10, 12) + d( 3, 5, 6, 7, 11, 13, 14, 15)
6.10 Simplify the following logic expressions and realize them using universal gates.
(a) S m(6, 9, 13, 18, 19, 25, 27, 29, 31)
(b) S m(0, 2, 3, 10, 12, 16, 17, 18, 21, 26, 27) + d(11, 13, 19, 20)
(c) S m(0, 1, 2, 4, 5, 7, 8, 9, 10, 14, 15, 17, 19, 20, 28, 29, 34, 36, 40, 41, 42, 43)
(d) S m(4, 6, 8, 9, 10, 12, 13, 18, 19, 25, 26, 29, 33, 35, 36, 41, 42, 48, 49, 50, 56, 57) + d(0, 1,
11, 15, 30, 38, 40)
6.11 Obtain the minimal expression using the tabular method and implement it in universal logic.
(a) S m(0, 1, 3, 4, 5, 7, 10, 13, 14, 15) (b) S m(0, 2, 3, 6, 7, 8, 10, 11, 12, 15)
(c) S m(0, 1, 3, 4, 5, 6, 7, 13, 15) (d) P M(6, 7, 8, 9) ◊ d(10, 11, 12, 13, 14, 15)
(e) P M(1, 5, 6, 7, 11, 12, 13, 15) (f) S m(1, 5, 6, 12, 13, 14) + d(2, 4)
6.12 Implement the function F with the following four two-level forms:
(a) NAND-AND (b) AND-NOR
(c) OR-AND (d) NOR-OR
F(A, B, C, D) = S m(0, 1, 4, 6, 8, 9 , 10, 12)
6.13 Implement the function F with the following four two-level forms:
(a) NAND-AND (b) AND-NOR
(c) OR-AND d) NOR-OR
F(A, B, C, D) = S m(0, 2, 3, 4, 7, 9, 15) + d(6, 8, 11)
6.14 Minimize and implement the following multiple output functions in SOP form using K-maps.
(a) f1 = S m(1, 2, 5, 6, 8, 9, 10)
f2 = S m(2, 4, 6, 8, 10, 12, 15)
(b) f1 = S m(0, 1, 4, 6, 8, 9, 11) + d(2, 7, 13)
f2 = S m(2, 4, 5, 7, 9, 12) + d(0, 1, 6)
(c) f1 = S m(0, 1, 2, 4, 6, 7, 10, 14, 15)
f2 = S m(3, 4, 5, 9, 10, 11, 14)
(d) f1 = S m(2, 3, 7, 10, 11, 14) + d(1, 5, 15)
f2 = S m(0, 1, 4, 7, 13, 14) + d(5, 8, 15)
6.15 Reduce the following expressions using a three-variable map.
(a) A BC + ABC D + AB CD + ABC
(b) AB E C + ABC D + ABC E + A BC D + ABC
(c) A BC D + A BCD + A BC D + A BCD + ABCD + AB C D + AB CD + AB C D
(d) m1 + Dm2 + m3 + Dm5 + m7 + d(m0 + Dm6)
(e) Em2 + m3 + m4 + Dm5 + Dm7 + d(m0 + Em1 + E m6)
(f) Dm2 + Dm5 + m6 + d(m1 + Dm7)
MINIMIZATION OF SWITCHING FUNCTIONS 317
VHDL PROGRAMS
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity SOP_FORM is
Port (A, B,C: in STD_LOGIC;
Y: out STD_LOGIC);
end SOP_FORM;
architecture Behavioral of SOP_FORM is
component AND_GATE_3 is
Port ( A,B,C : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
component ANDGATE is
Port ( A,B : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
component NOTGATE is
Port ( A : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
component OR_GATE_3 is
Port ( A,B,C : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
signal n1,n2,n3,n4,n5:STD_LOGIC;
MINIMIZATION OF SWITCHING FUNCTIONS 319
begin
x1:AND_GATE_3 port map(A,B,C,n1);
x2:NOTGATE port map(B,n2);
x3:ANDGATE port map(A,n2,n3);
x4:NOTGATE port map(A,n4);
x5:AND_GATE_3 port map(n4,B,C,n5);
x6:OR_GATE_3 port map(n1,n3,n5,Y);
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM IN STRUCTURAL MODELING FOR A GIVEN SOP FORM
Y= ABC+AB+AC
module and_3_gate(
input a,b,c,
output y
);
assign y = a & b & c;
endmodule
module and_2_gate(
input a,b,
output y
);
assign y = a & b;
endmodule
module or_3_gate(
input a,b,c,
output y
);
assign y = a | b | c;
endmodule
RTL SCHEMATIC
SIMULATION OUTPUT:
SIMULATION OUTPUT:
RTL SCHEMATIC
SIMULATION OUTPUT:
SIMULATION OUTPUT:
7
COMBINATIONAL
LOGIC DESIGN
7.1 INTRODUCTION
Logic circuits for digital systems may be combinational or sequential. The output of a combinational
circuit depends on its present inputs only. Combinational circuits perform a specific information
processing operation fully specified logically by a set of Boolean functions. A combinational
circuit consists of input variables, logic gates, and output variables. The logic gates accept signals
from the inputs and generate signals to the outputs. This process transforms binary information
from the given input data to the required output data. Obviously both input and output data are
represented by signals, i.e. they exist in two possible values, one representing logic-1 and the other
logic-0. The block diagram of a combinational circuit is shown in Figure 7.1. The n input binary
variables come from an external source and the m output variables go to an external destination.
For n input variables, there are 2n possible combinations of binary input values. For each possible
input combination, there is one and only one possible output combination. A combinational circuit
can be described by m Boolean functions one for each output variable. Each output function is
expressed in terms of the n input variables. Usually the inputs come from flip-flops and outputs go
to flip-flops. So both the variable and its complement are assumed to be available.
7.3 ADDERS
Digital computers perform a variety of information processing tasks. Among the basic tasks
encountered are the various arithmetic operations. The most basic arithmetic operation is the addition
of two binary digits. This simple addition consists of 4 possible operations, namely,
0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, and 1 + 1 = 10.
The first three operations produce a sum whose length is one digit, but when both augend and addend
bits are equal to 1, the binary sum consists of two digits. The higher significant bit of this result is
called a carry. When the augend and addend numbers contain more significant digits, the carry
obtained from the addition of two bits is added to the next higher-order pair of significant bits. A
combinational circuit that performs the addition of two bits is called a half-adder. One that performs
the addition of three bits (two significant bits and previous carry) is called a full-adder. The name of
the former stems from the fact that two half-adders can be employed to implement a full-adder.
The sum (S) bit and the carry (C) bit, according to the rules of binary addition, are given by:
The sum (S) is the X-OR of A and B (It represents the LSB of the sum). Therefore,
S = A B + AB = A ≈ B
328 FUNDAMENTALS OF DIGITAL CIRCUITS
The carry (C) is the AND of A and B (It is 0 unless both the inputs are 1). Therefore,
C = AB
A half-adder can, therefore, be realized by using one X-OR gate and one AND gate as shown
in Figure 7.3a. Realization using AOI logic is shown in Figure 7.3b.
A half-adder can also be realized in universal logic by using either only NAND gates or only
NOR gates as shown in Figures 7.4 and 7.5 respectively.
NAND logic
S = A B + AB = A B + A A + AB + BB
= A( A + B) + B(A + B)
= A ◊ AB + B ◊ AB
= A ◊ AB ◊ B ◊ AB
C = AB = AB
Figure 7.4 Logic diagram of a half-adder using only 2-input NAND gates.
NOR logic
S = A B + AB = A B + A A + AB + B B
= A( A + B) + B( A + B)
COMBINATIONAL LOGIC DESIGN 329
= (A + B)( A + B)
= A+B+A+B
C = AB = AB = A + B
Figure 7.5 Logic diagram of a half-adder using only 2-input NOR gates.
From the truth table, a circuit that will produce the correct sum and carry bits in response to
every possible combination of A, B, and Cin is described by
S = A BCin + AB Cin + A B Cin + ABCin
= (A B + AB) Cin + (AB + A B)Cin = (A ≈ B) Cin + ( A ≈ B)Cin = A ≈ B ≈ Cin
and
Cout = ABCin + A BCin + AB Cin + ABCin = AB + (A ≈ B)Cin = AB + ACin + BCin
The sum term of the full-adder is the X-OR of A, B, and Cin, i.e. the sum bit is the modulo
sum of the data bits in that column and the carry from the previous column. The logic diagram of
the full-adder using two X-OR gates and two AND gates (i.e. two half-adders) and one OR gate is
shown in Figure 7.7.
The block diagram of a full-adder using two half-adders is shown in Figure 7.8.
Even though a full-adder can be constructed using two half-adders as shown in Figure 7.7, the
disadvantage is that the bits must propagate through several gates in succession, which makes the
total propagation delay greater than that of the full-adder circuit using AOI logic shown in Figure 7.9.
The full-adder can also be realized using universal logic, i.e. either only NAND gates or only
NOR gates as shown in Figures 7.10 and 7.11 respectively.
NAND logic
We know that
A ≈ B = A ◊ AB ◊ B ◊ AB
Then
Figure 7.9 Sum and carry bits of a full-adder using AOI logic.
Figure 7.10 Logic diagram of a full-adder using only 2-input NAND gates.
NOR logic
We know that
A ≈ B = (A + B) + A + B
Then
Figure 7.11 Logic diagram of a full-adder using only 2-input NOR gates.
7.4 SUBTRACTORS
The subtraction of two binary numbers may be accomplished by taking the complement of the
subtrahend and adding it to the minuend. By this method, the subtraction operation becomes an
addition operation and instead of having a separate circuit for subtraction, the adder itself can be
used to perform subtraction. This results in reduction of hardware. In subtraction, each subtrahend
bit of the number is subtracted from its corresponding significant minuend bit to form a difference
bit. If the minuend bit is smaller than the subtrahend bit, a 1 is borrowed from the next significant
position. The fact that a 1 has been borrowed must be conveyed to the next higher pair of bits by
means of a signal coming out (output) of a given stage and going into (input) the next higher stage.
Just as there are half- and full-adders, there are half- and full-subtractors.
A half-subtractor can also be realized using universal logic—either using only NAND gates
or using only NOR gates—as shown in Figures 7.14 and 7.15 respectively.
NAND logic
d = A ≈ B = A ◊ AB ◊ B ◊ AB
b = AB = B( A + B) = B( AB) = B ◊ AB
Figure 7.14 Logic diagram of a half-subtractor using only 2-input NAND gates.
NOR logic
d = A ≈ B = A B + AB = A B + B B + AB + A A
= B(A + B) + A(A + B) = B + A + B + A + A + B
d = AB = A(A + B) = A(A + B) = A + (A + B)
334 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 7.15 Logic diagram of a half-subtractor using only 2-input NOR gates.
From the truth table, a circuit that will produce the correct difference and borrow bits in response
to every possible combination of A, B, and bi is described by
d = A Bbi + AB b i + A B b i + ABbi
= bi(AB + A B) + b i(A B + AB)
= bi( A ≈ B) + b i(A ≈ B) = A ≈ B ≈ bi
and
b = A Bbi + AB b i + ABbi + ABbi = AB(bi + b i) + (AB + A B)bi
= AB + ( A ≈ B)bi
COMBINATIONAL LOGIC DESIGN 335
A full-subtractor can, therefore, be realized using X-OR gates and AOI gates as shown in
Figure 7.17.
The full subtractor can also be realized in universal logic using either only NAND gates or
only NOR gates as shown in Figures 7.18 and 7.19 respectively.
NAND logic
b = AB + bi( A ≈ B) = AB + bi (A ≈ B)
= B ◊ AB ◊ bi [bi ◊ (A ≈ B)]
Figure 7.18 Logic diagram of a full-subtractor using only 2-input NAND gates.
NOR logic
d = A ≈ B ≈ bi = (A ≈ B) ≈ bi
= (A ≈ B)bi + (A ≈ B)bi
= (A ≈ B) + (A ≈ B) + bi + bi + (A ≈ B) + bi
= (A ≈ B) + (A ≈ B) + bi + bi + (A ≈ B) + bi
b = AB + bi( A ≈ B)
= A(A + B) + ( A ≈ B)[(A ≈ B) + bi]
= A + (A + B) + (A ≈ B) + (A ≈ B) + b i
Figure 7.19 Logic diagram of a full subtractor using only 2-input NOR gates.
for the sum bits, and two terminals for the input and output carries. An n-bit parallel adder requires
n-full adders. It can be constructed from 4-bit, 2-bit, and 1-bit full adder ICs by cascading several
packages. The output carry from one package must be connected to the input carry of the one with
the next higher-order bits. The 4-bit full adder is a typical example of an MSI function.
There is another possibility of producing a carry out. X-OR gate inside the half-adder at the
input produces an intermediary sum bit—call it Pn—which is expressed as Pn = An ≈ Bn. Next Pn
and Cn are added using the X-OR gate inside the second half adder to produce the final sum bit
Sn = Pn ≈ Cn = An ≈ Bn ≈ Cn and output carry C0 = Pn ◊ Cn = (An ≈ Bn)Cn which becomes input
carry for the (n + 1)th stage.
Consider the case of both Pn and Cn being 1. The input carry Cn has to be propagated to the
output only if Pn is 1. If Pn is 0, even if Cn is 1, the AND gate in the second half-adder will inhibit
Cn. We may thus call Pn as the propagated carry as this is associated with enabling propagation
of Cn to the carry output of the nth stage which is denoted as Cn+1 or C0n. So, we can say that the
carryout of the nth stage is 1 when either Gn = 1 or Pn ◊ Cn = 1 or both Gn and Pn ◊ Cn are equal
to 1.
For the final sum and carry outputs of the nth stage, we get the following Boolean expressions.
Sn = Pn ≈ Cn where Pn = An ≈ Bn
Con = Cn+1 = Gn + PnCn where Gn = An ◊ Bn
Observe the recursive nature of the expression for the output carry at the nth stage which
becomes the input carry for the (n + 1)st stage. By successive substitution, it is possible to
express the output carry of a higher significant stage in terms of the applied input variables A,
B and the carry-in to the LSB adder. The carry-in to each stage is the carry-out of the previous
stage.
Based on these, the expressions for the carry-outs of various full adders are as follows:
C1 = G0 + P0 ◊ C0
C2 = G1 + P1 ◊ C1 = G1 + P1 ◊ G0 + P1 ◊ P0 ◊ C0
C3 = G2 + P2 ◊ C2 = G2 + P2 ◊ G1 + P2 ◊ P1 ◊ G0 + P2 ◊ P1 ◊ P0 ◊ C0
C4 = G3 + P3 ◊ C3 = G3 + P3 ◊ G2 + P3 ◊ P2 ◊ G1+ P3 ◊ P2 ◊ P1 ◊ G0 + P3 ◊ P2 ◊ P1 ◊ P0 ◊ C0
The general expression for n stages designated as 0 through (n – 1) would be
Cn = Gn–1 + Pn–1 ◊ Cn–1 = Gn–1 + Pn–1 ◊ Gn–2 + Pn–1 ◊ Pn–2 ◊ Gn–3 + ... + Pn–1 ◊ … P0 ◊ C0
Observe that the final output carry is expressed as a function of the input variables in SOP
form, which is a two-level AND-OR or equivalent NAND-NAND form. To produce the output
carry for any particular stage, it is clear that it requires only that much time required for the signals
to pass through two levels only. Hence the circuit for look-ahead-carry introduces a delay
corresponding to two gate levels.The block diagram of a 4 stage look-ahead-carry parallel adder is
shown in Figure 7.24.
Observe that the full look-ahead-scheme requires the use of OR gate with (n + 1) inputs and
AND gates with number of inputs varying from 2 to (n + 1).
340 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 7.26 Logic diagram of a parallel adder/subtractor using 2’s complement system.
both registers are shifted once to the right. This process continues until the shift control is disabled.
Thus the addition is accomplished by passing each pair of bits together with the previous carry
through a single full adder circuit and transferring the sum, one bit at a time, into register A.
Initially, register A and the carry flip-flop are cleared to 0 and then the first number is added
from B. While B is shifted through the full adder, a second number is transferred to it through its
serial input. The second number is then added to the content of register A while a third number is
transferred serially into register B. This can be repeated to form the addition of two, three, or more
numbers and accumulate their sum in register A.
A BCD adder circuit must be able to operate in accordance with the above steps. In other
words, the circuit must be able to do the following.
1. Add two 4-bit BCD code groups, using straight binary addition.
2. Determine, if the sum of this addition is greater than 1001 (decimal 9); if it is, add 0110
(decimal 6) to this sum and generate a carry to the next decimal position.
The first requirement is easily met by using a 4-bit binary parallel adder such as the 74LS83 IC.
For example, if the two BCD code groups A3A2A1A0 and B3B2B1B0 are applied to a 4-bit parallel
adder, the adder will output S4S3S2S1S0, where S4 is actually C4, the carry-out of the MSB bits.
The sum output S4S3S2S1S0 can range anywhere from 00000 to 10010 (when both the BCD
code groups are 1001 = 9). The circuitry for a BCD adder must include the logic needed to detect
whenever the sum is greater than 01001, so that the correction can be added in. Those cases, where
the sum is greater than 1001 are listed in Table 7.1.
Table 7.1
S4 S3 S2 S1 S0 Decimal number
0 1 0 1 0 10
0 1 0 1 1 11
0 1 1 0 0 12
0 1 1 0 1 13
0 1 1 1 0 14
0 1 1 1 1 15
1 0 0 0 0 16
1 0 0 0 1 17
1 0 0 1 0 18
Let us define a logic output X that will go HIGH only when the sum is greater than 01001
(i.e. for the cases in Table 7.1). If we examine these cases, we see that X will be HIGH for either of
the following conditions.
1. Whenever S4 = 1 (sum greater than 15)
2. Whenever S3 = 1 and either S2 or S1 or both are 1 (sums 10 to 15)
This condition can be expressed as
X = S4 + S3(S2 + S1)
Whenever X = 1, it is necessary to add the correction factor 0110 to the sum bits, and to
generate a carry. Figure 7.28 shows the complete circuitry for a BCD adder, including the logic
circuit implementation for X.
The circuit consists of three basic parts. The two BCD code groups A3A2A1A0 and B3B2B1B0
are added together in the upper 4-bit adder, to produce the sum S4S3S2S1S0. The logic gates shown
implement the expression for X. The lower 4-bit adder will add the correction 0110 to the sum
bits, only when X = 1, producing the final BCD sum output represented by S3S2S1S0. The X is also
the carry-out that is produced when the sum is greater than 01001. Of course, when X = 0, there is
no carry and no addition of 0110. In such cases, S3S2S1S0 = S3S2S1S0.
Two or more BCD adders can be connected in cascade when two or more digit decimal
numbers are to be added. The carry-out of the first BCD adder is connected as the carry-in of the
COMBINATIONAL LOGIC DESIGN 345
second BCD adder, the carry-out of the second BCD adder is connected as the carry-in of the third
BCD adder and so on.
Figure 7.28 Logic diagram of a BCD adder using two 4-bit adders and a correction-detector circuit.
4-bit parallel adder. If the carry is a 0, then 1101(13) is added to the sum bits (This is equivalent
to subtracting 0011(3) from the sum bits. The correct sum in XS-3 is obtained as shown in
Figure 7.29.
Implementation of the XS-3 subtractor using two 4-bit parallel adders is shown in Figure 7.30.
The minuend and the 1’s complement of the subtrahend in XS-3 are added in the upper 4-bit
parallel adder. If the carry-out from the upper adder is a 0, then 1101 is added to the sum bits of the
upper adder in the lower adder and the sum bits of the lower adder are complemented to get the
result. If the carry-out from the upper adder is a 1, then 3 = 0011 is added to the sum bits of the
lower adder and the sum bits of the lower adder give the result.
Figure 7.30 Logic diagram of an XS-3 subtractor using 4-bit binary adders.
In a binary multiplier, instead of adding all the partial products at the end, they are added two
at a time and their sum accumulated in a register (the accumulator register). In addition, when the
multiplier bit is a 0, 0s are not written down and added because it does not affect the final result.
Instead, the multiplicand is shifted left by one bit.
The multiplication of 1110 by 1001 using this process is illustrated below.
Multiplicand: 1110
Multiplier: 1001
1 1 1 0 The LSB of the multiplier is a 1; write down the multiplicand;
shift the multiplicand one position to the left (1 1 1 0 0).
1 1 1 0 The second multiplier bit is a 0; write down the previous result
1 1 1 0; shift the multiplicand to the left again (1 1 1 0 0 0).
1 1 1 0 The third multiplier bit is a 0; write down the previous result
1 1 1 0; shift the multiplicand to the left again (1 1 1 0 0 0 0).
+ 1 1 1 0 0 0 0 The fourth multiplier bit is a 1; write down the new multiplicand;
add it to the first partial product to obtain the final product.
1111110
This multiplication process can be performed by the serial multiplier circuit shown in
Figure 7.31, which multiplies two 4-bit numbers to produce an 8-bit product. The circuit consists
of the following elements.
X register: A 4-bit shift register that stores the multiplier—it will shift right on the falling edge of
the clock. Note that 0s are shifted in from the left.
B register: An 8-bit register that stores the multiplicand; it will shift left on the falling edge of the
clock. Note that 0s are shifted in from the right.
A register: An 8-bit register, i.e. the accumulator that accumulates the partial products.
Adder: An 8-bit parallel adder that produces the sum of A and B registers. The adder outputs S7
through S0 are connected to the D inputs of the accumulator so that the sum can be transferred to
the accumulator only when a clock pulse gets through the AND gate.
The circuit operation can be described by going through each step in the multiplication of
1110 by 1001. The complete process requires 4 clock cycles.
1. Before the first clock pulse: Prior to the occurrence of the first clock pulse, the register A
is loaded with 00000000, the register B with the multiplicand 00001110, and the register X
with the multiplier 1001. We can assume that each of these registers is loaded using its
asynchronous inputs (i.e. PRESET and CLEAR). The output of the adder will be the sum
of A and B, that is, 00001110.
2. First clock pulse: Since the LSB of the multiplier (X0) is a 1, the first clock pulse gets
through the AND gate and its positive going transition transfers the sum outputs into the
accumulator. The subsequent negative going transition causes the X and B registers to
shift right and left, respectively. This, of course, produces a new sum of A and B.
3. Second clock pulse: The second bit of the original multiplier is now in X0. Since this
bit is a 0, the second clock pulse is inhibited from reaching the accumulator. Thus, the
sum outputs are not transferred into the accumulator and the number in the accumulator
does not change. The negative going transition of the clock pulse will again shift the X
and B registers. Again a new sum is produced.
Figure 7.31 Logic diagram of a binary multiplier.
COMBINATIONAL LOGIC DESIGN
349
350 FUNDAMENTALS OF DIGITAL CIRCUITS
4. Third clock pulse: The third bit of the original multiplier is now in X0; since this bit is
a 0, the third clock pulse is inhibited from reaching the accumulator. Thus, the sum
outputs are not transferred into the accumulator and the number in the accumulator does
not change. The negative going transition of the clock pulse will again shift the X and B
registers. Again a new sum is produced.
5. Fourth clock pulse: The last bit of the original multiplier is now in X0, and since it is a
1, the positive going transition of the fourth pulse transfers the sum into the accumulator.
The accumulator now holds the final product. The negative going transition of the clock
pulse shifts X and B again. Note that, X is now 0000, since all the multiplier bits have
been shifted out.
operations can be performed on it. The binary results of arithmetic operations must be converted
to BCD for transmission to output devices. Therefore, conversions are often accomplished by
using the major components of the computer system itself rather than special converter circuits.
Conversion tables may be stored in the ROM. In some systems, conversions are accomplished by
the computer itself, through execution of a specially designed program. This is called software
conversion, as opposed to the hardware conversion performed by logic circuits.
The expressions for the outputs X4, X3, X2 and X1 are shown in Figure 7.35b. Drawing
K-maps for the outputs X4, X3, X2 and X1 in terms of the inputs B4, B3, B2, and B1 and simplifying
them, as shown in Figure 7.35c the minimal expressions for X4, X3, X2, and X1 are as shown in
Figure 7.35b. A logic diagram can be drawn based on those minimal expressions.
The truth table of the SOP circuit is shown in Figure 7.38a. Looking at the truth table of the SOP
circuit, we observe that the output is 1 for the input combinations corresponding to minterms 7, 5,
4, 12, 13, 15, 14, and 10 (i.e. corresponding to the Gray code of decimal numbers 5, 6, 7, 8, 9, 10,
11 and 12). So the expression for the output is
f = S m(7, 5, 4, 12, 13, 15, 14, 10) = S m(4, 5, 7, 10, 12, 13, 14, 15)
The K-map for f, its minimization, the minimal expression obtained from it and its realization
in NAND logic are shown in Figures 7.38b and c respectively.
fmin = B C + BD + AC D = BC ◊ BD ◊ ACD
The K-map, its minimization, the minimal expression obtained from it and the realization of
the minimal expression in NAND logic are shown in Figure 7.39.
fmin = A D + AC + C D = AD ◊ AC ◊ CD
Figure 7.40 Conversion table and K-maps for the circuit (Contd.)
360 FUNDAMENTALS OF DIGITAL CIRCUITS
The K-maps in SOP and POS forms, their minimization, the minimal expressions obtained
from them and the actual minimal circuit in NOR logic are shown in Figures 7.41b and c respectively.
SOP minimal is
fmin = CD + AD + AC + A CD
POS minimal is
fmin = ( A + C + D)( B + C + D)( B + C + D)
For minimal circuit in NOR logic the minimal expression is written as
fmin = ( A + C + D)( B + C + D)( B + C + D) = (A + C + D) + (B + C + D) + (B + C + D)
Figure 7.41 Truth table, K-maps and logic diagram for the circuit.
EXAMPLE 7.3 Design a minimal circuit to produce an output of 1, when its input is a
2421 code representing an even decimal number less than 10.
Solution
The input to the circuit is a 4-bit 2421 code. There are 16 possible combinations of 4-bit input,
out of which the 10 combinations shown in the truth table are valid for the 2421 code, and the
remaining 6 combinations 0101, 0110, 0111, 1000, 1001 and 1010 are invalid and hence the
corresponding outputs are don’t cares. Looking at the truth table of the SOP circuit shown in
Figure 7.42a we observe that the output is 1 for the input combinations corresponding to minterms
0, 2, 4, 12, and 14 (i.e. corresponding to the 2421 code of decimal numbers 0, 2, 4, 6, and 8).
362 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 7.4 Design a combinational circuit that accepts a 3-bit BCD number and
generates an output binary number equal to the square of the input number.
Solution
The square of a 3-bit number is a 6-bit number. The truth table of the combinational circuit
and the minimal expressions for the outputs obtained after algebraic simplification are shown
in Figures 7.43a and b respectively. A logic diagram can be drawn based on the above
expressions.
COMBINATIONAL LOGIC DESIGN 363
EXAMPLE 7.5 Design a logic circuit with 4 inputs A, B, C, D that will produce output ‘1’
only whenever two adjacent input variables are 1s. A and D are also to be treated as adjacent.
Implement it using universal logic.
Solution
The truth table of the logic circuit is shown in Figure 7.44a.
From the truth table, we observe that the expression for the output is given by:
In SOP form
F = S m(3, 6, 7, 9, 11, 12, 13, 14, 15 )
In POS form
F = P M(0, 1, 2, 4, 5, 8, 10 )
The K-maps in SOP and POS forms, their minimization and the minimal expressions obtained
from them are shown in Figure 7.44b.
SOP minimal is
Fmin = AB + AD + BC + CD
POS minimal is
Fmin = (A + C)(B + D)
The SOP form requires 12 gate inputs whereas the POS form requires only 6 gate inputs for
realization. To realize in universal logic the minimal expression can be written as
Fmin = (A + C)(B + D) = (A + C) + (B + D)
A logic diagram based on the real minimal expression can be drawn as shown in Figure 7.44c.
EXAMPLE 7.6 A8A4A2A1 is an 8421 BCD input to a logic circuit whose output is a 1
when A8 = 0, A4 = 0 and A2 = 1, or when A8 = 0 and A4 = 1. Design the simplest possible
logic circuit.
Solution
Denote the non-complemented variable by a 1 and the complemented variable by a 0. Based
on the statement of the problem, the expression for the output is
f = A8 A4A2 + A8A4
Now expand it to get it in the standard SOP form. Therefore,
f = A8 A4A2(A1 + A1) + A8A4(A2 + A2)(A1 + A1)
= 001X + 01XX
= 0010 + 0011 + 0100 + 0101 + 0110 + 0111
= S m(2, 3, 4, 5, 6, 7)
The input is a 4-bit BCD. So there are 6 invalid combinations (corresponding to minterms
10, 11, 12, 13, 14, 15) and the corresponding outputs are don’t cares. So, the Boolean
expression is
f = S m(2, 3, 4, 5, 6, 7) + d (10, 11, 12, 13, 14, 15)
Obtain the minimal expressions in SOP and POS forms and implement the minimal of these
minimals. The K-maps in SOP and POS forms, their minimization, the minimal expressions
obtained from each, and the logic diagram based on the minimal expression are shown in
Figures 7.45a and b.
COMBINATIONAL LOGIC DESIGN 365
EXAMPLE 7.7 Design each of the following circuits that can be built using AOI logic
and outputs a 1 when:
(a) A 4-bit hexadecimal input is an odd number from 0 to 9.
(b) A 4-bit BCD code translated to a number that uses the upper right segment of a seven-
segment display.
Solution
(a) The output is a 1 when the input is a 4-bit hexadecimal odd number from 0 to 9. There are
16 possible combinations of inputs, and all are valid. The output is a 1 only for the input
combinations 0001, 0011, 0101, 0111, and 1001. For all other combinations of inputs, the
output is a 0. The problem may thus be stated as f = S m(1, 3, 5, 7, 9). The SOP K-map, its
minimization, the minimal expression obtained from it, and the realization of the minimal
expression in AOI logic are shown in Figures 7.46a and b.
(b) We see from Figure 7.47a that display of digits 0, 1, 2, 3, 4, 7, 8, and 9 requires the upper-
right segment of the seven-segment display. Since the input is a 4-bit BCD, inputs 1010
366 FUNDAMENTALS OF DIGITAL CIRCUITS
through 1111 are invalid, and therefore, the corresponding outputs are don’t cares. The
problem may be stated as
f = S m(0, 1, 2, 3, 4, 7, 8, 9) + d (10, 11, 12, 13, 14, 15)
The K-map, its minimization, the minimal expression obtained from it and the realization of
the minimal expression using AOI logic are shown in Figures 7.47b and c respectively.
Thus we would like to generate a parity bit with the three message bits given. The parity bit will be 1
whenever the number of 1’s in the 3-message bits is odd, i.e. a single 1 or three 1s. So P1 is generated
using data bits D3, D5, D7. P2 is generated using data bits D3, D6, D7. P4 is generated using data bits
D5, D6, D7. So two X-OR gates are to be used to generate each parity bit. The logic diagram of a
parallel parity bit generator is shown in Figure 7.51.
Solution
(a) 8 of the 9-bits are applied at A-H inputs and the ninth bit, I, is applied to the ODD input.
The circuit is shown in Figure 7.54a.
(b) The 9-bit word consisting of A through I is converted to a 10-bit word with even parity.
The circuit is shown in Figure 7.54b.
(c) The 16-bit even parity checker is shown in Figure 7.54c.
7.18 COMPARATORS
A comparator is a logic circuit used to compare the magnitudes of two binary numbers. Depending
on the design, it may either simply provide an output that is active (goes HIGH for example) when
the two numbers are equal, or additionally provide outputs that signify which of the numbers is
greater when equality does not hold.
The X-NOR gate (coincidence gate) is a basic comparator, because its output is a 1 only if its
two input bits are equal, i.e. the output is a 1 if and only if the input bits coincide.
372 FUNDAMENTALS OF DIGITAL CIRCUITS
Two binary numbers are equal, if and only if all their corresponding bits coincide. For example,
two 4-bit binary numbers, A3A2A1A0 and B3B2B1B0 are equal, if and only if, A3 = B3, A2 = B2,
A1 = B1 and A0 = B0. Thus, equality holds when A3 coincides with B3, A2 coincides with B2, A1
coincides with B1, and A0 coincides with B0. The implementation of this logic,
EQUALITY = (A3 B3)(A2 B2)(A1 B1)(A0 B0)
is straightforward. It is obvious that this circuit can be expanded or compressed to accommodate
binary numbers with any other number of bits.
The block diagram of a 1-bit comparator which can be used as a module for comparison of
larger numbers is shown in Figure 7.55.
7.19 IC COMPARATOR
Figure 7.59a shows the pin diagram of IC 7485, a 4-bit comparator. Pins labelled (A < B)IN,
(A = B)IN, and (A > B)IN are used for cascading. Figure 7.59b shows how two 4-bit comparators
COMBINATIONAL LOGIC DESIGN 375
are cascaded to perform 8-bit comparisons. The (A < B)OUT, (A = B)OUT and (A > B)OUT outputs
from the lower order comparator used for the least significant 4 bits, are connected to the (A <
B)IN, (A = B)IN, and (A > B)IN inputs of the higher-order comparator. Note that, (A < B)IN input of
the lower order comparator is connected to VCC, and (A = B)IN and (A > B)IN inputs of the lower
order comparator are connected to ground.
EXAMPLE 7.9 Design a 5-bit comparator using a single 7485 and one gate.
Solution
The circuit is shown in Figure 7.60. The two 5-bit numbers to be compared are X4X3X2X1X0
and Y4Y3Y2Y1Y0.
7.20 ENCODERS
An encoder is a device whose inputs are decimal digits and/or alphabetic characters and whose
outputs are the coded representation of those inputs, i.e. an encoder is a device which converts
familiar numbers or symbols into coded format. In other words, an encoder may be said to be a
combinational logic circuit that performs the ‘reverse’ operation of the decoder. The opposite of
the decoding process is called encoding, i.e. encoding is a process of converting familiar numbers
376 FUNDAMENTALS OF DIGITAL CIRCUITS
or symbols into a coded format. An encoder has a number of input lines, only one of which is
activated at a given time, and produces an N-bit output code depending on which input is activated.
Figure 7.61 shows the block diagram of an encoder with M inputs and N outputs. Here the inputs
are active HIGH, which means they are normally LOW.
listed in the truth table (Figure 7.63b) and from this we can determine the relationships between
each BCD bit and the decimal digits. There is no explicit input for a decimal 0. The BCD output is
0000 when the decimal inputs 1– 9 are all 0.
The logic circuit of the encoder is shown in Figure 7.63c. From the table, we get
A3 = D8 + D9
A2 = D4 + D5 + D6 + D7
A1 = D2 + D3 + D6 + D7
A0 = D1 + D3 + D5 + D7 + D9
The S-R flip-flops are used to store the BCD output. When a key corresponding to one of the
decimal digits is pressed, a positive voltage forward biases the selected diodes connected to the
SET(S) and RESET(R) inputs of the flip-flops. The diodes are so arranged that each flip-flop sets
COMBINATIONAL LOGIC DESIGN 379
or resets, as necessary to produce the 4-bit code corresponding to the decimal digit. For example,
when the key 7 is pressed, the diodes connected to the S inputs of Q4, Q2, and Q1 are forward
biased, as is that connected to the R input of Q8. Thus, the output is 0111. Note that, the diode
configuration at each S and R input is essentially a diode OR gate. Diode matrix encoders are
found on printed circuit boards of many devices having a keyboard as the means of data entry.
replaced by 0 and then by 1, we obtain all 16 possible input combinations. The minterms for the
two functions A and B are derived from the table as
A = S m(1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15)
B = S m(1, 3, 4, 5, 7, 9, 11, 12, 13, 15)
The same values of A and B mentioned above are obtained from the K-map.
Thus,
A0 = D1 D2 D4 D6D8 + D3 D4 D6 D8 + D5 D6 D8 + D7 D8 + D9
Similarly, A1 is HIGH when D2, D3, D6, or D7 is HIGH. So, in the priority encoder A1 will be
HIGH if:
D2 is HIGH and D4, D5, D8, and D9 are LOW. Or
D3 is HIGH and D4, D5, D8, and D9 are LOW. Or
D6 is HIGH and D8 and D9 are LOW. Or
D7 is HIGH and D8 and D9 are LOW.
Thus,
A1 = D2 D4 D5 D8 D9 + D3D4 D5 D8D9 + D6 D8 D9 + D7 D8 D9
Also, A2 is HIGH when D4, D5, D6, or D7 is HIGH. So, in the priority encoder A2 will
become HIGH if:
D4 is HIGH and D8 and D9 are LOW. Or
D5 is HIGH and D8 and D9 are LOW. Or
D6 is HIGH and D8 and D9 are LOW. Or
D7 is HIGH and D8 and D9 are LOW.
Thus,
A2 = D4 D8 D9 + D5 D8 D9 + D6D8 D9 + D7 D8 D9
Finally, A3 is HIGH if D8 is HIGH or if D9 is HIGH. So, in the priority encoder A3 will be
HIGH if D8 is HIGH OR D9 is HIGH.
Thus,
A3 = D8 + D9
The truth table operation of the priority encoder is shown in Table 7.2. The inputs and outputs
are active low. The truth table clearly shows that the magnitudes of the decimal inputs determine
their priorities. If any decimal input is active, it is encoded provided all higher value inputs are
inactive regardless of the states of all lower value inputs.
EXAMPLE 7.10 Design a hexadecimal-to-binary encoder using 74148 encoders and 74157
multiplexer.
Solution
Since there are 16 symbols (0–F) in the hexadecimal number system, two 74148 encoders
are required. Hexadecimal inputs 0–7 are applied to IC1 input lines and hexadecimal inputs
8–F to IC2 input lines. Whenever one of the inputs of IC2 is active (LOW), IC1 must be
disabled. On the other hand, if all the inputs of IC2 are HIGH, then IC1 must be enabled.
This is achieved by connecting the EO line of IC2 to the EI line of IC1. A quad 2:1 multiplexer
is required to get the proper 4-bit binary outputs. The complete circuit is shown in Figure 7.67.
The GS output of 74148 goes LOW whenever one of its inputs is active. Therefore, the GS
of IC2 is connected to the SELECT input of 74157. The 74157 selects its A inputs if the
SELECT input is LOW, otherwise B inputs are selected. The outputs of the multiplexer are
the required binary outputs and are active LOW. This circuit is also a priority encoder.
7.23 DECODERS
A decoder is a logic circuit that converts an N-bit binary input code into M output lines such that
only one output line is activated for each one of the possible combinations of inputs. In other
words, we can say that a decoder identifies or recognizes or detects a particular code. Figure 7.68
shows the general decoder diagram with N inputs and M outputs. Since each of the N inputs can be
a 0 or a 1, there are 2N possible input combinations or codes. For each of these input combinations,
COMBINATIONAL LOGIC DESIGN 383
only one of the M outputs will be active (HIGH), all the other outputs will remain inactive (LOW).
Some decoders are designed to produce active LOW output, while all the other outputs remain
HIGH.
Some decoders do not utilize all of the 2N possible input codes. For example, a BCD to
decimal decoder has a 4-bit input code and 10 output lines that correspond to the 10 BCD code
groups 0000 through 1001. Decoders of this type are often designed so that if any of the unused
codes are applied to the input, none of the outputs will be activated.
384 FUNDAMENTALS OF DIGITAL CIRCUITS
D6, D7, D8, D9). Only one output line is active at time. 6 of the 16 input combinations are invalid
and for input combinations that are invalid for BCD none of the outputs will be activated. The
inputs and outputs can be active high or active low. IC 7442 is a BCD to decimal decoder with
active low inputs and outputs. The TTL 7445 IC is a BCD-to-decimal decoder/driver. The term
driver is added to its description because this IC has open collector outputs that can operate at
higher current and voltage limits than a normal TTL output. It makes 7445 suitable for directly
driving loads such as indicator LEDs or lamps, relays or DC motors.
to all 4 outputs, but the input information is directed to only one of the output lines, as specified by
the binary combination of two selection lines A and B. This can be verified from the truth table of
the circuit. For example, if the selection lines AB = 10, the output D2 will be same as the
input value, while all other outputs are maintained at a 1. Because decoder and demultiplexer
operations are obtained from the same circuit, a decoder with an enable input is referred to as a
decoder/demultiplexer.
A function with a long list of minterms requires an OR gate with a large number of inputs. A
function having a list of K minterms can be expressed in its complemented form F with 2n–K
terms. If the number of minterms in a function is greater than 2n/2, then F can be expressed with
fewer minterms. In such a case, it is advantageous to use a NOR gate to sum the minterms of F.
COMBINATIONAL LOGIC DESIGN 387
The output of the NOR gate complements this sum and generates the normal output F. If NAND
gates are used for the decoder as in Figure 7.68 then the external gates must be NAND gates
instead of OR gates. This is because a two-level NAND gate circuit implements a sum of minterms
function and is equivalent to a 2-level AND-OR circuit.
Figure 7.72 Connecting two 74138 3-to-8 decoders to obtain a 4-to-16 decoder.
Decoders are widely used in memory systems of computers, where they respond to the address
code input from the central processor to activate the memory storage location specified by the
address code.
In the common-anode type, a low voltage applied to an LED cathode allows current to flow through
the diode, which causes it to emit light. In the common-cathode type, a high voltage applied to an
LED anode causes the current to flow and produces the resulting light emission.
An 8-4-2-1 BCD-to-seven segment decoder is a logic circuit as shown in Figure 7.74a. The
function table for such a decoder is shown in Figure 7.74b. Since a 1 (HIGH) on any output line
activates that line, we assume that the display is of the common-cathode type. The K-map used to
simplify the logic expression for driving segment b is shown in Figure 7.74c. Entries 10–15 are
don’t cares as usual. Since LEDs require considerable power, decoders often contain output drivers
capable of supplying sufficient power.
b = A3 A2A1 A0 + A3A2 A1A0 + A3A2A1 A0 + A3A2A1A0 + A3A2 A1 A0
+ A3A2A1A0 + A3 A2A1 A0 + A3A2 A1A0
= S m(0, 1, 2, 3, 4, 7, 8, 9)
Don’t cares,
d = S m(10, 11, 12, 13, 14, 15)
The multiplexer acts like a digitally controlled multi-position switch. The digital code
applied to the SELECT inputs determines which data inputs will be switched to the output. For
example, the output Z will equal the data input D0 for some particular input code; Z will equal
D1 for another particular code, and so on. In other words, we can say that a multiplexer selects
1-out-of-N input data sources and transmits the selected data to a single output channel. This is
called multiplexing.
determines which AND gate is enabled, so that its data input passes through the OR gate to the
output. The output, Z = D0 S + D1S.
When S = 0, AND gate 1 is enabled and AND gate 2 is disabled. So, Z = D0.
When S = 1, AND gate 1 is disabled and AND gate 2 is enabled. So, Z = D1.
The AND gates and inverters in the multiplexer resemble a decoder circuit and, indeed, they
decode the selection input lines. In general, a 2n- to-1 line multiplexer is constructed from an
n-to-2n decoder by adding to it 2n input lines, one to each AND gate. The outputs of the AND gates
are applied to a single OR gate. The size of multiplexer is specified by the number 2n of its data
lines and the single output line. The n selection lines are implied from the 2n data lines. As in
decoders multiplexers may have an enable input to control the operation of the unit. When the
enable input is in the inactive state, the outputs are disabled and when it is in the active state, the
circuit functions as a normal multiplexer.
Figure 7.78 Logic diagram for cascading of two 8 × 1 muxes to get a 16-bit mux.
Figure 7.79 Example 7.11: Use of 74151A to implement the logic function F = A ≈ B ≈ C.
Solution
The truth table for F and the logic diagram to implement the function F using an 8 : 1 MUX
are shown in Figures 7.80a and b respectively. The inputs x, y and z are applied to the data
select inputs S2, S1 and S0 respectively. Since F = 1 when xyz = 000, 010, 011, and 101, logic
1 is connected to data inputs D0, D2, D3 and D5. Logic 0 is connected to other data inputs D1,
D4, D6 and D7.
In general, a multiplexer with n-data select inputs can implement any function of n + 1
variables. The key to this design is to use the first n variables of the function as the select inputs
and to use the least significant input variable and its complement to drive some of the data inputs.
If the single variable is denoted by D, each data output of the multiplexer will be D, D, 1, or 0.
Suppose, we wish to implement a 4-variable logic function using a multiplexer with three data
select inputs. Let the input variables be A, B, C, and D; D is the LSB. A truth table for the function
F(A, B, C, D) is constructed. In the truth table, we note that ABC has the same value twice once
with D = 0 and again with D = 1. The following rules are used to determine the connections that
should be made to the data inputs of the multiplexer.
1. If F = 0 both times when the same combination of ABC occurs, connect logic 0 to the
data input selected by that combination.
2. If F = 1 both times when the same combination of ABC occurs, connect logic 1 to the
data input selected by that combination.
3. If F is different for the two occurrences of a combination of ABC, and if F = D in each
case, connect D to the data input selected by that combination.
4. If F is different for the two occurrences of a combination of ABC, and if F = D in each
case, connect D to the data input selected by that combination.
EXAMPLE 7.13 Use a multiplexer having three data select inputs to implement the logic
for the function given below. Also realize the same using a 16:1 MUX.
F = S m(0, 1, 2, 3, 4, 10, 11, 14, 15).
Solution
The truth table for the given function is shown in Figure 7.81a. Since the given function is of
four variables, we can use a multiplexer with three data select inputs (i.e. 8:1 mux) as shown
COMBINATIONAL LOGIC DESIGN 395
in Figure 7.81b. As seen from the truth table, since F is same for each of the two occurrences
of ABC = 000, ABC = 001, ABC = 101, and ABC = 111 and since F = 1 in both cases, 1 is
connected to D0, D1, D5, D7. Since F is the same for each of two occurrences of ABC = 011,
ABC = 100 and ABC = 110 and since F = 0 in both cases, 0 is connected to D3, D4 and D6.
Since F is different for each of the two occurrences of ABC = 010 and since F = D in both
cases, D is connected to D2.
Realization of the same using a 16:1 MUX is shown in Figure 7.81c.
S2 S1 S0 D S0
A B C D F C S1
0 0 0 0 1 B S2
F=1
0 0 0 1 1 A S3
8 × 1 MUX
0 0 1 0 1 1 0
F=1 C S0
0 0 1 1 1 1
0 1 0 0 1 B S1 2
F=D
0 1 0 1 0 A S2 3
0 1 1 0 0 4 16 : 1 Output F
F=0 1 D0 Output F 0 5 MUX
0 1 1 1 0
D1 6
1 0 0 0 0 7
F=0 D D2
1 0 0 1 0 8
1 0 1 0 1 0 D3 9
F=1
1 0 1 1 1 D4 10
1 1 0 0 0 11
F=0 D5 12
1 1 0 1 0 13
D6
1 1 1 0 1 14
F=1 D7
1 1 1 1 1 15
(a) Truth table (b) Logic diagram (c) Logic diagram
Figure 7.81 Example 7.13.
AB = 00, the output F = C, because F = 0 when C = 0 and F = 1 when C = 1. This requires that
variable C be applied to data line 0. The operation of the multiplexer is such that when AB =
00, data input 0 has a path to the output and that makes F = C. In a similar fashion, we can
determine the required input to data lines 1, 2, and 3 from the values of F when AB = 01, 10,
and 11 respectively.
EXAMPLE 7.15 Implement the following function with a MUX:
F(a, b, c) = S m(1, 3, 5, 6)
Choose a and b as select inputs.
Solution
The truth table for F and the implementation of F(a, b, c) = S m(1, 3, 5, 6) using a 4 : 1 MUX
with select inputs a and b are shown in Figures 7.83a and b respectively.
The inputs a and b are connected to the data select lines S1 and S0. From the truth table we
observe that
1. For both values of ab = 00, ab = 01 and ab = 10, F = c. So D0, D1 and D2 are connected
to c.
2. For both values of ab = 11, F = c . So D3 is connected to c .
The inputs a and b are connected to the data select lines S1 and S0 . From the truth table we
observe that
1. For both values of ab = 00, and ab = 10, F = c. So D0 and D2 are connected to c.
2. For both values of ab = 01, F = 0. So D1 is connected to 0.
3. For both values of ab = 11, F = 1. So D3 is connected to 1.
EXAMPLE 7.17 Implement the following logic function using an 8 × 1 MUX:
F(A, B, C, D) = S m(1, 3, 4, 11, 12, 13, 14, 15)
Solution
The truth table for the given four variable function F and its implementation using an 8:1
MUX with three select inputs A, B, and C are shown in Figures 7.85a and b respectively.
The inputs A, B, and C are connected to the data select lines S2, S1, and S0. From the truth
table we observe that
1. For both values of ABC = 000, ABC = 001 and ABC = 101, F = D. So D0, D1, and D5 are
connected to D.
2. For both values of ABC = 010, F = D. So D2 is connected to D.
3. For both values of ABC = 011, and ABC = 100, F = 0. So D3 and D4 are connected to 0.
4. For both values of ABC = 110, and ABC = 111, F = 1. So D6 and D7 are connected to 1.
The inputs x, y and z are connected to the data select lines S2, S1 and S0. From the truth table
we observe that
1. F = 1 for xyz = 000, 010,011 and 101. So connect D0, D2, D3 and D5 to 1.
2. F = 0 for xyz = 001, 100, 110 and 111. So connect D1, D4, D6 and D7 to 0.
EXAMPLE 7.19 Implement the following Boolean function using an 8:1 multiplexer
considering D as the input and A, B, C as the selection lines:
F(A, B, C, D) = A B + BD + BC D
Solution
F(A, B, C, D) = A B + BD + BC D = 10XX + X1X1 + X010
= 1000 + 1001 + 1010 + 1011 + 0101 + 0111 + 1101 + 1111 + 0010 + 1010
= S m(8, 9, 10, 11, 5, 7, 13, 15, 2, 10) = S m (2, 5, 7, 8, 9, 10, 11, 13, 15)
The truth table for the given four variable function F and its implementation using an 8:1
MUX with three select inputs A, B, and C are shown in Figures 7.87a and b respectively.
The inputs A, B, and C are connected to the data select lines S2, S1, and S0. From the truth
table we observe that
1. For both values of ABC = 000, F = 0. So D0 is connected to 0.
2. For both values of ABC = 100, and ABC = 101, F = 1. So D4 and D5 are connected to 1.
3. For both values of ABC = 010, ABC = 011, ABC = 110, and ABC =111, F = D. So D2,
D3, D6 and D7 are connected to D.
4. For both values of ABC = 001, F = D. So D1 is connected to D.
gate O0 will be enabled, and the data input D will appear at output O0. Other select codes cause
input D to reach the other outputs. The truth table in Figure 7.90b summarizes the operation.
The demultiplexer circuit of Figure 7.90a is very similar to the 3-line to 8-line decoder
circuit of Figure 7.69a, except that a fourth input D has been added to each gate. The inputs ABC
of Figure 7.69b are here labelled S2 S1 S0 and become the data select inputs.
In the 3-to-8 IC decoder, there are three input lines and eight output lines. The enable input
E is used to enable or disable the decoding process. This 3-to-8 decoder can be used as a 1-to-8
demultiplexer as follows.
COMBINATIONAL LOGIC DESIGN 401
The enable input E is used as the data input D, and the binary code inputs are used as the
select inputs. Depending on the select inputs, the data input will be routed to a particular output.
For this reason, the IC manufacturers often call this type of device a decoder/demultiplexer.
The 74LS138 decoder can be used as a demultiplexer by using E1 as the data input D,
holding the other two enable inputs in their active states and using the A2A1A0 inputs as the select
code.
EXAMPLE 7.20 Implement the following multiple output combinational logic circuit using
a 4-line to 16-line decoder.
F1 = S m(1, 2, 4, 7, 8, 11, 12, 13)
F2 = S m(2, 3, 9, 11)
F3 = S m(10, 12, 13, 14)
F4 = S m(2, 4, 8)
Solution
The realization of the given multiple output logic circuit using a 4-line to 16-line decoder is
shown in Figure 7.91. The decoder’s outputs are active LOW; therefore, a NAND gate is
required for every output of the combinational circuit. In combinational logic design using a
multiplexer, additional gates are not required, whereas the design using a demultiplexer
requires additional gates. However, even with this disadvantage, the decoder is more
economical in cases where non-trivial, multiple-output expressions of the same input variables
are required. In such cases, one multiplexer is required for each output, whereas it is likely
that only one decoder supported with a few gates would be required. Therefore, using a
decoder could have advantages over using a multiplexer.
F4
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 F3
4-line to 16-line
decoder F2
A B C D Enable
F1
14 12 10 8 4 2
(MSB) (LSB) Logic 0
13 11 9 7 3 1
Figure 7.91 Example 7.20.
line decoders. In a similar manner 6-line to 64-line, 7-line to 128-line and 8-line to 256-line and in
general m-line to n-line decoders can be implemented.
7.27.2 Design of a 32:1 Mux Using Two 16:1 Muxs and One 2:1 Mux Modules
The arrangement to obtain a 32:1 mux using two 16:1 muxes and one 2:1 mux is shown in
Figure 7.94. A 32:1 mux has 32 data inputs. So it requires five data select lines. Since a 16:1 mux
has only four data select lines, the inputs B,C,D,E are connected to the data select lines of both the
16:1 muxes and the most significant input A is connected to the single data select line of the 2:1
mux. For the values of BCDE = 0000 to 1111, inputs 0 to 15 will appear at the input terminal 0 of
the 2:1 mux through the output F1 of the first 16:1 mux and inputs 16 to 31 will appear at the input
terminal 1 of the 2:1 mux through the output F2 of the second 16:1 mux. For A = 0, output F = F1.
For A = 1, output F = F2.
Figure 7.94 32:1 mux using two 16:1 muxs and one 2:1 mux.
chip with A10. Finally, the two outputs have to be mixed with an output OR gate. The additional
hardware in this case is thus one inverter and one OR gate. A similar scheme is commonly used in
expanding the size of memory by connecting additional modules.
So the 4-bit comparator using four 1-bit modules is shown in Figure 7.98.
SOP with AND-OR gates or with NAND gates, the removal of static 1 (0) hazard guarantees that
no static 0 (1) hazards or dynamic hazards will occur.
Dynamic hazards occur when the output changes for two adjacent input combinations. While
changing, the output should change only once, but it may change three or more times in short
intervals because of differential delays in several paths. Dynamic hazards occur only in multilevel
circuits. A typical dynamic hazard is shown in Figure 7.99f. We consider only single input changes
as in other cases it becomes almost impossible to prevent hazards.
of gate 2 becomes 0 but the output of gate 1 becomes 1 and the output F remains at 1. For the
change in B from 1 to 0, if gate 1 responds faster than gate 2, F will be 1 as expected. If gate 2 is
faster than gate 1, its output becomes 0 before the output of gate 1 changes to 1, and for a very
short time the outputs of the gates 1 and 2 will be 0 resulting in an output of 0. A little later of
course the output goes to 1. This erratic behaviour is shown in Figure 7.99d and is known as static
1-hazard marked by an arrow in the map. With contact networks it is called tie set hazard.
If we consider the POS realization of the same function, then F = P M(0, 1, 2, 6). The
minimal POS realization [Fmin = (A + B)( B + C)] with logic gates is shown in Figure 7.100b.
Consider the situation when A = 0, B = 0, C = 0 and only B changing from 0 to 1. Look at the
map. The output F has to remain at 0 by design. Look at the gate circuit. When B = 0, the output of
gate 1 is 0, the output of gate 2 is 1 and so the output F is 0. When B changes to 1, the output of
gate 1 becomes 1 and the output of gate 2 becomes 0 and so the output F remains at 0. For the
change in B from 0 to 1, if gate 2 responds faster than gate 1, F will be 0 as expected. If gate 1 is
faster than gate 2, its output becomes 1 before the output of gate 2 changes to 0 and for a very short
time the outputs of both the gates 1 and 2 will be 1 resulting in an output of 1. This erratic behaviour
is shown in Figure 7.99e and is known as static 0-hazard marked by arrows in the map of
Figure 7.100a. With contact networks it is called a cut set hazard.
Figure 7.101 A function with no static 1-hazard but having static 0-hazard.
The problem that they impose can be corrected by adjusting the amount of delay in the effected
path. To avoid essential hazards, each feedback loop must be handled with individual care to
ensure that the delay in the feedback loop is long enough compared to delays of other signals that
originate from the input terminals. This problem tends to be specialized, as it depends on the
particular circuit used and the amount of delays that are encountered in its various paths. In
synchronous sequential machines, hazards caused by transient behaviour are no consequence as
the clock speed is determined to allow all signals to settle in their steady static values before the
next change of inputs.
f = S1S2 + S1 S2 f = S1S2 + S1 S2
= S1 ◊ (S1 ◊ S2 ) ◊ S2 ◊ (S1 ◊ S2 ) = S2 + S1 ◊ S2 + S1 + S1 ◊ S2
= S1 + S1 + S2 + S2 + S1 + S2
EXAMPLE 7.24 A safe has 5 locks v, w, x, y, and z; all of which must be unlocked for the
safe to open. The keys to the locks are distributed among five executives in the following
manner.
Mr. A has keys for locks v and x.
Mr. B has keys for locks v and y.
Mr. C has keys for locks w and y.
Mr. D has keys for locks x and z.
Mr. E has keys for locks v and z.
(a) Determine the minimal number of executives required to open the safe.
(b) Find all the combinations of executives that can open the safe; write an expression
f(A, B, C, D, E) which specifies when the safe can be opened as a function of what
executives are present.
(c) Who is the essential executive?
412 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
Table 7.3 indicates the executives and the locks they can open.
We see that the key for lock w is only with Mr. C. So Mr. C is the essential executive,
without whom the safe cannot be opened. Once C is present, he can open lock y too. As seen
from the table, the remaining locks v, x, and z can be opened by A and D or A and E or B and
D or D and E. So the combinations of executives who can open the locks are CAD or CAE or
CBD or CDE.
The Boolean expression corresponding to the above statement is
f(A, B, C, D, E) = CAD + CAE + CBD + CDE
The minimal number of executives required is 3.
EXAMPLE 7.25 You are presented with a set of requirements under which an insurance
policy can be issued. The applicant must be
1. a married female 25 years old or over, or
2. a female under 25, or
3. a married male under 25 who has not been involved in a car accident, or
4. a married male who has been involved in a car accident, or
5. a married male 25 years or over who has not been involved in a car accident.
Find an algebraic expression which assumes a value 1 whenever the policy is issued. Simplify
the expression obtained.
Solution
Let the variables w, x, y, and z assume the truth value in the following cases.
w = 1, if the applicant has been involved in a car accident.
x = 1, if the applicant is married.
y = 1, if the applicant is a male.
z = 1, if the applicant is under 25.
The policy can be issued when any one of the conditions 1, 2, 3, 4, or 5 is met. The conditions
1, 2, 3, 4 and 5 are represented algebraically by x y z , yz, xyz w, xyw, xy z w. Therefore,
f(w, x, y, z) = x y z + yz + xyz w + xyw + xy w z
= xy w(z + z ) + xyw + y(z + x z )
= xy w + xyw + y (z + z )(z + x)
COMBINATIONAL LOGIC DESIGN 413
= xy(w + w ) + (z + x) y
= xy + x y + y z
= x(y + y) + yz
= x + yz
So the policy can be issued if the applicant is either married or is a female under 25.
EXAMPLE 7.26 An air-conditioning unit is controlled by four variables: temperature T,
humidity H, the time of the day D, and the day of the week W. The unit is turned on under
any of the following circumstances.
1. The temperature exceeds 78° F, and the time of the day is between 8 a.m. and 5 p.m.
2. The humidity exceeds 85%, the temperature exceeds 78°F, and the time of day is
between 8 a.m. and 5 p.m.
3. The humidity exceeds 85%, the temperature exceeds 78°F, and it is a weekend.
4. It is Saturday or Sunday and humidity exceeds 85%.
Write a logic expression for controlling the air-conditioning unit. Simplify the expression
obtained as far as possible.
Solution
Define the variables:
(a) T = 1, if the temperature exceeds 78°F.
(b) H = 1, if the humidity exceeds 85%.
(c) D = 1, if the time of the day is between 8 a.m. and 5 p.m.
(d) W = 1, if it is weekend, i.e. Saturday or Sunday.
The circumstances 1, 2, 3 and 4, respectively, are then given algebraically as TD, HTD,
HTW and WH. Therefore, the Boolean expression for turning on the machine is
f = TD + HTD + HTW + WH
= TD(1 + H) + HW(1 + T) = TD + HW
So the air-conditioning unit is turned on, if the temperature exceeds 78°F and the time of the
day is between 8 a.m. and 5 p.m, or if it is a weekend and humidity exceeds 85%.
EXAMPLE 7.27 Five soldiers A, B, C, D and E volunteer to perform an important military
task if their following conditions are satisfied.
1. Either A or B or both must go.
2. Either C or E but not both must go.
3. Either both A and C go or neither goes.
4. If D goes, then E must also go.
5. If B goes, then A and C must also go.
Define the variables A, B, C, D and E, so that an unprimed variable will mean that the
corresponding soldier has been selected to go. Determine the expression which specifies the
combinations of volunteers who can get the assignment.
Solution
Analyzing the problem to perform the task, the first condition is, either A or B or both must
go.
414 FUNDAMENTALS OF DIGITAL CIRCUITS
Case 1. Suppose A goes, then according to condition 3, C must also go. If C goes, then according
to condition 2, E cannot go. Then according to condition 4 when E is not going, D also cannot go.
So D does not go. So A and C can go to perform the task.
Case 2. When B goes, according to condition 5, A and C must go. When C goes, E cannot go, and
when E cannot go, D also cannot go. So the second combination of soldiers who can perform the
task is ABC.
Case 3. When both A and B go, C has to go. When C goes, E and therefore D cannot go. This is the
same as the second combination ABC.
So the conclusion is either A and C, or A, B and C can go and perform the military task.
Therefore,
f = AC + ABC
= AC(1 + B) = AC
So the minimal combination of soldiers who can get the assignment is A and C.
EXAMPLE 7.28 A lawn-sprinkling system is controlled automatically by certain
combinations of the following variables.
Season (S = 1, if summer; 0, otherwise)
Moisture content of soil (M = 1, if high; 0, if low)
Outside temperature (T = 1, if high; 0, if low)
Outside humidity (H = 1, if high; 0, if low)
The sprinkler is turned on under any of the following circumstances.
1. The moisture content is low in winter.
2. The temperature is high and the moisture content is low in summer.
3. The temperature is high and the humidity is high in summer.
4. The temperature is low and the moisture content is low in summer.
5. The temperature is high and the humidity is low.
Use a K-map to find the simplest possible logic expression involving the variables S, M, T
and H for turning on the sprinkler system.
Solution
The given circumstances 1, 2, 3, 4 and 5 are expressed in terms of the defined variables S, M,
T, and H as M S , T MS, THS, T MS, and T H, respectively.
The Boolean expression is
f = S M + S MT + STH + S M T + T H
=00XX+101X+1X11+100X+XX10
The expressions in terms of minterms and maxterms are
f = S m(0, 1, 2, 3, 6, 8, 9, 10, 11, 14, 15)
= P M(4, 5, 7, 12, 13)
The K-maps in SOP and POS forms, their minimization, the minimal expressions obtained
from each, and the logic diagram in the SOP form are all shown in Figure 7.104. Both SOP
and POS forms give the same minimum.
COMBINATIONAL LOGIC DESIGN 415
TH TH
SM 00 01 11 10 SM 00 01 11 10
0 1 3 2 0 1 3 2
00 1 1 1 1 00
4 5 7 6 4 5 7 6
01 1 01 0 0 0 S
12 13 15 14 12 13 15 14 T
11 1 1 11 0 0 fmin
M
8 9 11 10 8 9 11 10
10 1 1 1 1 10 T
H
fmin = M + ST + TH fmin = (M + T)(S + M + H) Logic diagram
Figure 7.104 Example 7.28.
REVIEW QUESTIONS
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.
1. An arithmetic circuit that adds only two binary digits is called a ______.
2. An arithmetic circuit that adds two binary digits and a carry is called a ______.
3. An arithmetic circuit that subtracts one binary digit from another without considering a borrow is
called a ______.
4. An arithmetic circuit that subtracts one binary digit from another considering a borrow is called
a ______.
5. An adder that adds two numbers in parallel form and produces the sum bits in parallel form is
called a ______.
6. A parallel adder in which the carry-out of each full-adder is the carry-in to the next most significant
adder is called a ______.
7. The ______ adder speeds up the process by eliminating the ripple carry.
8. ______ adders are used where circuit minimization is more important than speed as in pocket
calculators.
9. A ______ is a logic circuit that compares the magnitudes of two binary numbers.
10. A ______ is a logic circuit that converts an n-input binary code into a corresponding single
numeric output code.
11. ______ inputs are used to control the operation of the decoder.
12. A device whose inputs are decimal digits and /or alphabetic characters and whose outputs are the
coded representations of those inputs is called ______.
13. A ______ is a logic circuit that responds to just one input, in accordance with some priority
system, among those that may be simultaneously high.
14. A ______ is a logic circuit that accepts several data inputs and allows only one of them at a time
to get through to the output.
15. A 4-variable logic expression can be realized using a single ______ multiplexer.
16. A ______ is a logic circuit that depending on the status of the select inputs, channels its data
input to one of several data outputs.
17. A demultiplexer can be thought of as a ______.
18. The ______ gate is a basic comparator.
19. ______ is a process of converting familiar numbers or symbols into a coded format.
20. ______ means sharing.
21. ______ and ______ are the two types of multiplexing.
22. A ______ identifies or recognizes or detects a particular code.
23. A decoder with 64 output lines has ______ select lines.
24. A binary-to-octal decoder is a ______ line to ______ line decoder.
25. A 3-line to 8-line decoder is referred to as ______ decoder or ______ decoder.
422 FUNDAMENTALS OF DIGITAL CIRCUITS
12. In which of the following adder circuits is the carry ripple delay eliminated?
(a) half-adder (b) full-adder (c) parallel adder (d) carry-look-ahead adder
13. To secure a higher speed of addition, which of the following is the preferred solution?
(a) serial adder (b) parallel adder
(c) adder with a look-ahead-carry (d) full-adder
14. A parallel adder in which the carry-out of each full-adder is the carry-in to the next significant
digit adder is called a
(a) ripple carry adder (b) look-ahead-carry adder
(c) serial carry adder (d) parallel carry adder
15. The adder preferred for applications where circuit minimization is more important than speed
is
(a) parallel adder (b) serial adder (c) full-adder (d) half-adder
16. A serial adder requires only one
(a) half-adder (b) full-adder (c) counter (d) multiplexer
17. In digital systems subtraction is performed
(a) using half-adders (b) using half-subtractors
(c) using adders with 1’s complement representation of negative numbers
(d) by none of the above.
18. In a digital system BCD arithmetic is preferred to normal binary arithmetic because
(a) BCD arithmetic circuits are simpler than binary arithmetic circuits
(b) BCD arithmetic circuits are faster than binary arithmetic circuits
(c) BCD arithmetic circuits are less expensive than binary arithmetic circuits
(d) of ease of operation when input is in BCD format and the output display is decimal
19. In BCD addition, 0110 is required to be added to the sum for getting the correct result, if
(a) the sum of two BCD numbers is not a valid BCD number
(b) the sum of two BCD numbers is not a valid BCD number or a carry is produced
(c) a carry is produced
(d) none of the above is true
20. BCD subtraction is performed by using
(a) 1’s complement representation (b) 2’s complement representation
(c) 5’s complement representation (d) 9’s complement representation
21. Which logic gate is a basic comparator?
(a) NOR gate (b) NAND gate (c) X-OR gate (d) X-NOR gate
22. The logic gate used in parity checkers is
(a) NAND gate (b) NOR gate (c) X-OR gate (d) X-NOR gate
23. A device whose inputs are decimal digits and/or alphabetic characters and whose outputs are the
coded representations of those inputs is called
(a) an encoder (b) a decoder (c) a code converter (d) a decimal converter
24. A logic circuit that responds to just one input, in accordance with some priority system, among
those that may be simultaneously high is called
(a) an encoder (b) a priority encoder (c) a priority decoder (d) a decoder
424 FUNDAMENTALS OF DIGITAL CIRCUITS
40. The number of 16:1 multiplexers required for designing a 4-output 4-variable combinational
circuit is
(a) 16 (b) 8 (c) 4 (d) 1
41. A 4-variable logic circuit can be designed using
(a) a 16:1 multiplexer
(b) an 8:1 multiplexer and one inverter
(c) two 8:1 multiplexers and one 2:1 multiplexer
(d) any of the above
42. A 16:1 multiplexer can be used to design
(a) 4 variable logic function (b) BCD to binary code converter
(c) BCD to 7 segment decoder (d) full-adder
43. A BCD to XS-3 code converter can be designed using
(a) a 16:1 multiplexer (b) a 1:16 de multiplexer
(c) two 16:1 multiplexers (d) none of the above
44. Which of the following logic circuits takes data from a single source and distributes it to one of
several output lines?
(a) multiplexer (b) demultiplexer (c) encoder (d) decoder
45. Which logic device is called a distributor?
(a) multiplexer (b) demultiplexer (c) encoder (d) decoder
46. A demultiplexer with 4-bit select input has
(a) one data input and four data output lines (b) one data input and eight data output lines
(c) one data input and ten data output lines (d) one data input and sixteen data output lines
47. The number of 1:16 demultiplexers required for designing a 4-output 4-variable combinational
circuit is
(a) 16 (b) 8 (c) 4 (d) 1
48. A demultiplexer is used to
(a) perform arithmetic division
(b) select data from several inputs and route it to a single output
(c) steer the data from a single input to one of the many outputs
(d) perform parity checking
49. A combinational logic circuit which is used to send data coming from a single source to two or
more separate destinations is called
(a) a decoder (b) an encoder (c) a multiplexer (d) a demultiplexer
PROBLEMS
7.1 Design an 8421-to-2421 BCD code converter and draw its logic diagram.
7.2 Find the simplest possible logic expressions for a 2421-to-51111 BCD code converter.
7.3 Draw a logic diagram for an excess-3-to-decimal decoder. Inputs and outputs should be active
HIGH.
426 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
1. VHDL PROGRAM FOR HALF-ADDER USING X-OR GATE AND AND GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity HALFADDER is
Port ( A,B: in STD_LOGIC;
SUM,CARRY: out STD_LOGIC);
end HALFADDER;
architecture Structural of HALFADDER is
component XORGATE is
Port ( A,B: in STD_LOGIC;
Y: out STD_LOGIC);
end component;
component ANDGATE is
Port ( A,B: in STD_LOGIC;
Y: out STD_LOGIC);
end component;
begin
x1: XORGATE port map(A,B,SUM);
x2: ANDGATE port map(A,B,CARRY);
end Structural;
SIMULATION OUTPUT:
2. VHDL PROGRAM FOR HALF-SUBTRACTOR USING X-OR GATE AND AND GATE
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity HALFSUBTRACTOR is
Port ( A,B: in STD_LOGIC;
DIFFERENCE,BARROW: out STD_LOGIC);
end HALFSUBTRACTOR;
architecture Structural of HALFSUBTRACTOR is
component XORGATE is
Port ( A,B: in STD_LOGIC;
Y: out STD_LOGIC);
end component;
428 FUNDAMENTALS OF DIGITAL CIRCUITS
component ANDGATE is
Port ( A,B: in STD_LOGIC;
Y: out STD_LOGIC);
end component;
component NOTGATE is
Port ( A : in STD_LOGIC;
Y : out STD_LOGIC);
end component;
signal abar:STD_LOGIC;
begin
x1: XORGATE port map(A,B,DIFFERENCE);
x2: NOTGATE port map(A,abar);
x3: ANDGATE port map(abar,B,BARROW);
end Structural;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
430 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
COMBINATIONAL LOGIC DESIGN 431
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
end ENCODER8X3;
architecture Behavioral of ENCODER8X3 is
begin
process(D)
begin
if(D=”10000000") then Y<=”111";
elsif (D=”01000000") then Y<=”110";
elsif (D=”00100000") then Y<=”101";
elsif (D=”00010000") then Y<=”100";
elsif (D=”00001000") then Y<=”011";
elsif (D=”00000100") then Y<=”010";
elsif (D=”00000010") then Y<=”001";
elsif (D=”00000001") then Y<=”000";
else Y<=”XXX”;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
end if;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
entity PRIORITYENCODER8X3 is
Port ( D : in STD_LOGIC_VECTOR (7 downto 0);
Y : out STD_LOGIC_VECTOR (2 downto 0));
end PRIORITYENCODER8X3;
architecture Behavioral of PRIORITYENCODER8X3 is
begin
process(D)
begin
if (D(7)=’1') then Y<=”111";
elsif (D(6)=’1') then Y<=”110";
elsif (D(5)=’1') then Y<=”101";
elsif (D(4)=’1') then Y<=”100";
elsif (D(3)=’1') then Y<=”011";
elsif (D(2)=’1') then Y<=”010";
elsif (D(1)=’1') then Y<=”001";
elsif (D(0)=’1') then Y<=”000";
else Y<=”XXX”;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
438 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity DEMUX1X4 is
Port ( D : in STD_LOGIC;
S : in STD_LOGIC_VECTOR (1 downto 0);
Z : out STD_LOGIC_VECTOR (3 downto 0));
end DEMUX1X4;
architecture Behavioral of DEMUX1X4 is
begin
process(D,S)
begin
if (S=”00") then Z<=”000" & D;
elsif (S=”01") then Z<=”00" & D & ‘0’;
elsif (S=”10") then Z<=’0' & D & “00”;
elsif (S=”11") then Z<=D & “000”;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
SIMULATION OUTPUT:
entity Seven_Segment_Display is
port (
clk : in std_logic;
bcd : in std_logic_vector(3 downto 0);
segment : out std_logic_vector(6 downto 0) );
end Seven_Segment_Display;
architecture Behavioral of Seven_Segment_Display is
begin
process (clk,bcd)
begin
if (clk’event and clk=’1') then
case bcd is
when “0000”=> segment <=”0000001"; — ‘0’
when “0001”=> segment <=”1001111"; — ‘1’
when “0010”=> segment <=”0010010"; — ‘2’
when “0011”=> segment <=”0000110"; — ‘3’
when “0100”=> segment <=”1001100"; — ‘4’
when “0101”=> segment <=”0100100"; — ‘5’
when “0110”=> segment <=”0100000"; — ‘6’
when “0111”=> segment <=”0001111"; — ‘7’
when “1000”=> segment <=”0000000"; — ‘8’
when “1001”=> segment <=”0000100"; — ‘9’
COMBINATIONAL LOGIC DESIGN 441
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR HALF-ADDER USING DATA FLOW MODELING
module Half_Adder(input a,b,output s,c );
assign s = a ^ b;
assign c = a & b;
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
446 FUNDAMENTALS OF DIGITAL CIRCUITS
end
end
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
448 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
decoder_2x4 d5 (w[1:0],y[12:15],m[3]);
decoder_2x4 d6 (w[3:2],m[0:3],en);
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
16. VERILOG PROGRAM FOR 4:1 MULTIPLEXER USING DATA FLOW MODELING
module mux(s, i, y);
input [1 : 0]s;
input [3 : 0]i;
output y;
wire s0bar, s1bar, p, q, r, t;
assign s0bar = ~ s[0];
assign s1bar = ~ s[1];
assign p= s0bar & s1bar &i[0];
assign q= s[0] & s1bar &i[1];
assign r= s0bar & s[1] &i[2];
assign t= s[0] & s[1] &i[3];
assign y = p | q | r | t;
endmodule
SIMULATION OUTPUT:
454 FUNDAMENTALS OF DIGITAL CIRCUITS
always @(*)
begin
case ({sel0,sel1})
2’b00 : y = i0;
2’b01 : y = i1;
2’b10 : y = i2;
2’b11 : y = i3;
endcase
end
endmodule
SIMULATION OUTPUT:
input i7;
input [2:0] sel;
output y;
reg y;
always@(sel,i0,i1,i2,i3,i4,i5,i6,i7)
begin
case (sel)
3’b000 : y <= i0;
3’b001 : y <= i1;
3’b010 : y <= i2;
3’b011 : y <= i3;
3’b100 : y <= i4;
3’b101 : y <= i5;
3’b110 : y <= i6;
3’b111 : y <= i7;
endcase
end
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
output op;
wire [0:1] s;
mux41 m11 (ip[0:3], sel[1:0], s[0]);
mux41 m12 (ip[4:7], sel[1:0], s[1]);
mux21 m13 (s[0],s[1],sel[2], op);
endmodule
SIMULATION OUTPUT:
output op;
wire [0:3] s;
mux41 m11 (ip[0:3], sel[1:0], s[0]);
mux41 m12 (ip[4:7], sel[1:0], s[1]);
mux41 m13 (ip[8:11], sel[1:0], s[2]);
mux41 m14 (ip[12:15], sel[1:0], s[3]);
mux41 m15 (s, sel[3:2], op);
endmodule
SIMULATION OUTPUT:
output a ;
output b ;
output c ;
output d ;
input din ;
input x ;
input y ;
endmodule
COMBINATIONAL LOGIC DESIGN 459
SIMULATION OUTPUT:
8.1 INTRODUCTION
Logic designers have a wide range of standard ICs available to them with numerous logic functions
and logic circuit arrangements on a chip. In addition, these ICs are available from many
manufacturers and at a reasonably low cost. For these reasons, designers have been interconnecting
standard ICs to form an almost endless variety of different circuits and systems. Standard ICs (for
example, Multiplexers, demultiplexers, decoders, encoders, adders, code converters, comparators,
parity generators/checkers, ALUs, etc.) are also called fixed function ICs because each one of
them performs a fixed digital operation.
However, there are some problems with circuit and system designs that use only standard
ICs. Some system designs might require hundreds or thousands of these ICs.
Some of the disadvantages of this method are as follows:
1. Large board space requirements
2. Large power requirements
3. Lack of security
4. Additional cost, space, power requirements, etc. required to modify the design or to
introduce more features
Usually the designs are too complex to be implemented using fixed function ICs.
To overcome the disadvantages of fixed-function ICs, application specific integrated circuits
(ASICs) have been developed. The ASICs are designed by the users to meet the specific requirements
of a circuit and are produced by an IC manufacturer as per the specifications supplied by the user.
460
PROGRAMMABLE LOGIC DEVICES 461
Consider, for example, a 32 × 8 ROM. The unit consists of 32 words of 8 bits each. There are
five input lines that form the binary numbers from 0 through 31 for the address. Figure 8.2 shows
the internal logic construction of the ROM. The five inputs are decoded into 32 distinct outputs by
means of a 5 × 32 decoder. ROM is basically a decoder with k inputs and 2k output lines followed
by a bank of OR gates. Each output of the decoder represents a memory address. It represents a
PROGRAMMABLE LOGIC DEVICES 463
minterm of input variables. The 32 outputs of the decoder are connected to each of the 8 OR gates.
The diagram shows the array logic convention used in complex circuits. Each OR gate must be
considered as having 32 inputs. Each output of the decoder is connected to one of the inputs of
each OR gate. Since each OR gate has 32 input connections and there are 8 OR gates, the ROM
contains 32 × 8 = 256 internal connections. In general, a 2k × n ROM will have an internal k × 2k
decoder and n OR gates. Each OR gate has 2k inputs, which are connected to each of the outputs of
the decoder.
The 256 intersections in Figure 8.2 are programmable. A programmable connection between
two lines is logically equivalent to a switch that can be altered to either be close (meaning that
the two lines are connected) or open (meaning that the two lines are disconnected). The
programmable intersection between two lines is sometimes called a cross point. Various physical
devices are used to implement cross point switches. One of the simplest technologies employs a
fuse that normally connects the two points, but is opened or ‘blown’ by applying a high voltage
pulse into the fuse.
The internal binary storage of a ROM is specified by a truth table that shows the word
content in each address. For example, the content of a 32 × 8 ROM may be specified with a truth
table similar to the one shown in Table 8.1. The truth table shows the five inputs under which are
listed all 32 addresses. At each address, there is stored a word of 8 bits, which is listed under the
outputs columns. That table shows only the first four and the last four words in the ROM. The
complete table must include the list of all 32 words.
The hardware procedure that programs the ROM results in blowing fuse links according to
a given truth table. For example, programming the ROM according to the truth table given by
Table 8.1 results in the configuration shown in Figure 8.3. Every 0 listed in the truth table
specifies a no connection and every 1 listed specifies a path that is obtained by a connection. For
example, the table specifies the 8-bit word 10110010 for permanent storage at address 3. The
464 FUNDAMENTALS OF DIGITAL CIRCUITS
four 0s in the word are programmed by blowing the fuse links between output 3 of the decoder
and the inputs of the OR gates associated with outputs A6, A3, A2 and A0. The four 1s in the
word are marked in the diagram with a × to denote a connection in place of a dot used for
permanent connection in logic diagrams. When the input of the ROM is 00011, all the outputs
of the decoder are 0 except for output 3, which is at logic 1. The signal equivalent to logic 1 at
decoder output 3 propagates through the connections to the OR gate outputs of A7, A5, A4 and
A1. The other four outputs remain at 0. The result is that the stored word 10110010 is applied to
the eight data outputs.
Inputs Outputs
I4 I3 I2 I1 I0 A7 A6 A5 A4 A3 A2 A1 A0
0 0 0 0 0 1 0 1 1 0 1 1 0
0 0 0 0 1 0 0 0 1 1 1 0 1
0 0 0 1 0 1 1 0 0 0 1 0 1
0 0 0 1 1 1 0 1 1 0 0 1 0
. .
. .
. .
1 1 1 0 0 0 0 0 0 1 0 0 1
1 1 1 0 1 1 1 1 0 0 0 1 0
1 1 1 1 0 0 1 0 0 1 0 1 0
1 1 1 1 1 0 0 1 1 0 0 1 1
EXAMPLE 8.2 Give the logic implementation of a 32 × 4 bit ROM using a decoder of a
suitable size.
Solution
A 32 × 4 bit ROM is to be implemented. It consists of 32 words of four bits each. There must
be five input lines that form the binary numbers from 0 through 31 for the address. The five
inputs are decoded into 32 distinct outputs by means of a 5 × 32 decoder. Each output of the
decoder represents a memory address. The 32 outputs of the decoder are connected to each
of the four OR gates. Figure 8.5 shows the logic implementation of the 32 × 4 ROM using a
5 × 32 decoder.
EXAMPLE 8.3 Give the logic implementation of a 8 × 4 bit ROM using a decoder of a
suitable size.
Solution
An 8 × 4 bit ROM is to be implemented. It consists of eight words of four bits each. There
must be three input lines that form the binary numbers from 0 through 7 for the address. The
three inputs are decoded into 8 distinct outputs by means of a 3 × 8 decoder. Each output of
the decoder represents a memory address. The eight outputs of the decoder are connected to
each of the four OR gates. Figure 8.6 shows the logic implementation of the 8 × 4 ROM
using a 3 × 8 decoder.
PROGRAMMABLE LOGIC DEVICES 467
In this type of read-only memory, the user specifies the data to be stored to the manufacturer of the
memory. The data pattern specified by the user are programmed as a part of the fabrication process.
468 FUNDAMENTALS OF DIGITAL CIRCUITS
Once programmed, the data pattern can never be changed. This type of read-only memory is
referred to as ROM. ROMs are highly suited for very high volume usage due to their low cost.
Programmable read-only memory (PROM)
This type of memory comes from the manufacturer without any data stored in it, i.e. empty. The
data pattern is programmed electrically by the user using a special circuit known as PROM
programmer. It can be programmed only once during its life time. Once programmed, the data
cannot be altered. This type of memory is known as PROM. These are highly suited for high
volume usage due to their low cost of production.
Erasable programmable read-only memory (EPROM)
In this type of memory, data can be written any number of times, i.e. they are reprogrammable.
Before it is reprogrammed, the contents already stored are erased by exposing the chip to ultraviolet
radiation for about 30 minutes. This type of memory is referred to as EPROM. EPROMs are
possible only in MOS technology. Programming is done using a PROM programmer.
Electrically erasable and programmable read-only memory (EEPROM or E2PROM)
This is another type of reprogrammable memory in which erasing is done electrically rather than
exposing the chip to the ultraviolet radiation. It is referred to as EEPROM or electrically alterable
ROM (EAROM).
array and a fixed OR array. The most flexible PLD is the programmable logic array (PLA) where
both the AND and OR arrays can be programmed. The product terms in the AND array may be
shared by any OR gate to provide the required sum of products implementation.
Figure 8.9a shows a conventional means for abbreviating PAL connection diagrams. Note
that the AND gate is drawn with a single input line, whereas in reality, it has three inputs. The
vertical lines denote the inputs and the horizontal lines feed the AND gates. An × sign denotes a
connection through an intact fusible link and a dot sign represents a permanent connection. The
470 FUNDAMENTALS OF DIGITAL CIRCUITS
absence of any symbol represents an open or no connection by virtue of a burned-open link. In the
example shown, input A is connected to the gate through a fusible link, input C is permanently
connected, and input B is disconnected. Therefore, the output of the gate is AC.
Figure 8.9b shows an example of how the PAL structure is represented using the abbreviated
connections. It is a 3-input 3-wide AND-OR structure. In this example, each function can have
three minterms or product terms. Notice that there are nine AND gates, which implies only nine
chosen products of not more than three variables ABC. Inputs to the OR gates at the outputs are
fixed as shown by ×s marked on the vertical lines. The inputs to the AND gates are marked on the
corresponding line by the ×s. Removing the × implies blowing off the corresponding fuse which in
turn implies that the corresponding input variable is not applied to the particular AND gate. In this
example, the circuit is unprogrammed because all the fusible links are intact. Note that, the 3-input
OR gates in Figure 8.9c are also drawn with a single input line.
EXAMPLE 8.4 Using the connection abbreviations, redraw the circuit in Figure 8.9c to
show how it can be programmed to implement F1 = ABC + A C + A BC and F2 = A B C + BC.
Solution
The redrawn circuit to implement the given functions is shown in Figure 8.10a. Note that
one unused AND gate has all its links intact. All links intact can be represented by a × in the
AND gate as shown in Figure 8.10b. Such a diagram is sometimes called the fuse map.
An example of an actual PAL IC is the PAL 18L8A from Texas Instruments. It is manufactured
using low power Schottky technology and has ten logic inputs and eight output functions. Each
output OR gate is hard-wired to seven AND gate outputs and therefore it can generate functions
that include up to seven terms. An added feature of this particular PAL is that six of the eight
outputs are fed back into AND array, where they can be connected as inputs to any AND gate.
This makes the device very useful in generating all sorts of combinational logic.
the required paths between inputs and AND gates. The third column specifies the outputs of the
OR gates. For each product term the inputs are marked with 1, 0, or – (dash). If a variable in the
product term appears in its true form, the corresponding input variable is marked with a 1. If it
appears in complemented form, the corresponding input variable is marked with a 0. If the variable
is absent in the product term, it is marked as a – (dash).
The paths between the inputs and the AND gates are specified under the column heading
inputs in the programming table. A 1 in the input column specifies a connection from the input
variable to the AND gate. A 0 in the input column specifies a connection from the complement of the
variable to the input of the AND gate. A dash specifies a blown fuse in both the input variable and its
complement. It is assumed that a open terminal in the input of an AND gate behaves like a 1.
The outputs of the OR gates are specified under the column heading outputs. The size of a
PAL is specified by the number of inputs, the number of product terms, and the number of outputs.
For n inputs, k product terms, and m outputs the internal logic of the PAL consists of n buffer
inverter gates, k AND gates, and m OR gates.
When designing a digital system with a PAL, there is no need to show the internal connections
of the unit. All that is needed is a PAL programming table from which the PAL can be programmed
to supply the required logic. When implementing a combinational circuit with a PAL, careful
investigation must be undertaken in order to reduce the number of distinct product terms. Since a
PAL has a finite number of AND gates, this can be done by simplifying each Boolean function to
a minimum number of terms.
EXAMPLE 8.5 Implement the following Boolean functions using PAL with four inputs
and 3-wide AND-OR structure. Also write the PAL programming table.
F1(A, B, C, D) = S m(2, 12, 13)
F2(A, B, C, D) = S m(7, 8, 9, 10, 11, 12, 13, 14, 15)
F3(A, B, C, D) = S m(0, 2, 3, 4, 5, 6, 7, 8, 10, 11, 15)
F4(A, B, C, D) = S m(1, 2, 8, 12, 13).
Solution
The K-maps for the above expressions, their minimization and the minimal expressions
obtained from them are shown in Figure 8.11. Note that the function for F4 has four product
terms. The logical sum of two of these terms is equal to F1. By using F1 it is possible to
reduce the number of terms for F4 from four to three. The implementation of the minimal
logic expressions using PAL is shown in Figure 8.12b.
The programming table that specifies the PAL of Figure 8.12b is listed in Figure 8.12a.
Since the given problem has four outputs the table is divided into four sections with three product
terms in each to conform with the PAL of Figure 8.9b. The first two sections need only two
product terms to implement the Boolean function. The last section for output F4 needs four
product terms. Using the output from F1 we can reduce the function into a function with three
terms.
The fuse map for the PAL as specified in the programming table is shown in Figure 8.12b.
For each 1 or 0 in the table, we mark the corresponding intersection in the diagram with the
symbol for an intact fuse. For each dash, we mark the diagram with blown fuses in both the true
and complement inputs. If the AND gate is not used, we leave all its input fuses intact. Since the
corresponding input receives both the true and the complement of each input variable, we have
A A = 0 and the output of the AND gate is always 0. Usually a × inside the AND gate is used to
indicate that all its input fuses are intact.
EXAMPLE 8.6 Realize the following functions using a PAL with four inputs and 3-wide
AND-OR structure. Also write the PAL programming table.
F1(A, B, C, D) = S m(6, 8, 9, 12–15) F2(A, B, C, D) = S m(1, 4–7, 10–13)
F3(A, B, C, D) = S m(4–7, 10–11) F4(A, B, C, D) = S m(4–7, 9–15)
Solution
The first step in the realization is to obtain the minimal sum of products form of all the given
functions. The K-maps for the given functions, their minimization, and the minimal SOP
expressions obtained from them are shown in Figure 8.13.
Each section in the PAL comprises three AND gates feeding the given OR gate. There are
four such sections. Notice that F2 has four product terms but the given PAL device has
provision for three products only as inputs to OR gates. So some manipulation becomes
necessary. Observe that out of four terms two of the terms of F2 are equal to F3 itself. So F2
PROGRAMMABLE LOGIC DEVICES 475
can be written as the sum of F3 and the remaining two terms. The PAL programming table is
shown in Figure 8.14a. The actual realization is shown in Figure 8.14b.
table is used by the vender to produce a user made PLA that has the required internal paths between
inputs and outputs. A second type of PLA available is called a field programmable logic array or
FPLA. The FPLA can be programmed by the user by means of certain recommended procedures.
FPLAs can be programmed with commercially available programmer units.
EXAMPLE 8.7 Show how the PLA circuit in Figure 8.15 would be programmed to
implement the sum and carry outputs of a full adder.
Solution
The truth table of a full-adder is shown in Figure 8.16a . Drawing the K-maps for the sum
and carry-out terms and minimizing them, the minimal expressions for the sum and carry-out
terms are:
The sum is
S = A BCin + AB Cin + A B Cin + ABCin
478 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 8.8 Show how the PLA circuit in Figure 8.15 can be programmed to implement
the 3-bit binary-to-gray conversion.
Solution
The conversion table of 3-bit binary (B3, B2, B1)-to-gray (G3, G2, G1) is shown in Figure 8.17a.
From the conversion table we observe that the expressions for the outputs are:
G3 = S m(4, 5, 6, 7)
G2 = S m(2, 3, 4, 5)
G1 = S m(1, 2, 5, 6)
Drawing the K-maps for the Gray code outputs G3, G2, and G1 in terms of binary inputs B3,
B2, B1 and minimizing them as shown in Figure 8.17b, the minimal expressions for G3, G2,
and G1 are:
G3 = B3
G2 = B3 B2 + B3B2
G1 = B2 B1 + B2B1
The programming of the PLA circuit to implement the conversion is shown in Figure 8.17c.
The product term generated in each AND gate is listed along the output of the gate in the
diagram. The product term is determined from the inputs whose cross points are connected and
marked with a ×. The output of an OR gate gives the logic sum of the selected product terms. The
output may be complemented or left in its true form depending on the connection for one of the
X-OR gate inputs. A PLD with a programmable polarity feature is shown in Figure 8.18.
Figure 8.17 Example 8.8: Use of PLA as a 3-bit binary-to-Gray code converter (Contd.)
480 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 8.17 Example 8.8: Use of PLA as a 3-bit binary-to-Gray code converter.
EXAMPLE 8.9 Implement the following two Boolean functions with a PLA:
F1(A, B, C) = S m(0, 1, 2, 4)
F2(A, B, C) = S m(0, 5, 6, 7)
Solution
The K-maps for the functions F1 and F2, their minimization, and the minimal expressions for
both the true and complement forms of those in sum of products are shown in Figure 8.20.
For finding the minimal in true form, consider the 1s on the map and for finding the minimal
in complement form consider the 0s on the map.
Considering the 1s of F1
F1(T) = A C + B C + A B
Considering the 0s of F1
F1 = AB + AC + BC
Therefore,
F1(C) = (AB + AC + BC)
Considering the 1s of F2
F2(T) = A B C + AB + AC
PROGRAMMABLE LOGIC DEVICES 483
Considering the 0s of F2
F2 = A B C + AB + AC
Therefore,
F2(C) = ABC + AB + AC
Out of F1(T), F1(C), F2(T), F2(C), the combination that gives the minimum number of product
terms is
F1(C) = (AB + AC + BC)
F2(T) = AB + AC + A B C
This gives four distinct terms: AB, AC, and BC and A B C. The PLA programming table for
this combination is shown in Figure 8.21a. The implementation using a PLA is shown in
Figure 8.21b.
F1 is the true output even though a C is marked over it in the table. This is because F1 is
generated with an AND-OR circuit and is available at the output of the OR gate. The X-OR
gate complements the function to produce the true F1 output.
Figure 8.21 Example 8.9: Programming table and fuse map (Contd.)
484 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 8.10 Write the program table to implement a BCD to XS-3 code conversion
using a PLA.
Solution
The BCD to XS-3 code conversion table and the expressions for the XS-3 outputs are shown
in Figure 8.22.
Figure 8.22 Example 8.10: Conversion table and expressions for outputs.
To write the PLA program table, obtain the true and complement form of the minimal
expressions for outputs using K-maps as shown in Figure 8.23. For true form consider the 1s on
the K-maps, and for complement form consider the 0s on the K-maps and obtain the expressions in
SOP form in both cases.
PROGRAMMABLE LOGIC DEVICES 485
Observing the expressions in true and complement form for E0, E1, E2 and E3, we notice that
two terms in E2(C) and E3(T) are common. So minimal combinations are as follows:
EXAMPLE 8.11 Tabulate the PLA programming table for the four Boolean functions
listed below.
A(x, y, z) = S m(1, 2, 4, 6) B(x, y, z) = S m( 0, 1, 6, 7)
C(x, y, z) = S m(2, 6) D(x, y, z) = S m(1, 2, 3, 5, 7)
Solution
The K-maps for the functions A, B, C and D, their minimization, and the minimal expressions
for both the true and complement of those in sum of products are shown in Figure 8.25.
PROGRAMMABLE LOGIC DEVICES 487
Observing the expressions in true and complement form for A, B, C and D, we notice that the
combination that gives a minimum number of product terms is:
A(T) = x z + y z + x y z B(T) = x y + xy C(T) = y z D(C) = xz + y z
This gives 6 distinct terms: x z , y z , x yz, x y, xy, y z .
The PLA programming table and the fuse map for this combination are shown in
Figure 8.26.
488 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 8.12 Give the PLA realization of the following functions using a PLA with
5 inputs, 4 outputs and 8 AND gates:
f1(A, B, C, D, E) = S m(0, 1, 2, 3, 11, 12, 13, 14, 15, 16, 17, 18, 19, 27, 28, 29, 30, 31)
f2(A, B, C, D, E) = S m(4, 5, 6, 7, 8, 9, 10, 11, 20, 21, 22, 23, 30)
Solution
Drawing the 5-variable K-maps for f1 and f2 and simplifying them as shown in Figure 8.27,
the minimal expressions for f1 and f2 are:
f1(A, B, C, D, E) = B C + BC + BDE
f2(A, B, C, D, E) = BC + AB C + ACD E
PROGRAMMABLE LOGIC DEVICES 489
The realization of the minimal expressions using a PLA with 5 inputs, 4 outputs and 8 AND
gates is shown in Figure 8.28.
EXAMPLE 8.13 Show how an 8 × 1 PROM can be programmed to implement the logic
function whose truth table is shown in Figure 8.29a.
Solution
From the truth table shown in Figure 8.29a, we observe that the logic function is
F = S m(2, 3, 5, 7) = AB C + ABC + A BC + ABC
No simplification of the expression is to be done for realization with a PROM. Eight AND
gates (one for each minterm) and one OR gate (to obtain the SOP form of the single output) are
required for its implementation. Figure 8.29c shows the programmed PROM in the simplified
connection format of a PLA. To realize F, address lines 2, 3, 5 and 7 are connected to F. Logic 1 or
a 0 is stored at every address combination corresponding to a combination of the input variables
for which the function equals a 1 or a 0. An 8 × 1 PROM means a PROM with 8 address lines and
one output. So a 3 × 8 decoder is required as shown in Figure 8.29b.
PROGRAMMABLE LOGIC DEVICES 491
Solution
Since F1 and F2 are functions of two variables A1 and A0, a small PROM of size 4 × 2 is
required. A 4 × 2 PROM means a PROM with 4 address lines and two outputs. 4 address
lines means two inputs. So a decoder of size 2 × 4 is required. F1 has two 1s and two 0s
whereas F2 has three 1s and one 0. To realize F1, address lines 0 and 2 are connected to the
output line F1 and to realize F2, the address lines 0, 1, and 3 are connected to the output line
F2. Since the PROM has fixed AND gates no minimization is required. The realization is
shown in Figure 8.31.
EXAMPLE 8.16 Design a combinational circuit using a PROM. The circuit accepts a
3-bit binary number and generates its equivalent XS-3 code.
Solution
The input is a 3-bit binary number. So the PROM requires a 3 × 8 decoder. It generates the
equivalent XS-3 code (i.e. 4 bits). So it has 4 outputs and requires 4 OR gates. Since the
PROM has fixed AND gates, no minimization is required. Table 8.3 is the truth table for the
combinational circuit.
The realization of the combinational circuit using the PROM is shown in Figure 8.32. To
realize E0, address lines 0, 2, 4 and 6 are connected to the output line E0. To realize E1,
address lines 0, 3, 4 and 7 are connected to the output line E1. To realize E2, address lines
1, 2, 3 and 4 are connected to the output line E2. To realize E3, address lines 5, 6 and 7 are
connected to the output line E3.
PROGRAMMABLE LOGIC DEVICES 493
Inputs Outputs
B2 B1 B0 E3 E2 E1 E0
0 0 0 0 0 1 1
0 0 1 0 1 0 0 E0 = S m(0, 2, 4, 6)
0 1 0 0 1 0 1 E1 = S m(0, 3, 4, 7)
0 1 1 0 1 1 0 E2 = S m(1, 2, 3, 4)
1 0 0 0 1 1 1 E3 = S m(5, 6, 7)
1 0 1 1 0 0 0
1 1 0 1 0 0 1
1 1 1 1 0 1 0
The PROM can generate any possible logic function of the input variables because it generates
every possible AND product term. In general, any application that requires every input combination
to be available is a good candidate for a PROM. However, PROMs become impractical when a
large number of input variables have to be accommodated, because the number of fuses doubles
for each added input variable.
The advantages of using a PROM as a PLD are as follows:
1. Ease of design since no simplification or minimization of logic function is required.
2. Design can be changed, modified rapidly.
3. It is usually faster than discrete SSI/MSI circuit.
4. Cost is reduced.
There are also few disadvantages of ROM-based circuits such as non-utilization of complete
circuit, increase of power requirement and enormous increase in size with increase in the number
of input variables making it impractical.
494 FUNDAMENTALS OF DIGITAL CIRCUITS
8.10 PROGRAMMING
When PLDs were first introduced, the logic designer would develop a fuse map that showed which
fuses to blow. The manufacturer would then program the device according to the fuse map, test it,
and return it the designer. In recent years, the availability of relatively inexpensive programming
equipment has made it convenient for users to program their own PLDs. There are universal
programmers in the market that can program the most common PROMs, PALs, and FPLAs. The
device to be programmed is plugged into a socket on the programmer and the programmer programs
and tests the device according to data that have been supplied by the user.
The programming and test data are typically developed by using the commonly available
software that will run on standard PCs. Using this software, the user enters the data into the computer
describing the logic functions to be programmed into the PLD, as well as information on how the
device is to be tested. The software then generates a fuse map and the test data in a form that can
be sent over a cable to the PLD programmer’s memory. Once the programmer has the data, he can
proceed to program and test the device. When finished, the programmer will indicate whether the
device has passed or failed the test procedure. If it passes, it can be removed from the programmer’s
socket and placed in the prototype circuit for further testing.
Erasable PLDs
The PLDs we have been talking about are programmed by blowing fuses. Once a fuse is blown, it
cannot be reconnected. Thus, if you make a mistake in programming or if you want to change the
design, the device will no longer be useful. This drawback has been addressed by several
manufacturers who have developed PLDs that can be erased and programmed over and over.
These are called erasable programmable logic devices (EPLDs). These devices are programmed
and erased much like EPROMs and EEPROMs.
PROGRAMMABLE LOGIC DEVICES 495
1. What is a PLD?
A. A PLD (programmable logic device) is an IC that contains a large number of gates, flip-flops and
registers that are interconnected on the chip. Many of the connections, however, are fusible links
which can be broken.
2. What is the principal advantage of a PLD?
A. The principal advantage of PLDs is that in many applications, they can replace a number of other
circuits.
3. What is programming?
A. The fuse blowing process is called programming.
4. What are the advantages of PLDs over fixed function ICs?
A. The advantages of PLDs over fixed function ICs are:
(a) Low development cost (b) Less space requirement
(c) Less power requirement (d) High reliability
(e) Easy circuit testing (f) Easy design modification
(g) High design security (h) Less design time
5. What is a ROM?
A. A ROM (Read Only Memory) is essentially a memory device in which permanent information is
stored. Data can only be read from it.
6. What are the technologies used for the fabrication of ROMs.
A. MROMs and PROMs can be fabricated using bipolar or MOS technology but EPROMs and
EEPROMs are possible only with MOS technology.
7. How is the memory size specified?
A. The memory size is specified as M × N bits where M is the number of locations and N is the
number of bits in each location.
8. Is there no provision of entering information in the read only memory? If no what can be read
from the memory and if yes why it is called as read only memory.
A. There is a provision of entering information in ROM. This process is known as programming. In
case of programmable ROMs, the ROM is removed from the circuit and is programmed using a
PROM programmer. In the case of non-programmable ROM, the information is entered as a part
of the fabrication process itself. Because of the requirement of programming it is known as read
only memory.
9. A memory has 16-bit address bus. How many locations are there in this?
A. The number of memory locations in a memory with 16-bit address bus = 216 = 65,536 = 64 K.
10. What for is the letter ‘K’ used in memories?
A. Digital systems operate on binary numbers and 210 = 1024 is represented by 1K.
11. What happens to the information stored in memory location after it has been read?
A. The reading operation is non-destructive, which means the stored information remains intact
after it has been read and can be read any number of times.
12. Explain the programming of ROM.
A. A ROM is programmed at the time of manufacturing. The information to be entered is supplied
by the user. The contents of this are fixed at the time of its fabrication and these can never be
changed. That means it cannot be erased.
496 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTION
22. An EPROM
(a) is of random-access type (b) is non volatile
(c) is programmable (d) has all of the above requirements
23. A mask programmed ROM is
(a) programmed at the time of fabrication (b) programmed by the user
(c) erasable and programmable (d) erasable electrically
24. A PROM
(a) is mask programmed (b) is erasable by ultraviolet light
(c) can be programmed only once (d) can be programmed any number of times
25. The process of entering information in EPROM is commonly known as
(a) writing (b) programming (c) storing (d) none of the above
26. The term ‘programming’ as used in connection with EPROMs is
(a) the same as that used for computers
(b) the same as that used for microcomputers
(c) the same as that used for mP based systems
(d) none of the above
27. An EPROM is
(a) non erasable (b) volatile
(c) programmable and erasable (d) erasable but not programmable
28. An EPROM is fabricated using
(a) TTL bipolar technology (b) MOS technology
(c) ECL bipolar technology (d) I2 L bipolar technology
29. A function table is required in very large numbers. The memory most suitable for this purpose
would be
(a) ROM (b) PROM (c) EPROM (d) EAROM
30. When the power supply of a ROM is switched off, its contents
(a) become all zeros (b) become all ones (c) remain intact (d) are unpredictable
31. A PLA is
(a) mask programmable (b) field programmable
(c) can be programmed by a user (d) can be erased and programmed
32. A FPLA can
(a) not be programmed by a user (b) can be programmed by a user only once
(c) can be erased by a user
(d) can be programmed any number of times by a user
33. The capacity of a PLA is specified in terms of the
(a) number of inputs only
(b) number of outputs only
(c) number of inputs and outputs only
(d) number of inputs, product terms and outputs
34. A PLA is
(a) an LSI device (b) an MSI device (c) an SSI device (d) a discrete device
502 FUNDAMENTALS OF DIGITAL CIRCUITS
PROBLEMS
8.1 Design a BCD-to-XS-3 code converter using a (a) PROM, (b) PLA and (c) PAL.
8.2 Design an XS-3-to-BCD code converter using a (a) PROM, (b) PLA and (c) PAL.
8.3 Implement the following Boolean functions using PLA:
f1(A, B, C) = S m( 0, 1, 3, 5), f2(A, B, C) = S m( 0, 3, 5, 7)
8.4 Implement the following Boolean functions using PAL:
f1(w, x, y, z) = S m(0, 2, 5, 7, 8, 10, 12, 13)
f2(w, x, y, z) = S m(0, 2, 6, 8, 9, 14, 15)
f3(w, x, y, z) = S m(0, 8, 14, 15)
f4(w, x, y, z) = S m(0, 1, 2, 4, 5, 8, 9, 10)
8.5 Tabulate the PLA programming table for the four Boolean functions listed below.
f1(A, B, C) = S m(0, 1, 2, 4, 6)
f2(A, B, C) = S m(0, 2, 6, 7)
f3(A, B, C) = S m(3, 6)
f4(A, B, C) = S m(1, 3, 5, 7)
PROGRAMMABLE LOGIC DEVICES 503
VHDL PROGRAMS
SIMULATION OUTPUT:
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity rom8x4 is
port ( a : in std_logic_vector (2 downto 0);
b : out std_logic_vector (3 downto 0));
end rom8x4;
architecture structural of rom8x4 is
component decoder3x8 is
port ( i : in std_logic_vector (2 downto 0);
y : out std_logic_vector (7 downto 0));
end component;
component orgate_3 is
port ( a,b,c: in std_logic;
y: out std_logic);
end component;
component orgate is
port ( a,b : in std_logic;
y : out std_logic);
end component;
signal y:std_logic_vector(7 downto 0);
begin
x1:decoder3x8 port map (a,y);
x2:orgate port map(y(2),y(6),b(0));
x3:orgate port map(y(3),y(5),b(1));
x4:orgate_3 port map(y(4),y(5),y(7),b(2));
x5:orgate port map(y(6),y(7),b(3));
end structural;
VHDL PROGRAM FOR DECODER3:8
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity decoder3x8 is
port ( i : in std_logic_vector (2 downto 0);
y : out std_logic_vector (7 downto 0));
end decoder3x8;
architecture behavioral of decoder3x8 is
begin
process(i)
begin
if (i=“000”) then y<=“00000001”;
elsif (i=“001”) then y<=“00000010”;
506 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
PROGRAMMABLE LOGIC DEVICES 507
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR 4:16 ROM USING BEHAVIORAL MODELING
module ROM (clk, en, addr, data);
input clk,en;
input [4:0] addr;
output reg [3:0] data;
always @(posedge clk)begin
if (en)
case(addr)
5’b00000: data = 4’b0110;
5’b00001: data = 4’b1010;
5’b00010: data = 4’b1110;
5’b00011: data = 4’b0110;
5’b00100: data = 4’b1111;
5’b00101: data = 4’b1010;
5’b00110: data = 4’b1100;
5’b00111: data = 4’b0000;
5’b01000: data = 4’b1011;
5’b01001: data = 4’b0010;
5’b01010: data = 4’b1110;
5’b01011: data = 4’b0010;
5’b01100: data = 4’b0100;
5’b01101: data = 4’b1010;
5’b01110: data = 4’b1100;
5’b01111: data = 4’b0110;
default: data = 4’b0000;
endcase
end
endmodule
SIMULATION OUTPUT:
508 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
input [3:0] a;
output reg [7:0] y;
reg [3:0] data;
always @(posedge clk)begin
if (en)
case(a)
4’b0001: data = 4’b0001;
4’b0010: data = 4’b0010;
4’b0011: data = 4’b0011;
4’b0100: data = 4’b0100;
4’b0101: data = 4’b0101;
4’b0110: data = 4’b0110;
4’b0111: data = 4’b0111;
4’b1000: data = 4’b1000;
4’b1001: data = 4’b1001;
4’b1010: data = 4’b1010;
4’b1011: data = 4’b1011;
4’b1100: data = 4’b1100;
4’b1101: data = 4’b1101;
4’b1110: data = 4’b1110;
4’b1111: data = 4’b1111;
default: data = 4’b0000;
endcase
y = data * data;
end
endmodule
SIMULATION OUTPUT:
9
THRESHOLD LOGIC
9.1 INTRODUCTION
In the earlier chapters, the techniques of designing various logic circuits using AND, OR and NOT
gates were discussed. Implementation using universal gates such as NAND gates and NOR gates
was also discussed. In this chapter an entirely new concept is presented. The threshold element,
also called the threshold gate (T-gate), is a much more powerful device than any of the conventional
logic gates such as NAND, NOR and others. Complex, large Boolean functions can be realized
using much fewer threshold gates. Frequently a single threshold gate can realize a very complex
function which otherwise might require a large number of conventional gates. Also the
interconnection of components is much simpler than the circuits using gates. Eventhough the
T-gate offers incomparably economical realization, it has not found extensive use with the digital
system designers mainly because of the following limitations.
1. It is very sensitive to parameter variations.
2. It is difficult to fabricate it in IC form.
3. The speed of switching of threshold elements is much lower than that of conventional
gates.
The basic principles of threshold logic are presented in this chapter.
two more parameters. Its parameters are a threshold T and weights w1, w2, …, wn. The weights
w1, w2, …, wn are associated with the input variables x1, x2, …, xn. The value of the threshold (T) and
weights (ws) may be real, finite, positive or negative numbers. The symbol of a threshold element is
shown in Figure 9.1. It is represented by a circle partitioned into two parts, one part represents the
weights and the other represents T. The behaviour of a threshold element is specified by a relationship
between its inputs and output involving the parameters ws and T. It is defined as
n
F(x1, x2, …, xn) = 1, if and only if  wi x i ≥ T,
i =1
otherwise
F(x1, x2, …, xn) = 0
n
Here the sum and product operations are normal arithmetic operations and the sum  wi xi is
i =1
called the weighted sum of the element or gate.
be at logic 1 level. The base to emitter voltage depends on the weighted sum of the inputs determined
by R0 and the input resistors. When this weighted sum equals or exceeds a certain value, the
transistor goes into saturation to make the output logical 0. This is exactly opposite to the definition
of threshold gate. Hence this threshold gate is called a complemented threshold gate. The threshold
is determined by R0 since all resistances have only positive values; this gate is capable of providing
only positive weights. Using magnetic core as a threshold gate, it is possible to realize positive as
well as negative weights depending on the direction of the windings.
EXAMPLE 9.1 Obtain the minimal Boolean expression from the threshold gate shown in
Figure 9.3.
Solution
Figure 9.3 shows the threshold gate with three inputs x1, x2, x3 with weights –2 (w1), 4 (w2),
and 2 (w3) respectively. The value of threshold is 2 (T). Table 9.1 shows the weighted sums
and outputs for all input combinations. For this threshold gate, the weighted sum is
w = w1 x1 + w2 x2 + w3 x3
= (–2) x1 + (4)x2 + (2)x3
= –2x1 + 4x2 + 2x3
The output F is logic 1 for w ≥ 2 and it is logic 0 for w < 2.
From the input-output relation given in Table 9.1, we can see that the Boolean expression for
the output is
F = S m(1, 2, 3, 6, 7)
THRESHOLD LOGIC 515
The K-map for F, its minimization and the minimal expression obtained from it are shown in
Figure 9.4.
Figure 9.5 Threshold gate and K-map to show weighted sum figures in cells.
Observe that this gate produces the NULL function. F = 0 if T ≥ 8 because the weighted sum is
less than 8 for every combination of input variables. As the threshold T is gradually decreased to 7,
6, 5, 4, 3, 2, 1, 0 the function realized will contain the minterms as indicated. Eventually if T is further
decreased to (–1) or less, the function will be 1 (called tautology), regardless of the input variables.
516 FUNDAMENTALS OF DIGITAL CIRCUITS
By merely changing the values of resistance, we can change the value of the threshold and
realize different Boolean functions. The weights can also be changed in a similar fashion. It can
therefore be concluded that a large number of functions can be realized using a single T gate. This
capability has to be attributed to the hybrid nature of the T gate having analog weights and threshold
but digital inputs and output. Figure 9.6 illustrates the power of T.
EXAMPLE 9.2 Determine the switching function of the threshold element shown in
Figure 9.7.
Solution
For the given threshold element
w1 = –2 and T = –1
The weighted sum
w = w1 x1 = –2 x1
The input-output relation for this threshold element is shown in Table 9.2.
From the table we observe that the output is the complement of the input. Hence the threshold
gate realizes the NOT gate. The switching function is NOT:
F = x1
EXAMPLE 9.3 Determine the switching function of the threshold element shown in
Figure 9.8.
Solution
For the given threshold element
w1 = 2, w2 = 2, and T = 3
The weighted sum
w = w1 x1 + w2 x2 = 2x1 + 2x2
518 FUNDAMENTALS OF DIGITAL CIRCUITS
The value of the weighted sum is determined for each of the possible input combinations of
x1 and x2 and compared with the value of T and the corresponding value of F is obtained as
shown in Table 9.3.
0 0 0 0
0 1 2 0
1 0 2 0
1 1 4 1
From Table 9.3, we observe that the input-output relation of this threshold element is the
same as the operation of the AND gate. Thus the threshold element realizes the AND operation.
The switching function is AND:
F = x1 · x2
EXAMPLE 9.4 Determine the switching function of the threshold element shown in
Figure 9.9.
Solution
For the given threshold element
w1 = 2, w2 = 2, w3 = 2, and T=2
The weighted sum
w = w1 x1 + w2 x2 + w3 x3 = 2x1 + 2x2 + 2x3
The value of the weighted sum is determined for each of the possible input combinations of
x1, x2 and x3 and compared with the value of T and the corresponding value of F is obtained
as shown in Table 9.4.
THRESHOLD LOGIC 519
0 0 0 0 0
0 0 1 2 1
0 1 0 2 1
0 1 1 4 1
1 0 0 2 1
1 0 1 4 1
1 1 0 4 1
1 1 1 6 1
The table shows that the output is 1 even if one of the inputs is a 1. So the threshold element
realizes a 3-input OR gate. Therefore, the switching function performed by this threshold
gate is OR. The K-map, its minimization and the minimal expression obtained from it are
shown in Figure 9.10.
EXAMPLE 9.5 Determine the switching function of the threshold element shown in
Figure 9.11.
Solution
For the given threshold element
1
w1 = –2, w2 = –2, and T = –2
2
The weighted sum
w = w1x1 + w2x2 = –2x1 – 2x2
520 FUNDAMENTALS OF DIGITAL CIRCUITS
The input-output relation for this threshold element is shown in Table 9.5.
0 0 0 1
0 1 –2 1
1 0 –2 1
1 1 –4 0
From the table we observe that the output is 0 only when all the inputs are 1. Hence the
threshold element realizes a NAND gate. The switching function is NAND:
F = x1 x 2
The K-map for F, its minimization, and the minimal expression obtained from it are shown
in Figure 9.12.
EXAMPLE 9.6 Determine the switching function of the threshold element shown in
Figure 9.13.
Solution
For the given threshold element
1
w1 = –2, w2 = –2, and T = –1
2
The weighted sum
w = w1x1 + w2x2 = –2x1 – 2x2
THRESHOLD LOGIC 521
The input-output relation for this threshold element is shown in Table 9.6.
From the table we observe that the output is 1 only when all the inputs are 0. Hence the
threshold element realizes a NOR gate. The switching function is NOR: F = x1 + x 2 . The K-map
for F, its minimization, and the minimal expression obtained from it are shown in Figure 9.14.
EXAMPLE 9.7 Find the function F(x1, x2, x3, x4) realized by each of the threshold networks
shown in Figures 9.15a, b and c.
Solution
(a) For the given threshold element of Figure 9.15a
1
w1 = –1, w2 = 2, w3 = 2, w4 = –3, and T=–
2
The weighted sum
w = w1x1 + w2x2 + w3x3 + w4x4 = –x1 + 2x2 + 2x3 – 3x4
522 FUNDAMENTALS OF DIGITAL CIRCUITS
The input-output relation for this threshold element is shown in Table 9.7a.
From the table we observe that the Boolean expression for F is F = S m(0, 2, 4, 6, 7, 10, 12,
14, 15).
Drawing a 4-variable K-map for F and minimizing it as shown in Figure 9.16 the minimal
expression for F is
Fmin = x3 x 4 + x2x3 + x2 x 4 + x 1 x 4
THRESHOLD LOGIC 523
EXAMPLE 9.8 Obtain the logic expression for the threshold element shown in Figure 9.19
and determine its equivalent gate circuit.
Implementation of X-OR gate: An X-OR gate cannot be implemented by using single threshold
gate. We know that the logic expression for an X-OR gate is
F(A, B) = AB + A B
The output of the X-OR gate is logic 1 when the input combinations are AB and A B and it is
logic 0 when the input combinations are A B and AB.
Thus, we can write
(AB) -w1 + w2 ≥ T ¸
˝ (–w1 + w2 + w1 – w2) ≥ 2 T, i.e. 0 ≥ T
(AB) w1 - w2 ≥ T ˛
(AB) -w1 - w2 < T ¸ (–w1 – w2 + w1 + w2) < 2 T, i.e. 0 < T
(AB) w1 + w2 < T ˝˛
The above two equations are contradictory; T cannot be greater than or equal to and less
than 0 simultaneously. Therefore, we can say that the function F(A, B) = AB + A B cannot be
realized using only one threshold gate.
528 FUNDAMENTALS OF DIGITAL CIRCUITS
This also shows that every Boolean function cannot be realized by only one threshold gate.
The Boolean function which can be realized by a single threshold gate is called a threshold function.
Implementation of X-OR gate using three threshold gates: Figure 9.22 shows the implementation
of X-OR gate using three threshold gates.
X-OR gate can also be implemented by using three threshold gates by interchanging the
weights of A and B inputs of the gates P and Q as shown in Figure 9.22.
Implementation of X-OR gate using two threshold gates: Figure 9.23 shows the implementation
of X-OR gate using two threshold gates.
Implementation of X-NOR gate: Like X-OR gate, X-NOR gate also cannot be implemented
using single threshold gate. Figure 9.24 shows the implementation of X-NOR gate using two
threshold gates.
Notice that in all the realizations shown above, the variables associated with positive weights
appear in uncomplemented form and the variables with negative weights appear in complemented
form in the output function.
In the above table from row 0, we observe that 0 ≥ T, that means T must be zero or negative.
From row 2 we observe that w2 < T, that means w2 must be negative. From row 4 we observe that
w1 ≥ T. From rows 5 and 6 we observe that w3 > w2. Take w1 > w3. Thus, we are able to establish
the relations between weights and threshold as
w1 > w3 > T > w2
For simplicity assigning integer values to weights and T, we get
1
w1 = 2, w3 = 1, T = – , and w2 = –3
2
Here we get the solutions which satisfy all the relations in column 4. This result is verified in
Table 9.11.
A B C w = 2A – 3B + C F
0 0 0 0 1
0 0 1 1 1
0 1 0 –3 0
0 1 1 –2 0
1 0 0 2 1
1 0 1 3 1
1 1 0 –1 0
1 1 1 0 1
Hence the given function can be realized using a single threshold gate.
Limitations of threshold gates: The limitations of threshold gates are as follows:
1. A threshold gate is very sensitive to parameter variations.
2. It is difficult to fabricate it in IC form.
3. The speed of switching of threshold elements is much lower than that of conventional
gates.
the function f = x1x2 x 3 + x 1 x 3 is negative in variable x3, since x3 appears only in complemented
form in this expression.
If a function f(x1, x2, ..., xn) is either only positive or only negative in xi, then it is said to be
unate in xi. Further, if it is unate in each one of its variables, then it is called a unate function. Thus,
if a function can be represented by a disjunctive or conjunctive expression in which no variable
appears in both its complemented and uncomplemented forms, then it is a unate function.
EXAMPLE 9.11 Determine whether the function f = DC + BC + AB is a unate function.
Solution
Since no variable in this function is appearing both in complemented and uncomplemented
forms, it is a unate function. Since all the variables in this function appear in uncomplemented
form only, it is a positive function.
EXAMPLE 9.12 Determine whether the function f = DC + AB + AC is a unate function.
Solution
In this function each variable appears either only in complemented or only in uncomplemented
form. Therefore, the function is unate in all of its variables and hence is a unate function, but
it is neither a positive nor a negative function.
EXAMPLE 9.13 Determine whether the function f = x 1 x 2x3 + x 2 x 3x4 is a unate function.
Solution
In the given function f, the variables x1, x2 and x4 appear as x 1, x 2, and x4 respectively, but
the variable x3 appears as x3 in the first term and as x 3 in the second term. Therefore, f is
unate in the variables x1, x2 and x4 and is not unate in the variable x3. Hence the function f is
not a unate function.
EXAMPLE 9.14 Determine whether the following functions are unate functions:
F1(A, B, C, D) = AB + AD + B C + A C
F2(A, B, C, D) = AB + AD + BC + AC
Comment on the results.
Solution
The function F1 has the variables A, B, C, and D as A, B, C, and D respectively. This shows
that the function F1 is positive in B and D and negative in A and C. It is neither positive nor
negative for all the variables but is a unate function.
The function F2 has all the variables present in uncomplemented form, therefore, it is
positive in all its variables and is a unate function.
Comparing F1 and F2, we observe that in F1 if A is replaced by A and C is replaced by C,
the resulting function will be a positive function. Therefore, we can conclude that a unate
function can be converted into a positive unate function or negative unate function by
relabelling complemented variables as uncomplemented variables and uncomplemented
variables as complemented variables respectively. For reconverting the latter function, the
original function can be determined. It is important to note that every threshold function is
unate.
THRESHOLD LOGIC 533
The minimal expression for F (Fmin = x1x2 + x2 x 3 + x1x 3 + x1x4) shows that all the variables in the
function are unate and hence the given function is a unate function.
Step 2. Convert the given unate function into a positive function
To convert the given unate function into a positive function (FP) replace each complemented
variable by its uncomplemented form.
Therefore,
FP = x1x2 + x1x3 + x1x4 + x2x3
Step 3. Determine the true and false prime implicants of the function FP
To determine the true and false prime implicants of FP draw the K-maps in SOP and POS forms,
minimize them, and obtain the minimal expressions from them as shown in Figure 9.26. Observe
that the true prime implicants are the same as those of FP.
Figure 9.26 Example 9.15: K-maps to determine the true and false prime implicants.
Solution
Step 1. Check for unateness of the function
Draw the K-map for F, minimize it and obtain the minimal expression for F as shown in Figure 9.29.
Fmin = x1x 2x4 + x 2 x 3 + x 1 x 3 + x 3x4
Since the variable x1 is not unate in F, the given function is not a unate function.
Figure 9.30 Example 9.16: Decomposition of non unate function into two unate functions.
Figure 9.31 Example 9.16: K-maps to obtain the false prime implicants.
Ïw1 + w2 + w 4 Ï w2 + w3 + w 4
w1 + w3 ¸ Ô w1 + w2 + w3 ¸ Ô
˝ > Ì w3 + w 4 ˝ > Ì w1 + w3 + w4
w 2 + w3 + w 4 ˛ w1 + w2 + w4 ˛
ÔÓw2 + w3 ÔÓ w1 + w2
Step 6. Obtain the weight constraints for functions Fap and Fbp
The weight constraints for the functions Fap and Fbp are obtained as follows:
Weight constraints for function Fap Weight constraints for function Fbp
w1 > w4 since w1 + w3 > w3 + w4 w1 > w4 since w1 + w2 + w3 > w2 + w3 + w4
w1 > w2 since w1 + w3 > w2 + w3 w2 > w4 since w1 + w2 + w3 > w1 + w3 + w4
w3 > w1 since w2 + w3 + w4 > w1 + w2 + w4 w3 > 0 since w1 + w2 + w3 > w1 + w2
w4 > 0 since w2 + w3 + w4 > w2 + w3 w1 > w3 since w1 + w2 + w4 > w2 + w3 + w4
w2 > 0 since w2 + w3 + w4 > w3 + w4 w2 > w3 since w1 + w2 + w4 > w1 + w3 + w4
w4 > 0 since w1 + w2 + w4 > w1 + w2
There is no clear relation between w2 and w4. There is no clear relation between w1 and w2 and
So we choose w2 = w4. between w3 and w4. So we choose w1 = w2 and
Therefore, we have w3 = w4. Therefore, we have
w3 > w1 > w2 = w4 > 0 w1 = w2 > w3 = w4
THRESHOLD LOGIC 539
We assign w2 = w4 = 1 We assign w3 = w4 = 1
Therefore, assign w1 = 2 and w3 = 3. Therefore, assign w1 = w2 = 2.
Therefore, we have Therefore, we have
} }
Ï2 + 1 + 1 Ï2 + 1 + 1
2+3 Ô 2 + 2 +1 Ô
> Ì3 + 1 > Ì2 + 1 + 1
1+ 3 +1 2 + 2 +1
ÔÓ1 + 3 ÔÓ2 + 2
Minimal weighted sum of true prime implicants Minimal weighted sum of true prime implicants
is 5. is 5.
Maximal weighted sum of false prime implicants Maximal weighted sum of false prime implicants
is 4. is 4.
Therefore, Therefore,
Tap = (5 + 4)/2 = 9/2 = 4.5 T bp = ( 5 + 4) / 2 = 9/2 = 4.5
For Fa For F b
Since x1 Æ x1 and x3 Æ x3 Since x2 Æ x2 and x3 Æ x3
w1 = –2 and w3 = –3 w2 = –2 and w3 = –1
Therefore, Therefore,
Ta = Tap – w1 – w3 = 9/2 – 2 – 3 = –1/2 Tb = Tbp – w2 – w3 = 9/2 – 2 – 1 = 3/2
By cascading the two functions we have the threshold gate as shown in Figure 9.33.
Value of wx. When the cascading is done as shown in Figure 9.33, it is desired to achieve OR
operation in addition to the realization of Fb by the second threshold element since F = Fa + Fb.
Now the weight wx is to be determined. When Fa or Fb or both are 1, F must be 1 and wx is to be
determined to achieve this operation.
When Fa = 0, it does not affect the operation of the second threshold element, but when
Fa = 1, for F to be 1, the weighted sum of the second element must be greater than Tb = 3/2.
Therefore, the minimal weighted sum is to be obtained and Fa = 1 corresponding to this must
produce F = 1. For all other combinations of inputs, the weighted sum will be higher than this and
this condition will be automatically satisfied.
The minimal weighted sum occurs when x1 = x4 = 0, x2 = x3 = 1. Therefore, wx must satisfy
the condition
3
–w2 –w3 + wx = –2 – 1 + wx = –3 + wx ≥
2
9
or wx ≥
2
Therefore, wx is chosen as 5.
In general, the above procedure can be employed for the realization of any arbitrary switching
function.
REVIEW QUESTIONS
1. The speed of switching threshold gates is much ______ than that of conventional gates.
2. It is ______ to fabricate threshold gates in IC form.
3. X-OR and X-NOR gates ______ be realized using a single threshold gate.
4. In a positive unate function all the variables are only in ______ form.
5. In a negative unate function all the variables are only in ______ form.
6. The minimal expression of a unate function is ______.
7. The complement of a unate function is ______.
8. A threshold function is having a variable B present as B. It is converted into a positive unate
function with associated weight 5. The weight associated with this variable in the original function
will be ______.
9. A threshold function has T = 3. For a specific combination of values of variables for which
output is 1, the weighted sum will be ______.
10. When two threshold elements are connected in cascade for the realization of a switching function,
the interconnection between the two is required to perform ______ operation.
11. ______ functions cannot be realized using a single threshold gate.
12. ______ functions can be realized using a single threshold gate.
(a) a NOT gate (b) an AND gate (c) an OR gate (d) a NAND gate
2. The T-gate shown below represents
(a) a NOR gate (b) an AND gate (c) an OR gate (d) a NAND gate
544 FUNDAMENTALS OF DIGITAL CIRCUITS
(a) a NOR gate (b) an AND gate (c) an OR gate (d) a NAND gate
4. The T-gate shown below represents a
(a) a NOR gate (b) an AND gate (c) an OR gate (d) a NAND gate
5. The T-gate shown below represents
(a) a NOR gate (b) an AND gate (c) an OR gate (d) a NAND gate
6. The T-gate shown below represents F =
PROBLEMS
9.1 Determine whether the following switching functions are unate functions:
(a) f(A, B, C, D) = S m( 0, 1, 3, 4, 5, 6, 7, 12, 13)
(b) f(A, B, C, D) = S m( 5, 6, 7, 10, 11, 13, 14,15)
9.2 Test whether the following Boolean expressions can be realized using a single threshold gate or
not:
(a) F(A, B, C) = S m(1, 4, 6, 7)
(b) F(A, B, C) = S m(0, 2, 4, 5, 7)
9.3 Realise the following Boolean functions using T-gate:
(a) f(w, x, y, z) = S m( 0, 1, 4, 5, 6, 7, 12, 13)
(b) f(x, y, z) = S m(0, 1, 4, 5, 7)
9.4 Realise the Boolean functions using T-gates:
(a) f(w, x, y, z) = S m(2, 3, 6, 7, 10, 14, 15)
(b) f(w, x, y, z) = S m(3, 5, 7, 10, 12, 14, 15)
(c) f(w, x, y, z) = S m(2, 3, 7, 8, 9, 12, 13, 14, 15)
10
FLIP-FLOPS
10.1 INTRODUCTION
Basically, switching circuits may be combinational switching circuits or sequential switching
circuits. The switching circuits considered so far have been combinational switching circuits.
Combinational switching circuits are those whose output levels at any instant of time are dependent
only on the levels present at the inputs at that time. Any prior input level conditions have no effect
on the present outputs, because combinational logic circuits have no memory. A circuit consisting
of only logic gates is a combinational circuit. On the other hand, sequential switching circuits are
those whose output levels at any instant of time are dependent not only on the levels present at the
inputs at that time, but also on the state of the circuit, i.e. on the prior input level conditions (i.e. on
its past inputs). The past history is provided by feedback from the output back to the input. It
means that sequential switching circuits have memory. Sequential circuits are thus made of
combinational circuits and memory elements. The past history is provided by feedback from the
output back to the input.
There are many applications in which digital outputs are required to be generated in accordance
with the sequence in which the input signals are received. This requirement cannot be satisfied
using a combinational logic system. These applications require outputs to be generated that are not
only dependent on the present input conditions, but also upon the past history of the inputs. Hence
sequential circuits come into picture.
Parallel adders, subtractors, encoders, decoders, code converters, parity bit generators, etc.
are examples of combinational circuits. Counters, shift registers, serial adders, sequence generators,
logic function generators, etc. are examples of sequential circuits.
546
FLIP-FLOPS 547
Figure 10.1 shows a block diagram of a sequential circuit. The memory elements are connected
to the combinational circuit as a feedback path.
The information stored in the memory element at any given time defines the present state of
the sequential circuit. The present state and the external inputs determine the outputs and the next
state of the sequential circuit. Thus, we can specify the sequential circuit by a time sequence of
external inputs, internal states (present state and next state) and outputs. Table 10.1 presents the
comparison between combinational and sequential circuits.
When an input variable changes in value, the secondary variables, i.e. y1, y2, ..., yk do not
change instantaneously. Certain amount of time is required for the input signal to propagate from
FLIP-FLOPS 549
the input terminals through the combinational circuit and the delay elements. The combinational
circuit generates k excitation variables which give the next state of the circuit. The excitation
variables are propagated through delay elements to become the new present state for the secondary
variables, i.e. y1, y2, ..., yk. In the steady state condition excitation and secondary variables are the
same, but during transition they are different. In other words, we can say that for a given value of
input variables, the system is stable if the circuit reaches a steady-state condition with yi = Yi for
i = 1, 2, ..., k; otherwise the circuit is in a continuous transition and is said to be unstable.
To ensure proper operation, it is necessary for asynchronous sequential circuits to attain a
stable state before the input is changed to a new value. Because of unequal delays in the wires and
gate circuits, it is impossible to have two or more input variables change at exactly the same instant.
Therefore, simultaneous changes of two or more input variables are usually avoided. In other words,
we can say that only one input variable is allowed to change at any one time and the time between
two input changes is kept longer than the time it takes the circuit to reach a stable state.
According to how the input variables are to be considered, there are two types of asynchronous
circuits: fundamental mode circuits and pulse mode circuits.
Fundamental mode circuit assumes that:
1. The input variables change only when the circuit is stable.
2. Only one input variable can change at a given time.
3. Inputs are levels and not pulses.
Pulse mode circuit assumes that:
1. The input variables are pulses instead of levels.
2. The width of the pulses is long enough for the circuit to respond to the input.
3. The pulse width must not be so long that it is still present after the new state is reached.
As the symbol in Figure 10.3 implies, a flip-flop can have one or more inputs. The input
signals which command the flip-flop to change state are called excitations. These inputs are used
to cause the flip-flop to switch back and forth (i.e. ‘flip-flop’) between its possible output states. A
flip-flop input has to be pulsed momentarily to cause a change in the flip-flop output, and the
output will remain in that new state even after the input pulse has been removed. This is the
flip-flop’s memory characteristic.
There are a number of applications of flip-flops. As such, the flip-flop serves as a storage
device. It stores a 1 when its Q output is a 1, and stores a 0 when its Q output is a 0. Flip-flops are
the fundamental components of shift registers and counters.
The term ‘latch’ is used for certain flip-flops. It refers to non-clocked flip-flops, because
these flip-flops ‘latch on’ to a 1 or a 0 immediately upon receiving the input pulse called SET or
RESET. They are not dependent on the clock signal for their operation, i.e. a latch is a sequential
device that checks all its inputs continuously and changes its outputs accordingly at any time
independent of a clock signal. Gated latches (clocked flip-flops) are latches which respond to the
inputs and latch on to a 1 or a 0 only when they are enabled, i.e. only when the input ENABLE or
gating signal is HIGH. In the absence of ENABLE or gating signal, the latch does not respond to
the changes in its inputs (The gating signal may be a clock pulse). On the other hand, a flip-flop is
a sequential device that normally samples its inputs and changes its outputs only at times determined
by clock pulses.
A latch may be an active-HIGH input latch or an active-LOW input latch. Active-HIGH
means that the SET and RESET inputs are normally resting in the LOW state and one of them will
be pulsed HIGH whenever we want to change the latch outputs. Active-LOW means that the SET
and RESET inputs are normally resting in the HIGH state and one of them will be pulsed LOW
whenever we want to change the latch outputs.
The simplest type of flip-flop is called an S-R latch. It has two outputs labelled Q and Q and two
inputs labelled S and R. The state of the latch corresponds to the level of Q (HIGH or LOW, 1 or
0) and Q is, of course, the complement of that state. It can be constructed using either two
cross-coupled NAND gates or two-cross coupled NOR gates. Using two NOR gates, an active-
HIGH S-R latch can be constructed and using two NAND gates an active-LOW S-R latch can be
constructed. The name of the latch, S-R or SET-RESET, is derived from the names of its inputs.
Figure 10.4a shows the logic symbol of an S-R latch. When the SET input is made HIGH, Q
becomes 1 (and Q equals 0). When the RESET input is made HIGH, Q becomes 0 (and Q equals 1).
If both the inputs S and R are made LOW, there is no change in the state of the latch. It means that
FLIP-FLOPS 551
the latch remains in the same state in which it was, prior to the application of inputs. If both the
inputs are made HIGH, the output is unpredictable, i.e. both Q and Q may be HIGH, or both may
be LOW or any one of them may be HIGH and the other LOW. This condition is described as not-
allowed, unpredictable, invalid or indeterminate. The S-R latch is also called R-S latch or S-C
(SET-CLEAR) latch. Resetting is also called clearing because we CLEAR out the 1 in the output
by resetting to 0. In more complex flip-flops, called gated latches, the change of state does not take
place immediately after the application of the inputs. The change of state takes place only after
applying a gate pulse.
The NOR gate S-R latch (active-high S-R latch): Figure 10.4b shows the logic diagram of an
active-HIGH S-R latch composed of two cross-coupled NOR gates. Note that the output of each
gate is connected to one of the inputs of the other gate. The latch works as per the truth table of
Figure 10.4c. Qn represents the state of the flip-flop before applying the inputs (i.e. the present
state PS of the flip-flop). Qn+1 represents the state of the flip-flop after the application of the inputs
(i.e. the next state NS of the flip-flop).
It is necessary only to pulse a SET or RESET input to change the state of the latch. For
example, if the latch is initially RESET, a pulse applied to its SET is the same as making S
momentarily a 1, followed by a 0. The 1 sets the latch, after which R and S are once again a 0, the
no-change condition. Since a pulse must remain HIGH long enough for NOR gates to change
states, the minimum pulse width is the sum of the propagation delays through the gates. One gate
must change from LOW to HIGH and the other from HIGH to LOW. Thus,
PWmin = tPLH + tPHL
where PWmin is the minimum pulse width required for proper operation of the gate, tPLH and tPHL
are the propagation delays associated with the gates when the output is changing from LOW to
HIGH and HIGH to LOW, respectively.
The analysis of the operation of the active-HIGH NOR latch can be summarized as follows.
1. SET = 0, RESET = 0: This is the normal resting state of the NOR latch and it has no
effect on the output state. Q and Q will remain in whatever state they were prior to the
occurrence of this input condition.
552 FUNDAMENTALS OF DIGITAL CIRCUITS
2. SET = 1, RESET = 0: This will always set Q = 1, where it will remain even after SET
returns to 0.
3. SET = 0, RESET = 1: This will always reset Q = 0, where it will remain even after
RESET returns to 0.
4. SET = 1, RESET = 1: This condition tries to SET and RESET the latch at the same
time, and it produces Q = Q = 0. If the inputs are returned to zero simultaneously, the
resulting output state is erratic and unpredictable. This input condition should not be
used. It is forbidden.
The SET and RESET inputs are normally in the LOW state and one of them will be pulsed
HIGH, whenever we want to change the latch outputs.
The NAND gate S-R latch (active-low S-R latch): Figures 10.5a and b show the logic diagram
and truth table of an active-LOW S-R latch. Since the NAND gate is equivalent to an active-LOW
OR gate, an active-LOW S-R latch using OR gates may also be represented as shown in Figure 10.5c.
The operation of this latch is the reverse of the operation of the NOR gate latch discussed
earlier. That is why it is called an active-LOW S-R latch. If the 0s are replaced by 1s and 1s by 0s
in Figure 10.5b, we get the same truth table as that of the NOR gate latch shown in Figure 10.4c.
The SET and RESET inputs are normally resting in the HIGH state and one of them will be
pulsed LOW, whenever we want to change the latch outputs.
The S-R latch (active-high NAND latch): An active-LOW NAND latch can be converted into
an active-HIGH NAND latch by inserting the inverters at the S and R inputs. Figure 10.6 shows
the proof.
When power is applied to a circuit, it is not possible to predict the starting state of a flip-flop
output, when its SET and RESET inputs are in their inactive states (i.e. S = R = 1 for a NAND
latch, and S = R = 0 for a NOR latch). There is just as much chance that the starting state will be a
Q = 0 as Q = 1. It will depend on things like internal propagation delays, parasitic capacitance and
external loading.
EXAMPLE 10.1 Determine the output waveform Q if the inputs shown in Figure 10.8a
are applied to a gated S-R latch shown in Figure 10.8b, that was initially SET.
Solution
The output waveform Q shown in Figure 10.8c is drawn as follows:
Prior to t0, Q is HIGH. Even though R goes HIGH prior to t0, Q will not change because
EN is LOW. Similarly, even though S goes HIGH prior to t1, Q will not change because EN
is LOW. Any time S is HIGH and R is LOW, a HIGH on the EN sets the latch, and any time
S is LOW and R is HIGH, a HIGH on the EN resets the latch.
554 FUNDAMENTALS OF DIGITAL CIRCUITS
t
R
(a) Input waveforms
S Q
t
EN
EN
R Q
Q
(c) Output waveform
t0 t1 t2 t3 t4 t
Figure 10.8 Example 10.1: Waveforms—the gated S-R latch.
The gated D-latch: In many applications, it is not necessary to have separate S and R inputs to
a latch. If the input combinations S = R = 0 and S = R = 1 are never needed, the S and R are always
the complement of each other. So, we can construct a latch with a single input (S) and obtain the R
input by inverting it. This single input is labelled D (for data) and the device is called a D-latch. So,
another type of gated latch is the gated D-latch. It differs from the S-R latch in that it has only one
input in addition to EN. When D = 1, we have S = 1 and R = 0, causing the latch to SET when
ENABLED. When D = 0, we have S = 0 and R = 1, causing the latch to RESET when ENABLED.
When EN is LOW, the latch is ineffective, and any change in the value of D input does not affect
the output at all. When EN is HIGH, a LOW D input makes Q LOW, i.e. resets the flip-flop and a
HIGH D input makes Q HIGH, i.e. sets the flip-flop. In other words, we can say that the output Q
follows the D input when EN is HIGH. So, this latch is said to be transparent. The logic diagram,
the logic symbol and the truth table of a gated D-latch are shown in Figure 10.9.
Generation of narrow spikes: A narrow positive spike is generated at the rising edge of the
clock using an inverter and an AND gate as shown in Figure 10.11a. The inverter produces a delay
of a few nanoseconds. The AND gate produces an output spike that is HIGH only for a few
nanoseconds, when CLK and CLK are both HIGH. This results in a narrow pulse at the output of
the AND gate which occurs at the positive-going transition of the clock signal.
Similarly, a narrow positive spike is generated at the falling edge of the clock by using an
inverter and an active-LOW AND gate as shown in Figure 10.11b. The inverter produces a delay
of a few nanoseconds. The active-LOW AND gate produces an output spike that is HIGH only for
556 FUNDAMENTALS OF DIGITAL CIRCUITS
a few nanoseconds, when CLK and CLK are both LOW. This results in a narrow pulse at the
output of the AND gate which occurs at the negative-going transition of the clock.
The edge-triggered S-R flip-flop: Figure 10.12 shows the logic symbol and the truth table for
a positive edge-triggered S-R flip-flop. The S and R inputs of the S-R flip-flop are called the
synchronous control inputs because data on these inputs affect the flip-flop’s output only on the
triggering (positive going) edge of the clock pulse. Without a clock pulse, the S and R inputs
cannot affect the output. When S is HIGH and R is LOW, the Q output goes HIGH on the positive-
going edge of the clock pulse and the flip-flop is SET. (If it is already in SET state, it remains
SET). When S is LOW and R is HIGH, the Q output goes LOW on the positive-going edge of the
clock pulse and the flip-flop is RESET, i.e. cleared. (If it is already in RESET state, it remains
RESET). When both S and R are LOW, the output does not change from its prior state (If it is in
SET state, it remains SET and if it is in RESET state, it remains RESET). When both S and R are
HIGH simultaneously, an invalid condition exists. The basic operation described above is illustrated
in Figure 10.12b.
The truth table of a negative edge-triggered S-R flip-flop is the same as that of a positive
edge triggered S-R flip-flop except that the arrows point downwards. This flip-flop will trigger
only when the clock input goes from 1 to 0.
FLIP-FLOPS 557
EXAMPLE 10.2 The waveforms shown in Figure 10.13a are applied to the positive
edge-triggered S-R flip-flop shown in Figure 10.13b. Sketch the output waveforms.
Solution
The output waveform is drawn as shown in Figure 10.13c after going through the following
steps.
1. Initially, S = 0 and R = 0 and Q is assumed to be HIGH.
2. At the positive-going transition of the first clock pulse (i.e. at a), both S and R are LOW.
So, no change of state takes place. Q remains HIGH and Q remains LOW.
3. At the leading edge of the second clock pulse (i.e. at b), S = 0 and R = 1. So, the flip-flop
resets. Hence, Q goes LOW and Q goes HIGH.
4. At the positive-going edge of the third clock pulse (i.e. at c), S = 1 and R = 0. So, the
flip-flop sets. Hence, Q goes HIGH and Q goes LOW.
5. At the rising edge of the fourth clock pulse, S = 1 and R = 0. Since the flip-flop is already
in a SET state, it remains SET. That is, Q remains HIGH and Q remains LOW.
6. The fifth pulse resets the flip-flop at its positive-going edge because S = 0 and R = 1 is
the input condition and Q = 1 at that time.
7. The sixth pulse sets the flip-flop at its rising edge because S = 1 and R = 0 is the input
condition and Q = 0 at that time.
Internal circuitry of the edge-triggered S-R flip-flop: A detailed analysis of the internal circuitry
of a flip-flop is not necessary, since all types are readily available as ICs. A simplified description
is, however, presented here. Figure 10.14 shows the simplified circuitry of the edge-triggered S-R
flip-flop.
It contains three sections.
1. A basic NAND gate latch formed by NAND gates G3 and G4
558 FUNDAMENTALS OF DIGITAL CIRCUITS
The edge detector generates a positive spike at the positive-going or negative-going edge
of the clock pulse. The steering gates ‘direct’ or ‘steer’ the narrow spike either to G3 or to G4
depending on the state of the S and R inputs.
The edge-triggered D flip-flop: The edge-triggered D flip-flop has only one input terminal.
The D flip-flop may be obtained from an S-R flip-flop by just putting one inverter between the S
and R terminals (Figure 10.15a). Figures 10.15b and c show the logic symbol and the truth table of
a positive edge-triggered D flip-flop. Note that, this flip-flop has only one synchronous control
input in addition to the clock. This is called the D (data) input. The operation of the D flip-flop is
very simple. The output Q will go to the same state that is present on the D input at the positive-going
transition of the clock pulse. In other words, the level present at D will be stored in the flip-flop at
the instant the positive-going transition occurs. That is, if D is a 1 and the clock is applied, Q goes
to a 1 and Q to a 0 at the rising edge of the pulse and thereafter remain so. If D is a 0 and the clock
is applied, Q goes to a 0 and Q to a 1 at the rising edge of the clock pulse and thereafter remain so.
Internal circuitry of the edge-triggered D flip-flop: Figure 10.16 shows the internal circuitry of
the edge-triggered D flip-flop.
The negative edge-triggered D flip-flop operates in the same way as the positive edge-triggered
D flip-flop except that the change of state takes place at the negative-going edge of the clock
pulse. In the truth table of the negative edge triggered flip-flop the arrows point downwards.
The edge-triggered J-K flip-flop: The J-K flip-flop is very versatile and also the most widely
used. The J and K designations for the synchronous control inputs have no known significance.
The functioning of the J-K flip-flop is identical to that of the S-R flip-flop, except that it has
no invalid state like that of the S-R flip-flop. The logic symbol and the truth table for a positive
edge-triggered J-K flip-flop are shown in Figure 10.17.
When J = 0 and K = 0, no change of state takes place even if a clock pulse is applied.
When J = 0 and K = 1, the flip-flop resets at the positive-going edge of the clock pulse.
When J = 1 and K = 0, the flip-flop sets at the positive-going edge of the clock pulse.
When J = 1 and K = 1, the flip-flop toggles, i.e. goes to the opposite state at the positive-going
edge of the clock pulse. In this mode, the flip-flop toggles or changes state for each occurrence of
the positive-going edge of the clock pulse.
A negative edge-triggered J-K flip-flop operates in the same way as a positive edge-triggered
J-K flip-flop except that the change of state takes place at the negative-going edge of the clock
pulse. In the truth-table of a negative edge-triggered J-K flip-flop the arrows point downwards.
560 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 10.3 The waveforms shown in Figure 10.18a are applied to the edge-triggered
J-K flip-flop shown in Figure 10.18b. Draw the output waveform.
Solution
The output waveform shown in Figure 10.18c is drawn as explained below:
1. Initially J = 0, K = 0 and CLK = 0. Assume that the initial state of the flip-flop is a 1, i.e.
Q = 1 initially.
2. At the negative-going edge of the first clock pulse (i.e. at a), J = 1 and K = 0. So, Q
remains as a 1 and, therefore, Q as a 0.
3. At the trailing edge of the second clock pulse (i.e. at b), J = 0 and K = 1. So, the flip-flop
resets. That is, Q goes to a 0 and Q to a 1.
4. At the falling edge of the third clock pulse (i.e. at c), both J and K are a 1. So, the flip-flop
toggles. That is, Q changes from a 0 to a 1 and Q from a 1 to a 0.
5. At the negative-going transition of the fourth clock pulse (i.e. at d), J = 0 and K = 1. So,
the flip-flop RESETS, i.e. Q goes to a 0 and Q to a 1.
6. At the negative going edge of the fifth clock pulse (i.e. at d), J = 0 and K = 1. So the flip-
flop remains reset, i.e. Q remains as 0 and Q remains as 1.
Internal circuitry of the edge-triggered J-K flip-flop: A simplified version of the internal circuitry
of the edge-triggered J-K flip-flop is shown in Figure 10.19. It contains the same three sections as
those of the edge-triggered S-R flip-flop. In fact, the only difference between the two circuits is
that, the Q and Q outputs are fed back to the pulse steering NAND gates. This feedback connection
is what gives the J-K flip-flop its toggle operation for J = K = 1 condition.
The toggling operation may be explained as given below:
1. Suppose Q = 0, Q = 1 and J = K = 1. When a clock pulse is applied, the narrow positive
pulse of the edge detector is inverted by gate G1, i.e. G1 steers the spike inverted (because
its other inputs J and Q are both a 1) to gate G3. So, the output of G3, i.e. Q goes HIGH.
Since Q is connected as one input of G2, the output of G2 remains HIGH (because initially
Q was a 0). So, G4 has both inputs as a 1. Thus, its output Q will be a 0.
FLIP-FLOPS 561
The edge-triggered T flip-flop: A T flip-flop has a single control input, labelled T for toggle.
When T is HIGH, the flip-flop toggles on every new clock pulse. When T is LOW, the flip-flop
remains in whatever state it was before. Although T flip-flops are not widely available commercially,
it is easy to convert a J-K flip-flop to the functional equivalent of a T flip-flop by just connecting
J and K together and labelling the common connection as T. Thus, when T = 1, we have J = K = 1,
and the flip-flop toggles. When T = 0, we have J = K = 0, and so there is no change of state. The
logic symbol and the truth table of a T flip-flop are shown in Figure 10.20.
A table which lists the present state, the next state and the excitations of a flip-flop is called
the excitation table of a flip-flop, i.e. the excitation table is a table which indicates the excitations
required to take the flip-flop from the present state to the next state.
The characteristic equation of a flip-flop is the equation expressing the next state of a flip-flop
in terms of its present state and present excitations. To obtain the characteristic equation of a
flip-flop write the excitation requirements of the flip-flop, draw a K-map for the next state of the
flip-flop in terms of its present state and inputs and simplify it as shown in Figures 10.22 (JK FF),
10.23 (SR FF), 10.24 (T FF), and 10.25 (D FF).
(a)
(b)
(c)
(d)
the input terminals. The inputs in that case are labelled PRE and CLR or S D and RD. Most IC
flip-flops have both DC SET and DC CLEAR inputs. Some have only DC CLEAR. Some have
active-HIGH inputs, and some have active-LOW inputs.
It is important to realize that these asynchronous inputs respond to the DC levels. That means,
in the case of active-HIGH (LOW) inputs, if a constant 1 (0) is held on the PRE ( PRE ) input, the
flip-flop will remain in the Q = 1 state regardless of what is occurring at the other inputs. Similarly,
if a constant 1 (0) is held on the CLR ( CLR ) input, the flip-flop will remain in the Q = 0 state
regardless of what is occurring at the other inputs. Most often, however, the asynchronous inputs
are used to SET or CLEAR the flip-flop to the desired state by the application of a momentary
pulse. When DC SET and DC RESET conditions are not used in any application, they must be
held at their inactive levels.
The logic symbol and the truth table of a J-K flip-flop with active-LOW PRESET and CLEAR
inputs are shown in Figure 10.26. In this case, both PRESET and CLEAR inputs must be kept
HIGH for synchronous operation.
Figure 10.26 J-K flip-flop with active-LOW PRESET and CLEAR inputs.
Figure 10.27 J-K flip-flop with active-HIGH PRESET and CLEAR inputs.
Figure 10.28 Logic diagram of a basic J-K flip-flop with active-LOW PRESET and CLEAR.
EXAMPLE 10.4 The waveforms shown in Figure 10.29a are applied to the J-K flip-flop
shown in Figure 10.29b. Draw the output waveform.
Solution
The output waveform shown in Figure 10.29c is drawn as explained below:
1. Initially PRE and CLR are both a 1, and Q is LOW.
2. At the instant a, PRE goes LOW. So, Q is SET to a 1, and remains SET up to b, because
PRE is kept LOW up to b. From b to c also it remains at a 1, because both PRE and CLR
are a 1 during this period.
3. Since the flip-flop is in the clocked mode (i.e. PRE = 1 and CLR = 1) and since J and K
are both a 1, the flip-flop toggles and goes to a 0 at the negative-going edge of the third
clock pulse at c.
4. At d, PRE goes LOW. So, Q is SET to a 1 and remains SET till e.
5. At e, CLR goes LOW. So, Q is RESET to a 0 and remains RESET till f.
6. After f, Q toggles and goes to a 1 at g at the negative-going edge of the seventh clock
pulse.
7. At h, CLR goes LOW. So, Q also goes LOW.
Figure 10.31 Propagation delays tPLH and tPHL w.r.t. PRESET and CLEAR.
Set-up time: The set-up time (ts) is the minimum time for which the control levels need to be
maintained constant on the input terminals of the flip-flop, prior to the arrival of the triggering
edge of the clock pulse, in order to enable the flip-flop to respond reliably. Figure 10.32a illustrates
the set-up time for a D flip-flop.
Hold time: The hold time (th) is the minimum time for which the control signals need to be
maintained constant at the input terminals of the flip-flop, after the arrival of the triggering edge of
the clock pulse, in order to enable the flip-flop to respond reliably. Figure 10.32b illustrates the
hold time for a D flip-flop.
Maximum clock frequency: The maximum clock frequency (fMAX) is the highest frequency at
which a flip-flop can be reliably triggered. If the clock frequency is above this maximum, the
flip-flop would be unable to respond quickly enough and its operation will be unreliable. The fMAX
limit will vary from one flip-flop to another.
Pulse widths: The manufacturer usually specifies the minimum pulse widths for the clock and
asynchronous inputs. For the clock signal, the minimum HIGH time tW(H) and the minimum
LOW time tW(L) are specified and for asynchronous inputs, i.e. PRESET and CLEAR, the minimum
active state time is specified. Failure to meet these minimum time requirements can result in
unreliable operation. Figure 10.33 shows pulse widths for CLK and asynchronous inputs.
568 FUNDAMENTALS OF DIGITAL CIRCUITS
Clock transition times: For reliable triggering, the clock waveform transition times (rise and
fall times) should be kept very short. If the clock signal takes too long to make the transitions from
one level to the other, the flip-flop may either trigger erratically or not trigger at all.
Power dissipation: The power dissipation of a flip-flop is the total power consumption of the
device. It is equal to the product of the supply voltage (VCC) and the current (ICC) drawn from the
supply by it.
P = VCC ◊ ICC
The power dissipation of a flip-flop is usually in mW.
If a digital system has N flip-flops and if each flip-flop dissipates P mW of power, the total
power requirement
PTOT = N ◊ VCC ◊ ICC = (N ◊ P) mW
CLK inputs of different flip-flops at different times. This delay is called clock skew. If the clock
skew is minimal, a flip-flop may get clocked before it receives a new input (derived from the
output of another clocked flip-flop). On the other hand, if the clock pulse is delayed significantly,
the inputs to a flip-flop may have changed before the clock pulse arrives. In these situations, we
have a kind of a race between the two competing signals that are attempting to accomplish opposite
effects. This can be termed time race. The winner in such a race depends largely on unpredictable
propagation delays—delays that can vary from one device to another and that can change with
environmental conditions. It is clear that reliable system operation is not possible when the responses
of a flip-flop depend on the outcome of a race.
A typical situation where this type of potential timing problem occurs is illustrated in Figure 10.34,
where the output of the first flip-flop Q1 is connected to the S input of the second flip-flop and both
the flip-flops are clocked by the same signal at their CLK inputs.
The potential timing problem is like this: Since Q1 will change on the positive-going transition
of the clock pulse, the S2 input of the second flip-flop will be in a changing state as it receives the
same positive-going transition. This could lead to an unpredictable response at Q2.
Let us assume that, initially Q1 = 1 and Q2 = 0. Let FF1 has S1 = 0, R1 = 1 and FF2 has S2 = 1,
R2 = 0 prior to the positive-going transition of the clock pulse. When the positive-going transition
occurs, Q1 will go to the LOW state, but cannot actually go LOW until after the propagation delay
tPHL. The same positive-going transition will reliably clock FF2 to the HIGH state, provided that
tPHL is greater than the FF2’s hold time requirement th. If this condition is not met, the response of
FF2 will be unpredictable.
Fortunately, all modern edge-triggered flip-flops have hold time requirements that are 5 ns or
less; most have th = 0 which means that they have no hold time requirements. So, we can say that:
The flip-flop output will go to a state determined by the logic levels present at its synchronous
control inputs just prior to the active clock transition.
If we apply this rule to Figure 10.34, it says that Q2 of FF2 will go to a state determined by
S2 = 1 and R2 = 0, a condition that is present just prior to the positive-going transition of the clock
pulse. The fact that S2 is changing in response to the same positive-going transition has no effect
on Q2.
1 to 0, 0 to 1 and so on, and at the end of the clock pulse, its state will be uncertain. This phenomenon
is called the race around condition. The outputs Q and Q will change on their own if the clock
pulse width tp is too long compared with the propagation delay t of each NAND gate. Table 10.4
shows how Q and Q keep on changing with time if the clock pulse width tp is greater than t.
Assuming that the clock pulse occurs at t = 0, and tp >> t, the following expressions hold before
and during tp in the J-K flip-flop of Figure 10.35. Note that f(t – t) is f(t) delayed by t.
During no pulse
}
X(t ) = 1
Y(t ) = 1
No change in Q and Q
If initially the flip-flip is in QQ = 10, the transitions will take the following path.
QQ = 10 Æ 10 Æ 11 Æ 01 Æ 11 Æ 10 ...
We thus conclude that the state of the flip-flop keeps on complementing itself for every 2t.
The clock pulse width should be such as to allow only one change to complement the state and not
too long to allow many changes resulting in uncertainty about the final state. This is a stringent
requirement which cannot be ensured in practice. This problem is eliminated using master-slave
flip-flop or edge triggered flip-flop.
Let t be the propagation delay of the NAND gate. Follow the transition indicated.
X becomes the complement of previous Q.
FLIP-FLOPS 571
a master-slave flip-flop by its logic symbol is the postponed output symbol at the outputs. Note
that there is no dynamic input indicator at the clock input.
EXAMPLE 10.5 The waveforms shown in Figure 10.38a are applied to the master-slave
S-R flip-flop shown in Figure 10.37a. Draw the output waveform.
Solution
Let us assume that, initially the flip-flop is SET, i.e. Q = 1 and the control inputs are S = 0
and R = 1 and the output of master is a 1.
At the positive-going edge of the first clock pulse, the master resets, i.e. the output of G3
goes LOW. At the negative-going edge of the first clock pulse, the slave copies it. So, Q goes
LOW. The inputs S and R now change when the clock is LOW; so it does not affect the
operation. At the positive-going edge of the second clock pulse, S = 1 and R = 0 (and G3 = 0,
Q = 0). So, the master sets, i.e. the output of G3 goes HIGH. At the negative-going edge of
the second clock pulse, the slave copies this action of the master and, therefore, Q goes
HIGH.
At the positive-going edge of the third clock pulse, S = 0 and R = 1, so, the master resets,
i.e. the output of G3 goes LOW. At the negative-going edge of the third clock pulse, the slave
copies this action of the master and, therefore, Q goes LOW.
At the positive-going edge of the fourth clock pulse, S = 0 and R = 0 (the output of G3 = 0,
Q = 0). So, there is no change in the state of the master. Hence, there will not be any change
in the state of the slave at the negative-going edge of that clock pulse and Q, therefore,
remains LOW.
The output waveform is shown in Figure 10.38b.
EXAMPLE 10.6 The waveforms shown in Figure 10.41a are applied to the master-slave
J-K flip-flop shown in Figure 10.41b. Draw the output waveform.
Solution
The output waveform shown in Figure 10.41c is drawn as explained below.
Initially, J = 0 and K = 1 and the flip-flop is assumed to be in SET state, i.e. Q = 1.
576 FUNDAMENTALS OF DIGITAL CIRCUITS
At the positive-going edge of the first clock pulse, J = 0 and K = 1. So, the flip-flop resets,
and Q goes LOW at the negative-going edge of this clock pulse.
At the positive-going edge of the second clock pulse, J = 1 and K = 0. So, the flip-flop
sets, and Q goes HIGH at the negative-going edge of this clock pulse.
At the positive-going edge of the third clock pulse, J = 0 and K = 0. So, there will not be
any change in the state of the flip-flop at the negative-going edge. Thus, the flip-flop remains
SET. Hence Q remains HIGH. There afterwards, both J and K remain HIGH. So, the flip-
flop will be in toggle mode. Hence, Q goes to the opposite state at the negative-going edge of
each of the subsequent clock pulses.
S R Qn+1
0 0 Qn
0 1 0
1 0 1
1 1 ?
FLIP-FLOPS 577
PS NS Required inputs
Qn Qn+1 S R
0 0 0 ×
0 1 1 0
1 0 0 1
1 1 × 0
0 Æ 0 transition: If the present state of the FF is 0 and if it has to remain 0 when a clock pulse is
applied, the inputs can be either S = 0, R = 0 (no change condition) or S = 0, R = 1 (reset condition).
Thus, S has to be 0 but R can be either 0 or 1. So SR = 0× for this transition.
0 Æ 1 transition: If the present state of the FF is 0 and if it has to go to 1 state when a clock pulse
is applied, the inputs have to be S = 1 and R = 0 (set condition). So SR = 10 for this transition.
1 Æ 0 transition: If the present state of the FF is 1 and if it has to go to 0 state when a clock pulse
is applied, the inputs have to be S = 0, R = 1 (reset condition). So SR = 01 for this transition.
1 Æ 1 transition: If the present state of the FF is 1 and if it has to remain 1 when a clock pulse is
applied, the inputs can be either S = 0, R = 0 (no change condition) or S = 1, R = 0 (set condition).
Thus R has to be 0 but S can be either 0 or 1. So SR = ×0 for this transition.
J-K flip-flop: The truth table and excitation table of a J-K flip-flop are shown in Tables 10.6a
and b.
0 0 Qn
0 1 0
1 0 1
1 1 Qn
PS NS Required inputs
Qn Qn+1 J K
0 0 0 ×
0 1 1 ×
1 0 × 1
1 1 × 0
578 FUNDAMENTALS OF DIGITAL CIRCUITS
0 Æ 0 transition: The present state of the FF is 0 and it has to remain 0 after the clock pulse. This
can happen with either J = 0, K = 0 (no change condition) or J = 0, K = 1 (reset condition). Thus,
J has to be 0 but K can be either 0 or 1. So JK = 0× for this transition.
0 Æ 1 transition: The present state of the FF is 0 and it has to go to 1 state after the clock pulse.
This can happen with either J = 1, K= 0 (set condition) or J = 1, K = 1 (toggle condition). Thus J
has to be 1 but K can be either 0 or 1. So JK = 1× for this transition.
1 Æ 0 transition: The present state of the FF is 1 and it has to go to 0 state after the clock pulse.
This can happen with either J = 0, K = 1 (reset condition) or J = 1, K = 1 (toggle condition). Thus
K has to be 1 but J can be either 0 or 1. So JK = ×1 for this transition.
1 Æ 1 transition: The present state of the FF is 1 and it has to remain in 1 state after the clock
pulse. This can happen with either J = 0, K = 0 (no change condition) or J = 1, K = 0 (set condition).
Thus K has to be 0 but J can be either 0 or 1. So JK = × 0 for this transition.
D flip-flop: The truth table and the excitation table of the D flip-flop are shown in Tables 10.7a
and b.
D Qn+1
0 0
1 1
PS NS Required input
Qn Qn+1 D
0 0 0
0 1 1
1 0 0
1 1 1
For a 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 be 0, and 1 if Qn+1 has to be 1 regardless of the
value of Qn.
T flip-flop: The truth table and the excitation table of the T flip-flop are shown in Tables 10.8a
and b.
T Qn+1
0 Qn
1 Qn
FLIP-FLOPS 579
PS NS Required input
Qn Qn+1 T
0 0 0
0 1 1
1 0 1
1 1 0
For a T flip-flop, when the input T = 1, the state of the flip-flop is complemented and when
T = 0, the state of the flip-flop remains unchanged. Thus, for 0 Æ 0 and 1 Æ 1 transitions T must
be 0 and for 0 Æ 1 and 1 Æ 0 transitions T must be 1.
S-R flip-flop to J-K flip-flop: Here the external inputs to the already available S-R flip-flop
will be J and K. S and R are the outputs of the combinational circuit, which are also the actual
inputs to the S-R flip-flop. We write a truth table with J, K, Qn, Qn+1, S, and R, where Qn is the
present state of the flip-flop and Qn+1 is the next state obtained when the particular J and K inputs
are applied, i.e. Qn denotes the state of the flip-flop before the application of the inputs and Qn+1
refers to the state obtained by the flip-flop after the application of inputs.
J, K and Qn can have eight combinations. For each combination of J, K and Qn, find the
corresponding Qn+1, i.e. determine to which next state (Qn+1) the J-K flip-flop will go from the
present state Qn if the present inputs J and K are applied. Now complete the table by writing the
values of S and R required to get each Qn+1 from the corresponding Qn, i.e. write what values of S
and R are required to change the state of the flip-flop from Qn to Qn+1.
580 FUNDAMENTALS OF DIGITAL CIRCUITS
The conversion table, the K-maps for S and R in terms of J, K and Qn and the logic diagram
showing the conversion from S-R to J-K are shown in Figure 10.44.
J-K flip-flop to S-R flip-flop: Here, the external inputs to the already available J-K flip-flop
will be S and R. J and K are the outputs of the combinational circuit which are also the actual
inputs to the J-K flip-flop. So, we have to get the values of J and K in terms of S, R and Qn. Thus,
write a table using S, R, Qn, Qn+1, J, and K. The external inputs S and R and the present output Qn
can make eight possible combinations. For each combination, find the corresponding next state
Qn+1. In the S-R flip-flop, the combination S = 1 and R = 1 is not permitted. So, the corresponding
output is invalid and, therefore, the corresponding J and K are don’t cares. Complete the table by
writing the values of J and K required to get each Qn+1 from the corresponding Qn.
The conversion table, the K-maps for J and K in terms of S, R, and Qn and the logic diagram
showing the conversion from J-K to S-R are shown in Figure 10.45.
S-R flip-flop to D flip-flop: Here S-R flip-flop is available and we want the operation of D
flip-flop from it. So D is the external input and the outputs of the combinational circuit are the
inputs to the available S-R flip-flop. Express the inputs of the existing flip-flop S and R in terms of
the external input D and the present state Qn.
The conversion table, the K-maps for S and R in terms of D and Qn, and the logic diagram
showing the conversion from S-R to D are shown in Figure 10.46.
D flip-flop to S-R flip-flop: Here D flip-flop is available and we want S-R flip-flop operation
from it. So S and R are the external inputs and D is the actual input to the existing flip-flop. S, R
FLIP-FLOPS 581
and Qn make eight possible combinations, but S = R = 1 is an invalid combination. So, the
corresponding entries for Qn+1 and D are don’t cares. Express D in terms of S, R and Qn.
The conversion table, the K-map for D in terms of S, R and Qn, and the logic diagram
showing the conversion from D to S-R are shown in Figure 10.47.
J-K flip-flop to T flip-flop: Here J-K flip-flop is available and we want T flip-flop operation
from it. So T is the external input and J and K are the actual inputs to the existing flip-flop. T and
Qn make four combinations. Express J and K in terms of T and Qn.
The conversion table, the K-maps for J and K in terms of T and Qn, and the logic diagram
showing the conversion from J-K to T are shown in Figure 10.48.
J-K flip-flop to D flip-flop: Here J-K flip-flop is available and we want D flip-flop operation
from it. Hence D is the external input and J and K are the actual inputs to the existing flip-flop. D
and Qn make four combinations. Express the inputs of the existing flip-flop J and K in terms of the
external input D and the present state Qn.
The conversion table, the K-maps for J and K in terms of D and Qn, and the logic diagram
showing the conversion from J-K to D are shown in Figure 10.49.
D flip-flop to J-K flip-flop: Here D flip-flop is available and we want J-K flip-flop operation
from it. Hence J and K are the external inputs, i.e. inputs to the combinational circuit and D is the
actual input to the existing flip-flop. J, K and Qn make eight combinations. Express the input of the
existing flip-flop D in terms of external inputs J, K and the present state Qn.
The conversion table, the K-map for D in terms of J, K, and Qn and the logic diagram showing
the conversion from D to J-K are shown in Figure 10.50.
Counting: A number of flip-flops may be connected in a particular fashion to count the pulses
electronically. One flip-flop can count up to 2 pulses; two flip-flops can count up to 22 = 4 pulses.
In general, N flip-flops can count up to 2N pulses. In a simple counter, all the flip-flops are connected
in toggle mode. The clock pulses are applied to the first flip-flop and the clock terminal of each
subsequent flip-flop is connected to the Q output of the previous flip-flop. Feedback may be
provided if the maximum count required is not 2N. Flip-flops may be used to count up or down or
up/down. Figures 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, etc. illustrate the use of flip-flops for counting.
Frequency division: Flip-flops may be used to divide the input signal frequency by any number.
A single flip-flop may be used to divide the input frequency by 2. Two flip-flops may be used to
divide the input frequency by 4. In general, N flip-flops may be used to divide the input frequency
by 2N. If N flip-flops are connected as a ripple counter (a counter in which the external signal is
applied to the clock terminal of the first flip-flop and the Q output of each flip-flop is connected to
the clock input of next flip-flop) and if the input signal of frequency f is fed to the first flip-flop, the
output of this flip-flop will be of frequency f/2, the output of the second flip-flop will be of frequency
f/4, and so on.
Figure 12.2a and the waveforms in Figure 12.2b (also Figures 12.7a and 12.7b) illustrate the
use of flip-flops for frequency division.
A. (a) Set-up time: The set-up time (ts) is the minimum time for which the control levels need to be
maintained constant on the input terminals of the flip-flop prior to the arrival of the triggering
edge of the clock pulse in order to enable the flip-flop to respond reliably.
(b) Hold time: The hold time (th) is the minimum time for which the control signals need to be
maintained constant at the input terminals of the flip-flop after the arrival of the triggering
edge of the clock pulse, in order to enable the flip-flop to respond reliably.
(c) Propagation delay time: The time interval between the time of application of the triggering
edge or asynchronous inputs and the time at which the output actually makes a transition is
called the propagation delay time of the flip-flop.
(b) Maximum clock frequency: The maximum clock frequency (fmax) is the highest frequency
at which a flip-flop can be reliably triggered.
(e) Power dissipation: The power dissipation of a flip-flop is the total power consumption of
the device. It is equal to the product of the supply voltage (VCC) and the current (ICC) drawn
from the supply by it. P = VCC ICC.
41. How do you convert one type of flip-flop into another?
A. To convert one type of flip-flop into another type, a combinational circuit is designed such that
if the inputs of the required flip-flop (along with the outputs of the actual flip-flop if required) are
fed as inputs to the combinational circuit and the output of the combinational circuit is connected
to the inputs of the actual flip-flop, then the output of the actual flip-flop is the output of the
required flip-flop.
42. What is a master-slave flip-flop?
A. A master-slave flip-flop is a cascade of two flip-flops in which the first one responds to the data
inputs when the clock is high, whereas the second one responds to the outputs of the first one
when the clock is low. Thus the final outputs change only when clock is low, when the data
inputs are not effective. Thus the race around condition gets eliminated in this. The first flip-flop
is known as the master and the second as the slave.
43. Why are master-slave flip-flops called pulse-triggered flip-flops?
A. Master-slave flip-flops are called pulse-triggered flip-flops, because the length of the time required
for its output to change state equals the width of one (clock) pulse.
44. Differentiate between edge-triggered and master-slave flip-flops.
A. In edge-triggered flip-flops only a positive or negative edge is required for triggering, whereas in
the case of master-slave flip-flops both a positive and a negative edge are required for
triggering.
45. What are data lock-out flip-flops?
A. Data lock-out flip-flops are nothing but master-slave flip-flops in which the master is an
edge-triggered flip-flop.
46. What is a trigger?
A. A momentary change of signal level and return to the initial level is referred to as a trigger.
47. What do you mean by excitations?
A. The inputs to the flip-flops are called excitations.
48. What is an excitation table?
A. An excitation table is a table which lists the inputs required to be applied to the flip-flop to take
it from the given present state to the required next state.
590 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
6. Draw the circuit diagram of a master-slave J-K flip-flop and explain its operation with the help of
a truth-table. How is it different from edge triggering? Explain.
7. Explain the following:
(a) Race around condition in flip-flop (b) J-K master-slave flip-flop
(c) Excitation table for flip-flops
8. Give the transition table for the following flip-flops:
(a) SR flip-flop (b) JK flip-flop (c) T flip-flop (d) D flip-flop
Briefly state the salient features of each flip-flop.
9. Find the characteristic equation for:
(a) SR flip-flop (b) JK flip-flop (c) T flip- flop (d) D flip-flop
10. Convert a J-K flip-flop into:
(a) SR flip-flop (b) T flip-flop (c) D flip-flop
11. Convert a D flip-flop into:
(a) SR flip-flop (b) JK flip-flop (c) T flip-flop
FLIP-FLOPS 591
31. The name flip-flop is because this circuit shifts ______ and ______ between its two stable states
upon application of proper inputs.
32. The state in which a circuit can remain permanently is called ______.
33. The input signals to a flip-flop are called ______.
22. The output Qn of a J-K flip-flop is 0. It changes to 1 when a clock pulse is applied. The inputs Jn
and Kn are respectively.
(a) 1 and X (b) 0 and X (c) X and 0 (d) X and 1
23. The output Qn of a J-K (or S-R) flip-flop is 0. Its output does not change when a clock pulse is
applied. The inputs Jn and Kn (or Sn Rn) are respectively
(a) X and 0 (b) X and 1 (c) 1 and X (d) 0 and X
24. The output Qn of a J-K flip-flop is 1. Its output does not change when a clock pulse is applied.
The inputs Jn and Kn are respectively
(a) 0X (b) X0 (c) 10 (d) 01
25. The outputs Q and Q of a master-slave S-R flip-flop are connected to its R and S inputs
respectively. Its output Q when clock pulses are applied will be
(a) permanently 0 (b) permanently 1
(c) fixed 0 or 1 (d) complementing with every clock pulse
26. Flip-flops can be used to make
(a) latches (b) bounce-elimination switches
(c) registers (d) all of the above
27. A master-slave flip-flop is triggered
(a) when the clock input is at HIGH logic level
(b) when the clock input makes a transition from LOW to HIGH
(c) when a pulse is applied at the clock input
(d) when the clock input is at LOW logic level.
28. A J-K M-S flip-flop comprises which of the following configurations?
(a) S-R flip-flop followed by an S-R flip-flop (b) S-R flip-flop followed by a J-K flip flop
(c) J-K flip flop followed by a J-K flip-flop (d) J-K flip-flop followed by an S-R flip-flop
29. In a J-K M-S flip-flop, race around is eliminated because of which of the following reasons?
(a) output of slave is fed back to the input of master
(b) output of master is fed back to the input of slave
(c) while the clock drives the master, inverted clock drives the slave
(d) J-K flip-flop is followed by S-R flip-flop
30. The toggle mode for a J-K flip-flop is
(a) J = 0, K = 0 (b) J = 1, K = 0 (c) J = 0, K = 1 (d) J = 1, K = 1
31. The transparent latch is
(a) an S-R flip-flop (b) a D flip-flop (c) a T flip-flop (d) a J-K flip-flop
32. In a master-slave J-K flip-flop, J = K = 1. The state Qn+1 of the flip-flop after the clock pulse will
be
(a) 0 (b) 1 (c) Qn (d) Qn
33. The characteristic equation of a J-K flip-flop is
(a) Qn+1 = J Qn + KQn (b) JQn + K Qn (c) J Qn + KQn (d) J Qn + K Qn
34. The characteristic equation of a D flip-flop is
(a) Qn+1 = D (b) Qn+1 = Qn (c) Qn+1 = 1 (d) Qn+1 = Qn
FLIP-FLOPS 595
PROBLEMS
10.1 If the waveforms shown in Figure P10.1 are applied to an active-HIGH S-R latch which is in the
RESET state, draw the output waveform.
Figure P10.1
10.2 If the waveforms shown in Figure P10.2 are applied to an active-LOW S-R latch which is in the
RESET state, draw the output waveform.
Figure P10.2
10.3 The waveforms shown in Figure P10.3 are applied to (a) a positive edge-triggered S-R flip-flop
and (b) a negative edge-triggered S-R flip-flop. Draw the output waveform in each case.
Figure P10.3
596 FUNDAMENTALS OF DIGITAL CIRCUITS
10.4 The waveforms shown in Figure P10.4 are applied to (a) a positive-edge-triggered J-K flip-flop,
(b) a negative edge-triggered J-K flip-flop, and (c) a master-slave J-K flip-flop. Draw the output
waveform in each case.
Figure P10.4
10.5 The input signals shown in Figure P10.5 are applied to a positive edge-triggered J-K master-
slave flip-flop with active-LOW PRESET and CLEAR. Draw the output waveform.
Figure P10.5
10.6 The waveforms shown in Figure P10.6 are applied to a negative edge-triggered S-R flip-flop
with active-HIGH PRESET and CLEAR. Draw the output waveform.
Figure P10.6
FLIP-FLOPS 597
10.7 The following serial data are applied to the flip-flop shown in Figure P10.7. Determine the
resulting serial data that appears on the Q output. There is one clock pulse for each bit time.
Assume that, Q is initially 0. The rightmost bits are applied first.
J1 = 10110110 J2 = 11011001
K1 = 10010110 K2 = 11011011
J2
J Q
J1
C
K2
K Q
K1
Figure P10.7
598 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
SIMULATION OUTPUT:
begin
process (j, k, clk, rst, q, qbar)
begin
if (rst = ‘1’) then
q <= ‘0’;
qbar <= ‘0’;
else if (clk = ‘1’ and clk’event) then
if (j = ‘0’ and k = ‘0’ ) then
q <= q; qbar <= qbar;
elsif (j = ‘0’ and k = ‘1’ ) then
q <=’0'; qbar <= ‘1’;
elsif (j = ‘1’ and k = ‘0’ ) then
q <=’1'; qbar <= ‘0’;
else
q <= qbar; qbar <= q;
end if;
end if;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
q : inout std_logic;
qbar : inout std_logic);
end tff;
begin
process (clk,rst,t)
begin
if(rst=’1')then
q<=’0';
qbar<=’1';
elsif(clk=’1' and clk’event)then
if(t=’0')then
q<=q;
qbar<=qbar;
else
q<=not(q);
qbar<=not(qbar);
end if;
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
entity dff is
port (data :in std_logic;
clk :in std_logic;
reset :in std_logic;
q :out std_logic );
end dff;
FLIP-FLOPS 601
begin
process (clk) begin
if (reset = ‘1’) then
q <= ‘0’;
q <= data;
end if;
end process;
end Behavioral ;
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR S-R FLIP-FLOP
module SR_ff(q,qbar,s,r,clk);
output q,qbar;
input clk,s,r;
reg tq;
always @(posedge clk)
begin
if (s == 1’b0 && r == 1’b0)
tq <= tq;
else if (s == 1’b0 && r == 1’b1)
tq <= 1’b0;
else if (s == 1’b1 && r == 1’b0)
tq <= 1’b1;
else if (s == 1’b1 && r == 1’b1)
tq <= 1’bx;
end
assign q = tq;
assign qbar = ~tq;
endmodule
602 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
604 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
11
SHIFT REGISTERS
11.1 INTRODUCTION
Data may be available in parallel form or in serial form. Multi-bit data is said to be in parallel form
when all the bits are available (accessible) simultaneously. The data is said to be in serial form
when the data bits appear sequentially (one after the other, in time) at a single terminal. Data may
also be transferred in parallel form or in serial form. Parallel data transfer is the simultaneous
transmission of all bits of data from one device to another. Serial data transfer is the transmission
of one bit of data at a time from one device to another. Serial data must be transmitted under the
synchronization of a clock, since the clock provides the means to specify the time at which each
new bit is sampled.
As a flip-flop (FF) can store only one bit of data, a 0 or a 1, it is referred to as a single-bit
register. When more bits of data are to be stored, a number of FFs are used. A register is a set of
FFs used to store binary data. The storage capacity of a register is the number of bits (1s and 0s) of
digital data it can retain. Loading a register means setting or resetting the individual FFs, i.e.
inputting data into the register so that their states correspond to the bits of data to be stored.
Loading may be serial or parallel. In serial loading, data is transferred into the register in serial
form, i.e. one bit at a time, whereas in parallel loading, the data is transferred into the register in
parallel form meaning that all the FFs are triggered into their new states at the same time. Parallel
input requires that the SET and/or RESET controls of every FF be accessible.
605
606 FUNDAMENTALS OF DIGITAL CIRCUITS
A register may output data either in serial form or in parallel form. Serial output means that
the data is transferred out of the register, one bit at a time serially. Parallel output means that the
entire data stored in the register is available in parallel form, and can be transferred out at the same
time.
Shift registers are a type of logic circuits closely related to counters. They are used basically
for the storage and transfer of digital data. The basic difference between a shift register and a
counter is that, a shift register has no specified sequence of states except in certain very specialized
applications, whereas a counter has a specified sequence of states.
A shift register is a very important digital building block. It has innumerable applications.
Registers are often used to momentarily store binary information appearing at the output of an
encoding matrix. A register might be used to accept input data from an alphanumeric keyboard
and then present the data at the input of a microprocessor chip. Similarly, shift registers are often
used to momentarily store binary data at the output of a decoder. A shift register also forms the
basis for some very important arithmetic operations. For example, the operations of
complementation, multiplication, and division are frequently implemented by means of a register.
A shift register can also be connected to form a number of different types of counters. These
counters offer some very distinct advantages.
When the positive clock edge arrives, the stored word becomes:
Q4Q3Q2Q1 = X4X3X2X1
or Q=X
This circuit is too primitive to be of any use. What it needs is some control over the X bits, i.e.
some way of holding them off until we are ready to store them.
SHIFT REGISTERS 607
Figure 11.2 shows a controlled buffer register. If CLR goes LOW, all the FFs are RESET and the
output becomes, Q = 0000.
When CLR is HIGH, the register is ready for action. LOAD is the control input. When
LOAD is HIGH, the data bits X can reach the D inputs of FFs. At the positive-going edge of the
next clock pulse, the register is loaded, i.e.
Q4 Q3 Q2 Q1 = X4 X3 X2 X1
or Q=X
When LOAD is LOW, the X bits cannot reach the FFs. At the same time, the inverted signal
LOAD is HIGH. This forces each flip-flop output to feed back to its data input. Therefore, data is
circulated or retained as each clock pulse arrives. In other words, the contents of the register
remain unchanged in spite of the clock pulses. Longer buffer registers can be built by adding more
FFs.
input of the second FF, the Q output of the second FF to J(S) input of the third FF, and so on. Also,
Q1 is connected to K2 (R2), Q2 is connected to K3 (R3), and so on.
Figure 11.6 shows the logic diagrams of a 4-bit serial-in, serial-out, shift-left, shift register.
Figure 11.10 shows the logic diagram of a 4-bit serial-in, serial-out, bidirectional (shift-left,
shift-right) shift register. Right/ Left is the mode signal. When Right/ Left is a 1, the logic circuit
works as a shift-right shift register. When Right/ Left is a 0, it works as a shift-left shift register.
The bidirectional operation is achieved by using the mode signal and two AND gates and one OR
gate for each stage as shown in Figure 11.10.
A HIGH on the Right/ Left control input enables the AND gates G1, G2, G3, and G4 and
disables the AND gates G5, G6, G7, and G8, and the state of Q output of each FF is passed through
the gate to the D input of the following FF. When a clock pulse occurs, the data bits are then
effectively shifted one place to the right. A LOW on the Right/ Left control input enables the AND
gates G5, G6, G7, and G8 and disables the AND gates G1, G2, G3, and G4, and the Q output of each
FF is passed to the D input of the preceding FF. When a clock pulse occurs, the data bits are then
effectively shifted one place to the left. Hence, the circuit works as a bidirectional shift register.
Mode control
S1 S0 Register operation
0 0 No change
0 1 Shift right
1 0 Shift left
1 1 Parallel load
614 FUNDAMENTALS OF DIGITAL CIRCUITS
a shift-left operation results with the other serial input going into flip-flop FF1. Finally when
S1S0 = 11, the binary information on the parallel input lines is transferred into the register
simultaneously during the next clock edge.
Figure 11.12 One-half of the 2401 dual 1024-bit dynamic NMOS shift register.
18. How will you use a shift register to multiply or divide a binary number by 2?
A. The binary number is to be stored in the shift register and then shifted towards left or right
respectively by one bit position for multiplication or division by 2.
19. What are the basic types of shift registers?
A. There are four basic types of shift registers. They are: (a) serial-in, serial-out, (b) serial-in
parallel-out, (c) parallel-in, serial-out and (d) parallel-in, parallel-out shift registers.
20. What is a serial-in, serial-out shift register?
A. A serial-in, serial-out shift register is one which accepts data serially, i.e. one bit at a time and
also outputs data serially.
21. What is a serial-in, parallel-out shift register?
A. A serial-in, parallel-out shift register is one in which the data bits are entered into the register
serially, i.e. one bit at a time but the data stored in the register is shifted out in parallel form, i.e.
simultaneously.
22. What is a parallel-in, serial-out shift register?
A. A parallel-in, serial-out shift register is one in which the data bits are entered simultaneously into
their respective stages on parallel lines, but the data bits are transferred out of the register serially,
i.e. on a bit-by-bit basis on a single line.
23. What is a parallel-in, parallel-out shift register?
A. A parallel-in, parallel-out shift register is one in which the data is entered into the register in
parallel form and also the data is taken out of the register in parallel form.
24. What is a bidirectional shift register?
A. A bidirectional shift register is one in which the data bits can be shifted from left to right as well
as from right to left.
25. What is a universal shift register?
A. A universal shift register is a bidirectional register, whose input can be either in serial form or in
parallel form and whose output also can be either in serial form or in parallel form.
26. What is a static shift register?
A. A static shift register is one in which each of the memory elements used to build the register can
retain the data bit indefinitely. So once loaded, the contents of each element of the register remain
the same. So a shift register using flip-flops is called a static shift register. In a static shift register
data stored is stationary.
27. What is a dynamic shift register?
A. A dynamic shift register is one in which the storage is accomplished by continually shifting the
bits from one stage to the next and recirculating the output of the last stage into the first stage.
The data continually circulates through the register under the control of a clock. To obtain output,
a serial output terminal must be accessed at a specific clock pulse, otherwise the sequence of bits
will not correspond to the data stored.
28. Where are dynamic MOS registers used?
A. Dynamic MOS registers are widely used as memory devices in digital systems that operate on
serial data. Because of their small power consumption and the inherent slowness of the serial
systems, they are used in applications where power consumption and physical size are more
important considerations than speed, such as in pocket calculators.
29. Dynamic shift registers are made up of which devices?
A. Dynamic shift registers are made up of MOS inverters.
SHIFT REGISTERS 619
REVIEW QUESTIONS
10. In a ______ shift register data is fed in serially but taken out parallelly.
11. In a ______ shift register data is fed in, in parallel form but shifted out in serial form.
12. In a ______ shift register data is both fed in and shifted out in parallel form.
13. In a ______ shift register, data can be shifted from left-to-right or right-to-left.
14. In a ______ register, data can be shifted from left-to-right or right-to-left and also data can be
shifted in or shifted out in serial form or in parallel form.
15. A shift register using flip-flops is called a ______ shift register.
16. In a ______ shift register, the data stored is stationary.
17. Dynamic shift registers are made up of ______.
18. ______ registers are used in pocket calculators.
19. Dynamic MOS registers are used in applications where power consumption and space are more
important than ______.
20. In a ______ storage is accomplished by continually shifting data from one stage to the next and
re-circulating through the output of the last stage into the first stage.
21. The main advantages of dynamic MOS registers are their ______ and ______.
22. The main disadvantage of dynamic MOS registers is that ______.
23. An interfacing device used to accomplish serial-to-parallel and parallel-to-serial data conversion
is called ______.
24. ______ shift registers are made up of flip-flops which can retain data indefinitely.
VHDL PROGRAMS
1. VHDL PROGRAM FOR SERIAL-IN, SERIAL-OUT SHIFT REGISTER
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity serinout is
Port ( d : in std_logic;
clk : in std_logic;
rst : in std_logic;
q : out std_logic);
end serinout;
architecture Behavioral of serinout is
signal x : std_logic_vector(7 downto 0);
begin
process (d, clk, rst)
begin
if (rst = ‘1’) then
q <= ‘X’;
elsif (clk = ‘1’ and clk’event) then
x(0) <= d;
x(1) <= x(0);
x(2) <= x(1);
x(3) <= x(2);
x(4) <= x(3);
x(5) <= x(4);
x(6) <= x(5);
x(7) <= x(6);
q <= x(7);
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
622 FUNDAMENTALS OF DIGITAL CIRCUITS
entity sipo is
Port ( si : in std_logic;
clk : in std_logic;
rst : in std_logic;
q : inout std_logic_vector(0 to 7));
end sipo;
SIMULATION OUTPUT:
entity piso is
Port ( d : inout std_logic_vector(7 downto 0);
a : in std_logic_vector(7 downto 0);
clk : in std_logic;
rst : in std_logic;
i : in std_logic;
q : inout std_logic_vector(7 downto 0));
end piso;
begin
process (d, a, clk, rst, i, q)
variable ibar, s1, s2, s3, s4, s5, s6,s7,s8,s9,s10,s11,s12,s13,
s14: std_logic;
begin
ibar := not i;
s1 := q(0) and i;
s2 := ibar and a(1);
s3 := q(1) and i;
s4 := ibar and a(2);
s5 := q(2) and i;
s6 := ibar and a(3);
s7 := q(3) and i;
s8 := ibar and a(4);
s9 := q(4) and i;
s10 := ibar and a(5);
s11 := q(5) and i;
s12 := ibar and a(6);
s13 := q(6) and i;
s14 := ibar and a(7);
d(0) <= a(0);
d(1) <= s1 or s2;
d(2) <= s3 or s4;
d(3) <= s5 or s6;
d(4) <= s7 or s8;
d(5) <= s9 or s10;
d(6) <= s11 or s12;
d(7) <= s13 or s14;
if (rst = ‘1’) then
q <= “00000000”;
else if (clk = ‘1’ and clk’event) then
q(0) <= d(0);
q(1) <= d(1);
624 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
do(5)<=di(5);
do(6)<=di(6);
do(7)<=di(7);
end if;
end process;
end Behavioral;
SIMULATION OUTPUT:
entity univ_shiftreg is
port(clk, il, ir : in std_logic;
s: in std_logic_vector(1 downto 0);
i : in std_logic_vector(3 downto 0);
q : out std_logic_vector(3 downto 0));
end univ_shiftreg;
end process;
q <= qtmp;
end Behavioral;
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR SERIAL-IN, SERIAL-OUT SHIFT REGISTER
module siso(clk,rst,a,q);
input a;
input clk,rst;
output q;
reg q;
always@(posedge clk,posedge rst)
begin
if(rst==1’b1)
q<=1’b0;
else
q<=a;
end
endmodule
SIMULATION OUTPUT:
SHIFT REGISTERS 627
SIMULATION OUTPUT:
begin
q<=1’b0;
temp<=a;
end
else
begin
q<=temp[0];
temp <= temp>>1’b1;
end
end
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
12
COUNTERS
12.1 INTRODUCTION
A digital counter is a set of flip-flops (FFs) whose states change in response to pulses applied at
the input to the counter. The FFs are interconnected such that their combined state at any time is
the binary equivalent of the total number of pulses that have occurred up to that time. Thus, as its
name implies, a counter is used to count pulses. A counter can also be used as a frequency divider
to obtain waveforms with frequencies that are specific fractions of the clock frequency. They are
also used to perform the timing function as in digital watches, to create time delays, to produce
non-sequential binary counts, to generate pulse trains, and to act as frequency counters, etc.
Counters may be asynchronous counters or synchronous counters. Asynchronous counters
are also called ripple counters. The ripple counter is the simplest type of counter, the easiest to
design and requires the least amount of hardware. In ripple counters, the FFs within the counter
are not made to change the states at exactly the same time. This is because the FFs are not triggered
simultaneously. The clock does not directly control the time at which every stage changes state.
An asynchronous counter uses T FFs to perform a counting function. The actual hardware used is
usually J-K FFs connected in toggle mode, i.e. with Js and Ks connected to logic 1. Even D FFs
may be used here.
The asynchronous counter has a disadvantage, in so far as the unwanted spikes are concerned.
This limitation is overcome in parallel counters. The asynchronous counter is called ripple counter
because when the counter, for example, goes from 1111 to 0000, the first stage causes the second
to flip, the second causes the third to flip, and the third causes the fourth to flip, and so on. In other
631
632 FUNDAMENTALS OF DIGITAL CIRCUITS
words, the transition of the first stage ripples through to the last stage. In doing so, many intermediate
stages are briefly entered. If there is a gate that will AND during any state, a brief spike will be
seen at the gate output every time the counter goes from 1111 to 0000. Ripple counters are also
called serial or series counters. Synchronous counters are clocked such that each FF in the counter
is triggered at the same time. This is accomplished by connecting the clock line to each stage of the
counter. Synchronous counters are faster than asynchronous counters, because the propagation
delay involved is less.
Comparison of synchronous and asynchronous counters is given in Table 12.1.
A counter which goes through all the possible states before restarting is called the full modulus
counter. A counter in which the maximum number of states can be changed is called the variable
modulus counter. The final state of the counter sequence is called the terminal count.
Lock-out: In shortened-modulus counters, there may occur the problem of lock-out. Sometimes
when the counter is switched on, or any time during counting, because of noise spikes, the counter
may find itself in some unused (invalid) state. Subsequent clock pulses may cause the counter to
move from one unused state to another unused state and the counter may never come to a valid
state. So, the counter becomes useless. A counter whose unused states have this feature is said to
suffer from the problem of lock-out. To ensure that, at ‘start-up’ the counter is in its initial state,
external logic circuitry is provided which properly resets each FF. The logic circuitry for presetting
the counter to its initial state can be provided either by obtaining an expression for reset/preset for
the FFs or by modifying the design such that the counter goes from each invalid state to the initial
state after the clock pulse. So, no don’t cares are permitted in this design.
Combination of modulo counters: A single FF is a mod-2 counter. We can have a counter of
any modulus by choosing an appropriate number of FFs and providing proper feedback. Counters
of different mods can be combined to get another mod counter. For example, a mod-2 counter and
a mod-5 counter can be combined to get a mod-10 counter; a mod-5 counter and a mod-4 counter
can be combined to get a mod-20 counter, and so on. The connection between the individual
counters may be a ripple connection, or the counters may be operated in synchronism with one
another independently of whether the individual counters are ripple or synchronous. Further, we
are at liberty to choose the order of the individual counters in a chain of counters. Such permutations
will not change the modulus of the composite counter but may well make a substantive difference
in the code in which the counter state is to be read.
For down counting, Q1 of FF1 is connected to the clock of FF2. Let initially all the FFs be
reset, i.e. let the count be 00. At the negative-going edge of the first clock pulse, FF1 toggles, so,
Q1 goes from a 0 to a 1 and Q1 goes from a 1 to a 0. This negative-going signal at Q1 applied to the
clock input of FF2, toggles FF2 and, therefore, Q2 goes from a 0 to a 1. So, after one clock pulse
Q2 = 1 and Q1 = 1, i.e. the state of the counter is 11. At the negative-going edge of the second clock
pulse, Q1 changes from a 1 to a 0 and Q1 from a 0 to a 1. This positive-going signal at Q1 does not
affect FF2 and, therefore, Q2 remains at a 1. Hence, the state of the counter after the second clock
pulse is 10. At the negative-going edge of the third clock pulse, FF1 toggles. So, Q1 goes from a 0
to a 1 and Q1 from a 1 to a 0. This negative-going signal at Q1 toggles FF2 and, so, Q2 changes
from a 1 to a 0. Hence, the state of the counter after the third clock pulse is 01. At the negative-
going edge of the fourth clock pulse, FF1 toggles. So, Q1 goes from a 1 to a 0 and Q1 from a 0 to a
1. This positive-going signal at Q1 does not affect FF2. So, Q2 remains at a 0. Hence, the state of
the counter after the fourth clock pulse is 00. For subsequent clock pulses the counter goes through
the same sequence of states, i.e. the counter counts in the order 00, 11, 10, 01, 00, and 11 …
or a bidirectional counter. So, a control signal or a mode signal M is required to choose the direction
of count. When M = 1 for up counting, Q1 is transmitted to clock of FF2 and when M = 0 for down
counting, Q1 is transmitted to clock of FF2. This is achieved by using two AND gates and one OR
gate as shown in Figure 12.3. The external clock signal is applied to FF1.
Clock signal to FF2 = (Q1 ◊ Up) + (Q1 ◊ Down) = Q1M + Q1 M
Figure 12.3 Asynchronous 2-bit up-down counter using negative edge-triggered flip-flops.
Figure 12.4 Asynchronous 2-bit up-counter using positive-edge triggered J-K flip-flops.
Figure 12.5 Asynchronous 2-bit down-counter using positive edge-triggered J-K flip-flops.
Figure 12.6 Logic diagram of a two-bit ripple up/down counter using positive edge-triggered
flip-flops.
after the first clock pulse it goes to 001, after the second clock pulse, it goes to 010, and so on.
After the sixth clock pulse, it goes to 000.
For the design, write a truth table (Figure 12.7c) with the present state outputs Q3, Q2 and Q1
as the variables, and reset R as the output and obtain an expression for R in terms of Q3, Q2 and Q1.
That decides the feedback to be provided. From the truth table, R = Q3Q2. For active-LOW reset,
R is used. The reset pulse is of very short duration, of the order of nanoseconds and it is equal to
the propagation delay time of the NAND gate used. The expression for R can also be determined
as follows.
R = 0 for 000 to 101, R = 1 for 110, and R = X for 111
Therefore,
R = Q3Q2Q1 + Q3Q2Q1 = Q3Q2
The logic diagram, the timing diagram, and the table for R of a mod-6 counter are all shown
in Figure 12.7. From the timing diagram it is seen that a glitch appears in the waveform of Q2.
16 possible states, out of which ten are valid and the remaining six are invalid. The counter has ten
stable states, 0000 through 1001, i.e. it counts from 0 to 9. The initial state is 0000 and after nine
clock pulses it goes to 1001. When the tenth clock pulse is applied, the counter goes to state 1010
temporarily, but because of the feedback provided, it resets to initial state 0000. So, there will be
a glitch in the waveform of Q2. The state 1010 is a temporary state for which the reset signal R =
1, R = 0 for 0000 to 1001, and R = X (don’t care) for 1011 to 1111.
The count table and the K-map for reset are shown in Figures 12.8a and 12.8b,
respectively. From the K-map, R = Q4Q2. So, feedback is provided from second and fourth
FFs. For active-HIGH reset, Q4Q2 is applied to the CLEAR terminal. For active-LOW reset,
Q 4 Q 2 is connected to CLR of all the FFs. The logic diagram of the decade counter is shown
in Figure 12.8c.
propagation delay of tpd. Q2 changes state after another propagation delay time of 2tpd. Q3 changes
state after 3tpd and Q4 changes state after 4tpd. The timing diagram considering propagation delays
is shown in Figure 12.9.
Figure 12.9 Timing diagram considering propagation delay (no skipping of states).
If the propagation delay is large and clock frequency high, i.e. clock period is low, then there
is a possibility that the first FF responds to the new clock pulse before the previous clock pulse has
effected transition of the fourth FF. When the last FF finally responds, the counter may read 1001
having skipped 1000. Thus the count goes directly from 0111 to 1001. If the clock frequency is so
high that it is possible for the clock pulse to change the state of the first stage, before the state
changes caused by the previous clock pulse have rippled through to the last stage, then a count will
be skipped. Thus it is obvious that propagation delays in the FFs of a ripple counter impose a limit
on the frequency at which the counter can be clocked.
If TC is the period of the clock pulse, n the number of stages and tpd the propagation delay in
each stage, then the clock frequency fC is constrained by
1 1
fC
TC ntpd
Suppose TC = 0.1 ms, i.e. fC = 1/(0.1 ms) = 10 MHz and suppose tpd = 0.05 ms, the timing
diagram would then be as shown in Figure 12.10. Here skipping of states occur. The count 1000 is
not reached at all as shown in Figure 12.10.
640 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.11 Example 12.1: Logic diagram of a 3-bit asynchronous counter using D flip-flops.
are often constructed by cascading lower modulus counters because of the availability of certain
standard modulus counters in IC form. Figure 12.12(b) shows the logic diagram of cascaded ripple
counters.
EXAMPLE 12.2 A binary ripple counter is required to count up to 16,38310. How many
FFs are required? If the clock frequency is 8.192 MHz, what is the frequency at the output of
the MSB?
Solution
The number of FFs n is to be selected such that the number of states N £ 2n. With n FFs, the
largest count possible is 2n – 1. Therefore,
2n – 1 = 16,383
or n = log2 16,384 = 14
So, the number of FFs required is 14.
Frequency at the output of last stage is
fC 8.192 MHz
f14 = 14
= 500 Hz
2 16,384
EXAMPLE 12.3 For what minimum value of propagation delay in each FF will a 10-bit
ripple counter skip a count when it is clocked at 10 MHz?
Solution
For a state change to ripple through all n stages, TC = ntpd. Therefore, the clock frequency is
constrained by
642 FUNDAMENTALS OF DIGITAL CIRCUITS
1 1
fC
TC ntpd
1
Therefore, tpd
nfC
1
or tpd (min) 10 ns
10 10 106
Step 4. Minimal expressions for excitations: Obtain the minimal expressions for the excitations
of the FFs using the K-maps drawn for the excitations of the flip-flops in terms of the present states
and inputs.
Step 5. Logic diagram: Draw a logic diagram based on the minimal expressions.
If the synchronous counter is a shortened-modulus counter it may suffer from the problem of
lock-out. That is, the counter may not self-start. A self-starting counter is one that will eventually
enter its proper sequence of states regardless of its initial state. The counter can be made self-starting
by so designing it that it goes to a particular state whenever it enters an invalid state. The same
procedure can be used for counters of any number of bits and any arbitrary sequence. The only
restriction on the sequence is that, it cannot contain the same state more than once within one
complete cycle before repeating itself.
In the case of an up-down counter the state diagram shows the relationship between the
present state, the input, and the next state of the counter. In the case of an up-counter or down-
counter the state diagram shows only the relationship between the present state and the next state
because only one type of input is given.
The excitation tables of various flip-flops used in the counters are shown in Table 12.2.
0 0 0 0 0 0
0 1 1 0 1 1
1 0 0 1 0 1
1 1 1 1 1 0
Step 2. Draw the state diagram: The state diagram of the 3-bit up-down counter is drawn as
shown in Figure 12.13a.
Step 3. Select the type of flip-flops and draw the excitation table: JK flip-flops are selected
and the excitation table of a 3-bit up-down counter using JK flip-flops is drawn as shown in
Figure 12.13b.
Step 4. Obtain the minimal expressions: From the excitation table we can conclude that J1 = 1
and K1 = 1, because all the entries for J1 and K1 are either X or 1. The K-maps for J3, K3, J2 and K2
based on the excitation table and the minimal expressions obtained from them are shown in
Figure 12.14.
Step 5. Draw the logic diagram: A logic diagram using those minimal expressions can be drawn
as shown in Figure 12.15.
Figure 12.14 K-maps for excitations of synchronous 3-bit up-down counter (Contd.)...
COUNTERS 645
Figure 12.15 Logic diagram of the synchronous 3-bit up-down counter using J-K FFs.
Second method: A 3-bit up-down counter can also be realized by designing the up-counter and
the down-counter separately and then combining them using a mode signal and additional gates.
Step 1. Determine the number of flip-flops required: A 3-bit up-counter requires 3 flip-flops.
The counting sequence is 000, 001, 010, 011, 100, 101, 110, 111, 000 …
Step 2. Draw the state diagram: The state diagram of the 3-bit up-counter is drawn as shown in
Figure 12.16a.
Step 3. Select the type of flip-flops and draw the excitation table: JK flip-flops are selected and
the excitation table of a 3-bit up-counter using J-K flip-flops is drawn as shown in Figure 12.16b.
Step 4. Obtain the minimal expressions: From the excitation table it is seen that, J1 = K1 = 1,
because all the entries for J1 and K1 are either a 1 or an X. The K-maps for excitations based on the
excitation table and the minimal expressions for excitations J3, K3, J2, and K2 in terms of the
present outputs Q3, Q2, and Q1 obtained by minimizing the K-maps are shown in Figure 12.17.
Also observing the up counting sequence, we can conclude that Q1 changes state for every
clock pulse. So FF1 has to be in toggle mode. Therefore J1 = K1 = 1. Q2 changes state whenever Q1
is 1, i.e. FF2 toggles whenever Q1 is 1. Therefore J2 = K2 = Q1. Q3 changes state whenever Q2 = 1
and Q1 = 1; that means, FF3 toggles whenever Q1 Q2 = 1. Therefore J3 = K3 = Q1 Q2.
646 FUNDAMENTALS OF DIGITAL CIRCUITS
whenever Q2 = 0 and Q1 = 0, i.e Q1 = 1 and Q2 = 1; that means, FF3 toggles whenever Q1Q2 = 1.
Therefore J3 = K3 = Q1Q2.
Figure 12.19 K-maps for a three-bit down counter using J-K FFs.
From the design equations of the up-counter and the down-counter we see that, in both cases
J1 = 1 and K1 = 1. Therefore, for the up/down counter too, J1 = 1 and K1 = 1. For the up-counter
J2 = K2 = Q1 and for the down-counter, J2 = K2 = Q1. So, for the up/down counter, J2 = K2 =
(Q1 ◊ Up) + (Q1 ◊ Down).
Similarly, for the up-counter, J3 = K3 = Q2Q1, and for the down-counter, J3 = K3 = Q2Q1. So,
for an up/down counter
J3 = K3 = (Q1 ◊ Q2 ◊ Up) + (Q1 ◊ Q2 ◊ Down)
By using a control signal M, and taking M = 1 for the up-mode and M = 0 for the down-mode
and combining the above equations, the design equations of an up/down counter are
J1 = K1 = 1
J2 = K2 = (Q1 ◊ Up) + (Q1 ◊ Down) = Q1M + Q1M
J3 = K3 = (Q1 ◊ Q2 ◊ Up) + (Q1 ◊ Q2 ◊ Down) = Q1Q2M + Q1Q2M
648 FUNDAMENTALS OF DIGITAL CIRCUITS
We see that these equations are the same as the equations obtained by the direct design of the
up/down counter. So, the circuit will be the same as that shown in Figure 12.15.
Step 4. The minimal expressions: From the excitation table we observe that T1 = 1 because all
the entries for T1 are 1. The K-maps for T4 and T3 based on the excitation table and the minimal
expressions obtained from them are shown in Figure 12.21. Also drawing and minimizing the K-
maps for T2, we get
T2 = Q4Q1M + Q4Q1M + Q2Q1M + Q3Q1M
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.22.
COUNTERS 649
Step 4. The minimal expressions: The K-maps for excitations T4, T3, T2 , and T1 in terms of the
outputs of the FFs Q4, Q3, Q2, and Q1, their minimization and the minimal expressions for excitations
obtained from them are shown in Figure 12.24.
Figure 12.24 K-maps for excitations of synchronous mod-9 counter using T flip-flops.
COUNTERS 651
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.25.
Figure 12.25 Logic diagram of the synchronous mod-9 counter using T flip-flops.
Step 4. The minimal expressions: The K-maps for excitations of FFs T3, T2 and T1 in terms of
outputs of FFs Q3, Q2 and Q1, their minimization and the minimal expressions for excitations
obtained from them are shown in Figure 12.27.
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.28.
652 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.27 K-maps for excitations of a synchronous mod-6 Gray code counter.
Step 4. The minimal expressions: The K-maps for excitations of FFs T4, T3, T2 and T1 in terms of
outputs of FFs Q4, Q3, Q2 and Q1, their minimization, and the minimal expressions for excitations
obtained from them are shown in Figure 12.30.
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.31.
Figure 12.30 K-maps for excitations of a synchronous mod-10 Gray code counter.
Figure 12.31 Logic diagram of synchronous mod-10 Gray code counter using T FFs.
654 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.33 K-maps for excitations of synchronous BCD counter using J-K flip-flops (Contd.)...
COUNTERS 655
Figure 12.33 K-maps for excitations of synchronous BCD counter using J-K flip-flops.
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.30.
Figure 12.34 Logic diagram of synchronous BCD counter using J-K flip-flops.
The state diagram and the table to check for lock-out are shown in Figure 12.35. The table to
check for lock-out shows that, if the counter finds itself in an invalid state initially, it moves to a
valid state after one or two clock pulses and then counts in the normal way. Therefore, the counter
is self-starting.
Figure 12.35 Checking for lock out of Synchronous BCD counter using J-K flip-flops.
Step 2. The state diagram: The state diagram for the mod-6 counter is drawn as shown in Figure 12.36a.
Step 3. The type of flip-flops and the excitation table: JK flip-flops are selected and the excitation
table of a mod-6 counter using J-K FFs is drawn as shown in Figure 12.36b. (States 110 and 111
can be removed from the state diagram if it is not required to determine whether the counter is self
starting or not).
Step 4. The minimal expressions: The K-maps for excitations of FFs J3, K3, J2, K2, J1 and K1 in
terms of the outputs of FFs Q3, Q2 and Q1, their minimization, and the minimal expressions for
excitations obtained from them are shown in Figure 12.37.
Figure 12.37 K-maps for excitations of synchronous mod-6 counter using J-K flip-flops.
Step 5. The logic diagram: The logic diagram based on those minimal expressions is drawn as
shown in Figure 12.38.
Figure 12.38 Logic diagram of synchronous mod-6 counter using J-K flip-flops.
COUNTERS 657
Check for self starting: For this counter, 110 and 111 are the invalid states. We can determine
the counter’s sequence when its initial present state is 110 or 111. Given each present state, we can
determine the J and K inputs from the logic diagram. With these inputs applied to the counter,
which is in the present state, we can determine each of the next states of the counter. From Table 12.3
we see that, if the present state (Q3Q2Q1) is 110, the excitations are J3 = 0, K3 = 0, J2 = 0, K2 = 0,
J1 = 1 and K1 = 1. With these excitations, the counter changes from 110 to 111. If the present state
is 111, the excitations are J3 = 1, K3 = 1, J2 = 0, K2 = 1, J1 = 1 and K1 = 1. With these excitations the
counter changes from 111 to 000. From the table, to check for lock-out, we see that the counter is
self-starting because if the counter initially finds itself in state 111, it goes to 000 after one clock
pulse and if the counter is initially in state 110, then it goes to 111 after one clock pulse and goes
to 000 after two clock pulses.
PS Present inputs NS
Q3 Q2 Q1 J3 K3 J2 K2 J1 K1 Q3 Q2 Q1
1 1 0 0 0 0 0 1 1 1 1 1
1 1 1 1 1 0 1 1 1 0 0 0
EXAMPLE 12.4 Design a type T counter that goes through states 0, 3, 5, 6, 0 ... . Is the
counter self-starting?
Solution
Step 1. The number of flip-flops: This counter has only four stable states, but it requires
three FFs, because it counts 101 and 110 (6 £ 23). Three FFs can have 8 states, out of which
states 000, 011, 101, 110 are valid and states 001, 010, 100, 111 are invalid. The entries for
excitations corresponding to invalid states are don’t cares.
Step 2. The state diagram: The state diagram of the counter is shown in Figure 12.39a.
Step 3. The type of flip-flops and the excitation table: T flip-flops are selected and the
excitation table of this counter using T flip-flops is drawn as shown in Figure 12.39b.
Step 4. The minimal expressions: The K-maps for T3, T2, and T1 in terms of Q3, Q2, and Q1
based on the excitation table, their minimization, and the minimal expressions obtained from
them are shown in Figure 12.40.
658 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.40 Example 12.4: K-maps for excitations of T type, 0, 3, 5, 6, 0... counter.
Step 5. The logic diagram: The logic diagram based on those minimal expressions is shown
in Figure 12.41a.
The table to check for lock-out is shown in Figure 12.41b. We see that the counter is not
self-starting. It suffers from the problem of lock-out. That is, initially if it enters an invalid
state, it keeps on moving from one invalid state to another when clock pulses are applied and
never returns to a valid state and, therefore, it serves no useful purpose.
Figure 12.41 Example 12.4: T type counter that goes through states 0, 3, 5, 6, 0, … .
Figure 12.42 Example 12.4: Table for R, K-map, and the minimal expression for R.
Obtain this reset pulse from the counter already designed (taking the excitations corresponding
to the invalid states as don’t cares) and feed it to the CLR terminals of the FFs. The circuit of
Figure 12.41a is, therefore, modified as shown in Figure 12.43. The counter comes out of the
invalid state without requiring another clock pulse.
Second method. Redesign the counter assuming that the counter goes to the starting state, i.e.
000 whenever it enters any of the invalid states. The excitation requirements are shown in
Figure 12.44a. In this method, no don’t cares are available for excitations even if the present state
is an invalid one. The counter designed by this method cannot come out of the invalid state
COUNTERS 659
instantaneously. It requires one more clock pulse to let the counter come out of the invalid state.
The circuit is also more complicated because no don’t cares are present. The K-maps for T3, T2,
and T1 based on the excitation table and the minimal expressions obtained from them are shown in
Figure 12.44b. A logic circuit may be realized using those minimal expressions.
Figure 12.43 Logic diagram of the type T 0, 3, 5, 6, 0… counter modified to eliminate lock-out.
EXAMPLE 12.5 Design a type D counter that goes through states 0, 1, 2, 4, 0, … . The
undesired (unused) states must always go to zero (000) on the next clock pulse.
Solution
Step 1. The number of flip-flops: This counter has only four stable states 0, 1, 2 and 4 (000,
001, 010, 100), but it requires three FFs because it counts 4 (100) as well. Three FFs can
have eight states. So, the remaining four states (011, 101, 110, 111) are undesired. These
undesired states must go to 000 after the next clock pulse. So, no don’t cares.
Step 2. The state diagram: The state diagram of the 0, 1, 2, 4, 0, … counter is drawn as
shown in Figure 12.45a.
660 FUNDAMENTALS OF DIGITAL CIRCUITS
Step 3. The type of flip-flops and the excitation table: D flip-flops are selected and the
excitation table of the counter using D FFs is written as shown in Figure 12.45b.
Step 4. The minimal expressions: From the excitation table we can see that no minimization
is possible. So the expressions for excitations read from the excitation table are:
D3 = Q3Q2Q1; D2 = Q3Q2Q1; D1 = Q3Q2Q1
Step 5. The logic diagram: The logic diagram based on these expressions is drawn as
shown in Figure 12.46. The counter is self-starting, i.e. it does not suffer from the problem of
lock-out as may be seen from the state diagram.
Figure 12.46 Example 12.5: Logic diagram of type D counter that goes through states 0, 1, 2,
4, 0, ... .
EXAMPLE 12.6 Design a J-K counter that goes through states 3, 4, 6, 7 and 3… . Is the
counter self-starting? Modify the circuit such that whenever it goes to an invalid state it
comes back to state 3.
Solution
Step 1. The number of flip-flops: The counter has only four states: 3, 4, 6, 7 (011, 100, 110,
111), but the maximum count is 7. So this counter requires three FFs (7 £ 23). A counter
using three flip-flops can have eight states. So the remaining four states (000, 001, 010, 101)
are invalid. The entries for excitations corresponding to these invalid states are don’t cares.
Step 2. The state diagram: The state diagram of the 3, 4, 6, 7, 3, … counter is shown in
Figure 12.47a.
COUNTERS 661
Step 3. The type of flip-flops and the excitation table: JK flip-flops are selected and the
excitation table of the counter using JK FFs is drawn as shown in Figure 12.47b.
Step 4. The minimal expressions: From the excitation table, J3 = 1 and J2 = 1, since all
the entries for J3 and J2 are either a 1 or a X. The K-maps for K3, K2, J1 and K1 based on the
excitation table, their minimization, and the minimal expressions obtained from them are
shown in Figure 12.48.
Figure 12.48 Example 12.6: K-maps for excitations of type J-K 3, 4, 6, 7, 3, ... counter.
Step 5. The logic diagram: The logic diagram for the counter based on those minimal
expressions is drawn as shown in Figure 12.49.
Figure 12.49 Example 12.3: Logic diagram of the J-K counter that goes through states 3, 4,
6, 7, 3, … .
662 FUNDAMENTALS OF DIGITAL CIRCUITS
Test for lock-out: The NS entries of Table 12.4 to check for lock-out show that there is no
problem of lock-out and the counter is self-starting, because any time it goes into an invalid state,
it comes out and goes into a useful state after one clock pulse. The state diagram of the counter is
shown in Figure 12.47a.
PS Present inputs NS
Q3 Q2 Q1 J3 K3 J2 K2 J1 K1 Q3 Q2 Q1
0 0 0 1 0 1 1 0 1 1 1 0
0 0 1 1 1 1 1 1 1 1 1 0
0 1 0 1 0 1 1 0 1 1 0 0
1 0 1 1 1 1 0 1 0 0 1 1
To see that the counter goes to state 3 (011) whenever it enters any of the invalid states,
obtain an expression for reset R or set S as shown in Figure 12.50 and modify the circuit accordingly
such that the counter goes to 011 after the next clock pulse.
Since we do not want the counter to reset to 000, and instead we want it to go to state 011, we
apply the output to the clear terminal of FF3 and to the preset terminals of FF2 and FF1 as shown in
the modified circuit of Figure 12.51.
Figure 12.51 Example 12.6: Logic diagram of the J-K counter modified to go to state 3 from
invalid states.
COUNTERS 663
Hybrid counters can be used to obtain a symmetrical divide by N output. For example, when
N is any number divisible by 2, we can obtain a symmetrical divide by N counter, by making the
output of a synchronous mod-N/2 counter drive a mod-2 counter. The output of the mod-2 counter
has a frequency of fC/N. The logic diagram of a mod-12 synchronous hybrid counter obtained by
using a mod-6 counter and a mod-2 counter is shown in Figure 12.53. The timing diagram shown in
Figure 12.54 indicates that the sequence of the states of the counter is 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12,
13, 0, 1, 2, etc. The counter is self-starting. Whenever it goes to an invalid state, it comes back to the
valid state in 1 or 2 clock pulses.
EXAMPLE 12.7 Compare fmax of a 4-bit ripple counter with that of a 4-bit synchronous
counter using J-K FFs. The tpd for each FF is 50 ns and the tpd for each AND gate is 20 ns.
What needs to be done to convert these counters to mod-32? Determine fmax for the mod-32
ripple and parallel counters.
Solution
(a) The total delay that must be allowed between the input clock pulses of a synchronous
counter is equal to
tpd(FF) + tpd(AND)
Thus, Tclock ≥ 50 + 20 = 70 ns. And so, the parallel counter has, fmax = 1/(70 ns) = 14.3 MHz.
(b) A mod-16 ripple counter uses four FFs with tpd = 50 ns. Thus, fmax for the ripple counter is
1
fmax = = 5 MHz
(4 50)ns
(c) A fifth FF must be added, since 25 = 32.
(d) The fmax of the synchronous counters remains the same regardless of the number of FFs.
Thus, its fmax is still 14.3 MHz. The fmax of the 5-bit ripple counter will change to
1
fmax =
(5 50)ns
= 4 MHz
Figure 12.55 shows a mod-10 counter and a mod-8 counter connected in cascade. The terminal
count (TC) output of counter 1 is connected to the count enable (CTEN) input of counter 2. The
counter 2 is inhibited by the LOW on its CTEN input until counter 1 reaches its last or terminal state
when its terminal count output goes HIGH. This HIGH now enables counter 2, so that when the first
clock pulse after counter 1 reaches its last or terminal count (CLK10) is applied, counter 2 goes from
its initial state to its second state. Upon completion of the entire second cycle of counter 1 (when
counter 1 reaches TC the second time), counter 2 is again enabled and advances to its next state. This
sequence continues. Since the first one is a decade counter, it must go through 10 complete cycles
before counter 2 completes its first cycle. In other words, for every 10 cycles of counter 1, counter 2
goes through one cycle. Since the second counter is a mod-8 counter, it will complete one cycle only
after 80 clock pulses. The overall modulus of these two cascaded counters is
10 ¥ 8 = 80.
Figure 12.55 Mod-80 cascaded counter using mod-10 and mod-8 counters.
Figure 12.56 illustrates how to obtain a 1 Hz signal from a 1 MHz signal using decade
counters.
Figure 12.56 Logic diagram to obtain a 1 Hz signal from a 1 MHz signal using decade counters.
Figure 12.58 Logic diagram of a 4-bit ring counter using J-K flip-flops.
Figure 12.59 State diagram and sequence table of a 4-bit ring counter.
In most instances, only a single 1 is in the register and is made to circulate around the register
as long as clock pulses are applied. Initially, the first FF is preset to a 1. So, the initial state is 1000,
i.e. Q1 = 1, Q2 = 0, Q3 = 0 and Q4 = 0. After each clock pulse, the contents of the register are shifted
to the right by one bit and Q4 is shifted back to Q1. The sequence repeats after four clock pulses.
The number of distinct states in the ring counter, i.e. the mod of the ring counter is equal to the
number of FFs used in the counter. An n-bit ring counter can count only n bits, whereas an n-bit
ripple counter can count 2n bits. So, the ring counter is uneconomical compared to a ripple counter,
but has the advantage of requiring no decoder, since we can read the count by simply noting which
COUNTERS 667
FF is set. Since it is entirely a synchronous operation and requires no gates external to FFs, it has
the further advantage of being very fast.
Figure 12.61 Logic diagram of a 4-bit twisted ring counter using D flip-flops.
Figure 12.62 Logic diagram of a 4-bit twisted ring counter using J-K flip-flops.
668 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.63 State diagram and sequence table of a twisted ring counter.
Let initially all the FFs be reset, i.e. the state of the counter be 0000. After each clock pulse, the
level of Q1 is shifted to Q2, the level of Q2 to Q3, Q3 to Q4 and the level of Q4 to Q1 and the sequence
given in Figure 12.63b is obtained. This sequence is repeated after every eight clock pulses.
An n FF Johnson counter can have 2n unique states and can count up to 2n pulses. So, it is a
mod-2n counter. It is more economical than the normal ring counter, but less economical than the
ripple counter. It requires two input gates for decoding regardless of the size of the counter. Thus,
it requires more decoding circuitry than that by the normal ring counter, but less than that by the
ripple counter. It represents a middle ground between the ring counter and the ripple counter.
Both types of ring counters suffer from the problem of lock-out, i.e. if the counter finds itself
in an unused state, it will persist in moving from one unused state to another and will never find its
way to a used state. This difficulty can be corrected by adding a gate. With this addition, if the
counter finds itself initially in an unused state, then after a number of clock pulses, depending on
the state, the counter will find its way to a used state and thereafter, follow the desired sequence. A
Johnson counter designed to prevent lock-out is shown in Figure 12.65. A self-starting ring counter
(whatever may be the initial state, single 1 will eventually circulate) is shown in Figure 12.66.
COUNTERS 669
Figure 12.65 Logic diagram of a 4-bit Johnson counter designed to prevent lock-out.
The output in direct logic is taken from an FF’s Q or Q lead; so, the FF is made to go to the state
desired. The design procedure is:
1. Inspect the pulse train given and decide the number of unique states and the minimum
number of FFs required and list the entire sequence in terms of 1s and 0s. The list may
begin anywhere in the train. The number of unique states is equal to the number of bits in
the sequence.
2. Taking that the 1s and 0s of the sequence will form the least significant bits of the state
assignment; assign unique states to other FFs. If unique states are not possible with the
least number of FFs n, such that the number of states N £ 2n, increase the number of FFs
by one or more to get the unique states. (This is the disadvantage of direct logic.)
The number of flip-flops required to generate a particular sequence can also be
determined as follows:
● Find the number of 1s in the sequence.
670 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
The pulse train is first copied down as 011101110... . It is a 4-bit sequence 0111 repeated.
Write this sequence vertically in the LSB position as shown in Figure 12.67a and try to assign
states using n, i.e. two FFs. This does not result in four unique states. Thus, two FFs are not
sufficient even though there are only four bits in the sequence. So, increase the number of FFs
by one, i.e. use n + 1, or three FFs and assign the states (000, 001, 011, 101) as shown in Figure
12.67a. Three FFs can have eight states. So the remaining four states (010, 100, 110, 111) are
invalid and the entries for excitations corresponding to those states are don’t cares.
The state diagram is shown in Figure 12.67b. The excitation requirements for JK FFs are
shown in the excitation table of Figure 12.67c.
Drawing the K-maps for excitations of the FFs in terms of the present state variables, i.e. the
outputs of the FFs and minimizing them, the minimal expressions for excitations of the FFs are:
J3 = Q2, K3 = 1; J2 = Q3Q1, K2 = 1; J1 = 1, K1 = Q3
The logic diagram based on these minimal expressions is shown in Figure 12.68.
COUNTERS 671
Figure 12.68 Example 12.8: Logic diagram of the pulse train generator.
Writing the table to test for lock-out, we see that the sequence generator is self-starting.
EXAMPLE 12.9 Design a direct logic circuit to generate the following pulse trains.
Solution
The pulse trains to be generated simultaneously are 100000 and 011011. The period of each
pulse train is six time frames. The sequences are therefore 6 bits long. As there must be six
unique states, the minimum number of FFs required is three. Try to assign the states assuming
that pulse train (1) is to be available at Q1 output of FF1 and pulse train (2) at the Q2 output
of FF2 as shown in Figure 12.69a.
Observe that it is not possible to assign the states using only three FFs as seen from the
state assignment table. So, try with four FFs. It is now possible to assign the states (0001,
0010, 0110, 0000, 1010, 1110). Since four FFs can have 16 states, the remaining 10 states
(0011, 0100, 0101, 0111, 1000, 1001, 1011, 1100, 1101, 1111) are invalid and the entries for
excitations corresponding to those states are don’t cares. The state assignment and the state
diagram are shown in Figures 12.69a and b, respectively. The excitation requirements are
shown in Figure 12.69c.
The design equations for the multiple pulse train generator using J-K FFs obtained by drawing
the K-maps for the excitations based on the excitation table and minimizing them are:
J4 = Q2Q1 K4 = Q3
J3 = Q2 K3 = 1
J2 = 1 K2 = Q3
J1 = Q4Q3 K1 = 1
The logic diagram of the multiple pulse generator based on these minimal expressions is
shown in Figure 12.70.
672 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 12.70 Example 12.9: Logic diagram of the multiple pulse train generator.
EXAMPLE 12.10 Generate the following pulse train using indirect logic.
Solution
The given sequence is 10110. It is written vertically under the column heading output (f) in
the truth table of Figure 12.72a. It is 5 bits long. So we need five unique states to generate the
above pulse train. So, any mod-5 counter can be used. For simplicity, we use a ripple counter.
It goes through states 0, 1, 2, 3, 4, 0, … . States 5, 6, 7 are invalid, so the corresponding
outputs are don’t cares. The K-map for the output f in terms of the outputs of the FFs, its
minimization, and the minimal expression obtained from it are shown in Figure 12.72. The
logic diagram (using a mod-5 ripple counter) based on that minimal expression for f is shown
in Figure 12.73. While at state 0, it outputs a 1, i.e. the first bit of the sequence. While at
state 1, it outputs a 0, i.e. the second bit of the sequence, and so on.
Figure 12.73 Example 12.10: Logic diagram of the pulse train generator.
EXAMPLE 12.11 Design a pulse generator using indirect logic to produce the following
waveforms.
Solution
The pulse trains to be generated written vertically under column headings f1 and f2 in the
truth table of Figure 12.74a are: (a) 10011000 and (b) 11111100. These are both eight bits
long. So we need eight unique states to generate those two pulse trains. Therefore, a mod-8,
i.e. a 3-bit ripple counter can be used. Let f1 and f2 be the outputs of the combinational
674 FUNDAMENTALS OF DIGITAL CIRCUITS
circuits. The state assignment is shown in the truth table. The K-maps for outputs f1 and f2 in
terms of the outputs of the flip-flops, their minimization and the minimal expressions obtained
from them are shown in Figure 12.74b. The logic diagram (using a mod-8 ripple counter)
based on those minimal expressions for f1 and f2 is shown in Figure 12.75.
Figure 12.74 Example 12.11: Truth table and K-maps for f1 and f2.
Figure 12.75 Example 12.11: Logic diagram of the pulse train generator.
logic level of D1 is determined not only by Qn but also by the output of other FFs in the cascade.
That is,
D1 = f(Q1, Q2, …, Qn)
The prescribed sequence appears at the output of each of the FFs. Of course, as we go from
FF1 to FF2, etc. we find successive delays by one clock interval. In order to build a sequence
generator capable of generating a sequence of length S, it is necessary to use at least n FFs, where
n satisfies the condition S £ 2n – 1. If the order of 1s and 0s in the sequence is prescribed, generally
it will not be possible to generate a length S in which the minimum number of FFs is used. On the
other hand, for any n, there is at least one sequence for which the sequence length S is a maximum,
i.e. 2n – 1. The design procedure is as follows:
From the information of the waveform (or the sequence of bits, if given), decide the number
of FFs required for pulse generation. The minimum number of FFs required for N states is n such
that N £ 2n. Convert the waveform to 1s and 0s. Write the bits in vertical order. Form groups of n
bits starting from the top bit and convert them to state numbers (decimal) moving down one bit at
a time. The procedure is repeated until the cycle is completed. If the entire period of the train can
be examined without repeating a state, the job can be done by n FFs. If there is a repetition of
states, try (n + 1) FFs. If repeated states still occur, try (n + 2) FFs, and so on.
EXAMPLE 12.12 Design a pulse train generator using a shift register to generate the
following waveform.
Solution
The given sequence 1011110 is of 7-bit length. So seven unique states are required. So, the
minimum number of FFs required is three. Write the sequence 1011110 in vertical form and
make groups of three bits starting from the top bit and write the states in decimal as shown in
Figure 12.77a.
In 3-bit groups, states 7 and 5 are repeated. So, we cannot get seven unique states using
three FFs. Next, make groups of four bits as shown in Figure 12.77b. The states are not
repeated, i.e. seven unique states (11, 7, 15, 14, 13, 10, 5, that is 1011, 0111, 1111, 1110,
1101, 1010, 0101) can be obtained using four FFs. Make the truth table with the states of
676 FUNDAMENTALS OF DIGITAL CIRCUITS
the register, and the output of the combinational circuit which is to be fed as input to the
shift register. For each state corresponding to the particular group of four bits, the next
lower bit in the vertical order represents the output of the combinational circuit. For the
first state, i.e. 1011 (1110), the next lower bit in the column is 1. So, the output of the
combinational circuit for that state will be a 1. For the next state, i.e. 0111 (710), the next
lower bit in the column is 1. So, the output of the combinational circuit for that state will
be a 1, and so on. Four FFs can have 16 states. So the remaining nine states (0, 1, 2, 3, 4,
6, 8, 9, 12, that is 0000, 0001, 0010, 0011, 0100, 0110, 1000, 1001, 1100) are invalid.
Form the truth table and draw the K-map for f—the output of the combinational circuit in
terms of the outputs of the FFs. The minimization of the K-map, the minimal expression
obtained from it, and the realization of the logic diagram based on that minimal expression
are shown in Figure 12.78.
Figure 12.77 Example 12.12: State assignment for the pulse train generator.
EXAMPLE 12.13 Design a pulse generator using a shift register to generate the waveform
shown below.
Solution
The given pulse train is 1011101. There are seven states. So, the minimum number of FFs
required is three. Make groups of three bits and form the states as shown in Figure 12.79a.
Figure 12.79 Example 12.13: State assignment for the pulse train generator.
As seen from Figures 12.79a, b and c, it is not possible to generate seven unique states
using three or four or even five FFs. So, the required number of FFs is six. The corresponding
truth table is shown in Figure 12.80a. The six FFs can have 32 states. So, the remaining 25
states are invalid. Drawing a 6-variable K-map for f in terms of the outputs of the FFs and
minimizing it, the minimal expression for f is
f = Q6 + Q5Q4 + Q6Q1
678 FUNDAMENTALS OF DIGITAL CIRCUITS
The logic diagram of the pulse generator based on that minimal expression is shown in
Figure 12.80b.
The expressions for feedback signals for particular lengths of FFs are shown in Table 12.5.
Table 12.5 Expressions for feedback signals for particular lengths of flip-flops
Shift register length Expression for feedback Shift register length Expression for feedback
1 A 11 A/C
2 A≈B 12 A≈B≈C≈K
3 A≈C 13 A≈B≈C≈M
4 A≈B 14 A≈B≈C≈M
5 A≈C 15 A≈B
6 A≈B 16 A≈C≈D≈F
7 A≈B 17 A≈D
8 A≈E≈F≈G 18 A≈H
9 A≈E 19 A≈B≈C≈F
10 A≈D 20 A≈D
A linear sequence can be modified to reduce the number of states to any size by using the
following rules:
1. Knowing the number of desired states, N, find the smallest number of FFs, n, needed for
that number of states, such that N £ 2n.
2. Draw the state diagram for a linear sequence generator using n FFs.
3. Examine all pairs of states separated by 2n – N – 2 states and locate that pair in which the
smaller state number (decimal) is an even number and one less than the larger state
number (decimal).
4. Find the state number (decimal) that precedes the smaller state number of the above pair.
Draw an arrow from that state number to the larger state number of the pair. This modified
state diagram will be the final state diagram of the sequence.
EXAMPLE 12.14 Modify a 3-bit linear sequence generator to output 4 states.
Solution
It requires three FFs because the state number 0 is not permitted. So, draw a state diagram for
a 3-bit linear sequence generator (Figure 12.82c) and locate that pair of state numbers,
separated by 2n – N – 2 = 8 – 4 – 2 = 2 states, in which the smaller state number (decimal) of
the pair is even and one less than the larger state number (decimal).
The following pairs of state numbers separated by two states in between are examined to
find the difference between their decimal values.
States 7–2 differ by more than 1.
States 6–4 differ by more than 1.
States 5–1 differ by more than 1.
States 2–3 differ by 1. So, this pair fits.
Draw an arrow from the state before 2, that is state 5 to state 3. The required states are,
therefore, 7 Æ 6 Æ 5 Æ 3. The truth table is shown in Figure 12.82a. The K-map and its minimization
are shown in Figure 12.82b. The value of f, i.e. the output of the combinational circuit for each
state is taken as the next lower bit in the sequence as shown below.
The modified logic diagram based on the value of f is shown in Figure 12.83.
1. What is a counter?
A. A digital counter is a set of flip-flops interconnected such that their combined state at any time is
the binary equivalent of the total number of pulses applied up to that time, i.e. it is a logic circuit
used to count the number of pulses.
2. What are the applications of counters?
A. Counters are used to count pulses. They can also be used as frequency dividers. They are also
used to perform the timing function as in digital watches, to create time delays, to produce
non-sequential binary counts, to generate pulse trains, and to act as frequency counters, etc.
3. What are the two basic types of counters?
A. The two basic types of counters are (a) asynchronous counters and (b) synchronous counters.
COUNTERS 681
of propagation delay skipping of states may occur. In synchronous counters, propagation delays
of individual flip-flops do not add together and hence no problem of skipping of states.
Asynchronous counters have more decoding problems but synchronous counters have less severe
decoding problems. In asynchronous counters, the invalid states are bypassed by providing suitable
feedback. In synchronous counters, the invalid states are taken care of by treating the corresponding
excitations as don’t cares. Asynchronous counters require less circuitry and synchronous counters
require more circuitry.
16. What is problem of lock-out?
A. Sometimes when the counter is switched on, or any time during counting, because of noise
spikes the counter may find itself in some unused (invalid) state. Subsequent clock pulses may
cause the counter to move from one unused state to another unused state and the counter may
never come to a valid state. So the counter becomes useless.
A counter whose unused states have this feature is said to suffer from the problem of lockout.
17. Which counter may suffer from the problem of lock-out?
A. A shortened modulus counter may suffer from the problem of lock-out.
18. What do you mean by self-starting type counter?
A. A counter is said to be of self-starting type if it returns to a valid state and counts normally after
one or more clock pulses, even if it enters an invalid state.
19. How is the problem of lock-out eliminated?
A. To eliminate the problem of lock-out, external logic circuitry is provided which ensures by properly
resetting each flip-flop that at start up the counter is in its initial state. The logic circuitry presetting
the counter to its initial state can be provided either by obtaining an expression for reset/preset
for the flip-flops or by modifying the design such that the counter goes from each invalid state to
the initial state after the clock pulse.
20. What is a hybrid counter?
A. A hybrid counter is a counter in which the output of a synchronous counter drives the clock input
of another counter to get a divide-by-N operation.
21. What are shift register counters? Why is that name?
A. Shift register counters are counters obtained from serial-in, serial-out shift registers by providing
feedback from the output of the last flip-flop to the input of the first flip-flop. These devices are
called counters because they exhibit a specified sequence of states.
22. What is a ring counter? Why is that name?
A. A ring counter also called the basic ring counter is the most widely used shift register counter. It is
a serial-in, serial-out shift register in which the Q output of the last stage is connected back to the D
input of the first stage. Since the array of flip-flops is arranged in a ring, it is called a ring counter.
23. What is a twisted-ring counter?
A. A twisted-ring counter also called the Johnson counter or the switch-tail ring counter is a serial-in,
serial-out shift register in which the Q output of the last stage is connected back to the D input of
the first stage.
24. What is the advantage and disadvantage of ring counter compared to ripple counter?
A. An n-bit ring counter can count only n bits, whereas an n-bit ripple counter can count 2n bits. So the
ring counter is uneconomical compared to a ripple counter, but has the advantage of requiring no
decoder, since we can read the counter by simply noting which flip-flop is set. Since it is entirely a
synchronous operation and requires no gates external to flip-flops, it has the further advantage of
being very fast. An n-bit Johnson counter can have 2n unique states and can count upto 2n pulses.
COUNTERS 683
So it is a mod-2n counter. It is more economical than a normal ring counter but less economical
than a ripple counter. It requires two input gates for decoding regardless of the size of the counter.
Thus, it requires more decoding circuitry than that by the normal ring counter, but less than that by
the ripple counter. Both types of ring counters suffer from the problem of lock-out.
25. What is a BCD counter?
A. A BCD counter is a mod-10 counter, i.e. it is a decade counter.
26. What is the terminal count of a 4-bit binary counter in the up-mode and the down-mode? What is
the next state after the terminal count in the up-mode? In the down-mode?
A. The terminal count of a 4-bit binary counter in the up-mode is 1111 and the next state in this
mode is 0000. The terminal count of a 4-bit binary counter in the down-mode is 0001 and the
next state in this mode is 0000.
27. A 4-bit up-down counter is in the down-mode and in the 1100 state. On the next clock pulse, to
what state does the counter go?
A. It goes to state 1011.
28. How many decade counters are required to convert a clock of 10 MHz to 100 Hz?
A. 10 × 106/100 = 105. Therefore, five decade counters are required to convert a clock of 10 MHz to
100 Hz.
29. Four counters, mod-10, mod-10, mod-8 and mod-6 are connected in cascade. What is the modulus
of the cascaded counter?
A. The modulus of the cascaded counter = 10 × 10 × 8 × 6 = 4800.
30. What do you mean by the following?
(a) Decoding a counter (b) Decoding glitches
(c) Active low decoding (d) Active high decoding
A. (a) The outputs of a counter are in binary form. Determination of the decimal equivalent of these
binary outputs is called decoding a counter.
(b) The undesired voltage spikes of short duration produced at the output of a decoder by the
transitional states are called decoding glitches. The width of the glitch equals the width of
the propagation delay tpd.
(c) Active low decoding means producing a low output to indicate detection.
(d) Active high decoding means producing a high output to indicate detection.
31. How are decoding glitches caused?
A. The propagation delays owing to the ripple effect in asynchronous counters create transitional
states in which the counter outputs change at slightly different times. These transitional states
produce undesired voltage spikes of short duration called glitches.
32. What is strobing?
A. Elimination of decoding glitches by enabling the decoded outputs at a time after the glitches
have had time to disappear is called strobing. This can be accomplished by using the low level of
the clock to enable the decoder.
33. What is the maximum modulus of a counter with each of the following number of flip-flops?
(a) 2 (b) 5 (c) 6 (d) 8 (e) 10
A. (a) 22 = 4 (b) 25 = 32 (c) 26 = 64 (d) 28 = 256 (e) 210 = 1024
34. Determine the number of flip-flops in each of the following counters?
(a) mod-3 (b) mod-8 (c) mod-14 (d) mod-20 (e) mod-32 (f) mod-150
A. (a) 2 (b) 3 (c) 4 (d) 5 (e) 5 (f) 8
35. Which shift register counter requires the most number of flip-flops for a given mod number?
A. The normal ring counter requires the most number of flip-flops for a given mod number.
684 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
1. With general block diagrams, show how each of the following counters can be obtained using
flip-flop, a decade counter and a 4-bit binary counter or any combination of these.
(a) Divide-by-40 counter (b) Divide-by-32 counter
(c) Divide-by-160 counter (d) Divide-by-320 counter
(e) Divide-by-10,000 counter (f) Divide-by-1000 counter
2. With general block diagrams, show how to obtain the following frequencies from a 1 MHz
clock using single flip-flops, mod-5 counters and decade counters.
(a) 500 kHz (b) 250 kHz (c) 125 kHz (d) 40 kHz
(e) 10 kHz (f) 1 kHz
3. How do you test for the problem of lock-out of a counter? How do you eliminate this problem?
4. Write the design steps of synchronous counters.
22. The terminal count of a 5-bit counter in the up-mode is ______ and in the down mode it is ______.
23. The maximum modulus of a counter with seven flip-flops is ______.
24. Undesired voltage spikes of short duration produced at the outputs of the decoder are called ______.
25. Bringing the counter to a specific state at the beginning of the count is called ______ the counter.
26. The number of flip-flops required in a counter to count 68 pulses is ______.
27. ______ switching circuits have no memory.
28. ______ switching circuits require memory elements.
29. Sequential circuits which have a master oscillator are called ______ sequential circuits.
30. Sequential circuits in which there is no master oscillator are called ______ sequential circuits.
12. A 4-bit binary ripple counter uses flip-flops with propagation delay time of 25 ns each. The
maximum possible time required for change of state will be
(a) 25 ns (b) 50 ns (c) 75 ns (d) 100 ns
13. A 4-bit synchronous counter uses flip-flops with propagation delay time of 25 ns each. The
maximum possible time required for change of state will be
(a) 25 ns (b) 50 ns (c) 75 ns (d) 100 ns
14. A mod-2 counter followed by a mod-5 counter is
(a) the same as a mod-5 counter followed by a mod-2 counter
(b) a decade counter (c) a mod-7 counter (d) none of the above
15. A symmetrical squarewave of time period 100 ms can be obtained from a squarewave of time
period 10 ms by using a
(a) divide-by-5 circuit (b) BCD counter
(c) divide-by-5 circuit followed by a divide-by-2 circuit
(d) 4-bit binary counter
16. A 4-bit presettable up-counter has present input 0101. The presetting operation takes place as
soon as the counter becomes maximum, i.e. 1111. The modulus of this counter is
(a) 5 (b) 10 (c) 11 (d) 15
17. In general, a sequential logic circuit consists of
(a) only flip-flops (b) only gates
(c) flip-flops and combinational logic circuits (d) only combinational logic circuits
18. The output frequency of a mod-16 counter, clocked from a 20-kHz clock input signal is
(a) 20 kHz (b) 52 kHz (c) 625 Hz (d) 1250 Hz
19. The output frequency of a mod-12 counter is 6 kHz. Its input frequency is
(a) 6 kHz (b) 500 Hz (c) 24 kHz (d) 72 kHz
PROBLEMS
(b) A type-T counter that goes through states 6, 3, 7, 8, 2, 9, 1, 12, 14, 0, 6, 3,… .
Is the counter self-starting?
(c) A type-T counter that goes through states 0, 5, 4, 2, 0,… . Is the counter self-starting?
(d) A type T counter that must go through states 0, 2, 4, 6, 0,… if the control line is HIGH, and
through states 0, 4, 2, 7, 0,… if the control line is LOW.
12.4 Design the following types of generators:
(a) A sequence generator to generate the sequence 1011010…
(b) A pulse train generator to generate the sequence 1100010…
(c) A pulse generator using indirect logic to produce the pulse trains 10000111 and 10011010.
(d) A shift register pulse train generator to generate the pulse train 101110.
(e) A shift register pulse train generator to generate the pulse train 11110010.
12.5 Design a direct logic circuit to generate the sequences 100111 and 011101 simultaneously.
12.6 Generate the pulse train 100110 using indirect logic.
12.7 Design a BCD up/down counter using S-R FFs.
12.8 Design an up/down counter using D FFs to count 0, 3, 2, 6, 4, 0,… .
COUNTERS 689
VHDL PROGRAMS
SIMULATION OUTPUT:
entity updown_counter is
port(clk, clr, UP_DOWN : in std_logic;
Q : out std_logic_vector(3 downto 0));
end updown_counter;
architecture Behavioral of updown_counter is
signal tmp: std_logic_vector(3 downto 0);
begin
process (clk, clr)
begin
if (clr=’1') then
tmp <= “0000”;
elsif (clk’event and clk=’1') then
if (UP_DOWN=’1') then
tmp <= tmp + 1;
else
tmp <= tmp - 1;
end if;
end if;
end process;
Q <= tmp;
end Behavioral;
SIMULATION OUTPUT:
if (clr=’1') then
tmp <= “0000”;
elsif (clk’event and clk=’1') then
tmp <= tmp + 1;
end if;
end process;
gray_cnt(3) <= tmp(3);
gray_cnt(2) <= tmp(3) xor tmp(2);
gray_cnt(1) <= tmp(2) xor tmp(1);
gray_cnt(0) <= tmp(1) xor tmp(0);
end Behavioral;
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM IN STRUCTURAL MODELING FOR 4-BIT RIPPLE
COUNTER
module TFF(q, clk, reset);
output q;
input clk, reset;
reg q;
always @(negedge clk or negedge reset)
if (~reset)
q = 1’b0;
else
q = (~q);
endmodule
module ripple_counter(q, clk, reset);
output [3:0] q;
input clk, reset;
TFF tff0(q[0],clk,reset);
TFF tff1(q[1],q[0],reset);
TFF tff2(q[2],q[1],reset);
TFF tff3(q[3],q[2],reset);
endmodule
692 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
694 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
696 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
13
SEQUENTIAL CIRCUITS-I
Similarly, the circuit has a finite number m of output terminals which define the set
[z1, z2, z3, ..., zm] of output variables. Each output variable is a binary variable. An ordered set of m
0s and 1s is an output configuration. The set q of all possible combinations of m outputs, i.e. q = 2m
is called the output alphabet and is given by
O = [O1, O2, O3, ..., Oq]
Each output configuration is called a symbol of the output alphabet.
The signal value at the output of each memory element is referred to as the state variable and
the set [y1, y2, ..., yk] constitutes the set of state variables. The combination of values at the outputs
of k memory elements y1, y2, ..., yk defines the present internal state or the present state of the
machine. The set S of n = 2k combinations of state variables constitutes the entire set of states of
the machine.
S = [S1, S2, S3, ..., Sn]
The external inputs x1, x2,...,xl and the values of the state variables y1, y2, ..., yk are supplied to
the combinational circuit, which in turn produces outputs z1, z2, ..., zm and the values Y1, Y2, ..., Yk.
The values of the Ys which appear at the output of the combinational circuit at time t determine the
state variables at time t + 1, and therefore, the next state of the machine.
Synchronization is achieved by means of clock pulses. The clock pulses may be applied to
various AND gates to which input signal is applied. This allows the gates to transmit signals only
at instants which coincide with the arrival of clock pulses.
Before going for the design of sequential machines one should be familiar with the following
things.
In synchronous or clocked sequential circuits, clocked flip-flops are used as memory elements,
which change their individual states in synchronism with the periodic clock signal. Therefore, the
change in states of flip-flops and change in state of the entire circuit occurs at the transition of the
clock signal.
The synchronous or clocked sequential circuits are represented by two models.
1. Moore circuit: In this model, the output depends only on the present state of the flip-flops.
2. Mealy circuit: In this model, the output depends on both the present state of the
flip-flop(s) and the input(s).
Sequential circuits are also called finite state machines (FSMs). This name is due to the fact
that the functional behaviour of these circuits can be represented using a finite number of states.
SEQUENTIAL CIRCUITS-I 701
In the case of a Moore circuit, the directed lines are labelled with only one binary number
representing the input that causes the state transition. The output is indicated within the circle
below the present state, because the output depends only on the present state and not on the input.
Figure 13.3a shows the state diagram of a Moore circuit.
that by any verbal description. The succession of states through which a sequential machine passes
and the output sequence which it produces in response to a known input sequence, are specified
uniquely by the state diagram or by the state table and initial state.
The state of a memory element is specified by the value of its output, which may assume
either a 0 or a 1. The present state of the sequential machine indicates the present outputs of the
memory elements used in the machine. The next state of the machine indicates the next outputs of
the flip-flops that will be obtained when the present inputs are applied to the machine in the
present state.
outputs 0 and 1 for X = 0 and X = 1 respectively. Also states b and e both go to states e and f and
have outputs 0 and 1 for X = 0 and X = 1 respectively. Therefore, state c can be removed and
replaced by a. Also state e can be removed and replaced by state b. The final reduced state table is
shown in Figure 13.5a. The state diagram for the reduced state table consists of only four states
and is shown in Figure 13.5b.
The entries of the next state part of this table define the necessary state transitions of the
machine and, thus, specify the next values of the outputs of the FFs used. The next state part of the
state table is called the transition table. The output part of the table indicates the output of the
sequential machine for various input combinations applied to the machine, which is in the present
state.
Solution
The state table for the given sequential circuit will be as shown in Figure 13.6b.
From the state table of Figure 13.6b we observe that states g and e are equivalent because
they have the same next state and the same output for each one of the inputs. So one of them
becomes redundant and can be removed. Let us remove state g. Replacing g by e in the state
table we observe that states d and f are equivalent. So one of them becomes redundant and
can be removed. Let us remove f and replace f by d. So we are left with five states a, b, c, d,
and e. The reduced state table is shown in Figure 13.7a. The reduced state diagram is shown
in Figure 13.7b.
SEQUENTIAL CIRCUITS-I 705
Figure 13.7 Example 13.1: Reduced state table and state diagram.
EXAMPLE 13.2 Obtain a reduced state table and reduced state diagram for the sequential
machine whose state diagram is shown in Figure 13.8a.
Solution
The state table for the given state diagram is shown in Figure 13.8b. From the state table we
observe that states c and d are equivalent. So state d can be removed and d is replaced by c at
other places. The reduced state table is shown in Figure 13.9a. The reduced state diagram is
shown in Figure 13.9b.
Figure 13.9 Example 13.2: Reduced state table and state diagram.
706 FUNDAMENTALS OF DIGITAL CIRCUITS
13.2.2 T Flip-Flop
The excitation table, the state diagram(Mealy model) and the state table of the T flip-flop are
shown in Figures 13.11a, b and c respectively. The general state diagram, the K-map for the next
state, and the Moore model of the state diagram are shown in Figures 13.11d, e, and f respectively.
The expression for the next state of the flip-flop is
Q(t + 1) = Q(t) T(t) + Q(t) T(t) = Q(t) ≈ T(t)
Step 2. State diagram: Based on the word description of the machine, draw the state diagram
which depicts the complete information about it.
Step 3. State table: Write the state table which contains all the information of the state diagram
in tabular form.
Step 4. Reduced standard form state table: Remove the redundant states if any in step 2 and
write the reduced standard form state table.
Step 5. State assignment and transition table: Assign binary names to the states and write the
transition table.
Step 6. Choose type of flip-flops and form the excitation table: Based on the entries in the transition
table write the excitation table after choosing the type of FFs.
Step 7. K-maps and minimal expressions: Based on the contents of the excitation table draw the
K-maps and synthesize the logic functions for each of the excitations as functions of input variables
and state variables.
Step 8. Realization: Draw the circuit to realize the minimal expressions obtained above.
Steps 2 and 3. State diagram and state table: Let A designate the state of the serial adder at ti if
a carry 0 was generated at ti–1, and let B designate the state of the serial adder at ti if a carry 1 was
generated at ti–1. The state of the adder at the time when the present inputs are applied is referred to
as the present state (PS), and the state to which the adder goes as a result of the new carry value is
referred to as the next state (NS).
The behaviour of a serial adder may be conveniently described by its state diagram and the
state table as shown in Figure 13.15. The state diagram shows that if the machine is in state A, i.e.
carry from the previous addition is a 0, the inputs x1 = 0, x2 = 0 give sum 0 and carry 0. So, the
machine remains in state A and outputs a 0. An input x1 = 0 and x2 = 1 give sum 1 and carry 0. So,
the machine remains in state A and outputs a 1. Inputs x1 = 1, x2 = 0 give sum 1 and carry 0. So, the
machine remains in state A and outputs a 1, but the inputs x1 = 1, x2 = 1 give sum 0 and carry 1. So,
the machine goes to state B and outputs a 0.
If the machine is in state B, i.e. carry from the previous addition is a 1, inputs x1 = 0, x2 = 1
give sum 0 and carry 1. So, the machine remains in state B and outputs a 0. Inputs x1 = 1, x2 = 0
give sum 0 and carry 1. So, the machine remains in state B and outputs a 0. Inputs x1 = 1, x2 = 1
give sum 1 and carry 1. So, the machine remains in state B and outputs a 1. Inputs x1 = 0, x2 = 0
give sum 1 and carry 0. So, the machine goes to state A and outputs a 1. The state table also gives
the same information.
Step 4. Reduced standard form state table: The machine is already in this form. So no need to do
anything.
Step 5. State assignment and transition and output table: The states, A = 0 and B = 1 have
already been assigned. So, the transition and output table is as shown in Table 13.1.
PS NS O/P
x1x2 x1x2
00 01 10 11 00 01 10 11
0 0 0 0 1 0 1 1 0
1 0 1 1 1 1 0 0 1
Step 6. Choose type of flip-flops and form the excitation table: To write the excitation table,
select the memory element. Let us say, we want to use D flip-flop. The excitation table is shown in
Table 13.2.
SEQUENTIAL CIRCUITS-I 711
Step 7. K-maps and minimal expressions: Obtain the minimal expressions for D and z in terms
of the state variable y and inputs x1, and x2 by using K-maps as shown in Figure 13.16.
Step 8. Implementation: Implement the circuit using those minimal expressions as shown in
Figure 13.17.
states by splitting both the states a and b into two states each. Instead of a we will use a0 and a1 to
denote the fact that the carry is 0 and the sum is either 0 or 1 respectively. When the state is
splitted, we have to direct transition associated with output 0 to state 0 and transition associated
with output 1 to state 1. So state a with output 1 is directed to state a1 and state a without 0 is
directed to state a0. Figure 13.18b shows the state table for the Moore type serial adder. Once, the
Moore type state diagram and state table are drawn the Moore circuit can be designed following
the normal procedure.
valid sequence. Since overlapping is permitted, the second 1 may be used to start the sequence,
so, the machine remains in state B only and outputs a 0. So, an arc labelled 1/0 starting and
terminating at B is drawn. While in state C, the machine may receive a 0 or a 1 bit. If it
receives a 0, the last three bits received will be 100 and this is not a part of the valid sequence
and also none of the last two bits can be used to start the new sequence. So, the machine goes
to state A to restart the detection process and outputs a 0. Hence, an arc labelled 0/0 starting at
C and terminating at A is drawn. If it receives a 1 bit, the last three bits will be 101 which are
a part of the valid sequence. So, the machine goes to the next state, say state D, and outputs a
0. So, an arc labelled 1/0 is drawn from C to D. While in state D, the machine may receive a
0 or a 1. If it receives a 0, the last four bits become 1010 which is a valid sequence and the
machine outputs a 1. Since overlapping is permitted, the machine can utilize the last two bits
10 to get another 1010 sequence. So, the machine goes to state C (if overlapping is not permitted
or the machine has to restart after outputting a 1, the machine goes to state A). So, an arc
labelled 0/1 is drawn from D to C. If it receives a 1 bit, the last four bits received will be 1011
which is not a valid sequence. So, the machine outputs a 0. Since the fourth bit 1 can become
the starting bit for the valid sequence, the machine goes to state B. So, an arc labelled 1/0 is
drawn from D to B.
Step 4. Reduced standard form state table: The machine is already in this form. So no need to do
anything.
Step 5. State assignment and transition and output table: There are four states; therefore, two
state variables are required. Two state variables can have a maximum of four states. So, all states
are utilized and thus there are no invalid states. Hence, there are no don’t cares. Assign the states
arbitrarily. Let A Æ 00, B Æ 01, C Æ 10, and D Æ 11 be the state assignment. With this assignment
draw the transition and output Table 13.3.
AÆ0 0 0 0 0 1 0 0
BÆ0 1 1 0 0 1 0 0
CÆ1 0 0 0 1 1 0 0
DÆ1 1 1 0 0 1 1 0
714 FUNDAMENTALS OF DIGITAL CIRCUITS
Step 6. Choose type of Flip-flops and form the excitation table: Select the D flip-flops as memory
elements and draw the excitation Table 13.4.
y1 y2 x Y1 Y2 D1 D2 z
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 1 0 1 0 0
0 1 1 0 1 0 1 0
1 0 0 0 0 0 0 0
1 0 1 1 1 1 1 0
1 1 0 1 0 1 0 1
1 1 1 0 1 0 1 0
Step 7. K-maps and minimal expressions: Based on the contents of the excitation table, draw
the K-maps and simplify them to obtain the minimal expressions for D1 and D2 in terms of y1,
y2, and x as shown in Figure 13.20. The expression for z(z = y1 y2) can be obtained directly from
Table 13.3.
Step 8. Implementation: The logic diagram based on these minimal expressions is shown in
Figure 13.21.
Figure 13.21 Logic diagram of the sequence (1010) detector using D flip-flops.
SEQUENTIAL CIRCUITS-I 715
EXAMPLE 13.3 Draw the state diagram and the state table for a Moore type sequence
detector to detect the sequence 110.
Solution
The Moore type state diagram and state table of sequence detector to detect the sequence
110 are shown in Figure 13.23. The state diagram is drawn in the normal way. The machine
is in state C when the last two bits received are 11. If the next bit is a 0, the last three bits
become 110 which is a valid sequence, hence it outputs a 1, but the machine cannot go to
state A to restart the detection process because state A outputs a 0. So the machine goes to a
new state D and outputs a 1. While at D if the next bit received is a 0, the last four bits will be
1100. So the machine goes to state A to restart the process. If the bit received is a 1, the last
four bits will be 1101. So the machine goes to state B to utilize the last bit.
Step 1. Word statement of the problem: A serial parity-bit generator is a two-terminal circuit
which receives coded messages and adds a parity bit to every m bits of the message, so that the
resulting outcome is an error-detecting coded message. The inputs are assumed to arrive in strings
of three symbols (m = 3) and the strings are spaced apart by single time units (i.e. the fourth place
is a blank). The parity bits are inserted in the appropriate spaces so that the resulting outcome is a
continuous string of symbols without spaces. For even parity, a parity bit 1 is inserted, if and only
if the number of 1s in the preceding string of three symbols is odd. For odd parity, a parity bit 1 is
inserted, if and only if the number of 1s in the preceding string of three symbols is even.
Steps 2 and 3. State diagram and state table: The state diagram and the state table of an odd
parity-bit generator are shown in Figure 13.24. States B, D and F correspond to even number of 1s
out of 1, 2 and 3 incoming inputs, respectively. Similarly, states C, E and G correspond to odd
number of 1s out of 1, 2 and 3 incoming inputs, respectively. From either state F or state G, the
machine goes to state A regardless of the input. In fact, the fourth input is a blank.
Since the state diagram contains seven states, three state variables are needed for an
assignment. But since three state variables can have a total of eight states, one of the states will not
be assigned and its entries in the corresponding state table may be considered as don’t cares.
Step 4. Reduced standard form state table: The machine is already in this form. So no need to do
anything.
Step 5. State assignment and transition and output table: The state assignment is not unique.
Many possible assignments are there. One possible assignment is A Æ 000, B Æ 010, C Æ 011,
D Æ 110, E Æ 111, F Æ 100 and G Æ 101. With this assignment the transition and output table is
given in Table 13.5.
Step 6. Choose type of flip-flops and form the excitation table: Select the memory elements.
Suppose J-K flip-flops are selected. For implementing the parity-bit generator using J-K flip-
flops, draw the excitation table as shown in Table 13.6.
SEQUENTIAL CIRCUITS-I 717
Step 7. K-maps and minimal expressions: The minimal expressions for excitations J1, K1, J2, K2,
J3 and K3 of flip-flops and the output of the odd-parity generator z in terms of the present state
variables y1, y2, y3, and the input x can be obtained using K-maps as shown in Figure 13.25.
Table 13.5 Transition and output
PS NS (Y1Y2Y3) O/P (z)
y1 y2 y3 x=0 x=1 x=0 x=1
0 0 0 0 1 0 0 1 1 0 0
0 1 0 1 1 0 1 1 1 0 0
0 1 1 1 1 1 1 1 0 0 0
1 1 0 1 0 0 1 0 1 0 0
1 1 1 1 0 1 1 0 0 0 0
1 0 0 0 0 0 0 0 0 1 1
1 0 1 0 0 0 0 0 0 0 0
Figure 13.25 K-maps for excitations of 3-bit odd-parity generator using J-K flip-flops.
718 FUNDAMENTALS OF DIGITAL CIRCUITS
Step 8. Implementation: The logic diagram based on those expressions is shown in Figure 13.26.
Figure 13.26 Logic diagram of a 3-bit odd-parity generator using J-K flip-flops.
13.7 COUNTERS
13.7.1 Design of a 3-bit Gray Code Counter
Step 1. Word statement of the problem: The counter is to be designed with one input terminal
(which receives pulse signals) and one output terminal. It should be capable of counting in the
Gray system up to 7 and producing an output pulse for every 8 input pulses. After the count 7 is
reached, the next pulse will reset the counter to its initial state, i.e. to a count of zero.
Steps 2 and 3. State diagram and state table: The state diagram, and the state table of the 3-bit
Gray code counter are shown in Figure 13.27.
Step 4. Reduced standard form state table: The machine is already in this form. So no need to do
anything.
Step 5. State assignment and transition and output table: There are eight states for a 3-bit counter.
So, three state variables are required which can give a maximum of eight possible states. So, no
SEQUENTIAL CIRCUITS-I 719
invalid states exist. The state assignment cannot be arbitrary, since the counter has to change the
states in a definite manner. Hence, the state assignment is
S0 Æ 000, S1 Æ 001, S2 Æ 011, S3 Æ 010, S4 Æ 110, S5 Æ 111, S6 Æ 101, S7 Æ 100
The transition and output table for the counter is shown in Table 13.7.
Table 13.7 Transition and output table
PS NS O/P
x=0 x=1 x=0 x=1
0 0 0 0 0 0 0 0 1 0 0
0 0 1 0 0 1 0 1 1 0 0
0 1 1 0 1 1 0 1 0 0 0
0 1 0 0 1 0 1 1 0 0 0
1 1 0 1 1 0 1 1 1 0 0
1 1 1 1 1 1 1 0 1 0 0
1 0 1 1 0 1 1 0 0 0 0
1 0 0 1 0 0 0 0 0 0 1
Step 6. Choose type of flip-flops and form the excitation table: Select T type flip-flops. The
Excitation table is as shown in Table 13.8.
Table 13.8 Excitation table
PS I/P NS Inputs to FFs O/P
y3 y2 y1 x Y3 Y2 Y1 T3 T2 T1 z
0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 1 0 0 1 0
0 0 1 0 0 0 1 0 0 0 0
0 0 1 1 0 1 1 0 1 0 0
0 1 1 0 0 1 1 0 0 0 0
0 1 1 1 0 1 0 0 0 1 0
0 1 0 0 0 1 0 0 0 0 0
0 1 0 1 1 1 0 1 0 0 0
1 1 0 0 1 1 0 0 0 0 0
1 1 0 1 1 1 1 0 0 1 0
1 1 1 0 1 1 1 0 0 0 0
1 1 1 1 1 0 1 0 1 0 0
1 0 1 0 1 0 1 0 0 0 0
1 0 1 1 1 0 0 0 0 1 0
1 0 0 0 1 0 0 0 0 0 0
1 0 0 1 0 0 0 1 0 0 1
Step 7. K-maps and minimal expressions: The minimal expressions for excitation functions to T
flip-flops, T1, T2 and T3 in terms of the present state variables y1, y2, y3, and the input x can be
obtained using K-maps as shown in Figure 13.28. From the excitation table, the expression for
output z is
z = y3 y2 y1x
720 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 13.28 K-maps for excitations of 3-bit Gray code counter using T flip-flops.
Step 8. Implementation: The logic diagram based on these expressions is shown in Figure 13.29.
The input signal x can be ANDed with the clock signal, and the output of the AND gate
given as clock signal to each FF. The counter thus changes state only when x = 1, because only at
that time the AND gate transmits the external clock to the clock terminal of FFs. When x = 0, the
AND gate is disabled, the FFs receive no clock and the counter remains in the previous state. The
excitation table is shown in Table 13.9. The minimal expressions obtained from K-maps are shown
in Figure 13.30. The expressions in both the cases are the same, but the design is simpler in the
second case.
Table 13.9 Excitation table
PS NS O/P Excitation
y3 y2 y1 x = 1, clock present T3 T2 T1
0 0 0 0 0 1 0 0 0 1
0 0 1 0 1 1 0 0 1 0
0 1 1 0 1 0 0 0 0 1
0 1 0 1 1 0 0 1 0 0
1 1 0 1 1 1 0 0 0 1
1 1 1 1 0 1 0 0 1 0
1 0 1 1 0 0 0 0 0 1
1 0 0 0 0 0 1 1 0 0
SEQUENTIAL CIRCUITS-I 721
Steps 2 and 3. State diagram and state table: Let the machine be initially in state A. While
at A the first bit received may be a 0 or a 1. If it is a 0, it is invalid, so it will not start the
detection process and so it will remain at A itself and outputs a 0. If the first bit is a 1, it is
valid and so the detection process starts and the machine goes to next state B and outputs a 0.
While at B the next bit received may be a 0 or a 1. If the second bit is a 0, the first two bits
become 10 which is not a part of the valid sequence and so the detection has to start afresh.
So machine goes back to A the starting state and outputs a 0. If the second bit is a 1, the first
two bits become 11 which is a part of the valid sequence. So machine goes to next state C
and outputs a 0. While at C, the machine may receive the next bit as a 0 or a 1. If the third bit
is a 0, the sequence becomes 110 which is not a part of the valid sequence. So machine will
output a 0 and goes to the initial state A. If the third bit is a 1, the sequence becomes 111
which is a part of the valid sequence. So the machine goes to the next state D and outputs a
0. While at D, the machine may receive the next bit as a 0 or a 1. If the fourth bit is a 0, the
sequence becomes 1110, which is not valid and so the machine outputs a 0 and goes to state
A. If the fourth bit is a 1, the four bits become 1111 which is a valid sequence. The machine
outputs a 1 and remains at D itself because overlapping is permitted. It can utilize the second,
third and fourth bits, i.e. 111 and continue the detection process. So if the fifth bit is a 0, the
last four bits become 1110, so it will output a 0 and goes to state A. If the fifth bit is a 1, the
last four bits become 1111, so it will output a 1 and remain at D itself and so on.
722 FUNDAMENTALS OF DIGITAL CIRCUITS
Based on the above description of the working of the machine, the state diagram and the
state table indicating the transition of states are shown in Figure 13.32.
Step 4. Reduced standard form state table: The machine is already in this form. So no need
to do anything.
Step 5. State assignment and transition and output table: The state assignment is arbitrary.
There are four states. So, two state variables are needed, which can give a maximum of four
states. Therefore, there are no invalid states. Let the states be assigned as A Æ 00, B Æ 01,
C Æ 10, and D Æ 11. With this state assignment, the transition and output table is as shown
in Table 13.10.
Step 6. Choose type of flip-flops and form the excitation table: Let us say D flip-flops are
used as memory elements. With D flip-flops as memory elements the excitation table is as
shown in Table 13.11.
Table 13.11 Example 13.4: Excitation table
Step 7. K-maps and minimal expressions: The minimal expressions for excitations of FFs
of the sequential circuit in terms of the present state variables y1, y2 and input x are obtained
using K-maps as shown in Figure 13.33. From the excitation table the output z is given by
z = y1y2x.
Figure 13.33 Example 13.4: K-maps for the sequence (1111) detector using D flip-flops.
Step 8. Implementation: The logic diagram of the sequence detector based on those minimal
expressions is shown in Figure 13.34.
Figure 13.34 Example 13.4: Logic diagram of the sequence (1111) detector using D flip-flops.
EXAMPLE 13.5 A synchronous sequential machine has a single control input x and the
clock, and two outputs A and B. On consecutive rising edges of the clock, the code on A and
B changes from 00 to 01 to 10 to 11 and repeats itself if x = 1; if at any time, x = 0, it holds
to the present state. Draw the state diagram and implement the circuit using T flip-flops.
Solution
Step 1. Word statement of the problem: The block diagram of the sequential machine is
shown in Figure 13.35. The given machine is nothing but a sequential circuit with two flip-
flops. Let A and B be the outputs of the flip-flops. So, two state variables are required which
can have a maximum of four states. There are no invalid states present.
Steps 2 and 3. State diagram and state table: Let the machine be initially in state P.
The state diagram and the state table of the sequential machine with state assignment of
P Æ 00, Q Æ 01, R Æ 10, and S Æ 11
are shown in Figure 13.36.
Step 4. Reduced standard form state table: The machine is already in this form. So no need
to do anything.
Step 5. State assignment and transition and output table: The transition and output table
with this assignment is shown in Table 13.12.
Step 6. Choose type of flip-flops and form the excitation table: Let us select T flip-flops as
memory elements. With T FFs, the excitation table is shown in Table 13.13.
y1 y2 x Y1 Y2 T1 T2
0 0 0 0 0 0 0
0 0 1 0 1 0 1
0 1 0 0 1 0 0
0 1 1 1 0 1 1
1 0 0 1 0 0 0
1 0 1 1 1 0 1
1 1 0 1 1 0 0
1 1 1 0 0 1 1
SEQUENTIAL CIRCUITS-I 725
Step 7. K-maps and minimal expressions: The K-maps, their minimization, and the minimal
expressions for excitations obtained from them are shown in Figure 13.37a. The outputs of
the machine are the same as the outputs of the flip-flops.
Step 8. Implementation: The logic diagram based on those minimal expressions is shown
in Figure 13.37b.
EXAMPLE 13.6 Design a circuit that will function as prescribed by the state diagram
shown in Figure 13.38. Use S-R flip-flops for implementation.
0 0 0 1 0 0 0 0 0 0
0 1 1 1 1 1 0 1 0 1
1 1 1 0 1 0 1 1 1 1
1 0 1 0 0 0 1 0 1 0
y1 y2 x Y1 Y2 S1 R1 S2 R2 z1 z2
0 0 0 0 1 0 × 1 0 0 0
0 0 1 0 0 0 × 0 × 0 0
0 1 0 1 1 1 0 × 0 0 1
0 1 1 1 1 1 0 × 0 0 1
1 1 0 1 0 × 0 0 1 1 1
1 1 1 1 0 × 0 0 1 1 1
1 0 0 1 0 × 0 0 × 1 0
1 0 1 0 0 0 1 0 × 1 0
EXAMPLE 13.7 Design a 2-input 2-output synchronous sequential circuit which produces
an output z = 1, whenever any of the following input sequences 1100, 1010, or 1001 occurs.
The circuit resets to its initial state after a 1 output has been generated.
Solution
Step 1. Word statement of the problem: We have to design a 2-input 2-output synchronous
sequential circuit (i.e. a circuit with one input terminal and one output terminal) which produces
an output z = 1, whenever any of the following input sequences 1100, 1010, or 1001 occurs.
The circuit resets to its initial state after a 1 output has been generated. Assume that overlapping
is permitted.
Steps 2 and 3. State diagram and state table: Let the sequential machine be initially in
state A. The state diagram and the state table are shown in Figure 13.41.
Step 4. Reduced standard form state table: The machine is already in this form. So no need
to do anything.
Step 5. State assignment and transition and output table: There are seven states. So, three
state variables are required which can give a maximum of eight possible states. Since only
seven states are utilized, one is invalid and the corresponding excitations to the flip-flops are
don’t cares. The state assignment is arbitrary. Let it be A Æ 000, B Æ 010, C Æ 011,
D Æ 111, E Æ 110, F Æ 100, and G Æ 101. Three flip-flops are used. Draw the transition
and output table as shown in Table 13.16.
Step 6. Choose type of flip-flops and form the excitation table: Select J-K FFs as memory
elements. Draw the excitation table (Table 13.17).
Step 7. K-maps and minimal expressions: Draw the K-maps using the entries of the excitation
table and obtain the minimal expressions for J3, K3, J2, K2, J1, K1, and z in terms of y1, y2, y3,
and x as follows:
J1 = y2x + y3, K1 = y2 x + y2 y3;
J2 = y 3x, K2 = y1 y 3 + y1 x + y 1y3x;
J3 = y1y2 + y1 y2x, K3 = y1 + y2;
z = y 2y3 x + y1 y 2 y 3 x + y1y2 y 3x
Step 8. Implementation: The logic diagram can now be realized using these minimal
expressions.
EXAMPLE 13.8 Draw the state diagram and the state table of a 2-input 2-output
synchronous sequential circuit which examines the input sequence in non-overlapping strings
of three inputs each and produces a 1 output coincident with the last input of the string if and
only if the string consists of either two or three 1s. For example, if the input sequence is
010101110, the required output sequence is 000001001.
Solution
The block diagram of the sequential machine is shown in Figure 13.42. The state diagram
and the state table of the sequential circuit are shown in Figure 13.43.
SEQUENTIAL CIRCUITS-I 729
Assume that initially the machine is in state A. While at A it may receive the first bit either as
a 0 or as a 1. Both are valid for the sequence. So, the machine may go to state B (if the first bit is
a 0) or to state C (if the first bit is a 1). While at B, the machine may receive the next bit as a 0 or
a 1. If it is a 1, the last two bits are 01, which are part of the valid string. So, the machine goes to
state E. If it is a 0, the last two bits are 00, which are not part of the valid string. But since the
machine cannot start processing the next string from here (since it is non overlapping type) it goes
to state D just to provide a time delay and then goes to A whether the third bit received is a 0 or a
1. While at E, if the next bit is a 0, the string is 010 which is invalid and so the output is a 0; if it
is a 1, the string is 011 which is valid and, so, the machine outputs a 1. In both the cases, the
machine goes to A. While at C, the machine may receive a 0 or a 1. If it is a 0, the machine goes to
E because the first two bits are 10. If it is a 1, it goes to state F. The first two bits are now 11. While
at F, whether the next bit is a 0 or a 1 the machine outputs a 1 because both the sequences 110 and
111 are valid and goes to state A because overlapping is not permitted.
EXAMPLE 13.9 A clocked sequential circuit with single input x and single output z produces
an output z = 1 whenever the input x completes the sequence 1011 and overlapping is allowed.
(a) Obtain the state diagram.
(b) Obtain its minimum state table and design the circuit with D flip-flops.
Solution
Step 1. Word statement of the problem: A single input (x), single output (z) synchronous
sequential circuit to detect the sequence 1011 and to produce an output z = 1, whenever the
input x completes the sequence is to be designed. It is given that overlapping is permitted.
730 FUNDAMENTALS OF DIGITAL CIRCUITS
Steps 2 and 3. State diagram and state table: The state diagram is drawn as shown in
Figure 13.44. Let the machine be initially in state A. While at A it receives the first bit which
may be a 0 or a 1. If it is a 0, the detection does not start. So the machine remains in state A itself
and outputs a 0. If the first bit is a 1, it outputs a 0 and goes to state B. While at B, it receives the
next bit which may be either a 0 or a 1. If it is a 0, the last two bits will be 10 which is a part of
the valid sequence. So it outputs a 0 and goes to the next state C. If it is a 1, the last two bits
become 11 which is not a part of the valid sequence. So it outputs a 0 and since overlapping is
permitted it remains at state B (to utilize the last 1 bit). While at C it receives the third bit which
may be a 0 or a 1. If it is a 0 the last 3 bits will be 100 which is not a part of the valid sequence
and so it outputs a 0 and goes to state A because the detection has to start afresh. If it is a 1, the
last 3 bits will be 101 which is part of the valid sequence. So the machine outputs a 0 and goes
to state D. While at D it receives the fourth bit which may be either a 0 or a 1. If it is a 0, the last
four bits become 1010 which is not a valid sequence. So it outputs a zero and since overlapping
is permitted it goes to state C to utilize the last two bits 10. If it is a 1, the last 4 bits become
1011 which is a valid sequence. So the machine outputs a 1 and goes to state B to utilize the last
bit 1. The state table is also shown in Figure 13.44.
Step 4. Reduced standard form state table: Since there are no redundant states, the state
table shown in Figure 13.44 itself is the minimal.
Step 5. State assignment and transition and output table: There are four states. So two
state variables are required. Two state variables can have a maximum of four states. So all
the states are utilized and there are no invalid states. Hence there are no don’t cares. Assign
the states arbitrarily. Let A Æ 00, B Æ 01, C Æ 10, and D Æ 11 be the state assignment.
With this state assignment, draw the transition and output Table 13.18.
Step 6. Choose type of flip-flops and form the excitation table: It is given that the memory
elements are D flip-flops. With D flip-flops as memory elements draw the excitation
Table 13.19.
0 0 0 0 0 0 0 0
0 0 1 0 1 0 1 0
0 1 0 1 0 1 0 0
0 1 1 0 1 0 1 0
1 0 0 0 0 0 0 0
1 0 1 1 1 1 1 0
1 1 0 1 0 1 0 0
1 1 1 0 1 0 1 1
Step 7. K-maps and minimal expressions: Draw the K-maps and simplify them to obtain
the minimal expressions for excitations D2, and D1 in terms of present state outputs y1 and y2
and the input x as shown in Figure 13.45a. The expression for the output of the machine z in
terms of y1, y2 and x can be obtained directly from the excitation table.
Step 8. Implementation: The logic diagram based on those minimal expressions is shown
in Figure 13.45b.
EXAMPLE 13.10 A clocked sequential circuit is provided with a single input x and a
single output z. whenever the input produces a string of pulses 111 or 000 and at the end of
the sequence it produces an output z = 1 and overlapping is also allowed.
(a) Obtain the state diagram.
(b) Obtain the state table.
(c) Design the sequence detector.
Solution
Step 1. Word statement of the problem: A sequential circuit with one input terminal and
one output terminal to detect the sequence 111 or 000 is to be designed. Overlapping is
permitted.
Steps 2 and 3. State diagram and state table: Let the machine be initially in state A. While
at A the machine may receive the first bit as a 0 or as a 1. Both are valid and the machine
outputs a 0 and will go to state B if the first bit is a 0 and to state C if the first bit is a 1. While
at B the machine may receive the next bit as a 0 or as a 1. If the bit is a 0, the first two bits
become 00 which is a part of the valid string and so it outputs a 0 and goes to next state D. If
the bit is a 1, the first two bits become 01 which is not a part of the valid string. It outputs a
0 and since overlapping is permitted, to utilize the last bit 1 the machine will go to state C.
While at C the machine may receive the next bit as a 0 or as a 1. If the bit is a 0, the last two
bits will be 10 which is not a part of the valid string. It outputs a 0 and since overlapping is
permitted to utilize the last 0, the machine will go to state B. If the bit is a 1, the last two bits
will be 11 which is a part of the valid sequence. So the machine goes to state E and outputs
a 0. While at D the machine may receive the next bit as a 0 or as a 1. If the bit is a 0, the last
three bits become 000 which is a valid string. So the machine outputs a 1 and since overlapping
is permitted it remains on state D to utilize the last two zeros. If the bit is a 1, the last three
bits become 001 which is not a valid string. So it outputs a 0 and since overlapping is permitted
it goes to state C to utilize the last 1. While at E the machine may receive the next bit as a 0
or as a 1. If the bit is a 0, the last three bits become 110 which is not a valid string. So it
outputs a 0 and since overlapping is permitted it goes to state B to utilize the last 0. If the bit
is a 1, the last three bits will be 111 which is a valid sequence. So the machine outputs a 1 and
remains in the same state to utilize the last two 1s. The state diagram and the state table are as
shown in Figure 13.46.
Step 4. Reduced standard form state table: Since there are no redundant states the state
table shown in Figure 13.46 itself is the minimal.
Step 5. State assignment and transition and output table: There are five states. So three state
variables are required. The three state variables can have a maximum of eight states. Out of
those, five are valid and three are invalid. The invalid states can be treated as don’t cares.
Assign the states arbitrarily, as
A Æ 000, B Æ 001, C Æ 010, D Æ 011, and E Æ 100
States 101, 110 and 111 are invalid. With this state assignment, the transition and output
table is as shown in Table 13.20.
0 0 0 0 0 1 0 1 0 0 0
0 0 1 0 1 1 0 1 0 0 0
0 1 0 0 0 1 1 0 0 0 0
0 1 1 0 1 1 0 1 0 1 0
1 0 0 0 0 1 1 0 0 0 1
Step 6. Choose type of flip-flops and form the excitation table: The circuit is to be designed
using D flip-flops. So selecting D flip-flops as memory elements the excitation table is as
shown in Table 13.21.
Table 13.21 Example 13.10: Excitation table
Step 7. K-maps and minimal expressions: The K-maps, their minimization, and the minimal
expressions for excitations D1, D2, D3 and output z obtained from them are shown in
Figure 13.47.
734 FUNDAMENTALS OF DIGITAL CIRCUITS
Step 8. Implementation: A logic diagram can be drawn based on those minimal expressions.
EXAMPLE 13.11 The synchronous circuit shown in Figure 13.48 where D denotes a unit
delay produces a periodic binary output sequence. Assume that initially x1 = 1, x2 = 1, x3 = 0,
and x4 = 0 and that the initial output sequence is 1100101000. Thereafter, the sequence
repeats itself. Find a minimal expression for the combinational circuit f(x1, x2, x3, x4). The
clock need not be included in the expression although it is implicit.
Solution
The output x1 of the last delay unit is the output bit of the synchronous circuit. There are four
delay units arranged in the form of a shift register. It is given that the output sequence
1100101000 repeats itself. That means, the input to the first flip-flop which is the output of
the combinational circuit must also be the same sequence. Since initially x1 = 1, x2 = 1,
x3 = 0, and x4 = 0, the sequence of the bits at the input of the first delay element, i.e. bits of
f must come in the order 1010001100 to get the given output sequence. There are four state
SEQUENTIAL CIRCUITS-I 735
variables which can give a maximum of 16 possible states. Only 10 of them are utilized, so,
there are six invalid states. The values of f corresponding to those states are the don’t cares.
The initial state is 0011 and f = 1. The first clock pulse shifts each bit to the right by one
place. So, x1 is shifted out, and f is shifted to x4’s place, and the next f becomes the input to
the first flip-flop. Thus, the next state is 1001 and f = 0, and so on. After 10 clock pulses the
sequence repeats itself. The truth table and K-map are shown in Figure 13.49.
REVIEW QUESTIONS
1. The ______ of the state diagram represents the states of the machine.
2. The state of the machine after the application of the input sequence is called the ______.
3. The output values of physical devices are referred to as ______.
4. An up-down counter is also called a ______ counter or a ______ counter.
5. Synchronous counters have the advantages of ______ and ______, but the disadvantage of having
______ than that of asynchronous counters.
6. Presetting a counter is also referred to as ______ a counter.
7. State diagram can also be called the ______ diagram.
8. The next state part of the state table is called the ______ table.
9. The process of assigning the states of a physical device to the states of a sequential machine is
known as ______.
2. In a sequential circuit design, state reduction is done for designing the circuit with
(a) a minimum number of flip-flops (b) a minimum number of gates
(c) a minimum number of gates and memory elements
(d) none of the above
3. A sequential circuit with ten states will have
(a) 10 flip-flops (b) 5 flip-flops (c) 4 flip-flops (d) 0 flip-flops
4. The output of a clocked sequential circuit is independent of the input. The circuit can be represented
by
(a) Mealy model (b) Moore model
(c) either Mealy or Moore model (d) neither Mealy nor Moore model
5. For designing a finite state machine K-maps can be used for minimizing the
(a) excitation expressions of flip-flops (b) number of flip-flops
(c) output logic expressions (d) excitation and output logic expressions.
6. While constructing a state diagram of sequential circuit from the set of given statements,
(a) a minimum number of states must only be used
(b) redundant states may be used (c) redundant states must be avoided
(d) none of the above is relevant
7. A finite state machine
(a) is the same as a clocked sequential circuit
(b) consists of combinational logic circuits only
(c) consists of electrical motors
(d) does not exist in practice
8. A serial adder can be designed
(a) using only gates (b) using only flip-flops
(c) as a combinational circuit (d) as a sequential circuit
9. The number of directed arcs emanating from any state in a state diagram is
(a) 2n, where n is the number of inputs (b) independent of the number of inputs
(c) an arbitrary number (d) 2n, n is the number of flip-flops
10. The number of directed arcs terminating on any state of a state diagram is
(a) 2n where n is the number of inputs
(b) 2n where n is the number of flip-flops in the circuit
(c) independent of the number of inputs
(d) dependent on the number of outputs
PROBLEMS
13.1 A long sequence of pulses enters a 2-input 2-output synchronous sequential circuit which is
required to produce an output z = 1, whenever the sequence 1101 occurs. Overlapping sequences
are accepted. Design the circuit.
SEQUENTIAL CIRCUITS-I 739
13.4 Design a 2-input 2-output synchronous sequential circuit which produces an output z = 1, whenever
any of the following input sequences—1101, 1011, or 1001—occurs. The circuit resets to the
initial state after a 1 output is generated.
13.5 A long sequence of pulses enters a 2-input 2-output synchronous sequential circuit which produces
an output pulse z = 1, whenever the sequence 10010 occurs. The overlapping sequences are
accepted. Draw the state diagram, select an assignment and show the excitation table.
13.6 Design a sequence detector which generates an output z = 1, whenever the string is 0110, and
generates a 0 at all other times. The overlapping sequences are detected. Implement the circuit
using D FFs.
13.7 Design a 3-bit up/down counter which counts up when the control signal M = 1 and counts down
when M = 0.
13.8 Draw the state diagram and the state table for a 4-bit odd-parity generator.
13.9 Construct the state diagram and the state table for a 2-input machine, which produces an output
z = 1, whenever the last string of five inputs contains exactly four zeros and the string starts with
three zeros. Analysis of the next string does not start until the end of this string of five inputs,
whether or not it produces a 1 output.
740 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
SIMULATION OUTPUT:
SIMULATION OUTPUT:
SEQUENTIAL CIRCUITS-I 741
3. VHDL PROGRAM FOR FOUR-BIT EVEN AND ODD PARITY GENERATOR USING
DATA FLOW MODELING
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity PARITY_GENERATOR is
Port ( DATA : in STD_LOGIC_VECTOR (3 downto 0);
ODD_PARITY : out STD_LOGIC;
EVEN_PARITY : out STD_LOGIC);
end PARITY_GENERATOR;
architecture Behavioral of PARITY_GENERATOR is
begin
EVEN_PARITY <= (DATA(0) XOR DATA(1) XOR DATA(2) XOR DATA(3));
ODD_PARITY <= (NOT (DATA(0) XOR DATA(1) XOR DATA(2) XOR
DATA(3)));
end Behavioral;
SIMULATION OUTPUT:
VERILOG PROGRAMS
1. VERILOG PROGRAM TO FIND EVEN & ODD PARITY IN THE GIVEN SEQUENCE
module parity (addr, Even_Parity,Odd_Parity);
input [3:0] addr;
output reg Even_Parity;
output reg Odd_Parity;
always@(addr)
begin
Even_Parity = calc_parity(addr);
Odd_Parity = (~(calc_parity(addr)));
end
function calc_parity;
input [3:0] address;
begin
calc_parity = ^address;
end
endfunction
endmodule
742 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
2. VERILOG PROGRAM FOR 3-BIT EVEN & ODD PARITY GENERATOR USING
DATA FLOW MODELING
module parity_gen (a,b,c,odd,even);
input a,b,c;
output odd,even;
assign even = a^ b^ c;
assign odd = ~(a^ b^ c);
endmodule
SIMULATION OUTPUT:
SEQUENTIAL CIRCUITS-I 743
3. VERILOG PROGRAM FOR 4-BIT EVEN PARITY GENERATOR USING DATA GATE
LEVEL MODELING
SIMULATION OUTPUT:
4. VERILOG PROGRAM FOR 4-BIT ODD PARITY GENERATOR USING DATA GATE
LEVEL MODELING
module odd_parity_gen (a,b,c,d,odd);
input a,b,c,d;
output odd;
wire N1,N2;
xor x1 (N1,a,b);
xor x2 (N2,N1,c);
xnor x3 (odd,N2,d);
endmodule
744 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
14
SEQUENTIAL CIRCUITS-II
2. No infinite sequence: Consider an infinite sequence such that the output is 1 when and only
when the number of inputs received so far is equal to P( P + 1)/2 for P = 1, 2, 3, ..., i.e. the desired
input-output sequence has the following form:
Input: x x x x x x x x x x x x x x x x x x x x x
Output: 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1
Such an infinite sequence cannot be produced by a finite state machine.
3. Limited memory: The finite state machine has a limited memory and due to limited memory,
it cannot produce certain outputs. Consider a binary multiplier circuit for multiplying two arbitrarily
large binary numbers. If we implement this with a finite state machine capable of performing
serial multiplication, we can find that it is not possible to multiply certain numbers. Such a limitation
does occur due to the limited memory available to the machine. This memory is not sufficient to
store arbitrarily large partial products resulted during multiplication.
Finite state machines are of two types. They differ in the way the output is generated. They are:
1. Mealy type model: In this model, the output is a function of the present state and the
present input.
2. Moore type model: In this model, the output is a function of the present state only.
The behaviour of a clocked sequential circuit can be described algebraically by means of state
equations. A state equation (also called transition equation) specifies the next state as a function of
the present state and inputs. The Mealy model shown in the figure consists of two D flip-flops, an
748 FUNDAMENTALS OF DIGITAL CIRCUITS
input x, and an output z. Since the D input of a flip-flop determines the value of the next state, the
state equations for the model can be written as
y1(t + 1) = y1(t) x(t) + y2(t) x(t)
y2(t +1) = y1(t) x(t)
and the output equation is
z(t) = {y1(t) + y2(t)} x (t)
where y(t +1) is the next state of the flip-flop one clock edge later, x(t) is the present input, and z(t)
is the present output. If y1(t + 1) and y2(t + 1) are represented by Y1(t) and Y2(t), in more compact
form, the equations are
y1(t + 1) = Y1 = y1x + y2x
y2(t + 1) = Y2 = y1x
z = (y1 + y2) x
The state table of the Mealy model based on the above state equations and output equation is
shown in Figure 14.3a. The state diagram based on the state table is shown in Figure 14.3b.
In general form, the Mealy circuit can be represented with its block schematic as shown in
Figure 14.4.
In general form, the Moore circuit can be represented with its block schematic as shown in
Figure 14.7. Figure 14.8 shows the Moore circuit model with an output decoder.
Successor: Looking at the state diagram in Figure 14.9 we can say that, when present state is A
and input is 1, the next state is D. In other words, this condition is specified as D is the 1-successor
of A. Similarly, we can say that A is the 1 successor of B and C, D is the 11 successor of B and C,
C is the 00 successor of A, D is the 000 successor of A, E is the 10 successor of A or 0000
successor of A and so on. In general, we can say that, if an input sequence X takes a machine from
state Si to Sj, then Sj is said to be the X successor of Si.
Terminal state: Looking at the state diagram of Figure 14.9, we observe that no such input
sequence exists which can take the sequential machine out of state E and thus state E is said to be
a terminal state.
In general, we can say that a state is a terminal state when there are no outgoing arcs which
start from it and terminate in other states.
Strongly-connected machine: In sequential machines many times certain subsets of states may
not be reachable from other subsets of states, even if the machine does not contain any terminal
state. However, if for every pair of states Si, Sj of a sequential machine there exists an input
sequence which takes the machine M from Si to Sj, then the sequential machine is said to be
strongly connected.
State equivalence theorem: It states that two states S1 and S2 are equivalent if for every possible
input sequence applied, the machine goes to the same next state and generates the same output.
That is, if S1(t + 1) = S2(t + 1) and Z1 = Z2, then S1 = S2.
X=0 { A Æ C, 0 and
C Æ E, 0 and
E Æ D, 0: outputs are the same
D Æ B, 1: outputs are different
Here the outputs are different after 2-state transitions and hence states A and E are 2-distinguishable.
PS NS, Z
X=0 X=1
A C, 0 F, 0
B D, 1 F, 0
C E, 0 B, 0
D B, 1 E, 0
E D, 0 B, 0
F D, 1 B, 0
Step 1. Partition the states into subsets such that all states in the same subset are 1-equivalent.
The first partition P1 can be obtained by placing those states having the same outputs under
all inputs, in the same block. This partitioning gives two subsets.
1. (A, C, E): Their outputs under 0 and 1 inputs are 0 and 0 respectively.
2. (B, D, F): Their outputs under 0 and 1 inputs are 1 and 0 respectively.
\ P1 = (A, C, E)(B, D, F)
Step 2. Partition the states into subsets such that all states in the same subset are 2- equivalent.
This can be accomplished by observing that two states are 2-equivalent if and only if they
are 1-equivalent and their Ii-successors of all possible Ii are also 1-equivalent. In other words, we
can say that, two states are placed in the same block of partition P2 if and only if they are in the
same block of P1 and for each possible Ii, their Ii successors are also contained in the same block of
P 1.
1. The 0-successors of (A, C, E) are (C, E, D): They are in different blocks of P1. So the
block (A, C, E) must be split into (A, C) and (E).
2. The 1-successors of (B, D, F) are (F, E, B): They are in different blocks of P1. Therefore,
(B, D, F) must be split into (B, F) and (D).
\ P2 = (A, C)(E)(B, F)(D)
3. The 1-successors of (A, C, E) are (F, B, B): They are in the same block of P1. The
0-successors of (B, D, F) are (D, B, D). They are in the same block of P1. So, no partitioning
is possible.
Step 3. Partition the states into subsets such that all states in the same block are 3-equivalent. For
this, consider the states which are 2-equivalent, i.e. blocks in P2.
1. The 0-successors of (A, C) are (C, E): They are in different blocks of P2. So partition
(A, C) into (A) and (C).
2. The 1-successors of (A, C) are (F, B): They are in the same block of P2.
\ P3 = (A) (C) (E) (B, F) (D)
Further partitioning of states is not possible because we find that the 0- and 1-successors of
(B, F), i.e. (D, D) and (B, F) are in the same block of P3.
The states in the same blocks of P3 are equivalent. So states B and F are equivalent. One of
them is redundant and can be eliminated. Let us remove F and replace F by B in the other places in
the table. The minimized state table is shown in Table 14.3.
PS NS, Z
X=0 X=1
A C, 0 F, 0
B D, 1 F, 0
C E, 0 B, 0
D B, 1 E, 0
E D, 0 B, 0
754 FUNDAMENTALS OF DIGITAL CIRCUITS
In general, we can say that the Pk+1 partition is obtained from the Pk partition by placing in
the same block of Pk+1, those states which are in the same block of Pk and whose Ii successors for
every possible Ii are also in a common block of Pk.
When Pk+1 = Pk, the partitioning process terminates and Pk defines the sets of equivalent
states of the sequential machine. The Pk is thus called the equivalence partition and the partitioning
procedure discussed above is referred to as the Moore reduction procedure.
Note:
1. The equivalent partition is unique.
2. If two states, Si and Sj of sequential machine M are distinguishable, then they are
distinguishable by a sequence of length n–1 or less, where n is the number of states in M.
Machine equivalence: Two machines, M1 and M2 are said to be equivalent if and only if for
every state in M1, there is a corresponding equivalent state in M2 and vice versa.
EXAMPLE 14.1 For the machine given in Table 14.4, find the equivalence partition and
a corresponding reduced machine in standard form and also explain the procedure.
PS NS, Z
X=0 X=1
A B, 0 E, 0
B E, 0 D, 0
C D, 1 A, 0
D C, 1 E, 0
E B, 0 D, 0
Solution
1. For equivalence partition, group the states having the same output under all input conditions
(i.e. for X = 0 and X = 1) into blocks.
In the given table, states (A, B, E) and states (C, D) have same outputs under all input
conditions.
\ P1 = (A, B, E) (C, D)
2. See whether the 0 and 1-successors of states in each block of P1 are in the same block of
P1 or not. If they are in different blocks partition the states.
Here the 0-successors of (A, B, E), i.e (B, E, B) are in the same block, but 1-successors of
(A, B, E), i.e. (E, D, D) are in different blocks of P1. So, partition (A, B, E) into (A) and
(B, E). 0-successors of (C, D), i.e. (D, C) are in the same block. Also 1-successors of (C, D),
i.e. (A, E) are in the same block. So, no partitioning is possible.
\ P2 = (A) (B, E) (C, D)
3. See whether the 0 and 1-successors of states in each block of P2 are in the same blocks of
P2 or not. If they are in different blocks of P2, partition them.
SEQUENTIAL CIRCUITS-II 755
Here, the 0- and 1-successors of (B, E), i.e. (E, B) and (D, D) are in same blocks of P2. The
0-successors of (C, D), i.e. (D, C) are also in one block, but the 1-successors of (C, D), i.e.
(A, E) are in different blocks. So, partition (C, D) into (C) and (D).
\ P3 = (A) (B, E) (C) (D)
4. See whether the 0 and 1-successors of (B, E) are in same blocks of P3. If they are in
different blocks of P3 partition them.
The 0 and 1-successors of (B, E), i.e. (E, B) and (D, D) are in the same blocks of P3.
So, no further partitioning is possible.
\ P4 = (A) (B, E) (C) (D)
Thus, equivalent states are
B=E
So, state E is redundant and can be removed. Also state E can be replaced by state B in the
table. A corresponding reduced machine in standard form is shown in Table 14.5.
PS NS, Z
X=0 X=1
A B, 0 B, 0
B B, 0 D, 0
C D, 1 A, 0
D C, 1 B, 0
EXAMPLE 14.2
(a) Explain the limitations of finite state machines.
(b) Find the equivalence partition and a corresponding reduced machine in standard form for
the machine given in Table 14.6.
PS NS, Z
X=0 X=1
A E, 0 D, 1
B F, 0 D, 0
C E, 0 B, 1
D F, 0 B, 0
E C, 0 F, 1
F B, 0 C, 0
Solution
1. States having the same output under all input conditions can be grouped as
P1 = (A, C, E)(B, D, F)
756 FUNDAMENTALS OF DIGITAL CIRCUITS
2. The 0- and 1-successors of (A, C, E), i.e. (E, E, C) and (D, B, F) are in the same block of
P1. 0-successors of (B, D, F), i.e. (F, F, B) are also in the same block of P1. So, no
partitioning is required, but 1-successors of (B, D, F), i.e. (D, B, C) are in different blocks
of P1. So, partition (B, D, F) into (B, D) and (F).
\ P2 = (A, C, E)(B, D)(F)
3. 0-successors of (A, C, E), i.e. (E, E, C) and the 0- and 1-successors of (B, D), i.e. (F, F)
and (D, B) are in same blocks of P2. So, no partitioning is required. The 1-successors of
(A, C, E), i.e. (D, B, F) are in different blocks of P2. So, partition (A, C, E) into (A, C) and
(E).
\ P3 = (A, C)(E)(B, D)(F)
4. The 0- and 1-successors of (A, C), and (B, D) i.e. (E, E), (D, B) and (F, F), (D, B) are in
the same blocks of P3. So, no partitioning is required.
\ P4 = (A, C)(E)(B, D)(F)
Thus, equivalent states are
A = C and B = D
So, states C and D are redundant and can be removed. C and D can be replaced by A and B
respectively in the rest of the table. The resultant minimized state table is as shown in
Table 14.7.
PS NS, Z
X=0 X=1
A E, 0 B, 1
B F, 0 B, 0
E A, 0 F, 1
F B, 0 A, 0
EXAMPLE 14.3 What are the conditions for two machines to be equivalent? For the
machine given in Table 14.8, find the equivalence partition and a corresponding reduced
machine in standard form.
Table 14.8 Example 14.3: State table
PS NS, Z
X=0 X=1
A F, 0 B, 1
B G, 0 A, 1
C B, 0 C, 1
D C, 0 B, 1
E D, 0 A, 1
F E, 1 F, 1
G E, 1 G, 1
SEQUENTIAL CIRCUITS-II 757
Solution
1. States having the same output under all input conditions can be grouped as
P1 = (A, B, C, D, E)(F, G)
2. 1-successors of (A, B, C, D, E), i.e. (B, A, C, B, A) and the 0- and 1-successors of (F, G),
i.e. (E, E), and (F, G) are in the same blocks of P1. So, no partitioning is required. The
0-successors of (A, B, C, D, E), i.e. (F, G, B, C, D) are in different blocks of P1. So,
partition (A, B, C, D, E) into (A, B) and (C, D, E).
\ P2 = (A, B)(C, D, E)(F, G)
3. The 0- and 1-successors of (A, B) and (F, G), i.e. (F, G), (B, A) and (E, E), (F, G) are in
the same blocks of P2. So, no partitioning is required.
The 1-successors of (C, D, E), i.e. (C, B, A) are in different blocks of P2. Also the 0-successors
of (C, D, E), i.e. (B, C, D) are in different blocks of P2. So, partition (C, D, E) into (C) and
(D, E).
\ P3 = (A, B)(C)(D, E)(F, G)
4. The 0- and 1-successors of (A, B) and (F, G), i.e. (F, G), (B, A) and (E, E), (F, G) and the
1-successors of (D, E), i.e. (B, A) are in the same blocks of P3. So, no partitioning is
possible. But the 0-successors of (D, E), i.e. (C, D) are in different blocks of P3. So,
partition (D, E) into (D) and (E).
\ P4 = (A, B)(C)(D)(E)(F, G)
5. The 0- and 1-successors of (A, B) and (F, G), i.e. (F, G), (B, A) and (E, E) (F, G) are in
the same blocks of P4. So, no further partitioning is possible.
Thus, equivalent states are
A = B and F = G
So, states B and G are redundant and can be removed. In the rest of the table, B and G are
replaced by A and F respectively. The resultant minimized state table is shown in Table 14.9.
PS NS, Z
X=0 X=1
A F, 0 A, 1
C A, 0 C, 1
D C, 0 A, 1
E D, 0 A, 1
F E, 1 F, 1
EXAMPLE 14.4
(a) Define the state equivalence and machine equivalence with reference to sequential
machines.
(b) Reduce the number of states in the state table given in Table 14.10, and tabulate the
reduced state table and give proper assignment.
758 FUNDAMENTALS OF DIGITAL CIRCUITS
PS NS, Z
X=0 X=1
A F, 0 B, 0
B D, 0 C, 0
C F, 0 E, 0
D G, 1 A, 0
E D, 0 C, 0
F F, 1 B, 1
G G, 0 H, 0
H G, 1 A, 0
Solution
1. States having the same output under all input conditions can be grouped as
P1 = (A, B, C, E, G) (D, H) (F)
2. The 1-successors of (A, B, C, E, G), i.e. (B, C, E, C, H) are in different blocks. So, split
(A, B, C, E, G) into (A, B, C, E) and (G). The 0-successors of (A, B, C, E, G), i.e. (F, D,
F, D, G) are in different blocks. So, partition (A, B, C, E, G) into (A, C) (B, E) and (G).
\ P2 = (A, C) (B, E) (G) (D, H) (F)
3. The 0-successors of (A, C), i.e. (F, F) and the 1-successors of (A, C), i.e. (B, E) are in the
same blocks of P2. The 0-successors of (B, E), i.e. (D, D) and the 1-successors of (D, H),
i.e. (A, A) are also in the same block of P2. So, no further partitioning is possible.
\ P3 = (A, C) (B, E) (G) (D, H) (F)
Thus, the equivalent states are
A = C, B = E, and D = H
So, states C, E and H are redundant and can be removed from the state table. Also states C,
E and H can be replaced by A, B and D in the rest of the table. The resultant minimized state
table is shown in Table 14.11.
PS NS, Z
X=0 X=1
A F, 0 B, 0
B D, 0 A, 0
D G, 1 A, 0
F F, 1 B, 1
G G, 0 D, 0
There are five states. So three state variables are required. The state assignment can be
A Æ 000, B Æ 001, D Æ 011, F Æ 101, G Æ 111.
SEQUENTIAL CIRCUITS-II 759
PS NS, Z
X=0 X=1
A B, 1 H, 1
B F, 1 D, 1
C D, 0 E, 1
D C, 0 F, 1
E D, 1 C, 1
F C, 1 C, 1
G C, 1 D, 1
H C, 0 A, 1
Solution
(a)
1. States having the same output under all input conditions are grouped as
P1 = (A, B, E, F, G) (C, D, H)
2. The 1-successors of (A, B, E, F, G), i.e. (H, D, C, C, D) are in the same block of P1. Also
the 0- and 1-successors of (C, D, H), i.e. (D, C, C) and (E, F, A) are in the same blocks of
P1. So, no partitioning is possible. The 0-successors of (A, B, E, F, G), i.e. (B, F, D, C, C)
are in different blocks of P1. So, partition (A, B, E, F, G) into (A, B) and (E, F, G).
\ P2 = (A, B) (E, F, G) (C, D, H)
3. The 1-successors of (A, B), i.e. (H, D) and the 0-successors of (C, D, H), i.e. (D, C, C) are
in the same blocks of P2. So, no partitioning is possible.
The 0-successors of (A, B), i.e. (B, F) are in different blocks of P2. So, partition (A, B)
into (A) and (B). The 1-successors of (C, D, H), i.e. (E, F, A) are in different blocks of P2.
So, partition (C, D, H) into (C, D) and (H).
\ P3 = (A) (B) (E, F, G) (C, D) (H)
4. The 0- and 1-successors of (E, F, G) and (C, D), i.e. (D, C, C), (C, C, D) and (D, C), (E, F)
are in the same blocks of P3. So, no further partitioning is possible.
\ P4 = (A) (B) (E, F, G) (C, D) (H)
Thus, equivalent states are
E = F = G and C = D
So, states F, G and D are redundant and can be removed. Also states F, G and D can be
replaced by states E, E and C respectively in the remaining table. The corresponding reduced
machine table in the standard form is shown in Table 14.13.
760 FUNDAMENTALS OF DIGITAL CIRCUITS
PS NS, Z
X=0 X=1
A B, 1 H, 1
B E, 1 C, 1
C C, 0 E, 1
E C, 1 C, 1
H C, 0 A, 1
PS NS, Z
X=0 X=1
q1 q2, 0 q8, 1
q2 q6, 0 q4, 1
q3 q4, 1 q5, 0
q4 q3, 1 q6, 0
q5 q4, 0 q5, 1
q6 q3, 0 q5, 1
q7 q3, 0 q4, 1
q8 q3, 1 q1, 0
SEQUENTIAL CIRCUITS-II 761
Solution
(a)
1. States having the same output under all input conditions can be grouped as
P1 = (q1, q2, q5, q6, q7) (q3, q4, q8)
2. The 0-successors of (q3, q4, q8), i.e. (q4, q3, q3) and the 1-successors of (q3, q4, q8), i.e.
(q5, q6, q1) are in the same blocks of P1. So, no partitioning is required.
The 0-successors of (q1, q2, q5, q6, q7), i.e. (q2, q6, q4, q3, q3) are in different blocks of P1. So,
partition (q1, q2, q5, q6, q7) into (q1, q2) and (q5, q6, q7). The 1-successors of (q1, q2, q5, q6, q7),
i.e. (q8, q4, q5, q5, q4) are in different blocks. So, partition (q1, q2, q5, q6, q7) into (q1, q2, q7)
and (q5, q6).
\ P2 = (q1, q2) (q5, q6) (q7) (q3, q4, q8)
3. The 1-successors of (q1, q2), i.e. (q8, q4) are in the same block of P2 but the 0-successors
of (q1, q2), i.e. (q2, q6) are in different blocks of P2. So, partition (q1, q2) into (q1) and (q2).
The 0-successors of (q5, q6), i.e. (q4, q3) are in the same block of P2. Also the 1-successors
of (q5, q6), i.e.(q5, q5) are in the same block of P2. So, no partitioning of (q5, q6) is possible.
The 0-successors of (q3, q4, q8), i.e. (q4, q3, q3) are in the same block of P2. The 1-successors
of (q3, q4, q8), i.e. (q5, q6, q1) are in different blocks of P2. So, partition (q3, q4, q8) into
(q3, q4) and (q8).
\ P3 = (q1) (q2) (q5, q6) (q7) (q3, q4) (q8)
4. The 0- and 1-successors of (q5, q6) i.e. (q4, q3) and (q5, q5), and the 0- and 1-successors of
(q3, q4), i.e. (q4, q3) and (q5, q6) are in the same blocks of P3. So, no further partitioning is
possible.
\ P4 = (q1) (q2) (q5, q6) (q7) (q3, q4) (q8)
Thus, equivalent states are
q5 = q6 and q3 = q4
So, states q6 and q4 are redundant and can be removed. In the remaining table q6 can be
replaced by q5, and q4 can be replaced by q3. So, the resultant minimized state table is as
shown in Table 14.15.
PS NS, Z
X=0 X=1
q1 q2, 0 q8, 1
q2 q5, 0 q3, 1
q3 q3, 1 q5, 0
q5 q3, 0 q5, 1
q7 q3, 0 q3, 1
q8 q3, 1 q1, 0
762 FUNDAMENTALS OF DIGITAL CIRCUITS
(b) The minimum length sequence that distinguishes state q1 from state q2 is determined as
follows:
Ï q1 Æ q2, 0 q2 Æ q6, 0 outputs are the same
Ô
X = 0 Ì q2 Æ q6, 0 q6 Æ q3, 0 outputs are the same
Ô
Ó q6 Æ q3, 0 q3 Æ q4, 1 outputs are different
PS NS, Z
X=0 X=1
A A, 0 E, 1
B A, 1 E, 1
C B, 1 F, 1
D B, 1 F, 1
E C, 0 G, 0
F C, 0 G, 0
G D, 0 H, 0
H D, 0 H, 0
Solution
1. States having the same output under all input conditions can be grouped as
P1 = (A) (B, C, D) (E, F, G, H)
2. The 1-successors of (B, C, D), i.e. (E, F, F) are in the same block of P1. Also, the 0- and
1-successors of (E, F, G, H), i.e. (C, C, D, D) and (G, G, H, H) are in the same blocks of
P1. So, no partitioning is possible.
The 0-successors of (B, C, D), i.e. (A, B, B) are in different blocks of P1. So, partition (B, C,
D) into (B) and (C, D).
\ P2 = (A) (B) (C, D) (E, F, G, H)
3. The 0- and 1-successors of (C, D), i.e. (B, B) and (F, F) are in the same blocks of P2.
Also, the 0- and 1-successors of (E, F, G, H), i.e. (C, C, D, D) and (G, G, H, H) are in the
same blocks of P2. So, no further partitioning is possible.
SEQUENTIAL CIRCUITS-II 763
PS NS, Z
X=0 X=1
A A, 0 E, 1
B A, 1 E, 1
C B, 1 E, 1
E C, 0 E, 0
PS NS, Z
X=0 X=1
S1 S1, 1 S1, 0
S2 S1, 1 S6, 1
S3 S2, 0 S5, 0
S4 S1, 0 S7, 0
S5 S4, 1 S3, 1
S6 S2, 0 S5, 0
S7 S4, 1 S3, 1
764 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
1. States having the same output under all input conditions can be grouped as
P1 = (S1) (S2, S5, S7) (S3, S4, S6)
2. The 1-successors of (S2, S5, S7), i.e. (S6, S3, S3) are in the same block of P1. Also the 1-successors
of (S3, S4, S6), i.e. (S5, S7, S5) are in the same block of P1. So, no partitioning is required.
The 0-successors of (S2, S5, S7), i.e. (S1, S4, S4) are in different blocks of P1. So, partition
(S2, S5, S7) into (S2) and (S5, S7). Also, the 0-successors of (S3, S4, S6), i.e. (S2, S1, S2) are in
different blocks of P1. So, split (S3, S4, S6) into (S4) and (S3, S6).
\ P2 = (S1) (S2) (S5, S7) (S4) (S3, S6)
3. The 0- and 1-successors of (S5, S7) and (S3, S6), i.e. (S4, S4), (S3, S3 ) and (S2, S2), (S5, S5)
are in the same blocks of P2. So, no further partitioning is possible.
\ P3 = (S1) (S2) (S5, S7) (S4) (S3, S6)
Thus, the equivalent states are
S5 = S7 and S3 = S6
So, states S7 and S6 are redundant and can be removed. Also, S7 can be replaced by S5 and S6
can be replaced by S3 in the remaining table. The resultant minimized state table is shown in
Table 14.19.
PS NS, Z
X=0 X=1
S1 S1, 1 S1, 0
S2 S1, 1 S3, 1
S3 S2, 0 S5, 0
S4 S1, 0 S5, 0
S5 S4, 1 S3, 1
machine in which all state transitions are specified and only the outputs are partially specified.
Unspecified outputs can be assigned without any effect on the state sequence. However, it is
advantageous to leave outputs unspecified as long as possible during the state reduction process.
This provides additional flexibility in the state reduction process.
PS NS, Z
X=0 X=1
S1 S3, 0 –
S2 –, 1 S3, 0
S3 S1, 0 S2, 1
PS NS, Z
X=0 X=1
S1 S3, 0 T, –
S2 T, 1 S3, 0
S3 S1, 0 S2, 1
T T, – T, –
When reducing incompletely specified state table we use the term state compatibility instead
of state equivalence. The state compatibility is defined as:
States Si and Sj are said to be compatible states, if and only if for every input sequence that
affects the two states, the same output sequence occurs whenever both the outputs are specified
and regardless of whether Si or Sj is the initial state.
Consider the state table shown in Table 14.22. In this table the following compatible states
are there.
1. S0 = S3, if the output Z for S3 when X = 0 and X = 1 is changed from a don’t care to a 0.
2. S2 = S4, if the output Z for S2 and S4 when X = 0 is changed from a don’t care to either a
0 or a 1.
Table 14.22 State table
PS NS, Z
X=0 X=1
S0 S1, 0 S2, 0
S1 S0, – S2, 0
S2 S3, – S4, 1
S3 S1, – S2, –
S4 S2, – S4, 1
766 FUNDAMENTALS OF DIGITAL CIRCUITS
PS NS, Z
I1 I2 I3 I4
A – E, 1 B, 1 –
B – D, 1 – F, 1
C F, 1 – – –
D – – C, 1 –
E C, 0 – A, 0 F, 1
F D, 0 A, 1 B, 0 –
States A and B have non-conflicting outputs, but the successors (next states) under input I2
are compatible only if implied states D and E are compatible. So, draw a broken line from A to B
SEQUENTIAL CIRCUITS-II 767
with DE written in between. States A and C are compatible because the next states and output
entries of states A and C are not conflicting. Therefore, a line is drawn between nodes A and C.
States A and D have non-conflicting outputs but the successors under input I3 are B and C. Hence
join A and D by a broken line with BC entered in between. States A and E have conflicting outputs
under input I3. So states A and E are non-compatible and hence no line is drawn between A and E.
States A and F also have conflicting outputs under input I3. So states A and F are non-compatible
and hence no line is drawn between A and F. In a similar way, the merger graph is drawn for all
possible pairs of states. We can see that the merger graph displays all possible pairs of states and
their implied pairs. We know that a pair of states is compatible only if its implied pair is compatible.
Therefore, it is necessary to check whether the implied pairs are indeed compatible.
Two states are said to be incompatible if no line is drawn between them. If implied states are
incompatible, they are crossed and the corresponding line is ignored. For example, implied states
D and E are incompatible, so states A and B are also incompatible. Next, it is necessary to check
whether the incompatibility of A and B does not invalidate any other broken line. Observe that
states E and F also become incompatible because the implied pair AB is incompatible. The broken
lines which remain in the graph after all the implied pairs have been verified to be compatible are
regarded as complete lines.
After checking all possibilities of incompatibility, the merger graph gives the following seven
compatible pairs.
(A, C) (A, D) (B, C) (B, D) (C, D) (B, E) (B, F)
These compatible pairs are further checked for further compatibility. For example, pairs
(B, C) (B, D) (C, D) are compatible. So (B, C, D) is also compatible. Also pairs (A, C) (A, D) (C,
D) are compatible. So, (A, C, D) is also compatible. In this way the entire set of compatibles of
sequential machine can be generated from its compatible pairs.
To find the minimal set of compatibles for state reduction, it is useful to find what are called
the maximal compatibles. A set of compatible state pairs is said to be maximal, if it is not completely
covered by any other set of compatible state pairs. The maximum compatibles can be found by
looking at the merger graph for polygons which are not contained within any higher order complete
polygons. For example, in Figure 14.10b only triangles (A, C, D) and (B, C, D) are of higher order.
The set of maximal compatibles for this sequential machine is given as
(A, C, D) (B, C, D) (B, E) (B, F)
EXAMPLE 14.9 Draw the merger graph and obtain the set of maximal compatibles for
the incompletely specified sequential machine whose state table is given in Table 14.24.
Solution
The merger graph corresponding to the given state table is drawn as shown in Figure 14.11a.
In the merger graph shown states B and D are not connected. So the pair (B, D) is not
compatible. Notice that the pair (D, F) is compatible only if the implied pair (B, D) is
compatible. Since (B, D) is not compatible, (D, F) is also not compatible. Also notice that the
pair (B, F) is compatible only if the implied pairs (D, F) and (A, B) are compatible. Since the
pair (D, F) is not compatible, the pair (B, F) is also not compatible. Removing the broken
lines corresponding to non-compatible pairs, i.e. (D, F) and (B, F) and replacing the broken
lines of other pairs by unbroken lines (indicating that the corresponding pairs of states are
compatible) the merger graph is redrawn as shown in Figure 14.11b.
After checking all possibilities of incompatibility, the merger graph gives the following
nine compatible pairs:
(A, B) (A, C) (A, F) (B, C) (C, D) (C, E) (C, F) (D, E) (E, F)
= (A, B) (A, C) (B, C) (A, C) (A, F) (C, F) (C, D) (C, E) (D, E) (C, E) (C, F) (E, F)
= (A, B, C) (A, C, F) (C, D, E) (C, E, F)
Also looking at the merger graph in Figure 14.11b we can find the maximal compatibles
corresponding to the triangles as (A, B, C) (A, C, F) (C, D, E) (C, E, F).
mark × in the corresponding cell. For example, states B and C are incompatible because their
outputs are conflicting and hence the cell corresponding to them contains a cross mark ×. Similarly
states B, E; D, E; E, F are incompatible. Hence put a × mark in the corresponding cells. On the
other hand, states A and B are compatible and hence the cell corresponding to them contains the
check mark ✓. Similarly, cells corresponding to states A, D; A ,E; A, G; B, G; C, F; D, F ; D, G are
also compatible. So a check mark is put in those cells also. The implied pairs or pairs corresponding
to the state pair are written within the cell as shown in Table 14.26. For example, states A and C
are compatible only when implied states E and F are compatible. Therefore, EF is written in the
cell corresponding to states A and C. States C and E are compatible only when implied states A
and B, and D and F are compatible. So AB and DF are written in the cell corresponding to states C
and E. In a similar way, the entire merger table is written. Now it is necessary to check whether the
implied pairs are compatible or not by observing the merger table. The implied states are
incompatible if the corresponding cell contains a ×. For example, implied pair E, F is incompatible
because cell EF contains a ×. Similarly, implied pairs EF, AF are incompatible because EF contains
a ×. It is indicated by a ×.
PS NS, Z
00 01 11 10
A E, 0 – – –
B – F, 1 E, 1 A, 1
C F, 0 – A, 0 F, 1
D – – A, 1 –
E – C, 0 B, 0 D, 1
F C, 0 C, 1 – –
G E, 0 – – A, 1
Once the merger table is completed, the set of all maximal compatibles can be formed by
procedure which is the counterpart to that of finding a complete polygon in the merger graph. The
procedure is as follows:
1. Begin with the rightmost column in the merger table and proceed left until a column
containing a compatible pair is encountered. For example, in the table, the pair FG is the
starting one.
2. Proceed left to the next column containing at least one compatible pair. If the state to
which this column corresponds is compatible with all the states in the set of previously
determined compatible states, then add this state to that set of compatible states to form a
larger compatible. If this state is not compatible with all states of previously determined
set, but is compatible with some of them and / or with some other state(s), form a new set
of compatible states. For example, state E is not compatible with both F and G which are
the previously determined set of states. However, it is compatible with state G. Therefore,
it is not added to the previous set (FG) but a new set (EG) is formed. On the other hand,
state D is compatible with states F and G of the previous set. So form a set (DFG) but D
is not compatible with states E and G of the other previous set. So leave it as it is.
3. Repeat step 2 until the leftmost column is reached.
After application of the above mentioned procedure, the merger table in Table 14.26 gives
the following set of maximal compatibles.
Column F: (F, G)
Column E: (F, G) (E, G)
Column D: (D, F, G) (E, G)
Column C: (C, E) (C, F) (E, G) (D, F, G)
Column B: (B, D, F, G) (C, E) (C, F) (E, G)
Column A: (A, B, D, F, G) (A, E) (C, E) (C, F) (C, G)
The complete procedure for the considered merger table is as follows:
The rightmost column is F. It indicates that states F and G are compatible, so, form a compatible
set (F, G). Hence at column F we have (F, G). Column E indicates that state G is compatible only
with state E. So include a new compatible set (E, G) in the list. So at column E we have (E, G) (F,
G). Column D shows that states G and F are compatible with state D. Since (G, F) is already a
previously formed compatible set, expand it into a bigger compatible set (D, F, G). So at column
D, we have (D, F, G) (E, G) . Column C indicates that state C is compatible with states E and F. So
form new compatible pairs (C, E) and (C, F). So at column C we have (C, E) (C, F) (D, F, G) (E,
G). Column B indicates that state B is compatible with the states D, F, and G. Since we have a
previously formed set (D, F, G), expand it into a compatible set (B, D, F, G). So at column B we
have (B, D, F, G) (C, E) (C, F) (E, G). Column A indicates that state A is compatible with states B,
D, E, F, G. Out of these, since we already have a compatible set (B, D, F, G), expand it into a new
compatible set (A, B, D, F, G) and form another new set (A, E). So, at column A, we have (A, B,
D, F, G) (A, E) (C, E) (C, F) (C, G) as the set of compatibles.
Therefore, the set of maximal compatibles is (A, B, D, F, G) (A, E) (C, E) (C, F) (C, G).
EXAMPLE 14.10 Obtain the set of maximal compatibles for the sequential machine whose
state table is shown in Table 14.27 using the merger table method.
SEQUENTIAL CIRCUITS-II 771
PS NS, Z
I1 I2 I3 I4
A – C, 1 E, 1 B, 1
B E, 0 – – –
C F, 0 F, 1 – –
D – – B, 1 –
E – F, 0 A, 0 D, 1
F C, 0 – B, 0 C, 1
Solution
Table 14.28 shows the merger table for the sequential machine whose state table is given in
Table 14.27. A × is put in the cells corresponding to pairs (A, E), (A, F), (C, E), (D, E), and
(D, F) because they are non-compatible. A ✓ is put in cells corresponding to pairs (A, B), (B,
D), (B, E), (C, D), and (C, F) because they are compatible. In other cells the implied pairs are
written. Since pair (C, E) is not compatible put a × in cell (B, F) which has this implied pair.
The merger table in Table 14.28 gives the following set of maximal compatibles.
Column E: (E, F)
Column D: (E, F)
Column C: (C, D) (C, F) (E, F)
Column B: (B, C, D) (B, E) ( C, F) (E, F)
Column A: (A, B, C, D) (B, E) (C, F) (E, F)
The rightmost column is E. It indicates that state E is compatible with state F resulting in a
compatible pair (E, F). Column D indicates that there is no compatible pair. So at column D
also we have only (E, F). Column C indicates that state C is compatible with states D and F.
So, add new pairs (C, D) and (C, F). So at column C, we have (C, D) (C, F) (E, F). Column
B has 3 compatibilities. Since it is compatible with both C and D in the previous group, make
a bigger group (B, C, D). Also, add a new compatible pair (B, E). So, at column B we have
(B, C, D) (B, E) (C, F) (E, F). In column A, state A has compatibility with states (B, C, D).
772 FUNDAMENTALS OF DIGITAL CIRCUITS
Since (B, C, D) is already a group, we can form a bigger group (A, B, C, D). So at column A,
we have (A, B, C, D) (B, E) (C, F) (E, F) as the set of maximal compatibles.
EXAMPLE 14.11 Obtain the set of maximal compatibles for the state table given in
Table 14.29 using the merger table method.
PS NS, O/P
00 01 11 10
A B, – D, – – C, –
B F, – I, – – –
C – – G, – H, –
D B, – A, – F, – E, –
E – – – F, –
F A, 0 – B, – –, 1
G E, 1 B, – – –
H E, – – – A, 0
I E, – C, – – –
Solution
The merger table for the sequential machine described by the state table of Table 14.29 is
shown in Table 14.30. The maximal compatibles are obtained as follows:
SEQUENTIAL CIRCUITS-II 773
Column H: (H, I)
Column G: (G, H, I)
Column F: (F, I) (G, H, I)
Column E: (E, G, H, I) (E, F, I)
Column D: (D, E, G, H, I) (D, E, F, I)
Column C: (D, E, G, H, I) (C, F) (C, G) (C, H) (D, E, F, I) (C, I)
Column B: (D, E, G, H, I) (B, C, I) (B, C, H) (B, C, G) (B, C, F) (D, E, F, I)
Column A: (D, E, G, H, I) (B, C, I) (A, B, C, H) (B, C, G) (D, F) (A, B, C, F) (D, E, F, I)
EXAMPLE 14.12 Obtain the set of maximal compatibles for the sequential machine
whose state table is given in Table 14.31 using (a) Merger table method and (b) Merger
graph method.
PS NS, Z
I1 I2 I3
A C, 0 E, 1 –
B C, 0 E, – –
C B, – C, 0 A, –
D B, 0 C, 0 E, –
E – E, 0 A, –
Solution
(a) Merger table method: The merger table for the given state table of Table 14.31 is shown
in Table 14.32.
From the table we see that states (A, E) are not compatible. So cross all cells which contain
AE. So states (D, E) and (C, D) are also not compatible. Therefore, the maximal compatibles
are as follows:
Column D: NIL
Column C: (C, E)
774 FUNDAMENTALS OF DIGITAL CIRCUITS
Column B: ( B, C, E) (B, D)
Column A: (A, B) (B, C, E) (B, D)
Therefore, the set of maximal compatibles is (A, B) (B, C, E) (B, D).
(b) Merger graph method: The merger graph for the sequential machine corresponding to
the given state table of Table 14.31 is shown in Figure 14.12a. From the merger graph we
observe that states A and E are not connected. So they are not a compatible pair. So put
a × mark on all broken lines which have AE, i.e. cross the lines CD and DE. The rest of
the graph can be drawn as shown in Figure 14.12b with unbroken lines indicating that
those pairs are compatible. From the revised graph, we observe that the maximal set of
compatibles is
(A, B) (B, D) (B, C) (B, E) (C, E) = (A, B) (B, C, E) (B, D)
EXAMPLE 14.13 Obtain the set of maximal compatibles for the sequential machine whose
state table is given in Table 14.33 using (a) the merger table method and (b) merger chart
method.
PS NS, Z
00 01 11 10
A C, 0 – C, 0 –
B A, – B, 1 D, – –
C – E, 1 –, 0 D, 0
D E, 0 – F, 1 C, –
E F, 0 – B, – A, 1
F – B, 1 –, 0 C, 0
SEQUENTIAL CIRCUITS-II 775
Solution
(a) Merger table method: The merger table for the given state table of Table 14.33 is shown
in Table 14.34. From the table we see that states (E, F) are not compatible. So states (D,
E) are also not compatible. States (C, D) are not compatible. So states (C, F) and (A, B)
are also not compatible. If (C, F) are not compatible, then states (A, E) are not compatible.
States (D, F) are not compatible. So (B, D) are also not compatible. If states (B, D) are
not compatible states, (B, E) are also not compatible. If states (B, E) are not compatible,
then states (B, C) are also not compatible. So we are left with only compatible pairs (A,
C) (A, F) and (B, F):
Column E: Nil
Column D: Nil
Column C: Nil
Column B: (B, F)
Column A: (A, C)(A, F)(B, F)
Therefore, the set of maximal compatibles is
(A, C)(A, F)(B, F)
(b) Merger graph method: The merger graph for the sequential machine corresponding to
the given state table of Table 14.33 is shown in Figure 14.13a. From the merger graph,
we observe that E and F are not connected. So they are not a compatible pair. So put a ×
mark on all broken lines which have EF, i.e. cross line DE. A and E are not connected. So
cross line BD. Since line BD is crossed, cross line BE. Since line BE is crossed, cross
lines BC and CF. So we are left with the reduced merger graph shown in Figure 14.13b.
From the revised graph, we observe that the maximal set of compatibles is
(A, C)(A, F)(B, F)
can cover (implement) the sequential machine using the number of states equal to the number of
maximal compatible pairs. In this section, we discuss the compatibility graph which can be used to
get minimal closed covering giving further reduction of states if possible.
Step 1. Identify and draw vertices: Refer to the reduced merger graph shown in Figure 14.15a.
Mark the vertices corresponding to all compatible pairs. In the merger graph, each compatible
state pair is indicated by a line drawn between the two state vertices. For example, in the merger
SEQUENTIAL CIRCUITS-II 777
graph shown in Figure 14.15a, there are lines between A and B, A and D, A and E, B and D, B and
E, B and F, C and D, and E and F. This gives us eight vertices—AB, AD, AE, BD, BE, BF, CD,
and EF in the compatibility graph shown in Figure 14.15b.
Step 2. Draw arcs: Draw the arcs lead from vertex (Si, Sj) to vertex (Sp, Sq) if and only if the
compatible pair (Si, Sj) implies the pair (Sp, Sq). The implied pairs are shown in the merger graph
of Figure 14.14a. The compatible pair AB implies (AE) and (BE), AD implies (EF), AE implies
(AB) and (BE), BD implies (AE) and (BF), CD implies (BD), and so on.
Steps to construct compatibility graph from merger table: For the given state table of
Figure 14.14a, first draw the merger table shown in Figure 14.16a.
Step 1. Identify and draw vertices: Refer to the merger table of the sequential machine shown in
Figure 14.16a. Mark the vertices corresponding to all compatible pairs in the merger table. In the
merger table, each cell of the table except those marked (×) corresponds to the compatible pair
defined by the intersection of the row and column headings . If we observe the merger table from
right to left and top to bottom the compatible pairs are EF, CD, BD, BE, BF, AB, AD, and AE.
This gives us eight vertices in the compatibility graph as shown in Figure 14.16b.
Figure 14.16 Merger table and compatibility graph from merger table.
778 FUNDAMENTALS OF DIGITAL CIRCUITS
Step 2. Draw arcs: Draw the arcs lead from vertex (Si, Sj) to vertex (Sp, Sq) if and only if the
compatible pair (Si, Sj) implies (Sp, Sq). The entries in cell (Si, Sj) of the merger table are the pairs
implied by (Si, Sj). For example, compatible pair CD implies BD, pair BD implies AE and BF, pair
AB implies AE and BE, and so on.
EXAMPLE 14.14 For the incompletely specified sequential machine whose state table
is given in Figure 14.17a, obtain the compatibility graph from its (a) merger graph and
(b) merger table.
(b) The merger table of the sequential machine described by the given state table is shown in
Figure 14.19a. In the merger table there are eight compatible pairs. So there are eight
vertices—AB, AE, AF, BD, BE, BF, CD, and DE in the compatibility graph.
The compatibility graph based on the merger table is shown in Figure 14.19b.
SEQUENTIAL CIRCUITS-II 779
The set of maximal compatibles derived from the merger graph given in Figure 14.18a contains
four members {(A, B, D), (A, B, E), (B, E, F), (C, D)}. Therefore, the merger graph reduces the
number of states required to implement the machine up to four. On the other hand, the same
machine can be implemented using only three states as indicated by the subgraph of the compatibility
graph.
Using these assignments, we can write the minimal cover table as shown in Table 14.36.
PS NS, Z
I1 I2 I3 I4
A A, 0 – E, – B, 1
B E, – C, 1 B, – –
C – B, 0 –, 1 D, 0
D A, 0 – F, 1 B, –
E B, 0 – B, 0 –
F – C, 1 –, 0 C, 1
PS NS, Z
I1 I2 I3 I4
(A, B) Æ X Y, 0 – Z, – Z/X, 1
(A, E) Æ Y X, 0 – Z, 0 Z/X, 1
(B, E) Æ Z Z, 0 – Z/X, 0 –
EXAMPLE 14.15 Construct the compatibility graph and obtain the minimal cover table
for the sequential machine described by the state table given in Table 14.37.
PS NS, Z
I1 I2
S1 S5, 1 S2, 1
S2 S6, 1 S1, 1
S3 S5, – S3, 1
S4 S6, 0 S4, 1
S5 S3, 0 S3, 1
S6 S4, – S2, 1
Solution
The merger table for the given state table is constructed as shown in Figure 14.21a. From the
merger table the compatibility graph shown in Figure 14.21b can be constructed.
To construct the minimal cover table first we have to consider the closed subgraph. There
may be more than one subgraph for the given compatibility graph. So, there may be more
than one solution. One subgraph which can be easily visualized from the compatibility graph
contains four vertices (S1 S3), (S2 S3), (S3 S4), (S5 S6) as shown in Figure 14.22a. It indicates
SEQUENTIAL CIRCUITS-II 781
that the machine can be covered by a four state machine. This is one of the solutions. However,
we should try to find a larger closed subgraph and check whether the added vertices can be
used to merge compatible pairs to give larger compatibles. In the present case, if we add
vertex (S1 S2) to the preceding subgraph as shown in Figure 14.22b, we obtain a set which
consists of five compatible pairs {(S1 S2), (S1 S3), (S2 S3), (S3 S4), (S5 S6)} and is reduced to
the closed covering {(S1 S2, S3), (S3 S4), (S5 S6)}. Now there are three states and the machine
can be covered by a three-state machine.
Now by assigning A, B, C such that (S1 S2 S3) Æ A, (S3 S4) Æ B, (S5 S6) Æ C we can write
the minimal cover table as shown in Table 14.38.
782 FUNDAMENTALS OF DIGITAL CIRCUITS
PS NS, Z
I1 I2
(S1 S2 S3) Æ A C,1 A, 1
(S3 S4) Æ B C, 1 B, 1
(S5 S6) Æ C B, 1 A, 0
EXAMPLE 14.16 Construct the compatibility graph and obtain the minimal cover table
for the sequential machine described by the state table given in Table 14.39.
PS NS, Z
I1 I2
A – F, 0
B B, 0 C, 0
C E, 0 A, 1
D B, 0 D, 0
E F, 1 D, 0
F A, 0 –
Solution
The merger table for the given state table is constructed as shown in Table 14.40. From the
merger table the compatibility graph shown in Figure 14.23a may be constructed. Looking
at the compatibility graph we can consider the closed subgraph shown in Figure 14.23b.
From the closed covering we can derive the minimal cover table as follows: There are four
states (A B), (A E), (C F), (D F) in the subgraph. Assign them as
(A B) Æ P, (A E) Æ Q, (C F) Æ R, (D F) Æ S
SEQUENTIAL CIRCUITS-II 783
Using these assignments we can write the minimal cover table as shown in Table 14.41.
PS NS, Z
I1 I2
AB Æ P P, 0 R, 0
AE Æ Q R/S, 1 S, 0
CF Æ R Q, 0 P/Q, 1
DF Æ S P, 0 S, 0
1. By how many models are synchronous sequential circuits represented? Name them.
A. Synchronous or clocked sequential circuits are represented by two models. They are: 1. Moore
circuit (or model) and 2. Mealy circuit (or model).
2. What is a sequential machine?
A. A sequential machine is another name of a sequential circuit.
3. What is the Mealy machine?
A. The Mealy machine (or model or circuit) is a sequential circuit in which the output depends on
both the present state of the flip-flops and on the inputs.
4. What is the Moore machine?
A. The Moore machine (or model or circuit) is a sequential circuit in which the output depends only
on the present state of the flip-flops.
5. Compare the Moore and Mealy machines?
A. The Moore and Mealy machines are compared as follows.
784 FUNDAMENTALS OF DIGITAL CIRCUITS
2. Proceed left to the next column containing at least one compatible pair. If the state to which
this column corresponds is compatible with all the states in the set of previously determined
compatible states, then add this state to that set of compatible states to form a larger compatible.
If the state is not compatible with all the states of previously determined set, but is compatible
with some other state, form a new set of compatible states.
3. Repeat step 2 until the leftmost column is reached. The sets in the leftmost column give the
set of maximal compatibles.
27. What is compatibility graph?
A. The compatibility graph is a directed graph whose vertices correspond to all compatible pairs,
and an arc leads from vertex (Si, Sj) to vertex (Sp, Sq) if and only if (Si, Sj) implies (Sp, Sq). The
compatibility graph can be easily drawn from the merger graph or merger table.
28. What is subgraph of a compatibility graph?
A. Any part of a compatibility graph is called the subgraph of the compatibility graph.
29. What is a closed subgraph?
A. A subgraph of a compatibility graph is said to be closed if for every vertex in the subgraph all
outgoing arcs and their terminating vertices also belong to the subgraph. Each vertex in the
subgraph belongs to one state. Such a subgraph forms a closed covering for the corresponding
machine.
30. What is a minimal cover table?
A. A minimal cover table is a table which consists of the states of a minimal state machine.
REVIEW QUESTIONS
1. The sequential circuit in which the output depends only on the present state of the flip-flops is
called a ______ circuit.
2. The sequential circuit in which the output depends on the present state of the flip-flops as well as
on the present inputs is called a ______ circuit.
3. A sequential machine is another name of ______.
4. A state which has no outgoing arcs is called a ______ state.
5. If the outputs of two states are different after P-state transitions, they are said to be ______.
SEQUENTIAL CIRCUITS-II 787
PROBLEMS
14.1 For the state tables of the machines given below, find the equivalence partition and a corresponding
reduced machine in standard form.
(a) PS NS, Z
X=0 X=1
A D, 0 A, 1
B F, 1 C, 1
C D, 0 F, 1
D C, 0 E, 1
E C, 1 D, 1
F D, 1 D, 1
(b) PS NS, Z
X=0 X=1
A B, 1 H, 1
B F, 1 D, 1
C D, 0 E, 1
D C, 1 F, 1
E D, 1 C, 1
F C, 1 C, 1
G C, 1 D, 1
H C, 0 A, 1
788 FUNDAMENTALS OF DIGITAL CIRCUITS
(c) PS NS, Z
X=0 X=1
A E, 0 D, 1
B F, 0 D, 1
C E, 0 B, 0
D F, 0 B, 1
E C, 0 F, 0
F B, 0 C, 0
G D, 1 C, 1
H B, 1 A, 1
(d) PS NS, Z
X=0 X=1
A F, 0 B, 1
B F, 0 A, 1
C D, 0 C, 1
D C, 0 B, 1
E D, 0 A, 1
F E, 1 F, 1
G E, 1 G, 1
14.2 For the state tables of the incompletely specified sequential machines given below, find the set of
maximal compatibles using (a) the merger graph method and (b) the merger table method.
(a) PS NS, Z
I0 I1 I2 I3
A C, 0 – C, 0 –
B A, – B, 1 C, – –
C – C, 0 –, 1 D, 0
D F, 0 – E, 1 C, –
E F, 0 – A, – C, 1
F – B, 1 –, 0 B, 1
SEQUENTIAL CIRCUITS-II 789
(b) PS NS, Z
00 11 12 13
A A, – – F, – C, 1
B F, – B, 1 C, – –
C – C, 0 –, 1 D, 0
D A, 0 – E, 1 C, –
E C, 0 – C, 0 –
F – B, 1 –, 0 B, 1
(c) PS NS, Z
00 01 11 10
A F, 0 – – –
B – E, 1 F, 1 A, 1
C E, 0 – A, 0 E, 1
D – – A, 1 –
E – C, 0 B, 0 D, 1
F E, 0 – – A, 1
(d) PS NS, Z
I1 I2 I3 I4
A – C, – – –, 1
B A, 1 – B, 0 –
C – – – D, 1
D C, – A, – C, – F, 0
E B, – B, – A, – –, 0
F –, 0 C, 1 – H, 1
G –, 1 E, 1 F, 1 D, 1
H –, 1 G, – – F, 1
790 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
entity mealy_machine is
Port ( x : in STD_LOGIC;
clk : in STD_LOGIC;
z : out STD_LOGIC :=’0');
end mealy_machine;
begin
p1: process(ps,x)
begin
case ps is
when A=>
if x=’1' then ns<= B;
else ns<=A;
end if;
when B=>
if x=’1' then ns<=C;
else ns<=A;
end if;
when C=>
if x=’1' then ns<=C;
else ns<=D;
end if;
when D=>
if x=’1' then
z<=’1';
ns<=B;
else
z<=’0';
ns<=A;
end if;
when OTHERS=> z<=’0';
end case;
SEQUENTIAL CIRCUITS-II 791
SIMULATION OUTPUT:
entity MOOREBCD is
Port ( clk : in STD_LOGIC;
count : out STD_LOGIC_VECTOR (3 downto 0));
end MOOREBCD;
begin
process(clk)
begin
if clk=’1' and clk’ event then
ps<=ns;
end if;
end process;
process(ps)
792 FUNDAMENTALS OF DIGITAL CIRCUITS
begin
case ps is
when S0=> count <= “0000”; ns<=S1;
when S1=> count <= “0001”; ns<=S2;
when S2=> count <= “0010”; ns<=S3;
when S3=> count <= “0011”; ns<=S4;
when S4=> count <= “0100”; ns<=S5;
when S5=> count <= “0101”; ns<=S6;
when S6=> count <= “0110”; ns<=S7;
when S7=> count <= “0111”; ns<=S8;
when S8=> count <= “1000”; ns<=S9;
when S9=> count <= “1001”; ns<=S0;
when OTHERS => NULL;
end case;
end process;
end Behavioral;
SIMULATION OUTPUT:
VERILOG PROGRAMS
st0:
begin
z=1;
if(a)
moore_state=st2;
end
st1:
begin
z=0;
if(a)
moore_state=st3;
end
st2:
begin
z=0;
if(~a)
moore_state=st1;
else
moore_state=st3;
end
st3:
begin
z=1;
if(a)
moore_state=st0;
end
endcase
endmodule
SIMULATION OUTPUT:
794 FUNDAMENTALS OF DIGITAL CIRCUITS
st3:
begin
z=0;
if(~a)
n_state=st2;
else
n_state=st1;
end
endcase
end
endmodule
SIMULATION OUTPUT:
RTL SCHEMATIC:
SIMULATION OUTPUT:
SIMULATION OUTPUT:
15
ALGORITHMIC
STATE MACHINES
15.1 INTRODUCTION
The binary information stored in a digital system can be classified as either data or control
information. Data are discrete elements of information that are manipulated to perform arithmetic,
logic, shift, and other similar data processing tasks. These operations are implemented with digital
components such as adders, multiplexers, counters and shift registers. Control information provides
command signals that supervise the various operations in the data section in order to accomplish
the desired data processing tasks. The logic design of a digital system can be divided into two
distinct parts. One part is concerned with the design of the digital circuits that perform the data
processing operations. The other part is concerned with the design of the control circuits that
determine the sequence in which the various actions are performed. Figure 15.1 shows the
relationship between the control logic and the data processing in a digital system. The data processing
path, commonly referred to as the datapath, manipulates data in registers, according to the system’s
requirements. The control logic initiates a sequence of commands to the datapath. The control
logic uses status conditions from the datapath to serve as decision variables for determining the
sequence of control signals.
From the above discussion it is clear that to design a digital system, we have to design two
subsystems—datapath subsystem and control subsystem. A datapath subsystem consists of digital
circuits which are required to perform specified operations on the data information. A control
subsystem is a sequential circuit whose internal states decide the control commands for the
subsystem. At any given time, the state of the sequential circuit initiates a prescribed set of
commands. The sequential circuit considers the status conditions and the other external inputs to
determine the next state to initiate other operations.
The control sequence and datapath tasks of a digital system are represented by means of a
hardware algorithm. An algorithm consists of a finite number of procedural steps that specify how
to obtain a solution to a problem. A hardware algorithm is a step-by-step procedure to implement
the desired tasks with selected circuit components.
A state machine is another term for a sequential circuit which is the basic structure of a
digital system. Just as a flow chart serves as a useful aid in writing software programs, algorithmic
state machine (ASM) charts help in the hardware design of digital systems. An ASM chart is a
special flow chart that has been developed specifically to define digital hardware algorithms.
ASM charts provide a conceptually simple and easy to visualize method of implementing algorithms
used in hardware design. ASM charts are advantageously used in the design of the control unit of
the computer and in general control networks in any digital systems. ASM charts look similar to
flow charts but differ in that certain specific rules must be observed in constructing them. An ASM
chart is equivalent to a state diagram or a state graph. Normally state diagrams are used for the
design of finite state machines. For larger circuits ASM charts are useful. ASM chart is a useful
tool which leads directly to hardware realization.
The ASM chart is an alternative for describing the behaviour of finite state machines and is
similar to a conventional flow chart used in various engineering designs except for the timing
considerations. A conventional flow chart describes the sequence of procedural steps and decision
paths for an algorithm without any concern for their time relationship. The ASM chart on the other
hand describes the sequence of events as well as the timing relationships between the states of a
sequence controller and the events that occur while going from one state to the next state after
each clock edge.
2. Decision box: The decision box or condition box is represented by a diamond-shaped symbol
with one input and two or more output paths. The output branches are true and false branches. The
decision box describes the effect of an input on the control subsystem. A Boolean variable or input
or expression written inside the diamond indicates a condition which is evaluated to determine
which branch to take. The exit paths lead to the blocks corresponding to the next states of the
circuit following the next clock pulse. For example, X written inside this box indicates that the
decision is based on the value of X, whereas A + B written inside the box indicates that the true
path is chosen if A + B = 1 and the false path is chosen otherwise. Figure 15.3 shows a decision
box.
3. Conditional output box: The conditional output box is represented by a rectangle with rounded
corners or by an oval with one input line and one output line. The outputs that depend on both the
state of the system and the inputs are indicated inside the box. These are Mealy type outputs.
Figure 15.4 shows a conditional output box.
ASM block: An ASM chart is constructed from one or more interconnected ASM blocks. Each
ASM block contains a single state box and any decision and conditional output boxes associated
with that state. An ASM block has a single entry path and single or multiple exit paths represented
by the structure of the decision boxes. Each ASM block is associated with one specific state;
therefore, it describes the finite state machine operation during the time the machine is in that
state, i.e. it describes the state of the system under one clock pulse interval.
When a synchronous sequential system enters the state included in a given ASM block, the
outputs in the output list in the state box are asserted (become true). The conditions in the decision
boxes are evaluated to determine which path(s) is followed through the ASM block. When a
conditional output box is encountered in such a path, the corresponding conditional outputs become
true (asserted). A path through an ASM block from entry to exit is referred to as a link path.
In the ASM chart Mealy type outputs are now indicated in conditional output boxes and Moore
type outputs are indicated within the state box itself.
Figure 15.5 State diagram and ASM chart for mod-6 counter.
Look at the ASM chart which has six state boxes named S0 through S5. For every clock
pulse, X is sensed. If 1, then, the machine goes to the next state: if 0, then, the machine remains in
804 FUNDAMENTALS OF DIGITAL CIRCUITS
the same state as indicated by a return branch. All this happens in the same clock cycle. When the
machine is in state S5, on the occurrence of the clock pulse, if X is 1, the machine produces an
output pulse indicated as Z and goes to the initial state S0. The states are assigned binary numbers
using three flip-flops.
Let us design it using D flip-flops. With D flip-flops, the excitation Di has to be the same as
the next state variable Yi. Observing only state assignment indicated on the ASM chart, we notice
that the next value Y0 has to become 1 for the present states y2 y1 y0 = 000, 010, 100 only. Hence
using decimal codes and remembering that states 6 (110), and 7 (111) never occur, we get
D0 = Y0 = X [S m(0, 2, 4) + d(6, 7)]
Similarly, we obtain expressions for all the excitations and outputs by merely inspecting the
ASM chart.
D1 = Y1 = X[S m(1, 2) + d(6, 7)]
D2 = Y2 = X[S m(3, 4) + d(6, 7)]
Z = X[S m(5) + d(6, 7)]
Notice that the input X is ANDed with each of the expressions for the excitations. If the input
X is exclusively provided, then the circuit counts the number of clock pulses in the duration when
X is at level 1. In other words, X enables the counter. Some times, X is not provided, in which case
the clock pulses are counted modulo 6 and an output pulse is produced for every 6 clock pulses.
Example 2 Sequence detector: Let us say we want a sequence detector to detect the sequence
1010. The state diagram of the sequence detector is shown in Figure 15.6a. The ASM chart of the
sequence detector corresponding to that state diagram is shown in Figure 15.6b.
The machine has four states. So, four state boxes are required. While at each state, the machine
has to decide to which next state it has to go when the input 0 or 1 is given. Four decision boxes
with two branches each are also required. It has to output a 1 once the sequence 1010 is detected.
So it requires one conditional output box. The state assignment is arbitrary. Let it be S0 = 00,
S1 = 01, S2 = 10 and S3 = 11.
Notice that there are four ASM blocks, each containing one state box associated with one
decision box and the last ASM block has an output box as well. All the operations associated with
a state box from one ASM block have to be performed at the same time in one clock pulse period.
There are four states and y1 y0 are the binary values assigned to the states. If we decide to use two
D flip-flops, the excitation table is identical to the transition table and Di = Yi. In this ASM chart,
note that the next state variable Y0 becomes 1 in states S1 (01) and S3 (11). The corresponding
present states are S0 (y1 y0 = 00) and S2 ( y1 y0 = 10) and transition occurs if X = 1 and 1 respectively.
Thus, we may write the expressions for excitations by inspection as follows.
D0 = Y0 = X y1 y0 + Xy1 y0 = X y0( y1 + y1) = X y0
From the ASM chart observe that Y1 becomes 1 for S2 and S3 on X = 0 from S1 and X = 1
from S2 respectively.
D1 = Y1 = X y1y0 + Xy1 y0
The output Z = 1 when input X = 1 and the present state y1 y0 = 11. Therefore,
Z = Xy1y0
A logic circuit can be drawn based on the above expressions.
ALGORITHMIC STATE MACHINES 805
Example 3 Serial adder: We discussed earlier that a serial adder adds serial binary numbers.
The state diagram of the serial adder is shown in Figure 15.7a. The structure of the serial adder is
shown in Figure 15.7b. The ASM chart equivalent to the state diagram describing the same behaviour
is shown in Figure 15.8. In the ASM chart observe that there are four exit paths from each state
depending on the values of inputs A and B arranged in the form of a binary tree. Also observe that
all the paths merge into one entry path for each state. Comparing it with the state diagram, we
observe that in the state diagram from each state there is an exit path to the other state and three
re-entry paths to itself. This is because there are four different values that AB can assume 00, 01,
10 and 11 and hence there must be four exit paths—three of them happen to be re-entry paths in
this example. Observe in the state diagram that there are four incoming paths which merge into
one entry path to each state. Correspondingly, there are as many branches in the ASM chart. If the
number of inputs is large, the state graph will become quite complex and the ASM chart will
become unwieldy. The decision boxes are usually binary as we aim at an algorithmic procedure
comprising primitive steps. As we have two inputs we have to show four exit paths from each
state.
806 FUNDAMENTALS OF DIGITAL CIRCUITS
Synthesis of the circuit: By inspection of the ASM chart, we note that there are only two states S0
and S1 and hence we need to have only one flip-flop. We choose a D flip-flop, because D is easily
synthesized looking at the entry paths into each state. For the only flip-flop, D becomes 1 for state
S1. There are four arrows confluent on entry into S1. Hence, by inspection and tracing the paths
indicated by arrows, we write the expression for D given below. Remember that y is the present
state variable of the only flip-flop.
ALGORITHMIC STATE MACHINES 807
D = y AB + yA B + yAB + y AB
= AB(y + y ) + Ay(B + B) + By(A + A)
= AB + Ay + By
By a similar reasoning, the state S0 is characterized by y = 0. The corresponding excitation is
D. There are four paths confluent on the entry into S0 . By inspection and tracing the paths, we
may write
D = y A B + y A B + y AB + y A B
= A B(y + y ) + A y (B + B) + B y (A + A)
= AB + A y + B y
See the consistency in the expressions for D and D. There are four conditional output boxes.
Remember that the output Z is the sum bit to be produced serially. Tracing the corresponding
paths it is easy to write the expression for Z.
Z = y AB + y A B + y A B + y AB
= y( AB + A B) + y( A B + AB)
= y(A ≈ B) + y(A B)
=A≈B≈y
Notice that the expressions for Z and D are the same as those for sum S and output carry C0
of a full-adder.
Control subsystem implementation: The control subsystem consists of a sequential circuit. The
process to implement the sequential circuit described by ASM chart consists of the following
steps:
1. Translate the ASM chart to a state table.
2. Assign the states and convert the state table to a transition and output table.
3. Select the type of flip-flops and obtain the excitation table.
4. Obtain the minimal expressions for circuit outputs and memory element inputs in terms
of the present state variables and external inputs.
5. Draw a logic diagram based on those minimal expressions.
EXAMPLE 15.1 Develop an ASM chart and state table for a controllable waveform
generator that will output any one of the four waveforms given in Figure 15.9 as determined
by the values of its two inputs X1 and X2. The period of the first two waveforms is four clock
cycles, the period of the third is three, and the period of the fourth waveform is two clock
cycles respectively. When an input change does occur, the new waveform may begin at any
point in its period.
Solution
The longest waveform given is of four cycles. So the ASM chart for the above waveforms
can be drawn with four states, one for each clock cycle of the waveforms as shown in
Figure 15.10a. For each state, the output will be conditional on the values of input lines in
effect at that time. Let us observe the different conditions at different states.
1. State A: In the first state A, i.e. in the first clock cycle, all waveforms are at logic 1.
Therefore, the output Z = 1 (unconditional output) and is listed in the state box for the
first state A.
808 FUNDAMENTALS OF DIGITAL CIRCUITS
2. State B: In the second state B, i.e. in the second clock cycle, the output is 1 for input
combinations X1X2 = 01 and 10, and the output is 0 for input combinations X1X2 = 00
and 11. These conditions can be tested by X1 in the first decision box followed by X2 in
other two decision boxes. The outputs from state B are conditional, separate conditional
output boxes are used. Looking at Figure 15.9, we can observe that the fourth waveform
repeats after two cycles. Therefore, when X1 X2 = 11, the third and fourth states are not
used and the line goes back to the first state to start the new cycle.
3. State C: In the third state C, i.e. in the third clock cycle, the output will be 1, if X2 = 1.
The condition of X2 is checked and accordingly output is made 1 by decision box and
conditional box in state C. Looking at Figure 15.9, we can observe that the third waveform
repeats after three clock cycles. Therefore, when X1X2 = 10, the fourth state is not used
and the line goes back to the first state to start the new cycle.
4. State D: In the fourth state D, i.e. in the fourth clock cycle, the output is 0 for X1X2 = 00
and 01, and for X1X2 = 10 and 11 the next cycle has already started. So from state D, the
circuit returns to state A so that the waveforms for inputs X1X2 = 00 and 01 may be
repeated.
The ASM chart of the waveform generator can be expressed as a state table as shown in
Figure 15.10b. In the state table, the outputs along with next states are listed in the columns
corresponding to each combination of input values and the states are listed in the rows.
In the state table there are three don’t cares. When the machine is in state C, for input
X1X2 = 11, the next state and output are don’t cares because that waveform is repeated after two
clock cycles. Also when the machine is in state D, the next state and output entries for X1X2 = 10
and 11 are don’t cares because these waveforms are repeated after the third clock pulse.
EXAMPLE 15.2 Determine the transition table for the waveform generator from the state
table given in Figure 15.10b.
ALGORITHMIC STATE MACHINES 809
Figure 15.10 Example 15.2: ASM chart and state table for the waveform generator.
Solution
From the ASM chart we observe that the sequential machine has four states. So two state
variables are required. Assign the states as A Æ 00, B Æ 01, C Æ 10, and D Æ 11. Substituting
these values in the state table, we get the transition and output table as shown in Table 15.1.
PS NS O/P
Input X1X2 Input X1X2
00 01 10 11 00 01 10 11
AÆ00 01 01 01 01 1 1 1 1
BÆ01 10 10 10 00 0 1 1 0
CÆ10 11 11 00 × 0 1 0 ×
DÆ11 00 00 × × 0 0 × ×
810 FUNDAMENTALS OF DIGITAL CIRCUITS
Determination of minimal expressions: Based on the information in the excitation table, the
minimal expressions for excitations and output can be determined using
1. K-map simplification method or
2. Multiplexer control method.
K-map simplification method: The K-maps for D1, D2 and Z, their minimization, and the minimal
expressions obtained from them are shown in Figure 15.11.
Logic diagram: Based on the minimal expressions, a logic diagram using conventional hardware
can be drawn as shown in Figure 15.12.
Multiplexer control method: It is a simpler and straightforward method for the realization of
combinational circuit for any controller. In this method, the gates and flip-flops are replaced by
multiplexers and registers respectively. In this method, there are three levels of the components.
The first level consists of multiplexers that determine the next state of the register. So the outputs
of the multiplexers are to be connected to the inputs of the flip-flops in the register. The second
level contains a register that holds the present binary state. The third level has a decoder that
provides a separate output for each control state. Sometimes a combinational circuit is used in
place of a decoder.
Consider, for example, the ASM chart of Figure 15.10a. It consists of four states and two
control inputs X1 and X2. Figure 15.13 shows the three level implementation. It consists of two 4:1
multiplexers, Mux 1 and Mux 2; a register with two flip-flops and a decoder. A combinational
812 FUNDAMENTALS OF DIGITAL CIRCUITS
circuit is used to determine the output. The outputs of the register are used to select the inputs of
the multiplexers. In this way the present state of the register is used to select one of the inputs from
each multiplexer. The outputs of the multiplexers are then applied to the D inputs of flip-flops 1
and 2. The purpose of each multiplexer is to produce an input to its corresponding flip-flop equal
to the binary value of the next state.
The inputs of the multiplexers are determined from the decision boxes and state transitions
given in the ASM chart (refer to Figure 15.10a).The present states, next states and conditions for
transitions can be tabulated for ASM chart given in Figure 15.10a as shown in Table 15.3.
Inputs for multiplexers: MUX 1 generates input for flip-flop 1 and MUX 2 generates input for
flip-flop 2. The multiplexer input (see Table 15.4) can be determined by including the condition of
transition corresponding to logic 1 bit position in the next state. Consider the transition from A to
B. For flip-flop 1, the next state is 0, hence the corresponding input (input 0) of multiplexer 1 is 0.
For flip-flop 2, the next state is 1, hence the corresponding input (input 0) of multiplexer 2 is the
ALGORITHMIC STATE MACHINES 813
given condition of transition, i.e. 1. Consider the transition from B to A or C. In this case, the next
state for flip-flop 1 is 0 for A and 1 for C. Therefore, the sum of the conditions of transition
corresponding to C, i.e. x1 x 2 + x 1x2 + x 1 x 2 is taken as the corresponding input (input 1) of
multiplexer 1. The next state for flip-flop 2 is 0 for both A and C, hence, the corresponding input
(input 1) of multiplexer 2 is 0.
MUX 1 MUX 2
0Æ0 0Æ1
1 Æ x 1x2 + x1 x 2 + x 1 x 2 1Æ0
2 Æ x2 + x 1 x 2 2 Æ x2 + x 1 x 2
3Æ0 3Æ0
Consider the transition from C to A or D. In this case, the next state to both flip-flop 1 and
flip-flop 2 is 0 for A and 1 for D . Therefore, the sum of the conditions of transition corresponding
to D, i.e. x2 + x 1 x 2 is taken as the corresponding input (input 2) of the multiplexers 1 and 2.
Similarly, consider the transition from D to A. In this case, the next state for flip-flop 1 is 0. For
flip-flop 2 also it is 0 only. So connect 0 to input 3 of both the multiplexers.
The equation for output Z can be directly derived from the ASM chart. For this we have to
observe the ASM chart and find the conditions when output is 1. For example, in state A, Z = 1,
therefore, A will appear in the equation for output Z. After collecting all the conditions where
Z = 1, we get
Z = A + Bx1 x 2 + B x 1x2 + C x2 = y 1 y 2 + y 1y2x1 x 2 + y 1y2 x 1x2 + y1 y 2x2
Drawing a K-map and simplifying, the expression for output Z is
Z = y1 y2 + y2x2 + y1 x 1x2 + y1x1 x 2
Logic diagram: A logic diagram using multiplexers can be drawn as shown in Figure 15.13.
PLA control: We have already discussed in Chapter 5 how to implement combinational logic
circuit using PLA. We can also implement sequential circuit using PLA with the help of registers.
The PLA part of the circuit implements the combinational circuit and the register part implements
the memory.
EXAMPLE 15.4 An ASM chart of a waveform generator is given in Figure 15.14. X1 and
X2 are the inputs and Z is the output. Draw the waveforms and design the circuit.
Solution
From the ASM chart we notice that there are two inputs X1 and X2 and one output Z. The two
inputs can be combined in 22 = 4 ways. So four output waveforms can be generated. There
are four states. So the longest waveform is of four pulses.
State A (00): During the first clock pulse, the machine is in state A. While in A, it produces
an unconditional output Z = 1 and goes to state B. So during the first pulse all the four
waveforms are at logic 1 level.
814 FUNDAMENTALS OF DIGITAL CIRCUITS
State B (01): During the second clock pulse, the machine is in state B. While in state B, if
input X1 = 1, the machine outputs a 0 and goes to state C. So the waveforms corresponding
to X1X2 = 10 and 11 will be at logic 0 level during this period. If X1X2 = 00, Z = 0 and the
machine goes to state A to repeat the waveform. So during this period the waveform for
X1X2 = 00 is at logic 0 level. Hence the waveform corresponding to X1X2 = 00 is of two
cycles only. If X1X2 = 01, Z =1 and the machine goes to state C. So during the second clock
pulse the waveform for X1X2 = 01 is at logic 1 level.
State C (10): During the third clock pulse, the machine is in state C. While in state C, if
X1X2 = 11, it outputs a 0 and goes to state A for restarting. So during this period the waveform
for X1X2 = 11 is at logic 0 level. Hence the waveform of X1X2 = 11 is of three cycles only. If
X1X2 = 01, Z = 1. So during the third clock pulse the waveform for X1X2 = 01 is at logic 1
level. If X1X2 = 00 or 10, Z = 0 and the machine goes to state D. So the waveforms for
X1X2 = 00 and 10 are at logic 0 level during this period.
ALGORITHMIC STATE MACHINES 815
State D (11): During the fourth clock pulse, the machine is in state D. While in state D, if
X1X2 = 01 or 10 the output is at logic 0 level. In state D the inputs X1X2 = 00 and 11 are
invalid because the corresponding waveforms are already getting repeated. From here the
machine goes to state A.
Based on the above description the waveforms are drawn as shown in Figure 15.15.
Let us design the circuit using the multiplexer control method. The transition table is shown
in Table 15.5. The inputs for multiplexers are shown in Table 15.6. The logic diagram using
multiplexers is shown in Figure 15.16. T0, T1, T2, T3 are the control signals when the machine
is in states A, B, C and D respectively.
No. PS NS Condition of
transition
y1 y0 Y1 Y0
1 A 0 0 B 0 1 1
2 B 0 1 C 1 0 x1
C 1 0 x 1x2
A 0 0 x1 x2
3 C 1 0 A 0 0 x1x2
D 1 1 x 1x2
D 1 1 x2
4 D 1 1 A 0 0 1
816 FUNDAMENTALS OF DIGITAL CIRCUITS
MUX 1 MUX 2
0Æ0 0Æ1
1 Æ x1 + x 1x2 1Æ0
2 Æ x 2 + x 1x2 2 Æ x 2 + x 1x2
3Æ0 3Æ0
1. Form the partial products by multiplying the multiplicand with each of the multiplier bits
starting from the LSB and proceeding towards the MSB. When the multiplier bit is a 0,
the partial product is 0 and when the multiplier bit is a 1 the partial product is equal to the
multiplicand itself.
ALGORITHMIC STATE MACHINES 817
2. Write the partial products successively one below the other, shifting left each time by
one bit position.
3. Sum all the partial products to produce the final product.
The product of two n digit numbers can be a number of 2n digits atmost.
Digital implementation requires the following changes.
1. In manual working, we perform left shift on the subsequent partial product which is yet
to be formed, but this kind of anticipatory job is not done by a physically realizable
machine. A real machine can operate only on the existing operands but not on future
results. Hence, we shift the partial product already formed to the right by one bit and add
the next partial product in its normal position. This would produce the correct results as
the reality positions of the operands for additions are as they should be.
2. Instead of forming all the partial products and then adding, which would require a large
number of registers to store them, each partial product is added to register A (accumulator)
and shifted right. This job is repeated n times where n is the number of bits in the multiplier.
With this background we can proceed to design the data processor subsystem first and the
control subsystem next.
B C A Q Components Count P
1101 0 0000 1010 B ¨ Multiplicand
Q ¨ Multiplier 100 (4)
A ¨ 0, C ¨ 0, P ¨ n
number of bits in the multiplier. In the next step, the loop is executed to form the partial products.
The multiplier bit in Q0 is checked, and if it is equal to 1, the multiplicand in B is added to the
partial product in A. The carry from the addition is transferred to C. The partial product in A is left
unchanged if Q0 = 0. The process counter P is decremented by 1 regardless of the value of Q0.
Registers C, A and Q are combined into one composite register CAQ, which is then shifted right
by 1 bit to obtain a new partial product.
The value in the process counter is checked after the formation of each partial product. If the
content of P is not zero, control input Z is equal to 0 and the process is repeated to form a new
partial product. The looping process is stopped when the process controller, P reaches 0 and the
control input Z is equal to 1. It is important to note that the partial product formed in A is shifted
into Q one bit at a time and eventually replaces the multiplier. The final product is available in A
and Q with A holding the most significant bits and Q the least significant bits.
820 FUNDAMENTALS OF DIGITAL CIRCUITS
purpose of enabling addition in state 10 as depicted by the oval block in the ASM chart. All these
outputs eventually provide the control timing signals.
The control unit needs two flip-flops. If we choose D flip-flops, it is easy to get the following
expressions for the excitations as functions of state variables y1, y0 and the inputs S, Q0, Z.
D1 = Y1 = y1y0 + y1 y0Q0 + y1 y0Q0 + y1y0 Z
= y1y0 + y1 y0 + y1y0 Z
D0 = Y0 = y 1 y 0S + y1 y 0 S + y1 y 0S
= y 1 y 0 S + y1 y 0
The structure of the control unit is indicated in Figure 15.22. The excitations for control
subsystem are shown in Figure 15.23.
Note: The input Q0 nearly enables the adder in state 10 and hence it does not participate in the
excitation functions. Neverthless, it has to produce the control signals Q0T2 to enable the adder.
PLA control: Figure 15.24 shows the block diagram of a PLA control used for binary
multiplication. The combinational circuit part is implemented using a PLA. The inputs to the PLA
are the values of the present state of the flip-flops and the three control inputs. The outputs of the
PLA provide the values for the next state in the flip-flops and the control output variables. For this
circuit there is one output for each present state and an additional output for the conditional operation
D = Q0T2. When D input is 1, the conditional operation—add B to A is performed.
PLA programming table: In Chapter 8 we have discussed the internal organization of the PLA
and how to obtain the PLA programming table. We can obtain the programming table for PLA using
information given in the state table without any simplification. Table 15.8 shows the PLA programming
table which lists the products, inputs and outputs. Dashes in the table are don’t cares.
Note that
1. The don’t cares in the input column of the state table indicate no connection for PLA.
2. The 0s in the output column of the state table indicate no connection to PLA.
3. No connection for PLA path is indicated by a dash (–) in the table. All other entries
remain the same.
ALGORITHMIC STATE MACHINES 823
Multiplexer control: If we wish to design a multiplexer control, we need to have two MUXs,
one each for the state variables y1, y0. The present state variables will be fed to address (select)
inputs. Each MUX must have four inputs corresponding to the number of states. The inputs of the
multiplexer are determined from the decision boxes and state transitions given in the ASM chart of
the binary multiplier (Figure 15.21). The present states, next states and conditions for the transition
can be tabulated for the ASM chart as shown in the transition Table 15.9.
S0 0 0 S0 0 0 S
S1 0 1 S
S1 0 1 S2 1 0 1
S2 1 0 S3 1 1 1
S3 1 1 S2 1 0 Z
S0 0 1 Z
MUX 1 MUX 2
0Æ0 0ÆS
1Æ1 1Æ0
2Æ1 2Æ1
3Æ Z 3Æ0
824 FUNDAMENTALS OF DIGITAL CIRCUITS
The multiplexer inputs (Table 15.10) can be determined by including the condition of transition
corresponding to logic 1 bit position in the next state.
Consider the transition from S0 to S1. For flip-flop 1 the next state is 0, hence the corresponding
input of multiplexer 1 is 0. For flip-flop 2 the next state is 1, hence the corresponding input of
multiplexer is the condition of transition corresponding to S1, i.e. S.
Consider the transition from S1 to S2. For flip-flop 1 the next state is 1, hence the corresponding
input of the multiplexer is the condition of transition corresponding to S2, i.e. 1. For flip-flop 2 the
next state is 0, hence the corresponding input of multiplexer 2 is 0.
Consider the transition from S2 to S3. For both flip-flops 1 and 2, the next state is 1. Hence
the corresponding input of both the multiplexers is the condition corresponding to S3, i.e. 1.
Consider the transition from S3 to S 2. For flip-flop 1, the next state is 1. Hence the
corresponding input of the multiplexer is the condition of transition corresponding to S2, i.e. Z.
For flip-flop 2 the next state is 0, hence the corresponding input of multiplexer 2 is 0.
The multiplexer control of the binary multiplier is shown in Figure 15.25.
whenever it is 1, the register W is incremented by one. At the end W contains the weight of the
word.
The ASM chart for the weighing machine is shown in Figure 15.26. It has three inputs S
(start), Z ( zero), and F (flip-flop) and four states S0, S1, S2 and S3. S is the start input (S = 1 starts
the weight computation process), Z is for sensing all zeros in R (Z = 1 indicates all zeros in R), and
the value of F decides whether W is to be incremented or not (F = 1 indicates that W has to be
incremented).
State S0: Initially the weighing machine is in state S0. The weighing process starts when start (S)
signal becomes 1. While in state S0, if S is 1, the clock pulse causes three jobs to be done
simultaneously:
1. Binary number is loaded into register R.
2. W register is set to all 1s.
3. The machine is transferred to state S1.
State S1: While in state S1, the clock pulse causes two jobs to be done simultaneously:
1. Counter W is incremented by 1(in the first round, all 1s become all 0s).
2. If Z is 0, the machine goes to the state S2; if Z is 1, the machine goes to state S0.
826 FUNDAMENTALS OF DIGITAL CIRCUITS
If Z is 0, it means that the weight of the word loaded into register R is 1 or more, and the
machine has to go to S2 to continue the process. If Z is 1, it means that the word R contains in it all
zeros and hence the weight of word is already indicated by W. In this case, the machine should go
back to the initial state S0 having completed the task of computing the weight of the given word.
The machine reaches this state again from S3, if the value of F is sensed as 1.
State S2: In this state, register R is shifted right by 1 bit so that LSB goes into F and MSB is
loaded with 0.
State S3: In this state, the value of F is checked. If it is 0, the machine is transferred to the
state S2, otherwise the machine is transferred to state S1. Thus, when F = 1, W is incremented.
All the operations occur in coincidence with the clock pulse while in the corresponding state.
Also notice that the register R should eventually contain all 0s when the last 1 is shifted into it.
The state table shown is a modified state table. In this modified state table, we use one row
for each transition. It consists of many don’t cares. The values for D1 and D0 inputs of the two flip-
flops are assigned as follows.
Row 0: Row 0 shows that in the next state, the output of flip-flop 1 is always 0, hence, we can
put 0 in the column D1 of row 0. In the next state, the output of flip-flop 2 follows the input S (Y0
= 0, when S = 0; Y0 = 1, when S = 1), hence, we can put S in the column D0 of row 0.
Row 1: Row 1 shows that in the next state, the output of flip-flop 1 follows the complement of
input Z, hence, we can put Z in the column D1 of row 1. In the next state, the output of flip-flop 2
is always 0, hence, we can put 0 in the column D0 of row 1.
Row 2: Row 2 shows that in the next state, the outputs of both the flip-flops are logic 1, hence,
we can put 1 in the column D1 and D0 of row 2.
Row 3: Row 3 shows that, in the next state, the output of flip-flop 1 follows the complement of
input F, hence we can put F in the column D1 of row 3. In the next state, the output of flip-flop 2
follows the input F, hence, we can put F in the column D0 of row 3.
Since the control signals T0, T1, T2 and T3 correspond to states S0, S1, S2 and S3, i.e. to row
0, row 1, row 2 and row 3, the expressions for the inputs of flip-flop 1 and flip-flop 0 are given by
D1 = T0 ◊ 0 + T1 ◊ Z + T2 1 + T3 ◊ F
= T1 Z + T2 + T3 F
D0 = T0 ◊ S + T1 ◊ 0 + T2 ◊ 1 + T3 ◊ F
= T0S + T2 + T3F
Control subsystem implementation using conventional hardware: Based on the above
expressions for D1 and D0, a logic diagram can be drawn as shown in Figure 15.28.
Control subsystem implementation using multiplexer control: Use of multiplexers in the
control circuit makes the design much more elegant and helps the designer to conceive how the
states are changing with every clock pulse. The strategy is to use one multiplexer for each excitation.
The present state variables, that is, outputs of the flip-flops are connected to the select (address)
inputs of MUXs as shown in Figure 15.29.The weighing machine has four states realized by two D
flip-flops, D1 and D0. The outputs of MUXs feed the flip-flops and the MUX will have as many
inputs as there are states in the machine. These are actually next state variables. One of these is
chosen to follow to the output depending on the present state fed to the select inputs.
ALGORITHMIC STATE MACHINES 829
Control subsystem implementation using PLA control: Besides the conventional hardware
control or the multiplexer control, there is a third option using a PLA for designing the control
subsystem. Figure 15.30 shows the PLA control block. The state variables y1, y0 and the inputs S,
Z, F become the inputs numbered as 1 through 5. The excitations D1, D0 for the flip-flops (the
same as next state variables Y1, Y0) and the control signals T0, T1, T2 , T3 become the outputs of
the PLA. The PLA programming table is shown in Table 15.12. It consists of product terms, inputs
and outputs. The product terms are listed from the logic expressions of D1 and D0.
Each row corresponds to a product term. The columns represent the state variables, inputs to
the machine, inputs to the flip-flops and outputs of the machine. The machine will be in state S0
when T0 = 1, in S1 when T1 =1, in S2 when T2 = 1, and in S3 when T3 = 1. In each row, the input
830 FUNDAMENTALS OF DIGITAL CIRCUITS
variables contained in the product are marked 0 or 1, depending on whether the variables appear in
a complemented form or uncomplemented form. Each output column represents a sum of products
and is hence marked 1 in the corresponding row.
EXAMPLE 15.5 Draw an ASM chart, state diagram and state table for the synchronous
circuit having the following description:
The circuit has control input C, clock, and outputs x, y, z.
(a) If C = 1, on every clock rising edge, the code on the output x, y, z changes from 001Æ
011 Æ 101 Æ 111 Æ 001 and repeats.
(b) If C = 0, the circuit holds the present state.
ALGORITHMIC STATE MACHINES 831
Solution
The outputs x, y, z represent the state of the circuit. So x, y, z are the present state variables.
Let X, Y, Z be the next state variables. Let the states of the sequential circuit be S0 = 001,
S1 = 011, S2 = 101 and S3 = 111. The state diagram and the state table of the synchronous
circuit are shown in Figures 15.31a and b respectively. The corresponding ASM chart is
shown in Figure 15.31c.
EXAMPLE 15.6 Draw the state diagram, state table, and ASM chart for a 2-bit binary
counter having one enable line E such that E = 1 counting enabled, and E = 0 counting
disabled.
Solution
The given synchronous circuit is a 2-bit counter. So it has four states S0 = 00, S1 = 01,
S2 = 10 and S3 = 11. When enabled, i.e when E = 1, it goes from one state to the next state in
sequence. When disabled, i.e when E = 0, it goes to the starting state from any present state.
The state diagram and the state table of the 2-bit binary counter are shown in Figures 15.32a
and b respectively. The corresponding ASM chart is shown in Figure 15.32c.
832 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 15.7 Draw an ASM chart and state table for a 2-bit up-down counter having
mode control input.
M = 1: Up counting
M = 0: Down counting
The circuit should generate a output 1 whenever the count becomes minimum or maximum.
Solution
The given synchronous circuit is a 2-bit up-down counter. It counts up, i.e. 00, 01, 10, 11,
00, ... when M = 1, counts down, i.e. 00, 11, 10, 01, 00, ... when M = 0. It outputs a 1 only
when the state is 00 or 11. The counter has four states. The states are A = 00, B = 01, C =
10 and D = 11. The state diagram, and the state table of the 2-bit up-down counter are
shown in Figures 15.33a and b respectively. The corresponding ASM chart is shown in
Figure 15.33c.
EXAMPLE 15.8 Draw the state diagram, state table and ASM chart for a sequence detector
to detect the sequences 1111 and 0000. It has to output a 1 when the sequence is detected.
Overlapping is not permitted.
ALGORITHMIC STATE MACHINES 833
when four consecutive 1s or 0s are inputted. All other times Z will be 0. When Z = 1, i.e. the
sequence is detected, the machine will go to the starting state, i.e. no overlapping is permitted.
The state diagram and the state table of the sequence detector are shown in
Figures 15.34a and b respectively. The corresponding ASM chart is shown in Figure 15.35.
EXAMPLE 15.9 Draw an ASM chart and state diagram for the circuit shown in
Figure 15.36.
Solution
It is easier to draw the state diagram and the ASM chart from the state table. There are two
flip-flops, so two state variables and four states will be there. Let the states be A(00), B(01),
C(10) and D(11). The state table for the given circuit is shown in Figure 15.37a. The state
diagram based on the state table is shown in Figure 15.37b.
From the state diagram, the ASM chart can be drawn as shown in Figure 15.38.
EXAMPLE 15.10 Draw the state diagram, state table and ASM chart for a D flip-flop.
Solution
A D flip-flop has two states A(0) and B(1). In one state (A), it stores a 0 and in the other state
(B) it stores a 1. Its output is same as the present state which is equal to the input after time
delay. While in state 0, it may receive the D input as 0 or 1. If the input D = 0, the flip-flop
will remain in the same state and outputs a 0. If the input D = 1, the flip-flop will go to state
1 and outputs a 1. While in state 1, it may again receive the input as 0 or 1. If it is 0, it goes
to state 0 and outputs a 0. If it is 1, it remains in the same state and outputs a 1.
The state diagram, and the state table of the D flip-flop are shown in Figures 15.39a and b
respectively. The ASM chart of the D flip-flop is shown in Figure 15.39c. The circuit will
have two state boxes for states 0 and 1 and two decision boxes controlled by D input.
EXAMPLE 15.11 Draw the state diagram, state table and ASM chart for a J-K flip-flop.
Solution
We know that the J-K flip-flop has two states A(0) and B(1). While at A, if J-K = 00 or
J-K = 01, it remains in state A itself and outputs a 0. If J-K = 10 or J-K = 11, it goes to state B
and outputs a 1. While at B, if J-K = 00 or J-K = 10, it remains in state B itself and outputs a 1.
If J-K = 01 or J-K = 11, it goes to state A and outputs a 0. The state diagram and the state
table of a J-K flip-flop are shown in Figures 15.40a and b respectively. The ASM chart of the
J-K flip-flop is shown in Figure 15.40c.
EXAMPLE 15.12 Design a ROM-based controller for the ASM chart shown in
Figure 15.41. Tabulate the contents of ROM.
Solution
In the given ASM chart, there are four state boxes. So the machine has got four states A, B,
C and D. Therefore, two flip-flops are required. There are four input signals X,Y, Z and W.
ALGORITHMIC STATE MACHINES 837
ROM tabulation: The ROM tabulation is shown in Table 15.13. The dashes in the table
indicate that the corresponding inputs are don’t cares. For example all dashes in inputs of
row 1 indicate that when the machine is in state A, the next pulse takes it to state B independent
of the values of the inputs X, Y, Z and W.
PS Inputs NS
y1 y0 X Y Z W Y1 Y0
0 0 – – – – 0 1
0 1 0 0 0 – 0 1
0 1 0 0 1 – 1 1
0 1 0 1 – – 0 1
0 1 1 – – – 1 0
1 0 0 – – 0 0 0
1 0 0 – – 1 0 0
1 0 1 – – 0 1 0
1 0 1 – – 1 1 1
1 1 – – – – 0 0
EXAMPLE 15.13 Design a ROM-based controller for the ASM chart shown in
Figure 15.43. Tabulate the contents of ROM.
ALGORITHMIC STATE MACHINES 839
Solution
In the ASM chart, there are five state boxes. So the machine has five states A(000), B(001),
C(010), D(011) and E(100). Therefore, three flip-flops are required. But three flip-flops can
have eight states. So the remaining three states are invalid. There are four inputs P, Q, R and
S and two outputs Z1 and Z2.
ROM selection: The controller should have a ROM of size 2n × m, where
n = number of inputs + number of flip-flops
= 4 + 3 = 7 and
m = number of outputs + number of flip-flops
=2+3=5
Logic diagram: The logic diagram of the ROM-based controller using D flip-flops is
shown in Figure 15.44. The outputs of the flip-flops (present states) are fed to the ROM and
the inputs to flip-flops (next states) are fed from the ROM.
840 FUNDAMENTALS OF DIGITAL CIRCUITS
ROM tabulation: The ROM tabulation is shown in Table 15.14. The dashes in the table
indicate that the corresponding inputs are don’t cares. It is assumed that all illegal states go
to state A(000) without activating any outputs.
PS Inputs NS Outputs
y1 y2 y3 P Q R S Y1 Y2 Y3 Z1 Z2
0 0 0 0 – – – 0 0 1 0 0
0 0 0 1 0 – – 0 0 1 0 0
0 0 0 1 1 – – 0 1 1 0 0
0 0 1 – – – – 0 1 0 0 0
0 1 0 – – 0 – 0 1 0 0 0
0 1 0 – – 1 0 0 0 0 0 0
0 1 0 0 – 1 1 1 0 0 1 0
0 1 0 1 – 1 1 0 1 1 1 0
0 1 1 – – – – 0 0 0 1 0
1 0 0 – – – – 0 0 0 0 1
1 0 1 – – – – 0 0 0 0 0
1 1 0 – – – – 0 0 0 0 0
1 1 1 – – – – 0 0 0 0 0
EXAMPLE 15.14 For the ASM chart given in Figure 15.45a (a) draw the state diagram,
(b) design the control unit using D flip-flops and a decoder, and (c) design the control unit
using multiplexers and a register.
ALGORITHMIC STATE MACHINES 841
Solution
(a) The state diagram for the given ASM chart is shown in Figure 15.45b. The ASM chart
has four state boxes. So the state diagram will have four nodes.
(b) To design the control unit using D flip-flops and a decoder we require two flip-flops
because there are four states in the ASM chart. Let the state assignment be T0 = 00,
T1 = 01, T2 = 10 and T3 = 11. The state table for the control subsystem is as shown in
Table 15.15.
Figure 15.46 Example 15.14: Control circuit using flip-flops and decoder.
(c) For designing the control circuit using multiplexers, two multiplexers are required because
two state variables are there. The inputs to the multiplexers are the same as the inputs of
the flip-flops corresponding to states 00, 01, 10, and 11 given in the state table. The
outputs of flip-flops are connected to the select lines. The realization of the control unit
using multiplexers and a register is as shown in Figure 15.25.
EXAMPLE 15.15 (a) For the state diagram of a control circuit given in Figure 15.47,
obtain the ASM chart.
(b) Design the circuit using multiplexers.
Solution
(a) The ASM chart for the control circuit with the given state diagram is shown in Figure 15.48.
ALGORITHMIC STATE MACHINES 843
(b) Let the state assignment be T0 = 00, T1 = 01, T2 = 10 and T3 = 11. To design the circuit
using multiplexers, the transition table is drawn as shown in Table 15.16. The inputs to
the multiplexers are determined from the transition table (Table 15.17). Since the circuit
has four states, two flip-flops and two 4:1 MUXs and one 2:4 decoder are required. Let
the control signals be C0 = 1, C1 = 1, C2 = 1 and C3 = 1 when the circuit is in states T0 , T1,
T2 and T3 respectively. The circuit using multiplexers is shown in Figure 15.49.
844 FUNDAMENTALS OF DIGITAL CIRCUITS
No PS NS Condition of transition
y1 y0 Y1 Y0
1 T0 0 0 T0 0 0 x
T1 0 1 x
2 T1 0 1 T2 1 0 y
T3 1 1 y
3 T2 1 0 T0 0 0 x
T2 1 0 xy
T3 1 1 xy
4 T3 1 1 T0 0 0 x
T3 1 1 xy
T2 1 0 xy
MUX 1 MUX 2
0Æ0 0Æx
1Æy+ y 1Æy
2 Æ x y + xy 2 Æ xy
3 Æ xy + x y 3 Æ xy
EXAMPLE 15.16 (a) Draw the ASM chart for the following state transitions. Start from
the initial state T1, then, if xy = 00 go to T2, if xy = 01 go to T3, if xy = 10 go to T1, otherwise
go to T3 and design its control circuit using
(i) D flip-flop and decoder
(ii) Input multiplexer and register
(b) Show the exit paths in an ASM block for all binary combinations of control variables x,
y and z starting from an initial state.
Solution
(a) The ASM chart for the given state transitions is shown in Figure 15.50a. The corresponding
state diagram and state table are shown in Figures 15.50b and c respectively.
The sequential machine has three states. So two state variables are required. Two state variables
can represent four states. Since only three are used, the remaining state is invalid. Also since
transitions only from T1 are given and the transitions from the other states are not specified,
they may also be treated as invalid. Since D flip-flops are used two D flip-flops are required.
Let the control signals be C1 while in state T1, C2 while in state T2, C3 while in state T3, and
0 while in state T4 (since T4 is invalid). So the outputs of the decoder will be C1, C2, C3, 0.
The inputs to the flip-flops are obtained from the excitation table shown in Figure 15.51a as
D1 = y and D0 = x y . When the multiplexer control is used, two 4:1 MUXs are required.
Since the transitions occur only from the state T1, the input to the input terminal 1 of MUX1
is y and the input to the input terminal 1 of MUX2 is x y . All other input terminals are
connected to logic 0. The designed control circuit using D flip-flop and decoder is shown in
Figure 15.51b. The circuit using multiplexers and a register is shown in Figure 15.52.
(b) The exit paths in an ASM block for all binary combinations of control variables x, y and
z starting from an initial state are shown in Figure 15.53. The ASM block contains one
state box and eight decision boxes. No conditional output box is required. x, y and z can
be combined in eight possible ways. So eight decision boxes are required.
846 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 15.17 Obtain the ASM charts for the following state transitions:
(a) If x = 0, control goes from state T1 to state T2. If x = 1, generate the conditional operation
and go from T1 to T2.
(b) If x = 1, control goes from T1 to T2 and then to T3. If x = 0, control goes from T1 to T3.
Solution
The ASM charts for the given state transitions are shown in Figure 15.54.
EXAMPLE 15.18 (a) Draw the state diagram and the state table of the control unit for
conditions given below.
(b) Draw the equivalent ASM chart leaving the state box empty.
(c) Design the control unit with the multiplexers for the above problem.
(d) Design the control unit using D flip-flops and a decoder.
(i) From 00 state, if x = 1, it goes to 01 state and if x = 0, it remains in the same state 00.
(ii) From 01 state, if y = 1, it goes to 11 state and if y = 0, it goes to 10 state.
(iii)From 10 state, if x = 1 and y = 0, it remains in the same state 10 and if x = 1 and y = 1, it
goes to 11 state, and if x = 0, it goes to 00 state.
(iv)From 11 state, if x = 1, y = 0, it goes to 10 state and if x = 1 and y = 1, it remains in the
same state, and if x = 0, it goes to 00 state.
Solution
(a) The state diagram and the state table for the given conditions are shown in Figures 15.55a
and b respectively.
(b) The equivalent ASM chart of the control unit leaving the state box empty is shown in
Figure 15.56. Let the state assignment be A = 00, B = 01, C = 10, D = 11.
(c) The design of control unit using multiplexers is as follows. From the ASM chart write the
transition table. Looking at the conditions of transition in the transition table, write the
inputs of the multiplexers as shown in the inputs for multiplexers table. The control
circuit using multiplexers is drawn as shown in Figure 15.57.
848 FUNDAMENTALS OF DIGITAL CIRCUITS
(d) To design the control unit using D flip-flops and decoder write the state table as shown in
Table 15.18.
PS I/Ps NS FF inputs
y1 y0 x y Y1 Y0 D1 D0
0 0 0 – 0 0 0 x
1 – 0 1
0 1 – 0 1 0 1 y
– 1 1 1
1 0 1 0
1 0 0 – 0 0 x xy
1 1 1 1
1 0 1 0
1 1 1 0 1 0 x xy
1 1 1 1
Figure 15.58 Example 15.18: Control subsystem using flip-flops and decoder.
1. What is data?
A. Data is discrete elements of information that are manipulated to perform arithmetic, logic, shift
and other similar data processing tasks.
2. What is the purpose of control information?
A. Control information provides command signals that supervise the various operations in the data
section in order to accomplish the desired data processing tasks.
3. What are the two distinct parts of the logic design of a digital system?
A. The logic design of a digital system can be divided into two distinct parts. One part is concerned
with the design of the digital circuits that perform the data processing operations. The other part
is concerned with the design of the control circuits that determine the sequence in which the
various operations are performed.
4. What is an algorithm?
A. An algorithm is a finite number of procedural steps that specify how to obtain a solution to a
problem.
5. What is a hardware algorithm?
A. A hardware algorithm is a procedure for implementing the problem with a given piece of
equipment.
6. What is meant by the term ASM?
A. ASM is an acronym for algorithmic state machine which is the same as a synchronous sequential
circuit.
7. What is an ASM chart?
A. An ASM chart is a flow-chart used to describe a clocked sequential circuit. It is a hardware
algorithm which specifies the control sequence and datapath tasks of a digital system. A hardware
ALGORITHMIC STATE MACHINES 851
algorithm is a step-by-step procedure to implement the desired task with selected circuit
components. It has three elements: state box, decision box, and conditional output box. ASM
charts look similar to flow-charts but differ in that certain specific rules must be observed in
constructing them. An ASM chart is equivalent to a state diagram or state graph.
8. What are the elements of an ASM chart?
A. The elements of an ASM chart are: state box, decision box, and conditional output box.
9. Define a state box.
A. A state box represents a state of a synchronous sequential circuit and is represented by a rectangular
box with an arrow entering the box from top and an arrow leaving the box from bottom. The
name of the state is written on the left side of the box and the binary code of the state is written on
the top of the box. It is equivalent to a node in the state diagram or a row in the state table.
10. What is a decision box?
A. A decision box is represented by a diamond-shaped box with the variable or logic expression
written inside it. The decision is taken on the basis of the variable or the logic expression being
true or false. It has one arrow entering the box and two arrows leaving the box corresponding to
true and false outcome.
11. What is meant by conditional output box?
A. Output of a synchronous sequential circuit or ASM is represented by conditional output box. It is
an oval-shaped box with the output variable written inside. It has one arrow entering the box and
one arrow leaving the box.
12. What is an ASM block?
A. An ASM block is a structure consisting of a state box and all the decision and conditional output
boxes connected to its exit path. An ASM block has one entrance, any number of exit paths
represented by the structure of the decision boxes. In an ASM chart there is one ASM block for
each state. An ASM chart consists of one or more interconnected blocks. Each ASM block
describes the state of the machine during one clock pulse.
13. What is a link path?
A. A path through an ASM block from entry to exit is referred to as a link path.
14. Differentiate between an ASM chart and a conventional flow chart?
A. The ASM chart is an alternative for describing the behaviour of finite state machines and is
similar to a conventional flow chart. A conventional flow chart describes the sequence of
procedural steps and decision paths for an algorithm without any concern for their time relationship.
The ASM chart, on the other hand, describes the sequence of events as well as the timing
relationship between the states of a sequence controller and the events that occur while going
from one state to the next state after each clock edge. In an ASM chart every ASM block is
considered as one unit, whereas in a flow-chart every operation block is considered as a separate
unit. A conventional flow chart uses only two elements (a) state box and (b) decision box, whereas
an ASM chart uses three elements (a) state box, (b) decision box and (c) conditional box.
15. How many MUXs are required for the control subsystem?
A. The number of MUXs required for the control subsystem is equal to the number of flip-flops used.
16. What is the advantage of using MUXs for control?
A. Multiplexer control results in a systematically organized structure which is easily interpreted and
the sequence of states is easily found and visualized.
852 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
PROBLEMS
15.1 Draw the state diagram, state table and the ASM chart for a 3-bit up-down counter. The circuit
should generate a output 1 whenever the count becomes minimum or maximum.
15.2 Draw the ASM chart for a sequence detector to detect the sequences 1011 and 1101. It has to
output a 1 when the sequence is detected. Overlapping is not permitted.
15.3 Design a mod-5 counter using multiplexers.
15.4 Draw the ASM chart for (a) SR flip-flop and (b) T flip-flop.
15.5 Draw an ASM chart, a state diagram and a state table for the synchronous circuit having the
following description. The circuit has a control input C, clock and outputs x, y, z.
(i) If C =1, on every clock rising edge, the code on the output x, y, z changes from 000 Æ 010
Æ 100 Æ 110 Æ 000 and repeats.
(ii) If C = 0, the circuit holds the present state.
15.6 Develop an ASM chart and a state table for a controllable waveform generator that will output
any one of the four wave forms given in Figure 15.6P as determined by the values of its inputs x1
and x2. When an input change does occur, the new waveform may begin at any point in its
period. Design the circuit using multiplexers.
ALGORITHMIC STATE MACHINES 855
Figure 15.6P
856 FUNDAMENTALS OF DIGITAL CIRCUITS
VHDL PROGRAMS
entity binary_multiplier is
Port ( num1,num2 : in STD_LOGIC_VECTOR (2 downto 0);
product : out STD_LOGIC_VECTOR (5 downto 0));
end binary_multiplier;
SIMULATION OUTPUT:
ALGORITHMIC STATE MACHINES 857
VERILOG PROGRAMS
1. VERILOG PROGRAM FOR 4-BIT BINARY MULTIPLIER USING BEHAVIORAL
MODELING
module mult4(y,a,b);
output [7:0]y;
input [3:0]a,b;
reg [7:0]y;
reg [7:0]acc;
integer i;
always @(a , b)
begin
acc=a;
y=0; // needs to zeroed
for(i=0;i<4;i=i+1)
begin
if(b[i])
y=y+acc; // must be a blocking assignment
acc=acc<<1;
end
end
endmodule
SIMULATION OUTPUT:
SIMULATION OUTPUT:
hadd h2(.l(i[0]),.m(u[1]),.sum(su[0]),.cry(i[1]));
hadd h3(.l(u[3]),.m(u[5]),.sum(su[1]),.cry(i[2]));
hadd h4(.l(su[0]),.m(su[1]),.sum(p[2]),.cry(i[4]));
hadd h5(.l(i[1]),.m(i[2]),.sum(i[5]),.cry(i[6]));
or (i[7],i[5],i[4]);
fadd f3(.d(i[7]),.e(u[4]),.cin(u[6]),.s(p[3]),.cout(i[8]));
fadd f4(.d(i[8]),.e(i[6]),.cin(u[7]),.s(p[4]),.cout(p[5]));
endmodule
module fadd(s,cout,d,e,cin);
input d,e,cin;
output s,cout;
assign s = (d ^ e ^ cin);
assign cout = ((d&e) | (e&cin) | (d&cin));
endmodule
module hadd(sum,cry,l,m);
input l,m;
output sum,cry;
860 FUNDAMENTALS OF DIGITAL CIRCUITS
wire sum,cry;
assign sum = (l^m);
assign cry = (l&m);
endmodule
SIMULATION OUTPUT:
16
LOGIC FAMILIES
16.1 INTRODUCTION
Because of the advances in microelectronics, the digital IC technology in less than four decades
has rapidly advanced from small scale integration (SSI), through medium scale integration (MSI),
large scale integration (LSI), very large scale integration (VLSI), to ultra large scale integration
(ULSI). The technology is now entering giant scale integration (GSI) in which millions of gate
equivalent circuits are integrated on a single chip. The use of ICs has thus reduced the overall size
of a digital system drastically. Consequently, the cost of digital systems has also reduced. The
reliability has improved as well, because the number of external interconnections from one device
to another has reduced. The power consumption of digital systems has also reduced greatly, because
the miniature circuitry requires much less power.
ICs have certain limitations too. ICs cannot handle very large voltages or currents and also
electrical devices like precision resistors, inductors, transformers, and large capacitors cannot be
implemented on chips. So, ICs are principally used to perform low power circuit operations. The
operations that require high power levels or devices that cannot be integrated are still handled by
discrete components.
ICs are fabricated using various technologies such as TTL, ECL, and IIL which use bipolar
transistors, whereas the MOS and CMOS technologies use unipolar MOSFETs.
861
862 FUNDAMENTALS OF DIGITAL CIRCUITS
where VCC is the gate supply voltage, ICC(avg) is the average current drawn from the supply by the
entire IC and n is the number of gates in the IC. Now
I + I CCL
ICC(avg) = CCH
2
where ICCH is the current drawn by the IC when all the gates in the IC are in HIGH state, and ICCL
is the current drawn by the IC when all the gates in the IC are in LOW state. The total power
consumed by an IC is equal to the product of the power dissipated by each gate and the number of
gates in that IC.
16.2.4 Fan-in
The fan-in of a logic gate is defined as the number of inputs that the gate is designed to handle.
16.2.5 Fan-out
The fan-out (also called the loading factor) of a logic gate is defined as the maximum number of
standard loads that the output of the gate can drive without impairing its normal operation. A
standard load is usually specified as the amount of current needed by an input of another gate of
the same IC family. If a gate is made to drive more than this number of gate inputs, the performance
of the gate is not guaranteed. The gate may malfunction.
Figure 16.2 HIGH state, and LOW state fan-outs for TTL 7400 NAND gate.
Fan-out may be HIGH state fan-out, i.e. the fan-out of the gate when its output is logic 1, or
it may be LOW state fan-output, i.e. the fan-out of the gate when its output is a logic 0. The smaller
of these two numbers is taken as the actual fan-out. The fan-out of a gate affects the propagation
delay time as well as saturation. The driving gate sinks current when it is in LOW state and sources
current when it is in HIGH state.
I OH (max)
HIGH state fan-out =
I IH
where IOH(max) is the maximum current that the driver gate can source when it is in a 1 state and
IIH is the current drawn by each driven gate from the driver gate.
I (max)
LOW state fan-out = OL
I IL
864 FUNDAMENTALS OF DIGITAL CIRCUITS
where IOL(max) is the maximum current that the driver gate can sink when its output is a logic 0
and IIL is the current drawn from each driven gate by the driver gate. Figure 16.2 depicts the
current sourcing and current sinking actions for the TTL 7400 NAND gate.
Figure 16.3 Currents and voltages in the HIGH and LOW states.
Unwanted spurious signals are called noise. Noise may be ac noise or dc noise. A drift in the
voltage levels of signals is called dc noise. The ac noise is a random pulse caused by other switching
signals. Noise margin is expressed in volts and represents the maximum noise signal that can be
added to the input signal of a digital circuit without causing an undesirable change in the circuit
output. This is an important criterion for the selection of a logic family for certain applications
where environment noise may be high.
Figure 16.4a shows the range of output voltages that can occur in a logic circuit. Voltages
greater than VOH(min) are considered as a logic 1 and voltages lower than VOL(max) are considered
as a logic 0. Voltages in the disallowed range should not appear at a logic circuit output under
normal conditions. Figure 16.4b shows the input voltage requirements of a logic circuit. The logic
circuit will respond to any input greater than VIH(min) as a logic 1 and to any input lower than
VIL(max) as a logic 0. Voltages in the indeterminate range will produce an unpredictable response
and should not be used.
Noise margin may be HIGH state noise margin or LOW state noise margin:
High state noise margin (NMH) is, VNH = VOH(min) – VIH(min)
Low state noise margin (NML) is, VNL = VIL(max) – VOL(max)
High state noise margin is the difference between the lowest possible high output and the
minimum input voltage required for a HIGH. Low state noise margin is the difference between the
largest possible low output and the maximum input voltage for a LOW.
better the overall performance. The speed power product has the units of energy and is expressed
in picojoules. It is the figure of merit of an IC family. Suppose an IC family has an average
propagation delay of 10 ns and an average power dissipation of 5 mW, the speed power product is
10 ns ¥ 5 mW = 50 ¥ 10–12 watt-seconds = 50 picojoules (pJ)
and, therefore, Q3 and Q4 make a totem pole arrangement. Diodes D1 and D2 protect Q1 from being
damaged by the negative spikes of voltages at the inputs. When negative spikes appear at the input
terminals, the diodes conduct and bypass the spikes to ground. Diode D ensures that Q3 and Q4 do
not conduct simultaneously. Transistor Q3 acts as an emitter follower.
When both the inputs A and B are HIGH (+5 V), both the base-emitter junctions of Q1 are
reverse biased. So, no current flows to the emitters of Q1. However, the collector-base junction of
Q1 is forward biased. So, a current flows through R1 to the base of Q2, and Q2 turns on. Current
from Q2’s emitter flows into the base of Q4. So, Q4 is turned on. The collector current of Q2 flows
through R2 and, so, produces a drop across it thereby reducing the voltage at the collector of Q2.
Therefore, Q3 is OFF. Since Q4 is ON, VO is at its low level (VCE(sat)). So, the output is a logic 0,
When either A or B or both are LOW, the corresponding base-emitter junction(s) is (are) forward
biased and the collector-base junction of Q1 is reverse biased. So, the current flows to ground
through the emitters of Q1. Therefore, the base of Q1 is at 0.7 V, which cannot forward bias the
base-emitter junction of Q2. So, Q2 is OFF. With Q2 OFF, Q4 does not get the required base drive.
So, Q4 is also OFF. Transistor Q3 gets enough base drive because Q2 is OFF, i.e. since no current
flows into the collector of Q2, all the current flows into the base of Q3, and therefore, Q3 is ON.
The output voltage, VO = VCC – VR2 – VBE3 – VD ª 3.4 to 3.8 V, which is a logic HIGH level. So, the
circuit acts as a two-input NAND gate. When Q4 is OFF, no current flows through it, but the stray
and output capacitances between the output terminal, i.e. the collector of Q4, and ground get
charged to this voltage of 3.4 to 3.8 V. The I/O characteristics of a TTL NAND gate are shown in
Figure 16.5b.
Disadvantages of totem-pole
1. During transition of the output from LOW to HIGH, Q4 turns off more slowly than Q3
turns on, and so, there is a period of a few nanoseconds during which both Q3 and Q4 are
conducting and, therefore, relatively large currents will be drawn from the supply. So,
TTL circuits suffer from internally generated current transients or current spikes because
of the totem-pole connection.
2. Totem-pole outputs cannot be wire ANDed, that is, the outputs of a number of gates
cannot be tied together to obtain AND operation of those outputs.
I OL (max)
LOW state fan-out =
I IL
The smaller of these two numbers is the actual fan-out capability of the gate.
Suppose, Q4 can sink up to 16 mA before its output reaches VOL(max) = 0.4 V. Suppose
IIL = 1.6 mA. This means that Q4 can sink the current from up to 16/1.6 = 10 loads. If it is connected
to more than 10 loads, VOL increases above 0.4 V, and so, the noise margin is reduced and VOL may
even go to the indeterminate state.
HIGH state fan-out
When the TTL output is in a HIGH state, Q3 is acting as an emitter follower that is, sourcing a total
current IOH, which is the sum of the IIH currents of the different TTL inputs. If too many loads are
being driven, the current IOH will become large enough to cause a large voltage drop across R2, to
bring VOH (= VCC – VR2 – VBE3 – VD) below VOH(min). This is undesirable because it reduces the
HIGH state noise margin and could even cause VOH to go into the indeterminate range.
870 FUNDAMENTALS OF DIGITAL CIRCUITS
Suppose Q3 can source 0.4 mA of current before VOH falls below VOH(min), and each load
receives IIH = 40 mA. This means Q3 can source up to 0.4 mA/40 mA = 10 loads.
Unit load
Unit load means the current drawn or sourced back by similar gates. For 7400,
One unit load = 40 mA in HIGH state = IIH(max)
= 1.6 mA in LOW state = IIL(max)
If the output of 7400 IC is rated at IOH(max) = 800 mA and IOL(max) = 48 mA, then
I OH (max) 800 mA
HIGH state fan-out = = = 20 unit loads
I IH 40 mA
I OL (max) 48 mA
LOW state fan-out = = = 30 unit loads
I IL 1.6 mA
Therefore, the actual fan-out is equal to the smaller of the above two, i.e. 20 unit loads.
EXAMPLE 16.1 In Figure 16.5, the 7400 NAND gate has VCC = +5 V and a 5-kW load
connected to its output. Find the output voltage (a) when both the inputs are + 5 V and
(b) when both the inputs are 0 V.
Solution
When both the inputs are HIGH, i.e. +5 V, Q2 and Q4 are in saturation. When Q4 is in
saturation, its output is VCE(sat) = LOW = 0.3 V.
When both the inputs are LOW, i.e. 0 V, the output is HIGH (Q3 is ON but Q2 and Q4 are
OFF). Therefore,
VOH = VCC – IL(R4) – VCE(sat) – VD
ª [5 – (IOH ¥ 130) – 0.1 – 0.7] V
ª (4.2 – 130IL) V
VOH
The load current, IOH = . Therefore,
5 kW
È V ˘
VOH = Í 4.2 - 130 ¥ OH ˙ V
Î 5000 ˚
4.2
or VOH ª V = 4.09 V
13
1+
500
EXAMPLE 16.2 In Figure 16.5, what is the minimum value of the load resistance that can
be used if the HIGH state output voltage is to be not less than 3.5 V?
Solution
VOH = 3.5 V = VCC – 130IOH – VCE(sat) – VD
or 3.5 = (5 – 130IOH – 0.1 – 0.7) V
= (4.2 – 130IOH) V
LOGIC FAMILIES 871
È 3.5 ˘
= Í 4.2 - 130 ¥ ˙V
Î RL ˚
130 ¥ 3.5
Therefore, RL = = 650 W
0.7
EXAMPLE 16.3 Determine the fan-out of the circuit of Figure 16.6. Also, find its noise
margin.
Solution
The given circuit is a standard TTL inverter. From the data sheets, IOL(max) = 16 mA and
IIL(max) = 1.6 mA. Therefore,
I OL (max) 16 mA
Fan-out = = = 10
I IL (max) 1.6 mA
When the output is LOW, Q4 is in saturation. Therefore,
VOL = VCE(sat) ª 0.3 V
But VIL(max) = 0.8 V. Therefore,
Low level noise margin = VHL = VIL(max) – VOL = 0.8 V – 0.3 V = 0.5 V
Another way of determining fan-out: The fan-out is limited by the amount of current Q4 can
sink, when it is in saturation. Let VOL(max) = 0.4 V (the limiting value). Let I1 be the current sunk
from each load gate. Therefore,
VCC - VBE (sat) - VOL (max) (5 - 0.75 - 0.4)V
I1 = ª ª 1 mA
4 kW 4 kW
872 FUNDAMENTALS OF DIGITAL CIRCUITS
The ability of the gate to sink current while keeping Q4 in saturation is severely limited at
its lowest operating temperature, –55°C. This is about 30 mA. So, fan-out can be taken as
30 mA/1 mA = 30, but to keep VOL well below the 0.4 V limit, IOL(max) is limited to 16 mA. So,
the fan-out should be less than 16 mA/1 mA = 16. For safety, the fan-out is taken as 10.
The approximate fan-out may also be calculated as follows:
VCC - VBE - VOL (max)
Current drawn from each driven gate, I1 =
4 kW
(5 - 0.75 - 0.4)V
= ª 1 mA
4 kW
Calculate the collector current of Q4. In Figure 16.5,
VCC - VBE4 - VBE2 - VBC1
I=
4 kW
(5 - 0.75 - 0.75 - 0.7)V
ª
4 kW
2.8 V
ª ª 0.7 mA
4 kW
VBE4 0.7 V
I2 = ª ª 0.7 mA
1 kW 1 kW
VCC - VB3 VCC - VBE4 - VCE2
I3 = =
1.6 kW 1.6 kW
(5 - 0.7 - 0.3)V 4V
ª ª ª 2.5 mA
1.6 kW 1.6 kW
Therefore,
Ib4 = I + I3 – I2 = (0.75 + 2.5 – 0.7) mA = 2.55 mA
The transistor Q4 is in saturation. Therefore, IC4 is also saturated. Let IC4 be about 4 to 5 times
Ib4 (worst case), i.e. about 10 to 15 mA. Hence, the fan-out is equal to 10 (the worst case).
logic HIGH level through a resistor, it is called the passive pull-up. The open-collector arrangement
is much slower than the totem-pole arrangement, because the time constant with which the load
capacitance charges in this case is considerably larger. (In the case of totem-pole, it is active
pull-up, i.e. pull-up is through transistor Q3. The RON of Q3 is very small; so, the charging time
constant is low and the output rises fast.) The speed can be increased only a little bit by choosing
a smaller resistance. For this reason, the open-collector circuits should not be used in applications
where switching speed is a principal consideration. The traditional symbols for logic circuits with
open-collector outputs are the same as those for totem-pole outputs.
Because of the absence of pull-up transistors, the wired-AND connections significantly reduce
switching speeds. However, they are useful in reducing the chip count of a system when speed is
not a consideration.
16.5.3 Buffer/Drivers
Any logic circuit that is called a buffer, a driver, or a buffer/driver is designed to have a greater
output current and/or voltage capability than that of an ordinary logic circuit. Buffer/driver ICs are
available with totem-pole outputs, open-collector outputs, or tri-state outputs. Some tri-state buffers
also invert the signal as it goes through. They are called inverting tri-state buffers.
4 kW. The switching speed of the 74H series is approximately two times more than that of the
standard TTL, as also the power consumption. Newer Schottky versions are superior in both speed
and power consumption.
values reduce the circuit power requirement but at the expense of reduction in speed. The switching
speed of low power Schottky TTL is about the same as that of the standard TTL, but the power
consumption is about 1/5 of the standard TTL. The 74LS NAND gate does not use the multiple
emitter input transistor. Instead it uses diodes. This series is replacing the 74 series.
EXAMPLE 16.4 Determine the maximum average power dissipation and the maximum
average propagation delay of a single gate of IC 7400.
Solution
From the data sheets of the 7400 NAND IC, the maximum values of ICCH and ICCL are 8 mA
and 22 mA, respectively. The average ICC is, therefore,
I CCH + I CCL (8 + 22)mA
ICC(avg) = = = 15 mA
2 2
The average power is obtained by multiplying ICC(avg) by VCC. These ICC values are
obtained when VCC has its maximum value of 5.25 V. Thus, we have:
The power drawn from the complete IC is, PD(avg) = 15 mA ¥ 5.25 V = 78.75 mW
PD (avg) 78.75 mW
The power drain of each NAND gate is, = = = 19.7 mW
4 4
The maximum propagation delays for a 7400 NAND gate are
tPLH = 22 ns and tPHL = 15 ns
so that the average propagation delay is
(22 + 15)ns
tpd(avg) = = 18.5 ns
2
This is the worst case of maximum possible average propagation delay.
diverting current from the base of Q2. Transistor Q2 is, therefore, OFF and the output is HIGH. If
the input is HIGH, the injected current flows into the base of Q2 turning it ON and making the
output LOW as shown in Figure 16.11b. Figure 16.11c shows an actual I2L inverter. The output
transistor has two collectors (sometimes three), making it equivalent to two transistors with parallel
bases and emitters. Thus, it produces two equal outputs. Instead of a collector resistor, the outputs
are connected directly to the inputs of other I2L gates.
operation, this logic form is also referred to as current-mode logic (CML). It is also called
current-steering logic (CSL), because current is steered from one device to another. The ECL
family is not as popular and widely used as the TTL and MOS, except in very high frequency
applications where its speed is superior. It has the following drawbacks:
1. High cost
2. Low noise margin
3. High power dissipation
4. Its negative supply voltage and logic levels are not compatible with other logic families
(making it difficult to use ECL in conjunction with TTL and MOS circuits)
5. Problem of cooling
Still, the ECL is used in superfast computers and high-speed special purpose applications.
The ECL gates can be wired ORed, no noise spikes are generated, and complementary outputs are
also available. The important characteristics of ECL gates are:
1. Transistors never saturate. So, speed is high with tpd = 1 ns.
2. Logic levels are negative, – 0.9 V for a logic 1 and – 1.7 V for a logic 0.
3. Noise margin is less, about 250 mV. This makes ECL unreliable for use in heavy industrial
environment.
4. ECL circuits produce the output and its complement, and therefore, eliminate the need
for inverters.
5. Fan-out is large because the output impedance is low. It is about 25.
6. Power dissipation per gate is large, PD = 40 mW.
7. The total current flow in ECL is more or less constant. So, no noise spikes will be internally
generated.
One advantage of the differential input circuitry in ECL gates is that, it provides common
mode rejection—power supply noise common to both sides of the differential configuration is
effectively cancelled out (differenced out). Also, since the ECL output is produced at an emitter
follower, the output impedance is desirably low. As a consequence, the ECL gates not only have a
large fan-out, but also are relatively unaffected by capacitive loads. Some ECL gates are available
with multiple outputs, that are derived from multiple emitter transistors in the emitter-follower
output. For example, one OR/NOR gate may have two OR outputs and two NOR outputs.
(–5.2 V) as shown in Figure 16.15a to perform a wired OR operation. The transistors labelled Q3
are the output transistors of gates 1 and 2. The truth table of the wired OR gate is shown in
Figure 16.15b.
When the bases of both the transistors are at –0.9 V, both the transistors conduct and make
the common emitter voltage to be, –0.9 V – 0.8 V = –1.7 V. When both the bases are at –0.1 V,
again both the transistors conduct and make the output voltage to be,– 0.1 V – 0.8 V = – 0.9 V.
When only one base is at – 0.1 V and the other at – 0.9 V, the output transistor with – 0.1 V base
voltages conducts and makes the common emitter voltage – 0.9 V preventing the second transistor
from conducting. Hence, the circuit provides OR operation.
Solution
(a) To calculate the logic levels, the input voltage magnitudes need to be known. Since they
are not given, assume them to be –0.8 V (HIGH) and –1.5 V (LOW). VR (–1.15 V) is the
approximate average of the two input levels. When A = –0.8 V and B = –0.8 V, or
A = –0.8 V and B = –1.5 V, or A = –1.5 V and B = – 0.8 V, T2 is OFF and T1 or T1A or both
will be ON. Therefore, VE = –0.8 V – 0.7 V = –1.5 V and
[ -1.5 - ( -5.2)]V
IE = ª 3.1 mA
1.18 kW
h
Therefore, I1 = IE FE ª 3.1 mA
1 + hFE
VC1 = 0 – (267 ¥ 3.1 ¥ 10–3) = –0.827 V
VO2 = (–0.827 – 0.7)V = –1.527 V
VO2 is the OR output = –1.527 V (logic 0)
When T2 is OFF, I2 is the small base current of T4 given by
[0 - 0.7 - ( -5.2)] 4.5 V
I2 = = = 0.0728 mA
3
[300 + 1.5 ¥ 10 (1 + hFE )]W (300 + 1500 ¥ 41)W
VC2 = 0 – (300 ¥ I2) = (–300 ¥ 0.0728)V = –0.0218 V
Therefore,
VO1 = (–0.0218 – 0.7)V = –0.7218 V (logic 1)
When A = – 1.5 V and B = – 1.5 V, both T1 and T1A are OFF and T2 is ON.
When T1 and T1A are OFF, I1 is the small base current of T3 given by
[0 - 0.7 - ( -5.2)] 4.5 V
I1 = = = 0.07285 mA
3
[267 + 1.5 ¥ 10 (1 + hFE )]W (267 + 1500 ¥ 41)W
VC1 = 0 – (0.07285 ¥ 10–3 ¥ 267) = – 0.0195 V
Therefore,
VO2 = – 0.0195 – 0.7 = – 0.7195 V (logic 1)
Since T2 is ON, VE = – 1.15 – 0.7 = – 1.85 V
[1.85 - ( -5.2)]V
Therefore, IE = = 2.84 mA
1.18 kW
hFE
and I2 = IE ª IE = 2.84 mA
1 + hFE
Therefore, VC2 = 0 – (2.84 ¥ 10–3 ¥ 300) = – 0.852 V
VO1 = – 0.852 – 0.7 = – 1.56 V (logic 0)
(b) To show that the transistors do not saturate, find the VCE of the transistors.
When T2 is conducting, from the above calculations we see that its collector is at – 0.852 V
and its emitter is at –1.52 V. Therefore VCE = – 0.852 – (–1.85) ª 1 V. Since VCE ª 1 V, the
transistor is in the active region only.
LOGIC FAMILIES 885
Similarly, when T1 or T1A or both are ON, VC1 = – 0.847 V and VE = – 1.5 V.
Therefore, VCE = – 0.847 – (– 1.5) = + 0.653 V
So, the transistor is in the active region only.
(c) Noise margins:
For an ECL gate, the limits of transition region are – 1.1 V and – 1.25 V.
In the problem, we got logic HIGH as – 0.7218 V and logic LOW as – 1.52 V.
Therefore,
High level noise margin < 1 = – 0.73 V – (–1.1 V) = + 0.37 V
Low level noise margin < 0 = – 1.25 V – (– 1.52 V) = + 0.27 V
These noise margins are typical and not worst case values.
Figure 16.18a shows the circuit symbol of PMOSFET. Figure 16.18b shows its equivalent as a
closed switch when it is ON and Figure 16.18c shows its equivalent as an open switch when it is OFF.
The arrow in the symbols of MOSFETs indicates either P or N channel. In the channel, the
broken line between the source and the drain indicates that normally there is no conducting channel
between these electrodes. The separation between the gate and the other terminals indicates the
existence of very high resistance (10,000 MW) between the gate and the channel. The switch in a
MOSFET is between the drain and source terminals. The gate-to-source voltage VGS controls the
switch. In an N-channel MOSFET, switch closes and current flows from drain to source when VGS
is positive, and switch opens when VGS is negative or zero w.r.t. the source.
16.9.2 Resistor
A MOS transistor can be connected as a resistor as shown in Figure 16.19. The value of the
resistance presented by a resistor-connected NMOS device depends on the current through it. The
gate is permanently connected to +5 V, and so, it is always in the ON state and the transistor acts
as a resistor of value RON. The load resistor is designed to have a narrower channel, so, its RON is
much greater than the RON of the switching transistor. Typically, its RON = 100 kW.
Figure 16.20 Circuit diagram and equivalent circuits for various inputs of the NMOS inverter.
• When Vin = 0 V, Q2 is OFF. So, its ROFF = 1010 W, and the equivalent circuit (b) results.
Therefore,
VDD ROFF (Q 2 ) 5 ¥ 1010
Vout = ª ª5V
RON (Q1 ) + ROFF (Q 2 ) 100 ¥ 103 + 1010
• When Vin = 5 V, Q2 is ON. So, its RON = 1 kW, and the equivalent circuit (c) results.
Therefore,
VDD RON (Q 2 ) 5¥1
Vout = = ª0V
RON (Q1 ) + RON (Q 2 ) 100 + 1
This shows that the above circuit acts as an inverter. The I/O characteristics and the truth
table are shown in Figures 16.20d and e, respectively.
888 FUNDAMENTALS OF DIGITAL CIRCUITS
Figure 16.21 Circuit diagram and equivalent circuits for various inputs of the NMOS NAND gate.
In the NMOS NAND gate shown, Q1 is acting as a load resistor and Q2 and Q3 as switches
controlled by input levels A and B, respectively.
• When both A and B are 0 V, both Q2 and Q3 are OFF. So, the equivalent circuit (b) results
with Vout = + 5 V.
• When A = 0 V and B = + 5 V, Q2 is OFF and Q3 is ON. So, the equivalent circuit (c)
results with Vout = + 5 V.
• When A = + 5 V and B = 0 V, Q2 is ON and Q3 is OFF. So, the equivalent circuit (d)
results with Vout = + 5 V.
• When A = + 5 V and B = + 5 V, both Q2 and Q3 are ON. So, the equivalent circuit (e)
results with Vout = 0 V.
Thus, the above circuit works as a positive logic two-input NAND gate.
• When A is LOW and B is HIGH, Q2 is OFF and Q3 is ON. So, the equivalent circuit (c)
results with Vout = 0 V.
• When A is HIGH and B is LOW, Q2 is ON and Q3 is OFF. So, the equivalent circuit (d)
results with Vout = 0 V.
• When A is HIGH and B is HIGH, Q2 is ON and Q3 is ON. So, the equivalent circuit (e)
results with Vout = 0 V.
Thus, the above circuit works as a positive logic two-input NOR gate. The truth table is
shown in Figure 16.22f.
Figure 16.22 Circuit diagram and equivalent circuits for various inputs of the NMOS NOR gate.
ICs for a wide variety of applications ranging from general-purpose logic to microprocessors.
Because of its extremely small power consumption, it is useful for applications in watches and
calculators. The CMOS, however, cannot yet compete with MOS in applications requiring the
utmost in LSI. The CMOS has very high input resistance. Thus, it draws almost zero current from
the driving gate, and therefore, its fan-out is very high. Its output resistance is small (1 kW) compared
to that of NMOS (100 kW). Hence, it is faster than NMOS. The speed of CMOS decreases with
increase in load. In CMOS, there is always a very high resistance between the VDD terminal and
ground, because of the MOSFET in the current path. Hence, its power consumption is very low.
The noise margin of CMOS is the same in both the LOW and HIGH states and it is 30% of VDD,
indicating that noise margin increases with an increase in power supply voltage. So in noisy
environments, CMOS with large VDD is preferred. However, an increase in VDD results in the
corresponding increase in PD. The CMOS loses some of its advantages at high frequencies.
In MSI, the CMOS is also competitive with TTL. The CMOS fabrication process is simpler
than that of the TTL and it has greater packing density, thereby permitting more circuitry in a
given area and reducing the cost per function. The CMOS uses only a fraction of the power needed
even for low power TTL and is, thus, ideally suited for applications requiring battery power or
battery backup power. The CMOS is, however, generally slower than TTL.
Figure 16.23 Circuit diagram and equivalent circuits for various inputs of the CMOS inverter.
LOGIC FAMILIES 891
Figure 16.24 Circuit diagram and equivalent circuits for various inputs of the CMOS NAND gate.
Figure 16.25 Circuit diagram and equivalent circuits for various inputs of the CMOS NOR gate.
LOGIC FAMILIES 893
Figure 16.26 Circuit diagram and logic symbols of the CMOS transmission gate.
894 FUNDAMENTALS OF DIGITAL CIRCUITS
of NMOSFET Q2 is HIGH. If the input (data) is LOW, VGS1 is 0 V and VGS2 is positive. So, Q1 is
OFF and Q2 is ON. If the input is HIGH, VGS1 is negative and VGS2 is 0 V. So, Q1 is ON and Q2 is
OFF. Thus, there is always one conducting path from input to output when the CONTROL is
HIGH.
On the other hand, when the CONTROL is LOW, the gate of PMOSFET Q1 is HIGH and the
gate of NMOSFET Q2 is LOW. If the input (data) is LOW, VGS1 is positive and VGS2 is 0 V.
Therefore, Q1 is OFF and Q2 is also OFF. If the input (data) is HIGH, VGS1 is 0 V and VGS2 is
negative. So, again Q1 is OFF and Q2 is also OFF. Thus, there is no conducting path from input to
output when the CONTROL is LOW.
So, we can conclude that when the CONTROL is HIGH, the circuit acts as a closed switch
and allows the transmission of the signal from input to output. When the CONTROL is LOW, the
circuit acts as an open switch and blocks the transmission of the signal from input to output. The
CONTROL acts as an active-HIGH enabling signal. Active-LOW enabling is possible, if the
CONTROL is connected to the gate of PMOS and to the gate of NMOS.
Since the input and output terminals can be interchanged, the circuit can also transmit signals
in the opposite direction. Hence, it acts as a bilateral switch.
Fan-out: The CMOS fan-out depends on the permissible maximum propagation delay. For low
frequencies (£ 1 MHz), the fan-out is 50, and for high frequencies it will be less.
Switching speed: The speed of the CMOS gate increases with increase in VDD. The 4000 series
has tpd = 50 ns at VDD = 5 V and tpd = 25 ns at VDD = 10 V. The increase in VDD results in increase
in power dissipation too.
Unused inputs: The CMOS inputs should never be left disconnected. All CMOS inputs have to
be tied either to a fixed voltage level (0 V or VDD) or to another input.
Static charge susceptibility: The high input resistance of CMOS inputs makes CMOS gates
prone to static charge build-up, that can produce voltages large enough to break down the dielectric
insulation between the MOSFET gate and the channel. Most of the newer CMOS devices are
protected against static charge damage by the inclusion of protective zener diodes on each input.
When the gate terminal G is LOW, the transistor will be OFF irrespective of the potentials at
drain and source, i.e. irrespective of charges on C1 and C2, because the gate-to-source voltage may
LOGIC FAMILIES 897
be either 0 or negative. Once the transistor is OFF, it acts as an open switch as shown in Figure 16.28b
and the charges on capacitors remain as they are. That is, no transfer of charge takes place, and
therefore, no signal transmission takes place.
When G is HIGH, the transistor is ON and acts as a closed switch as shown in Figure 16.28c.
If capacitors C1 and C2 are charged to the same level, no transfer of charge takes place. But if one
capacitor is charged and the other discharged, transfer of charge takes place from one capacitor to
the other, i.e. the input is transmitted to the output.
When Vin is LOW, Q1 is OFF. When f1 goes HIGH, Q2 conducts and C1 is charged, but
when f1 goes LOW, there is no path for C1 to discharge, and so, C1 remains charged. When f2
goes HIGH, this charge on C1 is transferred to C2, and so, Vout goes HIGH. Thus, a LOW at the
input results in a HIGH at the output.
Suppose Vin is HIGH, when f1 goes HIGH, Q2 conducts and Q1 also turns on. So, C1 cannot
charge. When f2 goes HIGH, Q3 acts as a closed switch and C2 discharges into C1. So, Vout goes
LOW. Vout remains LOW when f2 is LOW. Thus, a HIGH at the input results in a LOW at the
output. Therefore, the above circuit acts as an inverter.
The output of a dynamic logic gate is ‘valid’ only when f2 is HIGH. Thus, we can say that
the gates are sampled at the frequency of f2. A sampled output becomes the input to other gates,
whose responses become available only at the next sampling time. The disadvantage of dynamic
898 FUNDAMENTALS OF DIGITAL CIRCUITS
logic is the complexity added by the clocking requirements. The capacitors need to be recharged
periodically so that the charge on the capacitors does not decay very much. This process of
recharging is called refreshing. The minimum clock frequency is, therefore, determined by the
amount of time taken by the capacitance to decay significantly. A typical period is 1 ms, giving a
minimum clock frequency of 1 kHz.
When f1 goes HIGH, C1 is charged according to the NAND logic of inputs A and B and
when f2 goes HIGH, this charge is transferred from C1 to C2. So, the output Vout follows the
NAND logic. When either A is LOW, or B is LOW, or both A and B are LOW, the corresponding
MOSFETs (QA and QB) will be OFF and no current passes through them. Thus, C1 is charged
when f1 goes HIGH, and this charge on C1 is transferred to C2, when f2 goes HIGH. Therefore, the
output goes HIGH (C1 remains discharged after f2 goes LOW).
Only when both A and B are HIGH, QA and QB will turn on when f1 goes HIGH and,
therefore, no current flows through C1 and it does not charge and remains in the discharged condition
only. When f2 goes HIGH, C2 discharges into C1, and so the output goes LOW. Hence, this circuit
works as a two-input NAND gate.
by f1 and a transmission gate is added at the output and the outputs are clocked through the
transmission gate by f2.
When f1 goes HIGH, C1 is charged according to the NOR logic of inputs A and B, and when
f2 goes HIGH, this charge is transferred from C1 to C2. So, the output Vout follows the NOR logic.
When both A and B are LOW, QA and QB will be OFF. So, C1 charges when f1 goes HIGH
and this charge on C1 is transferred to C2 when f2 goes HIGH, and so, the output goes HIGH. (C1
remains discharged, after f2 goes LOW).
When either A is HIGH or B is HIGH or both A and B are HIGH, either QA or QB or both QA
and QB will turn on when f1 goes HIGH, keeping C1 in the discharged condition only. When f2
goes HIGH, the charge on C2 is transferred to C1, and so, the output goes LOW. Hence, this circuit
works as a two-input NOR gate.
16.12 INTERFACING
Interfacing means connecting the output(s) of one circuit or system to the input(s) of another
system with different electrical characteristics.
900 FUNDAMENTALS OF DIGITAL CIRCUITS
There are a number of logic families, each having its own strong points. In designing more
complex digital systems, the designers utilize different logic families for different parts of the
system in order to take advantage of the strong points of each family. When the designed parts are
assembled, since the electrical characteristics of different logic families vary widely, interfacing
circuits or logic level translators are used to connect the driver circuit belonging to one family to
the load circuit belonging to another family.
26. Why does the MOS family mostly use NMOS devices?
A. The MOS family mostly uses NMOS devices because they operate at about three times the speed
of their PMOS counterparts, and also have twice the packing density of PMOS.
27. Why are MOS ICs especially sensitive to static charge?
A. MOS ICs are sensitive to static charge because of the very high impedance at the MOSFET’s input.
28. What are the advantages of MOS families over bipolar families?
A. Compared to the bipolar families, the MOS families are simpler and inexpensive to fabricate,
require much less power, have a better noise margin, a greater supply voltage range, a higher
fan-out and require much less chip area.
29. What are the disadvantages of MOS families compared to bipolar families?
A. Compared to bipolar families the MOS families are slower in operating speed and are susceptible
to static charge damage.
30. What are the parameters of MOS?
A. For MOS logic: tpd = 50 ns, NM = 1.5 V (for +5 V supply), PD = 0.1 mW, and fan-out = 50 for
frequencies greater than 100 Hz and virtually unlimited for dc or low frequencies.
31. What are the two types of MOSFETs and which type is used in MOS ICs?
A. The two types of MOSFETs are:
(a) depletion type, and
(b) enhancement type. The MOS digital ICs use enhancement MOSFETs exclusively.
32. What are the merits and demerits of MOS logic compared to TTL?
A. The MOS logic is the simplest to fabricate and has high packing density and low power dissipation
per gate, but is more susceptible to static charge damage and it is slow compared to TTL.
33. Where are MOS ICs used?
A. MOS ICs are ideally suited for LSI, VLSI and ULSI for dedicated applications such as large
memories, calculator chips, large microprocessors, etc. The operating speed of MOS is slower
than that of TTL, so they are hardly used in SSI and MSI applications.
34. What are the merits and demerits of CMOS?
A. The demerits and merits of CMOS are: the CMOS family has the greatest complexity and lowest
packing density, but it possesses the important advantages of higher speed and much lower
dissipation. It can be operated at high voltages resulting in improved noise immunity.
35. Where is CMOS technology used?
A. The CMOS technology is used to construct small, medium, and large scale ICs for a wide variety
of applications ranging from general purpose logic to microprocessors.
36. Which ICs are used in watches and calculators? And why?
A. CMOS ICs are used in watches and calculators because of their extremely low power consumption.
37. Why is the fan-out of CMOS very high?
A. The CMOS has very high input resistance. Thus it draws almost zero current from the driving
gate, and therefore its fan-out is very high.
38. How do you compare CMOS with TTL?
A. The CMOS fabrication process is simpler than that of TTL and it has greater packing density.
The CMOS uses only a fraction of the power needed even for low power TTL. The CMOS is
however generally slower than TTL.
39. For which applications is CMOS ideally suited?
A. The CMOS is ideally suited for applications requiring battery power or battery backup power.
LOGIC FAMILIES 905
40. Which is the fastest logic family? And the slowest family?
A. ECL is the fastest logic family and MOS is the slowest logic family.
41. Which family has the highest packing density? And the lowest packing density?
A. IIL has the highest packing density and ECL has the lowest packing density.
42. Which logic family consumes the maximum power? And the least power?
A. ECL family consumes the maximum power and CMOS family consumes the least power.
43. Which logic family is the simplest to fabricate? And most complex to fabricate?
A. The MOS logic family is the simplest to fabricate and the TTL family is the most complex to
fabricate.
44. Which logic family has the highest fan-out? And the least fan-out?
A. The CMOS family has the highest fan-out and the IIL family has the least fan-out.
45. Which logic family has the highest noise margin? And the least noise margin?
A. The CMOS family has the highest noise margin and the ECL family has the least noise margin.
46. What are level shifters?
A. Level shifters are specially designed ICs which are used to make devices from different logic
families compatible with each other.
47. Which CMOS series is compatible pin for pin with TTL?
A. The CMOS 74C series is compatible pin for pin and function for function with TTL devices
having the same number.
48. What do you mean by interfacing? Why is it required?
A. Interfacing means connecting the output(s) of one circuit or system to the input(s) of another
system with different electrical characteristics.
There are a number of logic families, each having its own strong points. In designing more
complex digital systems, the designers utilize different logic families for different parts of the
system in order to take advantage of the strong points of each family. When the designed parts
are assembled, since the electrical characteristics of different logic families vary widely, interfacing
circuits or logic level translators are used to connect the driver circuit belonging to one family to
the load circuit belonging to another family.
49. What is a transmission gate?
A. A transmission gate is simply a digitally controlled CMOS switch. It is a bilateral device.
50. Why is CMOS gate called a bilateral transmission gate?
A. Since the CMOS gate can transmit signals in both directions, it is called a bilateral transmission
gate.
51. Which logic family is suitable for SSI and MSI? For LSI and VLSI? And for VLSI and ULSI?
A. TTL is the most suitable for SSI and MSI. CMOS can also be used for SSI and MSI. MOS is
more suitable for LSI and VLSI. IIL and MOS are suitable for VLSI and ULSI.
52. When is dynamic MOS logic selected?
A. When physical size and power consumption are the prime design considerations as in digital
watches and calculators, dynamic MOS logic is selected.
53. What is the disadvantage of dynamic logic?
A. The disadvantage of dynamic logic is the complexity added by the clocking requirements. The
capacitors need to be recharged periodically so that the charge on the capacitors does not decay
very much.
906 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
1. With the help of a neat diagram, explain the working of a two-input TTL NAND gate.
2. With the help of a neat diagram, explain the working of a two-input ECL OR/NOR gate.
3. With the help of a neat diagram, explain the working of IIL NAND and NOR gates.
4. Show that in a totem pole TTL NAND gate transistors Q3 and Q4 cannot conduct simultaneously.
5. With the help of a neat circuit diagram, explain the working of (a) a MOS inverter, (b) a two-input
MOS NAND gate, and (c) a two-input MOS NOR gate.
6. With the help of a neat circuit diagram, explain the working of (a) a CMOS inverter, (b) a
two-input CMOS NAND gate, and (c) a two-input CMOS NOR gate.
7. With the help of the neat circuit diagram explain the working of a transmission gate.
8. Write short notes on dynamic logic.
9. With the help of circuit diagrams explain the working of (a) dynamic MOS inverter, (b) dynamic
NAND gate, and (c) dynamic NOR gate.
10. Write short notes on interfacing of various logic families.
11. Compare different logic families.
12. What are the merits and demerits of various logic families?
1. The IC technologies which use bipolar transistors are ______, ______, and ______.
2. The IC technologies which use unipolar transistors are ______ and ______.
3. The ______ voltage is defined as that voltage at the input of a gate which causes a change in the
state of the output from one logic level to the other.
4. The ______ of a gate is defined as the time taken by the pulse to propagate from input to output.
5. The ______ of a gate is defined as the power required by the gate to operate with 50% duty cycle
at a specified frequency.
6. The ______ of a logic gate is defined as the number of inputs that the gate is designed to handle.
7. The ______ of a logic gate is defined as the maximum number of similar gates that the output of
the gate can drive without impairing its normal operation.
8. The ______ is defined as the maximum noise signal that can be added to the input signal of a
digital circuit without causing an undesirable change in the circuit output.
9. The ______ of a logic gate is defined as the product of the gate propagation delay and the gate
power dissipation.
LOGIC FAMILIES 907
10. A ______ is defined as the amount of current needed by an input of another gate of the same
logic family.
11. ______ is the most popular and most widely used digital IC family.
12. ______ is the fastest of the saturated logic families.
13. The ______, ______, and ______ are the three types of TTL gates.
14. The three possible output states of a tri-state TTL are ______, ______, and ______.
15. ______ series is the most suitable for high frequencies.
16. ______ is the fastest logic family.
17. The ______ family has got both the logic levels negative.
18. ______ is a non-saturated logic.
19. The MOS family mostly uses ______ devices.
20. The two types of MOSFETs are (a) ______ and (b) ______.
21. The MOS digital ICs use ______ MOSFETs exclusively.
22. MOS ICs are ideally suited for ______, ______, and ______.
23. The ______ technology is used to construct small, medium and large scale ICs for a wide variety
of applications.
24. ______ ICs are used in watches and calculators.
25. ______ is ideally suited for applications involving battery power and battery backup power.
26. The ______ family consumes maximum power and the ______ family consumes the least power.
27. The ______ family has the highest fan-out and the ______ family has the least fan-out.
28. The ______ family has the highest noise margin and the ______ family has the least.
29. ______ gates are suitable for wired AND operation.
30. ______ gates are suitable for wired OR operation.
31. The advantages of totem-pole configuration are ______ and ______.
32. ______ is most suitable for SSI and MSI, and _________ can also be used for SSI and MSI.
33. ______ is more suitable for LSI and VLSI.
34. ______ and ______ are suitable for VLSI and ULSI.
35. A ______ gate is simply a digitally controlled CMOS switch.
36. The ______ logic is the simplest to fabricate and occupies very little space.
37. ______ ICs are hardly used in SSI and MSI applications because of their slower speed.
38. The recharging of capacitors in dynamic MOS logic is called ______.
39. The ______ gate is called a bilateral transmission gate.
40. The interfacing circuits are also called logic ______.
41. ______ is called the figure of merit of an IC family.
42. ______, ______, ______, and ______ logic families are now obsolete.
43. There are ______ TTL subfamilies.
44. ______ outputs cannot be wired ANDed whereas ______ outputs can be.
45. Low power TTL uses ______ resistors where as high speed TTL uses ______ resistors.
46. When power consumption and physical size are prime considerations ______ logic is preferred.
47. ______ are specially designed ICs which are used to make devices from different logic families
compatible with each other.
48. ______ logic is preferred in superfast computers.
908 FUNDAMENTALS OF DIGITAL CIRCUITS
49. ______ CMOS series is compatible pin for pin and function for function with TTL devices
having the same number.
50. ______ is the newest of the logic families.
51. The ______ logic family is preferred in noisy environments.
52. The ______ of CMOS gate increases with increase in VDD.
17.1 INTRODUCTION
An analog quantity is one that can take on any value over a continuous range of values. It represents
an exact value. Most physical variables are analog in nature. Temperature, pressure, light and
sound intensity, position, rotation, speed, etc. are some examples of analog quantities.
A digital quantity takes on only discrete values. The value is expressed in a digital code such
as a binary or BCD number.
When a physical process is monitored or controlled by a digital system such as a digital
computer, the physical variables are first converted into electrical signals using transducers, and
then these electrical analog signals are converted into digital signals using analog-to-digital
converters (ADCs). These digital signals are processed by a digital computer and the output of the
digital computer is converted into analog signals using digital-to-analog converters (DACs). The
output of the DAC is modified by an actuator and the output of the actuator is applied as the
control variable.
Figure 17.1 shows how ADCs and DACs function as interfaces between a completely digital
system such as a digital computer and the analog world. This function has become increasingly
more important as inexpensive microcomputers are being widely used for process control.
910
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 911
Strictly speaking, the output of a DAC is not a true analog quantity, because it can take on
only specific values. In that sense, it is actually digital. Thus, the output of a DAC is a ‘pseudo-
analog’ quantity. By increasing the number of input bits, the number of possible output values can
be increased and also the step size (the difference between two successive output values) can be
reduced, thereby producing an output that is more like an analog quantity. Figure 17.3 shows the
output waveform of a DAC when it is fed by a 4-bit binary counter.
When the binary counter is continually recycled through its 16 states by applying the clock
signal, the DAC output will be a staircase waveform with a step size of 1 V. When the counter is at
0000, the output of the DAC is minimum (0 V). When the counter is at 1111, the output of the
DAC is maximum (15 V). This is the full-scale output.
Digital-to-analog and analog-to-digital conversions form the very important aspects of digital
data processing. Digital-to-analog conversion is a straightforward process and is considerably
easier than the A/D conversion. In fact, a DAC is usually an integral part of any ADC.
912 FUNDAMENTALS OF DIGITAL CIRCUITS
Settling time. The operating speed of a DAC is usually specified by giving its settling time. It is
defined as the total time between the instant when the digital input changes and the time that the
output enters a specified error band for the last time, usually ± 1/2 LSB around the final value after
the change in digital input. It is measured as the time for the DAC output to settle within ± 1/2 step
size of its final value. Generally, DACs with a current output will have shorter settling times than
those with voltage outputs.
Offset voltage. Ideally, the output of a DAC should be zero when the binary input is zero. In
practice, however, there is a very small output voltage under this situation called the offset voltage.
This offset error, if not corrected, will be added to the expected DAC output for all input cases.
Monotonicity. A DAC is said to be monotonic if its output increases as the binary input is
incremented from one value to the next. This means that the staircase output will have no downward
steps as the binary input is incremented from 0 to full-scale value. The DAC is said to be non-
monotonic, if its output decreases when the binary input is incremented.
EXAMPLE 17.1 Determine the resolution of (a) a 6-bit DAC and that of (b) a 12-bit DAC
in terms of percentage.
Solution
(a) For the 6-bit DAC,
1 1 1
% resolution = N
¥ 100 = 6
¥ 100 = ¥ 100 = 1.587%
2 -1 2 -1 63
(b) For the 12-bit DAC,
1 1 1
% resolution = N
¥ 100 = 12
¥ 100 = ¥ 100 = 0.0244%
2 -1 2 -1 4095
EXAMPLE 17.2 A 6-bit DAC has a step size of 50 mV. Determine the full-scale output
voltage and the percentage resolution.
Solution
With 6 bits, there will be 26 – 1 = 63 steps of size 50 mV each.
The full-scale output will, therefore, be
63 ¥ 50 mV = 3.15 V
50 mV 1
% resolution = ¥ 100 = ¥ 100 = 1.587%
3.15 V 63
EXAMPLE 17.3 An 8-bit DAC produces Vout = 0.05 V for a digital input of 00000001.
Find the full-scale output. What is the resolution? What is Vout for an input of 00101010?
Solution
Full-scale output = Step size ¥ Number of steps
= 0.05(28 – 1) = 0.05 ¥ 255 = 12.75 V
1 1
% resolution = N ¥ 100 = ¥ 100 = 0.392%
2 -1 255
Vout for an input of 00101010 = 42 ¥ 0.05 = 2.10 V
914 FUNDAMENTALS OF DIGITAL CIRCUITS
EXAMPLE 17.4 A certain 6-bit DAC has a full-scale output of 2 mA and a full-scale error
of ± 0.5%. What is the range of possible outputs for an input of 100000?
Solution
The step size is 2 mA/63 = 31.7 mA. Since 100000 = 3210, the ideal output should be
32 ¥ 31.7 = 1014 mA. The error can be as much as ± 0.5% ¥ 2 mA = 10 mA.
Thus the actual output can deviate by this amount from the ideal value of 1014 mA, and
therefore, the actual output can be anywhere from 1004 mA to 1024 mA.
EXAMPLE 17.5 If the weight of A0 is 0.2 V in Figure 17.4, find the following values:
(a) step size, (b) full-scale output, (c) percentage resolution, and (d) Vout for D1C1B1A1 = 0110
and D0C0B0A0 = 0100.
Solution
(a) Step size is the weight of the LSB of the LSD, i.e. 0.2 V.
(b) There are 99 steps since there are two BCD digits. Thus, the full-scale output is
99 ¥ 0.2 V = 19.8 V.
(c) The resolution is
step size 0.2
¥ 100% = ¥ 100% ª 1%
full-scale output 19.8
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 915
The exact weights of the various bits in the number in volts are:
MSD: D1 = 16, C1 = 8, B1 = 4, A1 = 2
LSD: D0 = 1.6, C0 = 0.8, B0 = 0.4, A0 = 0.2
(d) One way to find Vout for a given input is to add the weights of all the bits that are 1s. Thus,
for an input of 01100100, we have
C1 B1 C0
Vout = 8 V + 4 V + 0.8 V = 12.8 V
As the BCD input code represents 6410 and the step size is 0.2 V, Vout can also be
determined as
Vout = (0.2 V) ¥ 64 = 12.8 V
EXAMPLE 17.6 A certain 12-bit BCD DAC has a full-scale output of 19.98 V. Determine
(a) the percentage resolution and (b) the converter’s step size.
Solution
(a) 12 BCD bits correspond to three decimal digits, i.e. decimal numbers from 000 to 999.
Therefore, the output of the DAC has 999 possible steps from 0 V to 19.98 V. Thus, we
have
1 1
% resolution = ¥ 100% = ¥ 100% ª 0.1%
number of steps 999
full-scale output 19.98 V
(b) Step size = = = 0.02 V
number of steps 999
To find the output voltage corresponding to any input combination, apply the principle of
superposition and simply add the voltages produced by the inputs where 1s are applied.
Typical values for R and 2R are 10 kW and 20 kW, respectively. For accurate conversion, the
output of the R-2R ladder network is connected to a high impedance circuit to prevent loading. An
op-amp configured as a voltage follower can be used for this purpose as shown in Figure 17.5.
The principal advantage of this converter is that resistors of only two values are required.
Therefore, standard resistors can be used.
R C R B R A
+
2R 2R 2R 2R 2R Vout
D0 +E D1 D2 D3
(a) When the input is 0010; D0, D2 and D3 are grounded (0 V) and D1 = +E.
C R B R A
+
Req = 2R 2R 2R 2R Vout
+E
(b) The circuit equivalent to (a) when the circuit to the left of C is replaced by Req = 2R.
2R C R B R A 2R A
RTH
VTH = i2 × 2R = E
E i1 2R i2 2R VTH = E 4
4 RTH = [((2R||2R) + R)||2R] + R = 2R
2R
+
E
2R Vout = E 2R =E
4 4 2R + 2R 8
EXAMPLE 17.7 What are the output voltages caused by logic 1 in each bit position in an
8-bit ladder if the input level for 0 is 0 V and that for 1 is + 10 V?
Solution
E
The output voltage level caused by the Dn bit = N - n
2
E E 10
The output voltage level caused by the D7 bit (MSB) = 8 - 7 = 1 = =5V
2 2 2
E 10
The output voltage level caused by the D6 bit = 2 = = 2.5 V
2 4
920 FUNDAMENTALS OF DIGITAL CIRCUITS
E 10
The output voltage level caused by the D5 bit = 3
= = 1.25 V
2 8
E10
The output voltage level caused by the D4 bit = 4
=
= 0.625 V
2 16
E 10
The output voltage level caused by the D0 bit (LSB) = 8 = = 0.03906 V
2 256
EXAMPLE 17.8 What is the resolution of a 9-bit DAC, which uses a ladder network?
What is this resolution expressed as a percentage? If the full-scale output voltage of this
converter is + 5 V, what is the resolution in volts?
Solution
The LSB in a 9-bit system has a weight of 1/512. Thus, this converter has a resolution of 1
part in 512. The resolution expressed as a percentage is, (1/512) ¥ 100 ª 0.2%. The voltage
resolution is obtained by multiplying the weight of the LSB by the full-scale output voltage.
Thus, the resolution in volts is, (1/512) ¥ 5 V = 9.8 mV.
The inverting terminal of the op-amp in Figure 17.10 acts as a virtual ground. Since the op-
amp adds and inverts,
Ê D D D ˆ ÊR ˆ
Vout = - Á D3 + 2 + 1 + 0 ˜ ¥ Á f ˜
Ë 2 4 8 ¯ Ë R¯
The main disadvantage of this type of DAC is, that a different-valued precision resistor must
be used for each bit position of the digital input.
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 921
EXAMPLE 17.9 For the 4-bit weighted-resistor DAC shown in Figure 17.10, determine
(a) the weight of each input bit if the inputs are 0 V and 5 V, (b) the full-scale output, if
Rf = R = 1 kW. Also, find the full-scale output if Rf is changed to 500 W.
Solution
(a) The MSB passes with a gain of 1, so, its weight = 5 V; the next bit passes with a gain of
1/2, so, its weight = 5/2 = 2.5 V; the following bit passes with a gain of 1/4, so, its
weight = 5/4 = 1.25 V; the LSB passes with a gain of 1/8, so, its weight = 5/8 = 0.625 V.
(b) Therefore, the full scale output
Ê 1 1 1ˆ
(when Rf = R = 1 kW) = – Á1 + + + ˜ ¥ 5
Ë 2 4 8¯
= – 9.375 V
The full-scale output, when Rf is changed to 500 W is
Ê 1 1 1ˆ Ê 5ˆ
Vout = – Á 1 + + + ˜ ¥ Á ˜ = – 4.6875 V
Ë 2 4 8¯ Ë 2¯
EXAMPLE 17.10 Determine the output of the DAC in Figure 17.11a, if the sequence of
the 4-bit numbers in Figure 17.11b is applied to the inputs. D0 is the LSB.
Solution
First, let us determine the output current I for each of the weighted inputs. Since the inverting
input (–) of the op-amp is at 0 V (virtual ground) and a binary 1 corresponds to +5 V, the
current through any of the input resistors is 5 V divided by the resistance value. Thus,
5V 5V
I0 = = 0.0125 mA; I1 = = 0.025 mA
400 kW 200 kW
5V 5V
I2 = = 0.05 mA; I3 = = 0.1 mA
100 kW 50 kW
The input impedance of the op-amp is extremely large; therefore, the current into the
op-amp is zero. Thus, the current, I0 + I1 + I2 + I3, has to go through the feedback resistance
Rf. Since one end of Rf is at 0 V (virtual ground), the drop across Rf equals the output
voltage.
EXAMPLE 17.11 Design a 4-bit weighted-resistor DAC whose full-scale output voltage
is – 5 V. The logic levels are 1 = + 5 V and 0 = 0 V. What is the output voltage when the input
is 1101?
Solution
The full-scale output voltage is the output voltage when the input voltage is maximum, i.e.
1111. Thus,
Ê 5 V 5 V 5 V ˆ Rf
The full-scale output = – Á 5 V + + + ˜× = –5 V
Ë 2 4 8 ¯ R
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 923
Therefore,
Rf
9.375 ¥ =5
R
Rf 5
Choosing Rf = 10 kW, and since = = , we have
R 9.375
9.375
R = Rf ¥ = 18.75 kW
5
Thus,
2R = 37.5 kW; 4R = 75 kW; 8R = 150 kW
When the input is 1101, the output voltage is
Ê 5V 5V ˆ Rf 10
Vout = - Á 5 V + +0+ ˜¥ = - 8.125 ¥ = – 4.333 V
Ë 2 8 ¯ R 18.75
EXAMPLE 17.12 The switched current-source DAC in Figure 17.13 has R = 5 kW and
EREF = 10 V. Find the total current delivered to the amplifier and the output voltage when the
digital input is 1101.
Solution
Since the digital input is 1101, the total current into the amplifier, i.e. IT is given by
IT = I3 + I2 + I0
ÊE ˆ ÊE ˆ ÊE ˆ
= Á REF ˜ + Á REF ˜ + Á REF ˜
Ë 2R ¯ Ë 4R ¯ Ë 16R ¯
Ê 10 10 10 ˆ 130 13
= Á + + = = mA
Ë 10 20 80 ˜¯ 80 8
Therefore, the output voltage,
Ê 13 ˆ
Vout = – IT ¥ R = Á - ¥ 5˜ = – 8.125 V
Ë 8 ¯
EXAMPLE 17.13 In a 4-bit DAC, for a digital input of 0100 an output current of 10 mA
is produced. What will be the output current for a digital input of 1011?
Solution
Output current = 10 mA for a digital input of 0100, i.e. 410.
Analog output = K ¥ digital input
Therefore,
10 mA
K= = 2.5 mA
4
Hence the output current for a digital input of 1011 is, 1110 ¥ 2.5 = 27.5 mA.
Figure 17.14a shows an example of a 4-bit switched-capacitor DAC. Note that the capacitance
values have binary weights. A two-phase clock is used to control switching of the capacitors.
When f1 goes HIGH, all capacitors are switched to ground and discharged. When f2 goes HIGH,
those capacitors where the digital inputs are HIGH are switched to EREF, whereas those whose
inputs are LOW remain grounded. Figure 17.14b shows the equivalent circuit when f2 is HIGH
and the digital input is 1101.
We see that the capacitors whose digital inputs are a 1, are in parallel and the capacitors
whose digital inputs are a 0, are in parallel with C/8. The circuit is redrawn in Figure 17.14c, where
each set of the parallel capacitors is replaced by its equivalent capacitance. The output of the
capacitive voltage divider is
Ê 13 ˆ
C
Á 8 ˜ 13
Vout = EREF ÁË ˜= E
2C ¯ 16 REF
In general, for any binary input,
ÊC ˆ
Vout = Á EQ ˜ ¥ E
Ë 2C ¯
where 2C is the sum of all the capacitance values in the circuit and CEQ is the sum of all the
capacitors whose digital inputs are HIGH.
The analog output is proportional to the digital input. When the input is 0000, the positive
terminal of EREF is effectively open-circuited as shown in Figure 17.14d; so, the output is 0 V.
Switched-capacitor technology has been developed for implementing analog functions in
integrated circuits, particularly MOS circuits. It is used to construct filters, amplifiers, and many
other special devices. The principal advantage of this technology is that, small capacitors of the
order of a few picofarads can be constructed in the integrated circuits to perform the function of
the much larger capacitors that are normally needed in low-frequency analog circuits.
into reference analog voltage (which is in the form of a step) by the DAC. The counter continues
to advance from one state to the next, producing successively larger steps in the reference voltage.
When the staircase output voltage reaches the value of the analog signal, the comparator outputs a
LOW, and the AND gate is disabled; so, the clock pulses do not reach the counter and the counter
stops. The count it reached is the digital output proportional to the analog input. The control logic
loads the binary count into the latches and resets the counter, thus, beginning another count sequence
to sample the input value. The cycle thus repeats itself.
The resolution of this ADC is equal to the resolution of the DAC it contains. The resolution
can also be thought of as the built-in error and is often referred to as the quantization error. Thus,
FSR
Resolution =
2N
where FSR is the full-scale reading and N is the number of bits in the counter.
As in the DAC, the accuracy is not related to the resolution, but is dependent on the accuracy
of the circuit components such as comparator, the DAC’s precision resistors, etc.
Figure 17.16 illustrates the output of a 4-bit DAC in an ADC over several cycles when the
analog input is a slowly varying voltage.
The principal disadvantage of this type of converter is that, the conversion time depends on
the magnitude of the analog input. The larger the input, the more will be the number of clock
pulses that must pass to reach the proper count, and, therefore, the larger will be the conversion
time. For each conversion, the counter has to start from reset only and count up to the point at
which the staircase reference voltage reaches the analog input voltage. This type of converter is
considered quite slow in comparison with the other types.
928 FUNDAMENTALS OF DIGITAL CIRCUITS
tc (max)
The average conversion time = .
2
The ADC must perform at a rate equal to at least twice the frequency of the highest component
of the input.
EXAMPLE 17.14 Determine the maximum conversion time that an ADC can have, if it is
used to convert signals in the range of 1 kHz to 50 kHz.
Solution
Since the highest input frequency is 50 kHz, conversions should be performed at the rate of
2 ¥ 50 ¥ 103 = 100 ¥ 103 conversions/s. The maximum allowable conversion time is, therefore,
equal to 1/(100 ¥ 103) = 10 ms.
EXAMPLE 17.15 An ADC has a total conversion time of 200 ms. What is the highest
frequency that its analog input should be allowed to contain?
Solution
The highest frequency that the analog signal can contain is
1 1
= = 2.5 kHz
2 ¥ conversion time 2 ¥ 200 ms
requires 7(= 23 – 1) comparators. A reference voltage EREF is connected to a voltage divider that
divides it into seven equal increment levels. Each level is compared to the analog input by a
voltage comparator. For any given analog input, one comparator and all those below it will have a
HIGH output. All comparator outputs are connected to a priority encoder, which produces a digital
output corresponding to the input having the highest priority, which in this case is the one that
represents the largest input. Thus, the digital output represents the voltage that is closest in value
to the analog input.
The voltage applied to the inverting terminal of the uppermost comparator in Figure 17.19 is
(by voltage divider action),
Ê 7R ˆ 7
ÁË 7R + R ˜¯ ¥ EREF = 8 ¥ EREF
Similarly, the voltage applied to the inverting terminal of the second comparator is
Ê 6R ˆ 6
ÁË 7R + R ˜¯ ¥ EREF = 8 ¥ EREF
1
and so forth. The increment between voltages is ¥ EREF.
8
The flash converter uses no clock signal, because there is no timing or sequencing period.
The conversion takes place continuously. The only delays in the conversion are in the comparators
and the priority encoders.
Figure 17.20 shows the block diagram of a modified flash A/D converter. To perform an 8-
bit conversion, it requires two 4-bit flash converters. So, an 8-bit conversion can be done by using
30[= 2 ¥ (24 – 1)] comparators instead of 255(= 28 – 1) comparators. One 4-bit flash converter is
used to produce the four most significant bits (MSBs). Those four bits are converted back to an
analog voltage by a D/A converter and this voltage is subtracted from the analog input. The
difference between the analog input and the analog voltage corresponding to the four most significant
bits, is an analog voltage corresponding to the four least significant bits (LSBs). Therefore, that
voltage is converted to the four least significant bits by another 4-bit flash converter.
4 MSBs
4-bit flash
ADC
4-bit
Latches 8-bit digital
DAC
output
4 LSBs
– 4-bit flash
Analog + Analog ADC
input subtractor
Figure 17.20 Modified flash ADC.
EXAMPLE 17.16 Determine the digital output of a 3-bit simultaneous A/D converter for
the analog input signal and the sampling pulses (encoder enable) shown in Figure 17.21.
VREF = + 8 V.
932 FUNDAMENTALS OF DIGITAL CIRCUITS
Solution
The resulting A/D output sequence is listed as follows and shown in Figure 17.22 in relation
to the sampling pulses.
000, 010, 101, 110, 110, 100, 010, 000, 000, 011, 101, 110.
Output
register
MSB LSB
... Binary output
DAC
VAX
The system enables the MSB first, then the next significant bit, and so on. After all the bits of
the DAC have been tried, the conversion cycle is complete. The processing of each bit takes one
clock cycle; so, the total conversion time for an N-bit SA-type ADC will be N clock cycles. That is,
tc for SAC = (N ¥ 1) clock cycles
The conversion time will be the same regardless of the value of VA. This is because the
control logic has to process each bit to see whether a 1 is needed or not.
The method is best explained by an example. Let us assume that the output of the DAC
ranges from 0 V to 15 V as its binary input ranges from 0000 to 1111, with 0000 producing 0 V,
and 0001 producing 1 V, and so on. Suppose that the unknown analog input voltage VA is 10.3 V.
On the first clock pulse, the output register is loaded with 1000, which is converted by the DAC to
8 V. The voltage comparator determines that 8 V is less than the analog input (10.3 V); so, the
control logic retains that bit. On the next clock pulse, the control circuitry causes the output register
to be loaded with 1100. The output of the DAC is now 12 V, which the comparator determines as
greater than the analog input. Therefore, the comparator output goes LOW. The control logic
clears that bit; so, the output goes back to 1000. On the next clock pulse, the control circuitry
causes the output register to be loaded with 1010. The output of the DAC is now 10 V, which the
comparator determines as less than the analog input. Thus, on the next clock pulse, the control
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 935
logic causes the output register to be loaded with 1011. The output of the DAC is now 11 V, which
the comparator determines as greater than the analog input; so, the control logic clears that bit.
Now the output of the ADC is 1010 which is the nearest integer value to the input (10.3 V).
At this point, all of the register bits have been processed, the conversion is complete and the
control logic activates its EOC output to signal that the digital equivalent of VA is now in the
output register.
EXAMPLE 17.17 Compare the maximum conversion periods of an 8-bit digital ramp
ADC and an 8-bit successive approximation ADC if both utilize a 1 MHz clock frequency.
Solution
For the digital-ramp converter, the maximum conversion time is
(2N – 1) ¥ (1 clock cycle) = 255 ¥ 1 ms = 255 ms
For an 8-bit successive-approximation converter, the conversion time is always 8 clock
periods, i.e. 8 ¥ 1 ms = 8 ms.
Thus, the successive-approximation conversion is about 30 times faster than the digital-
ramp conversion.
EXAMPLE 17.18 An 8-bit SAC has a resolution of 30 mV. What will its digital output be
for an analog input of 2.86 V?
Solution
Since, 2.86 V/30 mV = 95.3, the step 95 would produce 2.85 V and step 96 would produce
2.88 V. The SAC always produces a final output, that is, at the step below the analog input.
Therefore, for the case of VA = 2.86 V, the digital result would be 9510 = 010111112.
CLK IN: It is used for the external clock input, or for the capacitor connection when the internal
clock is used.
(g) Step size: The step size or resolution is the size of the jumps in the staircase waveform of
a DAC. It is the same as the proportionality factor in the DAC I/O relationship.
(h) Linearity error: The linearity error is the maximum deviation of the analog output from
the ideal output.
8. How many different output voltages can an 8-bit DAC produce?
A. An 8-bit DAC can produce 100 different output voltages.
9. What is the advantage of smaller (finer) resolution?
A. The advantage of smaller (finer) resolution is that the smaller the resolution, the more the output
looks like an analog quantity.
10. Distinguish between unipolar and bipolar DACs.
A. Unipolar DACs are DACs whose output is a positive voltage or current. Bipolar DACs are DACs
designed to produce both positive and negative voltages or currents.
11. Which is the most popular DAC?
A. The R-2R ladder type DAC is the most popular DAC.
12. What is the advantage of the R-2R ladder DAC over the weighted resistor type DAC?
A. The principal advantage of R-2R ladder type DAC over the weighted resistor type DAC is: In
R-2R ladder DAC, resistors of only two values are required. Therefore standard resistors can be
used. The main disadvantage of the weighted resistor type DAC is that a different valued precision
resistor must be used for each bit position of the digital input.
13. A certain 6-bit DAC uses binary weighted resistors. If the MSB resistor is 40 kW, what is the
LSB resistor?
A. 1280 kW.
14. Why are current DACs generally faster than voltage DACs?
A. Current DACs are generally faster than voltage DACs because the current can be switched in and
out of the circuit faster than the voltages.
15. Name two switched voltage type DACs?
A. The R-2R ladder network DAC and the weighted resistor DAC are switched voltage type DACs.
16. List the various types of DACs and ADCs. Name the most widely used DAC.
A. The various types of DACs are: The R-2R ladder network type DAC, the weighted resistor type
DAC, the switched-current-source type DAC and the switched-capacitor type DAC.The various
types of ADCs are: the counter type ADC, the tracking type ADC, the flash-type ADC, the
dual-slope type ADC, the successive approximation-type ADC and the voltage to frequency
ADC.
17. What is the advantage of switched capacitor technology?
A. The principal advantage of switched capacitor technology is that small capacitors of the order of
a few picofarads can be constructed in the ICs to perform the function of the much larger capacitors
that are normally needed in low frequency analog circuits.
18. Which is the simplest type ADC? What is its other name?
A. The counter-type ADC is the simplest type of ADC. It is also called a digital ramp ADC.
19. What is quantization?
A. The process of approximation used in digitizing samples is called quantization.
20. Give one advantage and one disadvantage of a counter-type ADC.
A. The main advantage of counter-type ADC is that it is the simplest ADC. The principal disadvantage
of counter-type ADC is that, the conversion time depends on the magnitude of the analog input.
ANALOG-TO-DIGITAL AND DIGITAL-TO-ANALOG CONVERTERS 939
21. Why does the conversion time increase with the value of the analog input voltage in a counter
type ADC?
A. In a counter-type ADC, the conversion time increases with the value of the analog input voltage
because the larger the input, the more will be the number of clock pulses that must pass to reach
the proper count.
22. Why is the tracking-type ADC faster than the counter type ADC?
A. The counter-type ADC is slow because the counter resets itself after each conversion. The
tracking-type ADC uses an up-down counter and is faster than the counter-type ADC because
the counter is not reset after each sample, but tends to track the analog input, i.e. counts up or
down from its last count to its new count.
23. Why is the name tracking-type ADC?
A. Since the count more or less keeps up with the changing analog input, the ADC is called the
tracking-type ADC.
24. What is the other name of the tracking-type ADC?
A. The tracking-type ADC is also called the continuous conversion type ADC.
25. Which is the fastest ADC and why?
A. The flash-type ADC is the fastest type of ADC, because it uses no clock signal and there is no
timing or sequencing period. The conversion takes place continuously.
26. Does a flash-type ADC contain a DAC?
A. No. The flash-type ADC does not contain a DAC, but a modified flash-type ADC contains a DAC.
27. Which is the most expensive ADC?
A. The flash-type ADC is the most expensive ADC.
28. What is the main disadvantage of a flash-type ADC?
A. The main disadvantage of a flash-type ADC is it is complex. An n-bit converter requires 2n – 1
comparators, 2n resistors and a priority encoder.
29. Give two advantages and one disadvantage of a dual-slope ADC.
A. The advantages of dual-slope ADC are: (a) it is relatively inexpensive and (b) it is less sensitive
to variations in its component values.
30. What are the major applications of dual-slope type ADC?
A. The major applications of dual-slope type ADC are in digital voltmeters, multimeters etc.,where
slow conversion is not a problem.
31. Which ADC has a fixed conversion time?
A. The successive approximation type ADC has a fixed conversion time.
32. What is the main advantage and disadvantage of a successive approximation type ADC over a
digital ramp ADC?
A. The advantage of SA type ADC over a digital ramp ADC is that the conversion time of SA type
ADC is fixed and low compared to the conversion time of digital ramp ADC, but the disadvantage
is it is not as simple as that.
33. Which is the most widely used ADC?
A. The successive approximation type ADC is the most widely used type of ADC.
34. Name the three types of ADCs that do not use a DAC.
A. The three types of ADCs that do not use a DAC are: (a) voltage-to-frequency ADC, (b) The flash
type ADC, and (c) the dual-slope type ADC.
940 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTION
1. With the help of neat diagrams explain the working of the following DACs and ADCs.
(a) R-2R ladder network type DAC (b) Weighted-resistor type DAC
(c) Current-switching type DAC (d) Switching-capacitor type DAC
(e) Counter-type ADC (f) Tracking-type ADC
(g) Flash-type ADC (h) Dual-slope ADC
(i) Successive-approximation type ADC.
PROBLEMS
17.1 How many bits are required for a DAC, so that its full-scale output is 12.6 V and resolution
200 mV?
17.2 A 5-bit DAC produces an output of 0.1 V for a digital input of 00001. What is the full-scale
output? Find the output for an input of 10101.
942 FUNDAMENTALS OF DIGITAL CIRCUITS
17.3 The logic levels used in a 6-bit R-2R ladder DAC are: 1 = 5 V and 0 = 0 V. Find the output
voltage for inputs (a) 010110, and (b) 101011.
17.4 The logic levels used in an 8-bit R-2R ladder DAC are: 0 = 0 V and 1 = +5 V. What is the binary
input when the analog output is 4 V?
17.5 Design a 4-bit weighted-resistor DAC whose full-scale output voltage is –12 V. Logic levels are
1 = + 5 V and 0 = 0 V. What is the output voltage when the input is 1011?
17.6 A 6-bit switched current source DAC has an output current of 20 mA for a digital input of
101100. What will be the output current for an input of 010110?
17.7 In the switched current-source DAC shown in Figure 17.13, R =10 kW and EREF = 15 V. Find the
current in each 2R resistor when it is connected to EREF.
17.8 An 8-bit switched current-source DAC of the design shown in Figure 17.13, has R = 5 kW and
EREF = 20 V. Find the total current IT delivered to the amplifier and the output voltage when the
input is 01110100.
17.9 A 4-bit switched capacitor type DAC of the type shown in Figure 17.14 has EREF = 10 V. Find
the output voltage for a digital input of 1011.
17.10 A 4-bit counter-type ADC has a full scale reading of 10 V. What is the quantization error of the
ADC.
17.11 The maximum conversion time of a tracking-type ADC is 100 ns. At what frequency is it clocked?
17.12 A flash-type 5-bit ADC has a reference voltage of 20 V. How many voltage comparators does it
have? How many resistors does it have? What is the increment between the voltages applied to
the comparators?
17.13 The resolution of a 12-bit ADC is 10 mV. What is its full-scale range?
17.14 The frequency components of the analog input to an ADC range from 50 Hz to 50 kHz. What is
the maximum total conversion time that the converter can have?
17.15 An 8-bit SA type ADC has a resolution of 15 mV. What will its digital output be for an analog
input of 2.65 V?
18
MEMORIES
bubble memory (MBM), a semiconductor memory that uses magnetic principles to store millions
of bits on one chip. The MBM is relatively slow and cannot be used as an internal memory.
4. Hold the output data coming from memory during a read operation.
5. Enable (or disable) the memory, so that it will (or will not) respond to the address inputs
and read/write command.
Figure 18.1a illustrates these basic functions in a simplified diagram of a 32 ¥ 4 memory that
stores 32 4-bit words. Since the word size is 4-bits, there are four data input lines I0 to I3 and four
data output lines O0 to O3. During a write operation, the data to be stored in memory have to be
applied to the data input lines. During a read operation, the word being read from memory appears
at the data output lines.
Memory cells Addresses
Data inputs
0 1 1 0 00000
1 0 0 1 00001
1 1 1 1 00010
A4 I3 I2 I1 I0
Read/write command
R/W 1 0 0 0 00011
A3
0 0 0 1 00100
Address A2 32 × 4
inputs Memory 0 0 0 0 00101
A1 Memory ENABLE
ME .. ..
A0 . .
O3 O2 O1 O0
1 1 0 1 11101
1 1 0 1 11110
1 1 1 1 11111
Data outputs
(a) (b)
Figure 18.1 Diagram of a 32 ¥ 4 memory and arrangement of memory cells.
Address inputs
Since this memory stores 32 words, it has 32 different storage locations and, therefore, 32 different
binary addresses ranging from 00000 to 11111 (0 to 31 decimal). Thus, there are five address
inputs A0 to A4. To access one of the memory locations for a read or write operation, the 5-bit
address code for that particular location is applied to the address inputs. In general, N address
inputs are required for a memory that has a capacity of 2N words.
We can visualize the memory of Figure 18.1a as an arrangement of 32 registers with each
register holding a 4-bit word as illustrated in Figure 18.1b. Each address location is shown containing
four memory cells that hold 1s and 0s to make up the data word stored at that location.
The R/ W input
The read/write (R/ W) input line determines the memory operation that would take place. Some
memory systems use two separate inputs, one for read and one for write. When a single R/W input is
used, the read operation takes place for R/ W = 1 and the write operation takes place for R/ W = 0.
Memory ENABLE
Many memory systems have some means of completely disabling all or part of the memory so that
it does not respond to the other inputs. This is represented in Figure 18.1a as the memory ENABLE
946 FUNDAMENTALS OF DIGITAL CIRCUITS
input, although it can have different names in the various memory systems. Here it is shown as an
active-HIGH input that enables the memory to operate normally when it is kept HIGH. A LOW on
this input disables the memory, preventing it to respond to address and R/ W inputs. This type of
input is useful when several memory modules are combined to form a larger memory.
EXAMPLE 18.1 A certain memory has a capacity of 8K ¥ 16.
(a) How many data input and data output lines does it have?
(b) How many address lines does it have?
(c) What is its capacity in bytes?
Solution
(a) Since the word size is 16 bits, data input and data output will be 16 lines each.
(b) The memory stores 8K = 8 ¥ 1024 = 8192 words. Thus, there are 8192 memory addresses.
Since 8192 = 213, it requires 13 address lines.
(c) A byte is 8-bits. This memory therefore, has a capacity of 16K bytes.
Microprocessor
Memory
(CPU)
Unidirectional
Read Write 16-bit
address bus
Control signals
1. The CPU activates the read control and transmits the 16-bit address, say, 000A16 to
memory via the address bus.
MEMORIES 947
2. As a result of step 1, the 8-bit word stored in address 000A16, say, 4516 is placed on the
data bus and transmitted to the CPU.
3. The CPU activates the write control and transmits the 16-bit address, say, 000B16 to
memory. It also transmits the 8-bit data word 4516 to memory via the data lines.
4. As a result of step 3, the data word 4516 is stored at address 000B16 (the original contents
of that address are lost).
small program, called the bootstrap program, is stored in a ROM (the term bootstrap comes from
the idea of pulling oneself up by one’s own boot straps). When the computer is powered on, it will
execute the instructions that are in its bootstrap program. These instructions typically cause the
CPU to initialize the system hardware. The bootstrap program then loads the operating system
programs from mass storage (disk into its main internal memory). At that point, the computer
begins executing the operating system program and is ready to respond to the user commands.
This start-up process is often called ‘booting up’ the system.
Data tables
ROMs are often used to store tables of data that do not change. Some examples are trigonometric
tables (i.e. sine, cosine, etc.) and code conversion tables. Several standard ROM look-up tables are
available with trigonometric functions.
Data converters
The data converter circuit takes data expressed in one type of code and produces an output expressed
in another type. Code conversion is needed, for example, when a computer is outputting data in
straight binary code and it is required to convert it to BCD in order to display it on seven-segment
LED readouts.
One of the easiest methods of code conversion uses a ROM programmed such that the
application of a particular address (the old code) produces a data output that represents the equivalent
one in the new code.
Character generators
If you have ever looked closely at the alphanumeric characters (letters, numbers, etc.) printed on a
computer’s video display screen, you might have noticed that each is generally made up of a group
of dots. Depending on the character being displayed, some dot positions are made bright while
others are dark. Each character is made to fit into a pattern of dot positions, usually arranged as a
5 ¥ 7 or 7 ¥ 9 matrix. The pattern of dots for each character can be represented as a binary code
(i.e. bright dot = 1, dark dot = 0).
A character generator ROM stores the dot pattern codes for each character at an address
corresponding to the ASCII code for that character. Character generator ROMs are used extensively
in any application that displays or prints out alphanumeric characters.
Function generator
The function generator is a circuit that produces waveforms such as sine waves, saw tooth waves,
triangular waves, and square waves. Figure 18.4 shows how a ROM look-up table and DAC are
used to generate a sine wave output signal. The ROM stores 256 different 8-bit values, each one
corresponding to a different waveform value, i.e. a different voltage point on the sine wave. The
8-bit counter is continuously pulsed by a clock signal to provide sequential address inputs to the
ROM. As the counter cycles through the 256 different addresses, the ROM outputs the 256 data
points to the DAC. The DAC output will be a waveform that steps through the 256 different analog
voltage values corresponding to the data points. A low-pass filter smoothes out the steps in the
DAC output to produce a smooth waveform. Circuits such as these are used in some commercial
function generators. The same idea is used in some speech synthesizers where the digitized speech
waveform values are stored in a ROM.
950 FUNDAMENTALS OF DIGITAL CIRCUITS
The RAM ICs are most often used as the internal memory of a computer. The CPU continually
performs read and write operations on this memory at a very fast rate constrained only by the
limitations of the CPU. The memory chips that are interfaced to the CPU have to be, therefore, fast
enough to respond to the CPU read and write commands.
RAMs, it is of the order of 200–400 ns (although some new CMOS designs have speeds approaching
those of the bipolar RAMs). The access time for ECL RAMs is of the order of 5–10 ns. The ECL
RAMs consume considerable power and are not available in large sizes; they are therefore used
where speed is the most important consideration. Examples include cache memory, where data
from a slower memory can be stored for quick access by a CPU, and scratch pad memory used for
storage of the intermediate results of computations. In these applications, data must be stored and
retrieved very rapidly in order not to delay the high-speed computations performed by an ALU.
The ECL RAMs typically have open-emitter outputs to facilitate expansion and wire-ORing.
They also have separate pins for input and output data, a feature that can be used to reduce delays
between the read and write operations; new data to be written can be applied while the old data is
still being read. As an illustration of the varieties available, the National Semiconductor line of
ECL RAMs ranges from 256 ¥ 1 to 1K ¥ 4 and 4K ¥ 1. Note that, these sizes, while small compared
to MOSFET RAMs, are considerably greater than those of the TTL RAMs.
oscilloscopes and logic analyzers require very high speed memory; for such applications, SRAMs
are normally used.
The main internal memory of most personal computers is DRAM, because of its high capacity
and low power consumption. These computers, however, sometimes use small amounts of SRAM
as well, for functions requiring maximum speed such as video graphics and look-up tables.
Early DRAMs had four NMOS transistors per cell and
Bit line
relied on inherent gate capacitance of the transistors for storage (column)
of charge. The 4-transistor cell was complex, because transistors
were needed to buffer and sense the tiny charges stored on the Address line
gate capacitance. A later improvement was a 3-transistor cell (row)
and the most current design is a single-transistor cell shown in
Figure 18.6. The single-transistor cell is the ultimate in simplicity.
Capacitor
The transistor serves as a transmission gate controlled by the
address line. To read, the address line is made HIGH, turning
Figure 18.6 The single-
on the transmission gate, and the capacitor voltage appears on transistor dynamic memory cell.
the bit line. To write, the address line is again made HIGH, and
the voltage on the bit lines charges or discharges the capacitor through the transmission gate. Read
out is destructive, so every read operation must be followed by a write operation.
and the word size. The process of increasing the word size or capacity by combining a number of
IC chips is called memory expansion. In a bit-organized memory, each IC stores 1-bit of each
word. For example, in a bit-organized 128K ¥ 8 memory, the LSB of each word is stored in one
128K ¥ 1 circuit, the next LSB in another 128K ¥ 1 circuit, and so forth. A memory in which every
bit of a word is stored in each circuit, is said to be word organized. For example, a word-organized
128K ¥ 8 memory might consist of sixteen 8K ¥ 8 circuits. In each of the above examples, memory
expansion is required. In the bit-organized memory, we must interconnect eight 128K ¥ 1 circuits
and in the word-organized memory, we must interconnect sixteen 8K ¥ 8 circuits. Some
organizations require an expansion in word size as well as expansion in word capacity. For example,
if we wish to construct a 128K ¥ 8 memory using 16K ¥ 4 circuits, we would need two of the latter
for each 16K of 8-bit words or a total of 2 ¥ (128K/16K) = 16 circuits.
Figure 18.7 shows how two 16 ¥ 4 memory RAM chips with common I/O lines are combined
to produce a 16 ¥ 8 memory. Since each chip can store 16 4-bit words and since 16 8-bit words are
to be stored, each chip is used to store half of each word. In other words, RAM 0 stores the four
higher order bits of each of the 16 words, and RAM 1 stores the four lower order bits of each of the
16 words. A full 8-bit word is available at the RAM outputs connected to the data bus.
AB3
AB2
Address
AB1 bus
AB0
R/W
CS
A3 A2 A1 A0 A3 A2 A1 A0
R/W R/W
RAM 0 RAM 1
16 × 4 16 × 4
CS CS
I/O3 I/O2 I/O1 I/O0 I/O3 I/O2 I/O1 I/O0
DB7
DB6
DB5
DB4
Data bus
DB3
DB2
DB1
DB0
Figure 18.7 Combining two 16 ¥ 4 RAMs for a 16 ¥ 8 module.
Any one of the 16 words is selected by applying the appropriate address code to the four line
address bus (AB3, AB2, AB1 and AB0). The address lines typically originate at the CPU. Note that,
MEMORIES 955
each address bus line is connected to the corresponding address input of each chip. This means
that once an address code is placed on the address bus, the same address code is applied to both
chips such that the same location on each chip is accessed at the same time.
Once the address is selected, we can read or write at this address under the control of the
common R/ W and CS line. To read, R/ W must be HIGH and CS must be LOW. This causes the
RAM I/O lines to act as outputs. RAM 0 places its selected 4-bit word on the upper four data bus
lines and RAM 1 places its selected 4-bit word on the lower four data bus lines. The data bus then
contains the full selected 8-bit word which can now be transmitted to some other device (usually a
register in the CPU).
To write, R/ W = 0 and CS = 0, causes the RAM I/O lines to act as inputs. The 8-bit word to
be written is placed on the data bus (usually by the CPU). The higher four bits will be written into
the selected location of RAM 0 and the lower four bits will be written into RAM-1.
In essence, the combination of two RAM chips acts like a single 16 ¥ 8 memory chip. We
would refer to this combination as a 16 ¥ 8 memory module.
The method illustrated here for increasing the word size applies to all of the memory devices
we have discussed, including ROMs, PROMs, and static RAMs. If the memory circuits are dynamic,
then the RAS and CAS inputs are also paralleled.
EXAMPLE 18.2 The 2125A is a static RAM IC that has a circuitry of 1K ¥ 1, one
active-LOW chip select, and separate data input and output. Show how to combine several
2125A ICs to form a 1K ¥ 8 module.
Solution
The arrangement is shown in Figure 18.8, where eight 2125A chips are used for a 1K ¥ 8
module. Each chip stores one of the bits of each of the 1024 8-bit words. Note that, all of the
R/ W and CS inputs are wired together and the 10-line address bus is connected to the address
inputs of each chip. Also, note that since the 2125A has separate data in and data out pins,
both of these pins of each chip are tied to the same data bus line.
Figure 18.9 shows how two 16 ¥ 4-bit chips can be combined to store 32 4-bit words. Each
RAM is used to store 16 4-bit words. The data I/O pins of each RAM are connected to a common
4-line data bus. Only one RAM chip can be selected (enabled) at one time such that there are no
bus contention problems. This is ensured by driving the respective CS inputs from different logic
signals.
Since the total capacity of this memory module is 32 ¥ 4, there are 32 different addresses.
This requires five address bus lines. The upper address line AB4 is used to select one RAM or the
other (via the CS inputs) which is to be read from or written into. The other four address lines AB0
to AB3 are used to select one memory location out of 16 from the selected RAM chip.
To illustrate, when AB4 = 0, the CS of RAM-0 enables this chip for read or write. Then, any
address location in RAM-0 can be accessed by AB3 through AB0. The latter four address lines can
range from 0000 to 1111 to select the desired location. Thus, the range of addresses representing
locations in RAM-0 is AB4 AB3 AB2 AB1 AB0 = 00000 to 01111.
Note that, when AB4 = 0, the CS of RAM 1 is HIGH, therefore, its I/O lines are disabled
(high impedance) and cannot communicate (give or take data) with the data bus.
956
FUNDAMENTALS OF DIGITAL CIRCUITS
When AB4 = 1, the roles of RAM-0 and RAM-1 are reversed. The RAM-1 is now enabled
and the lines AB3 to AB0 select one of its locations.
Thus, the range of addresses selected in RAM-1 is AB4 AB3 AB2 AB1 AB0 = 10000 to
11111.
While A11 = A10 = 0, the values of A9 through A0 can range from all 0s to all 1s. Thus,
PROM-0 will respond to the following range of 12-bit addresses.
A11–A0 = 0000 0000 0000 to 0011 1111 1111.
Similarly, when A11 = 1 and A10 = 0, the decoder selects PROM-2 which then responds by
putting the data word it has internally stored at the address A9 through A0. Thus, PROM -2 responds
to the following range of addresses.
A11–A0 = 1000 0000 0000 to 1011 1111 1111.
The NVRAM has the advantage of not needing a battery back-up. However, an NVRAM is
more complex than a normal memory chip because it contains both RAM and EEPROM cells as
well as the circuitry needed to transfer data between the two. For this reason, the NVRAMs are not
available in very high capacities. When a high capacity non-volatile memory is required, it is best
to use CMOS RAM with battery back-up.
Q3 Q2 Q1 Q0 Data out
While recirculating in the register, the data also appears at ‘Data out’, one bit at a time. In
this mode, ‘Data in’ is inhibited and has no effect on the register data.
Data input mode (REC = 0)
In this mode, the lower AND gate is enabled and the ‘Data in’ signal is applied to DS. As clock
pulses are applied, the data will shift as shown below.
Data in Q3 Q2 Q1 Q0 Data out
There is no recirculation of data, since the upper AND gate is inhibited by REC = 0. This
mode is used to enter new data at ‘Data in’ for storage in the register.
Figure 18.11b is a simplified symbol that we will use for the circulating shift register. The
control logic is understood to be built into the symbol.
Input × × × × Output
0 0 × × ×
1 1 0 × ×
1 1 1 0 ×
0 0 1 1 0
Input – – – – Output
0 – – – 0
1 – – 1 0
1 – 1 1 0
0 0 1 1 0
962 FUNDAMENTALS OF DIGITAL CIRCUITS
The FIFO memory is similar to the recirculating shift register memory in that, the order in
which the data words are entered at ‘Data in’ is the same as the order in which they are read out at
‘Data out’. In other words, the first word that is written in is the first word that is read out; hence
the name FIFO. There are two important differences, however, between a FIFO and the recirculating
shift register memory. First, in a FIFO, the output data are not recirculated; once the output data
are shifted out they are lost. Second, in a FIFO, the operation of shifting data into the memory is
completely independent from the operation of shifting data out of the memory. In fact, the rate at
which data are shifted in, is usually much different from the rate at which they are shifted out.
Applications
One important application area of the FIFO is the case in which two systems of different data rates
must communicate. Data can be entered into a FIFO at one rate and be put out at another rate. An
example of this is the data transfer from a computer to a printer. The computer can send data to the
printer at a much more rapid rate than the printer can accept it and print it out. A FIFO can act as
a data-rate buffer between the computer and the printer by accepting data from the computer at a
faster rate and storing it; the data are then shifted out to the printer at a slow rate. The FIFO can
also be used as a data-rate buffer for the transmission of data from a relatively slow device like a
keyboard to a much faster device like a computer. In this case, the FIFO accepts data from the
keyboard at a slow rate and stores them. The data are then shifted out to the computer at a faster
rate. In this way, the computer can be performing other tasks while the FIFO is slowly being filled
with data. Other applications are: (a) data input at an unsteady rate can be stored and retransmitted
at a constant rate by using a FIFO; (b) data output at a steady rate can be stored and then outputted
in even bursts; (c) data received in bursts can be stored and retransmitted into a steady-rate output.
Figure 18.12 shows the use of the FIFO as data-rate buffers.
Input bit stream Output bit stream
FIFO
(a) Telemetry data received at an unsteady rate can be stored and retransmitted at a constant rate.
FIFO
(b) Data input at a slow keyboard rate can be stored and then transferred at a higher rate for processing.
FIFO
(c) Data input at a steady rate can be stored and then output in even bursts.
FIFO
(d) Data received in bursts can be stored and transformed into a steady-rate output.
Figure 18.12 The FIFO used in data-rate buffering applications.
mechanism is magnetic rather than electronic. The characteristic common to all magnetic storage
devices is their non-volatility. Magnetic core, magnetic tape and disk, hard drives, floppy disk,
etc. are some of the magnetic memory devices.
on the surface in the direction of the field. A magnetized spot of one polarity represents a binary 1,
and one of the opposite polarity represents a binary 0. Once a spot on the surface is magnetized, it
remains there until written over with an opposite magnetic field. Thus, magnetic storage is
non-volatile. To write a sequence of 1s and 0s, the disk is rotated and the winding is driven by a
sequence of current pulses, each pulse having one direction or the other. Thus, 0s and 1s are stored
in a sequence around a circular path on the disk. To read data on a disk, a read head similar in
construction to the write head is used. When the magnetic surface passes a read head, the magnetized
spots produce magnetic fields in the read head which induce voltage pulses in the winding. The
polarity of these pulses depends on the direction of the magnetization spots and indicates whether
the stored bit is a 1 or a 0. This is illustrated in Figure 18.13b. Very often, the read and write heads
are combined into a single unit as shown in Figure 18.13c.
positive (corresponding to logic 1) and the other as negative (logic 0). The important point to note
is that magnetization returns to zero between every bit, including adjacent 1s and adjacent 0s.
1 1 1 1
1-level
magnetization
zero
magnetization
0-level
magnetization
0 0 0 0
(a) The return-to-zero (RZ) format
1 1 1 1
1-level
magnetization
zero
magnetization
0-level
magnetization
0 0 0 0
(b) The return-to-bias format in which the bias level is the
magnetization corresponding to logic 0.
Figure 18.14 Return-to-zero and return-to-bias formats for recording data.
A generalization of RZ is called the return-to-reference (or bias), wherein the level to which
magnetization returns between bits can be any level between 1 and 0. Figure 18.14b shows an
example in which magnetization ‘returns’ to the polarity representing logic 0 between every bit.
Although there is no return involved between adjacent 0s, this format has the advantage that the
total change in magnetization between a 0 and a 1 is large, making it easier to detect such cases. In
this format as well as the others that we will discuss, reading and writing are synchronized by a
clock signal, usually recorded on the disk itself. A clock is necessary to ascertain the precise time
interval, called the bit time during which successive bits occur.
Figure 18.15 illustrates a non-return-to-zero (NRZ) waveform. In this case, a 1 or a 0 level
remains during the entire bit time. If two or more 1s occur in succession, the waveform does not
return to the 0 level until a 0 occurs.
Bit time
(a) Clock
t
0 1 0 0 1 1 0 1
1-level
magnetization
Figure 18.16 is an illustration of a bi-phase waveform. In this type, a 1 is a HIGH level for
the first half of a bit time and a LOW level for the second half, so a HIGH-to-LOW transition
occurring in the middle of a bit time is interpreted as a 1. A 0 is represented by a LOW level during
the first half of a bit time followed by a HIGH level during the second half, so a LOW-to-HIGH
transition in the middle of a bit time is interpreted as a 0.
Bit time
(a) Clock
t
0 1 0 0 1 1 0 1
Positive
magnetization
(a) Clock
t
Positive
magnetization
The Kansas city method uses two different frequencies to represent 1s and 0s. The standard
300 bits/second version uses four cycles of 1200 Hz signal to represent a 0 and eight cycles of
2400 Hz signal to represent a 1. This is illustrated in Figure 18.18.
The index hole marks the beginning of sector 0 and track 0. A soft-sectored disk is one for
which all the remaining sectors must be defined and identified by the disk controller and computer
system before the disk can be used. This procedure is called formatting the disk. The disk is said to
be soft-sectored because formatting is performed under the control of a program (software) and
because the formatting can be changed at will. A hard-sectored disk has all sectors defined at the
time of manufacture. It typically has index holes marking the beginning of each sector. The number
of tracks and the number of sectors on a floppy disk vary widely with the system where it is used,
the size of the disk, and the recording density for which it is designed. Disks are available in single
density and double density and for single-sided and double-sided recording. Each sector on each
track typically contains 128 or 256 bytes of data in addition to the bits reserved for addresses and
various other identification and error-checking functions.
Floppy disk capacities typically range from 100 K to a few MB. Floppies have access times
about 10 times larger and data rates about 10 times slower than those of hard disks. The average
968 FUNDAMENTALS OF DIGITAL CIRCUITS
access time of floppy drives is 100 to 500 ms, and the average data transfer rates range from
250 K/s to 1 Mbits/s. When inserted into the disk drive unit, a floppy disk is rotated at a fixed
speed of 300 to 360 rpm, which is much slower than the speed of the hard disks.
Although floppy disk systems are slower and have less capacity than hard disk systems, they
do have the advantages of low cost and portability. They can be easily transported from one
computer to another, and can be sent through the mail.
EXAMPLE 18.4 A single-sided double-density 8-inch floppy disk has tracks numbered 0
to 76 and sectors 0 to 25. What is the total storage capacity of the disk?
Solution
Ê Sectors ˆ Ê bytes ˆ
(77 tracks) ¥ Á 26 ˜ ¥ Á 256 = 512,512 bytes
Ë track ¯ Ë sector ˜¯
EXAMPLE 18.5 The total storage capacity of a floppy disk having 80 tracks and storing
128 bytes/sector is 163,840 bytes. How many sectors does the disk have?
Solution
163,840 = (80) ¥ (number of sectors) ¥ (128). Therefore, the number of sectors = 16.
Heads
Head
positioning
arm
Disks
Drive
spindle
trains having different frequencies. In the Kansas city standard FM, a 0 is represented by four
cycles of a 1200 Hz signal and a 1 by eight cycles of a 2400 Hz signal.
Detector
Generator Major loop Replicator/
Annihilator Detector track
Transfer gates
Transfer
control
Minor
loops
Circulating
bubbles
(stored 1s)
Each bit in a given page occupies the same relative location in each minor loop. During read,
all of the bits in a page of data are shifted to the transfer gates and on to the major loop at the same
time. Then, they are serially shifted around the major loop to the replicator/annihilator where each
bubble is ‘stretched’ by the replicator until it ‘splits’ into two bubbles. One of the replicated bubbles
(or no bubble as the case may be) is transferred to the detector where the presence or absence of
the bubble is sensed and translated to the appropriate logic level to represent a 1 or a 0. The other
replicated bubble continues along the major loop and is transferred back on to the appropriate
minor loop for storage. The process continues until each bit in the page is read. The replication/
detection process results in a non-destructive read-out.
The write cycle. Before a new page of data can be written into an address, the data currently
stored at that address must be annihilated. This is done by a destructive read-out in which the
bubbles are not replicated. Now, the new page of data is produced by the generator one bit at a
time. Each bit is injected on to the major loop until the entire page of data has been entered. It is
then serially moved into position and transferred on to the minor loops for storage.
and WORMs cannot be erased. The read/write optical disk can be written and rewritten as often as
desired, and therefore, operates like a magnetic hard disk. It uses a different disk surface from
other types. Its surface is coated with a magnetic material that can have its magnetic properties
changed by a laser beam. The optical disk storage has the potential to emerge as the principal mass
storage device.
Insulation
(silicon dioxide)
Potential well,
formed when gate
voltage is positive P-substrate
The CCD memory is inherently serial. Practical memories are constructed in the form of
shift registers, each shift register being a line of CCDs. By controlling the timing of the clock
signals applied to the shift registers, data can be accessed one bit at a time from a single register or
several bits at a time from multiple registers. The principal advantage of the CCD memory is that,
its single cell structure makes it possible to construct large capacity memories at low cost. On the
other hand, like other dynamic memories, it must be periodically refreshed and driven by rather
complex, multi-phase clock signals. Since data are stored serially, the average access time is long
compared with the semiconductor RAM memory.
1. What is memory?
A. Basically memory is a means for storing data or information in the form of binary words. It is
made up of storage locations in which numeric or alpha numeric information or programs may
be stored.
2. What is a data memory?
A. Memory used to store data is called data memory.
MEMORIES 973
32. Which is the newest mass memory technology? What are its chief advantages?
A. The optical disk memory is the newest mass memory technology. The optical disk systems are
available in three basic types based on their writability—ORAM or CDROM, WORM, and
Read/Write. Its advantages are:
(a) its high capacity (b) its relatively low cost and
(c) its immunity to dust.
33. What is CCD memory ? What is its principal advantage?
A. CCD memory is a type of dynamic memory in which packets of charges (electrons) are
continuously transferred from one mass device to another. It is inherently a serial memory. The
principal advantage of the CCD memory is that its single cell structure makes it possible to
construct large capacity memories at low cost. The disadvantages are:
(a) It is a serial memory. So the average access time is large.
(b) Like other dynamic memories it must be refreshed periodically.
34. How are ROMs and RAMs classified?
A. Depending on the device used (a) ROMS are either BJT ROMs or MOSFET ROMs. BJT ROMs
may be MROMs or PROMs whereas MOSFET ROMs may be MROMs, PROMs, EPROMs and
EEPROMs. (b) RAMs are also either BJT RAMs or MOSFET RAMs. BJT RAMs are only static
RAMs, whereas MOSFET RAMs may be static RAMs or dynamic RAMs.
35. What is the principal difference between the BJT memory and the MOSFET memory in terms of
their speed and sizes?
A. MOSFET memory is small in size compared to BJT memory, but its speed is less compared to
the BJT memory.
36. What are the main advantages and disadvantages of floppy disk storage compared to hard disk
storage?
A. Although floppy disk systems are slower and have less capacity than hard disk systems, they do
have the advantages of low cost and portability. They can be easily transported from one computer
to another.
37. What is the major application of tape memory?
A. The major application of tape memory is mass storage and backup. Magnetic tape storage is
non-volatile and has immense capacity at relatively low cost per bit.
38. Where are SRAMs preferred?
A. For applications where speed and reduced complexity are more critical than space and power
consumption, SRAMs are preferred. Many microprocessor-controlled instruments and appliances
have very small memory capacity requirements. Some instruments such as digital storage
oscilloscopes and logic analyzers require very high speed memory. For such applications SRAMs
are normally used.
39. Which memory technology needs the least power?
A. The CMOS memory technology needs the least power?
40. What is memory expansion? Why is it required?
A. The process of increasing the word size or capacity by combining a number of IC chips is called
memory expansion. It is required because, in most IC memory applications, the required memory
capacity or word size cannot be satisfied by one memory chip. So several memory chips are
combined to provide the desired capacity and the word size.
976 FUNDAMENTALS OF DIGITAL CIRCUITS
REVIEW QUESTIONS
1. Computers which store programs in their memory are called ______ computers.
2. Each memory location is identified by ______.
3. The fundamental group of bits used to represent one entity of information is called a ______.
4. A storage element is called a ______.
5. ______ memories are well suited as the main memory.
6. Peripheral memory is also called ______ memory.
7. The process of storing data in memory is called ______.
8. Retrieving data from memory is called ______.
9. Programs stored in RWMs are called ______.
10. Programs stored in ROMs are called ______.
11. Memory that utilizes conventional storage devices is called ______.
12. The time required for valid data to appear on outputs after activation of appropriate inputs is
called ______.
13. ______ RAMs are available only in MOS technology whereas ______ RAMs are available both
in bipolar and MOS technologies.
14. ______ are used in cache memory and scratch pad memory.
15. The ______ is the newest mass memory technology.
16. CCD memory is inherently a ______ memory.
17. CCD memory is a type of ______ memory.
18. BJT memory is ______ than MOSFET memory.
19. MOSFET memory occupies ______ space than BJT memory.
20. ______ memory technology needs the least space.
21. Memory in which each IC stores one bit of each word is called ______ memory.
22. Memory in which every bit of a word is stored in each circuit is called ______ memory.
23. The major application of tape memory is ______.
24. SRAMs are preferred for applications where ______ and ______ are more critical than ______
and ______.
25. Combining a number of IC chips to increase the word size or capacity is called ______.
PROBLEMS
VHDL PROGRAMS
SIMULATION OUTPUT:
980 FUNDAMENTALS OF DIGITAL CIRCUITS
SIMULATION OUTPUT:
19
TIMING CIRCUITS
AND DISPLAY DEVICES
Figure 19.1d shows a Schmitt trigger inverter using an op-amp. Figure 19.1e shows the
hysterisis loop.
Figure 19.2b shows a monostable using NAND gates. G1 is a 2-input NAND gate. G2 is used
as an inverter. Under the resting condition, voltage across R is zero which is the input to G2. So, the
output of G2 is HIGH. As both the inputs to G1 are HIGH, its output is LOW.
When a negative trigger is applied at G1, the output of G1 goes HIGH. Since the voltage
across C cannot change instantaneously, this appears as a HIGH at the input to G2, and, therefore,
its output goes LOW. As the capacitor charges, the voltage across R and, therefore, the input to
G2 decreases with a time constant RC. When this voltage falls below a certain level, it appears
as a LOW to G2, and, therefore, its output goes back to HIGH. So, a triggering pulse causes the
output of the circuit to go LOW for a specific time. Hence, the circuit acts as a monostable
multivibrator.
TIMING CIRCUITS AND DISPLAY DEVICES 985
Figure 19.3 shows the various logic symbols used for monostable multivibrators.
Figure 19.4 shows a monostable multivibrator using 555 timer. The 555 timer is TTL
compatible. The output at pin 3 is normally in LOW state. When a negative triggering pulse is
applied at pin 2, the output goes HIGH for a specific time (tw = 1.1 RC) and then comes back to its
normal LOW state. So, a positive pulse of width tw = 1.1 RC is generated. This is a non-retriggerable
one-shot. Application of new trigger pulses during the timing cycle has no effect. However, the
RESET input at pin 4 can be used to terminate an output pulse during the timing cycle, if desired.
Figure 19.5a shows the waveforms for a non-retriggerable monostable multivibrator. From
the waveforms, observe that if tp is the pulse width of the one-shot, the output of the one-shot goes
HIGH only for tp whenever a positive going transition of the trigger occurs. Also, the duration of
the triggering pulse is of no consequence. Also, a triggering pulse applied when the output is
already HIGH, does not affect the output at all.
Figure 19.5b shows the waveforms for a retriggerable one-shot. Note that the output remains
HIGH for a time tp after the application of the trigger at any instant.
Figure 19.5c shows the comparison of waveforms for the outputs of retriggerable and
non-retriggerable one-shots.
Q
tp tp tp tp
Q
tp tp tp
Q
tp tp tp
Q
tp tp tp
74HC221 are dual non-retriggerable one-shot ICs; the 74122 and 74LS122 are single retriggerable
one-shots. The 74123, 74LS123, and 74HC123 are dual retriggerable one-shot ICs.
The 74121 is a widely used non-retriggerable one-shot IC. It is constructed with logic gates
at its inputs. Depending on how the external signal inputs are connected to these gates, the
monostable can be triggered by a LOW-to-HIGH or by a HIGH-to-LOW level transition.
Figure 19.6a shows the wiring diagram of the 74121 with connections to the external RC
timing circuit. The truth table governing the operation and triggering of this device is shown in
Figure 19.6b. We see that the device can be triggered by a HIGH-to-LOW transition on input A2
when the other inputs (A1 and B) are HIGH, or by a HIGH-to-LOW transition on A1, when A2 and
B are HIGH. It can also be triggered by a LOW-to-HIGH transition on B when either A1 or A2 is
LOW. Note that the AND gate incorporates a Schmitt trigger to provide sharp triggering from
slowly varying inputs. The width of the output pulse produced by the 74121 is given by
PW = (ln 2)RextCext = 0.69 RextCext
Rext
+VCC
Cext
NC NC Rext NC
VCC 14 13 12 11 10 9 8
A1 A2 B Q Q
L × H L H
Q × L H L H
L L H
H H × L H
Q H H
H H
H
L ×
1 2 3 4 5 6 7 GND × L
Q NC A1 A2 B Q (b) Truth table
Figure 19.7 shows the wiring diagram and the truth table for one-half of the dual 74123
retriggerable monostable multivibrator. Note that this version has a CLEAR input (CLR) which,
when made LOW will cause an output pulse, already in progress, to be terminated.
When Cext > 1000 pF, the output pulse width is approximately given by
tw ª 0.28RextCext(1 + 0.7/Rext)
If Cext is an electrolytic capacitor or if the CLR function is used, the manufacturer recommends
that a diode be inserted between Rext and pin 15 (cathode to pin 15), and the coefficient 0.28 in the
equation be changed to 0.25.
988 FUNDAMENTALS OF DIGITAL CIRCUITS
VCC
Rext Cext
(15) (14)
Q CLR A B Q Q
(13)
(1) L × × L H
A × H × L H
(2) × × L L H
B
H L
(3) Q H H
CLR CLR (4)
L H
(a) Wiring diagram for one-half of the 74123 dual monostable (b) Truth table
Figure 19.7 Dual 74123 retriggerable one-shot.
switching back and forth (oscillating) between its quasi-stable states. Hence, it is also called a
free-running multivibrator. It is useful for providing clock signals to synchronous digital circuits.
There are several types of astable multivibrators in common use. Some of them are presented
here.
values of R and C. The formulas for these time intervals t1 and t2 and the overall period of the
oscillations and the limiting values of the components are shown in Figure 19.9. The capacitor C
charges from VCC through RA and RB with a time constant (RA + RB)C. When the voltage across C
reaches (2/3)VCC, the output goes LOW, and the capacitor starts discharging through RB, with a
time constant RBC. When it discharges to (1/3)VCC, the output goes HIGH. So, the output is LOW
for t1 and HIGH for t2 and then this cycle repeats itself. With this arrangement, we can only get a
square wave with more than 50 per cent duty cycle. RB can be made very large compared to RA to
get an approximate square wave (50 per cent duty cycle). A diode can be connected across RB
(with anode at pin 7 and cathode at pin 6) to get a perfect square wave output. Even a square wave
with less than 50 per cent duty cycle can be obtained when RB is shunted by a diode.
A major drawback of this circuit is that the frequency of the square wave cannot be controlled.
It is difficult to determine the exact propagation delay of each logic gate and, therefore, the frequency
TIMING CIRCUITS AND DISPLAY DEVICES 991
of the square wave. It is possible to have some control over the frequency of the square wave by
using timing elements such as resistors and capacitors.
Figure 19.11 shows a simple, reliable, and highly flexible astable circuit. In this case, the
frequency of oscillation is determined primarily by the resistor and capacitor timing components.
Hence it is called an RC oscillator. The exact relationship between the oscillation frequency and
the R and C components depends in part on the electrical characteristics of the logic gates. For
the standard TTL family of components, a resistance of approximately 400 W produces the
relationship
1
f =
0.001C
where C is measured in mF and f in Hz.
Oscillator Buffer
R C
R
G1 G2 G3 Q
Figure 19.12 shows an astable multivibrator using an AND gate and an inverter. Both the
inputs to the AND gate are shorted. So, it just provides a time delay equal to the propagation delay
time of the gate and acts as a buffer. When the supply is switched on and as the capacitor is
uncharged, the input to the inverter is 0 V. Therefore, its output is HIGH. Hence the output of the
AND gate also goes HIGH. The capacitor now starts charging and when the voltage across it rises
to a level which appears as a logic 1 to the inverter, the output goes LOW. Thus, the output of the
AND gate also goes LOW. Now the capacitor starts discharging. When the voltage across it falls
to a level which appears as a logic 0 to the inverter, the output of the inverter goes HIGH again.
This cycle of events repeats itself, generating a square wave.
G1 G2 VO
R
C
Figure 19.13a shows an astable multivibrator using two inverters. The output of each inverter
is coupled to the input of the other through a capacitor. The capacitive coupling networks prevent
either inverter from having a stable state. If designed properly, the circuit will start oscillating on
its own and requires no initial input trigger.
992 FUNDAMENTALS OF DIGITAL CIRCUITS
+VCC
R2 R1 C
R
G1 G2 Q 1
C1 f= Hz
Q 1.8RC
C2
G1 G2 Q
Q
(a) (b)
G1 G2 G3 Q
R2 R1
(c)
Figure 19.13 Astable multivibrator using CMOS inverters.
Figure 19.13b shows another astable multivibrator circuit using inverters. The device used is
IC 74HC04, CMOS inverter.
Figure 19.13c uses the IC 74HC04. Although this circuit can operate reliably, its frequency
is not easily predictable.
The advantage of using CMOS devices in astable multivibrators is that, they have a much
higher input impedance than that of their TTL counterparts. This characteristic makes the
performance of CMOS multivibrators more predictable than that of TTL designs—in the sense
that CMOS multivibrators are less sensitive to variations in device characteristics.
discharges towards those values, and so, the output of the circuit will be a square wave with a
period
Ê1 + ˆ R1
T = 2RC ln Á ˜ s, where b =
Ë1 - ¯ R1 + R2
Figure 19.16 shows two crystal-controlled oscillators constructed with inverters from 74HC04
CMOS hex inverters. As in the TTL circuit of Figure 19.15, the oscillation frequencies may be
sensitive to the values of R used. A typical value for R in Figure 19.16a is 100 kW but it may have
to be specially selected to prevent oscillations at a harmonic frequency. The 100 pF capacitor
suppresses the spurious high frequency oscillations in the 30 MHz to 50 MHz range. The resistor
in Figure 19.16b is of the order of 1–5 MW and the circuit will oscillate for crystal frequencies up
to about 9 MHz.
R Crystal
Crystal
G1 G2 Q
1 1
74HC04 74HC04
6 6
G1
100 pF
1
74HC04
6
(a) (b)
Figure 19.16 Crystal clock generator using CMOS inverters.
EXAMPLE 19.1 Calculate the frequency and duty cycle of the 555 astable multivibrator
output for
C = 0.01 mF, RA = 10 kW and RB = 50 kW.
Solution
t1 = 0.693RBC = 0.693 ¥ 50 ¥ 103 ¥ 0.01 ¥ 10–6 = 346.5 ms
t2 = 0.693(RA + RB)C = 0.693 ¥ 60 ¥ 103 ¥ 0.01 ¥ 10–6 = 415.8 ms
T = t1 + t2 = (346.5 + 415.8) ms = 762.3 ms
1 1
f= = = 1.31 kHz
T 762.3 ms
t2 415.8
Duty cycle = = = 54.6%
T 762.3
EXAMPLE 19.2 Design an astable multivibrator using the 555 timer to generate a square
wave of 2 kHz frequency with 50% duty cycle.
Solution
To obtain a square wave using the 555 timer, a diode is connected across RB (see Figure 19.9),
such that it conducts and shorts RB when C is charging and opens when C is discharging.
Therefore,
t1 = 0.693 RBC
t2 = 0.693 RAC
As t1 = t2, RA = RB
TIMING CIRCUITS AND DISPLAY DEVICES 995
As f = 2 kHz,
1
T= = 0.5 ms
2 kHz
T
Hence, t1 = t2 = = 0.25 ms
2
Let RA = 2 kW,
0.25 ¥ 10 -3
therefore, C= = 0.18 mF
0.693 ¥ 2 ¥ 103
EXAMPLE 19.3 Design an astable multivibrator using the 555 timer to generate a square
wave of 5 kHz with 70 per cent duty cycle.
Solution
1 1
T= = = 0.2 ms
f 5 kHz
t1 = 0.693RBC = 0.3 ¥ 0.2 = 0.06 ms
t2 = 0.693(RA + RB)C = 0.7 ¥ 0.2 = 0.14 ms
Let C = 5000 pF,
therefore,
0.06 ¥ 10 -3
RB = = 17.25 kW
0.693 ¥ 5000 ¥ 10 -12
0.14 ¥ 10 -3
RA + RB = = 40.4 kW
0.693 ¥ 5000 ¥ 10 -12
Therefore,
RA = 40.4 – 17.25 = 23.15 kW
EXAMPLE 19.4 For the astable multivibrator using the op-amp shown in Figure 19.14,
R = 10 kW, C = 0.01 mF and R1 = 5 kW.
It is desired to make the frequency of the output square wave adjustable from 10 kHz
through 100 kHz by making R2 adjustable. Through what range of values should R2 be made
adjustable to obtain the required frequency range?
Solution
The period of the output square wave must range from
1 1
T= = 0.1 ms through T = = 0.01 ms
10 kHz 100 kHz
We know that,
Ê1 + ˆ R1
T = 2RC ln Á ˜ s, where b = .
Ë1 - ¯ R1 + R2
996 FUNDAMENTALS OF DIGITAL CIRCUITS
Therefore,
Ê1 + ˆ
T = 10–4 s = 2 ¥ 10 ¥ 103 ¥ 0.01 ¥ 10–6 ln Á
Ë 1 - ˜¯
Ê1 + ˆ 10 -4
or ln Á = = 0.5
Ë 1 - ˜¯ 2 ¥ 10 4 ¥ 0.01 ¥ 10 -6
Ê1 + ˆ 0.5
or ÁË 1 - ˜¯ = e = 1.6487
R1 5 kW
or b = 0.25 = =
R1 + R2 5 kW + R2
or R2 = 15 kW
Again,
Ê1 + ˆ
T = 10–5 s = 2 ¥ 10 ¥ 103 ¥ 0.01 ¥ 10–6 ln Á
Ë 1 - ˜¯
Ê1 + ˆ 10 -5
or ln Á ˜ = = 0.05
Ë 1 - ¯ 2 ¥ 10 4 ¥ 0.01 ¥ 10 -6
Ê1 + ˆ 0.05 = 1.05
or ÁË 1 - ˜¯ = e
R1 5 kW
or b = 0.025 = =
R1 + R2 5 kW + R2
or R2 = 192 kW
Hence the range of R2 must be 15 kW through 192 kW.
6. Incandescent Display
7. Electrophoretic Image Display (EPID)
8. Liquid Vapour Display (LVD)
In general, displays are classified in a number of ways, such as follows:
1. On the methods of conversion of electrical data to visible light:
(a) Active displays (light emitters—CRTs, Gas discharge plasma, LEDs, etc.)
(b) Passive displays (light controllers—LCDs, EPIDs, etc.)
2. On the applications:
(a) Analog displays—Bargraph displays (CRT)
(b) Digital displays—Nixies, Alphanumeric, LEDs, etc.
3. According to the display size and physical dimensions:
(a) Symbolic displays—Alphanumeric, Nixie tubes, LEDs, etc.
(b) Console displays—CRTs, LCDs, etc.
(c) Large screen displays—Enlarged projection system.
4. According to the display format:
(a) Direct view type (flat panel planar)—Segmental dot matrix, CRTs
(b) Stacked electrode (non-planar type)—Nixie
5. In terms of resolution and legibility of characters:
(a) Simple, single-element indicator
(b) Multi-element displays.
6. LEDs are manufactured with the same type of technology as that used for transistors and
ICs and, therefore, they are economical and have a high degree of reliability.
7. LEDs are rugged and can, therefore, withstand shocks and vibrations. They can be operated
over a wide range of temperature say, 0–70°C.
The disadvantage of LEDs compared to LCDs is their high power requirement. Also, LEDs
are not suited for large area displays, primarily because of their high cost.
thus appears dark. LCDs consume much less power than LED displays and are widely used in
battery powered devices such as calculators and watches. An LCD does not emit light energy like
an LED. So, it cannot be seen in the dark. It requires an external source of light.
Basically, LCDs operate from a low voltage (typically 3–15 V rms), low frequency
(20–60 Hz) ac signal and draw very little current. They are often arranged as seven segment
displays for numerical read-outs as shown in Figure 19.17. The ac voltage needed to turn on a
segment is applied between the segment and the backplane which is common to all segments. The
segment and the backplane form a capacitor, that draws very little current as long as the ac frequency
is kept low. The frequency is generally not lower than 25 Hz, because that would produce visible
flicker.
a
a
b f b
c
g
d
e
e c
f
g
d
Backplane
Driving an LCD
An LCD segment will turn on, when an ac voltage is applied between the segment and the backplane,
and will turn off, when there is no voltage between the two. Rather than generating an ac signal, it
is a common practice to produce the required ac voltage by applying out-of-phase square waves to
the segment and the backplane. Figure 19.18 illustrates the driving arrangement for one segment.
A 40 Hz square wave is applied to the backplane and also to the input of a CMOS 4070 X-OR gate.
The other input to the X-OR is a control input, that controls the ON/OFF state of the segment.
Segment
Control
40 Hz
signal
4070B Backplane
When the CONTROL input is LOW, the X-OR output will be exactly the same as the 40 Hz
square wave, so that the signals applied to the segment and the backplane are equal. Since there is
no difference in voltage, the segment will be OFF. When the CONTROL input is HIGH, the X-OR
output will be the inverse of the 40 Hz square wave, so that the signal applied to the segment is
1000 FUNDAMENTALS OF DIGITAL CIRCUITS
out-of-phase with the signal applied to the backplane. As a result, the segment voltage will
alternatively be at + 5 V and – 5 V relative to the backplane. This ac voltage will turn on the
segment. The same idea can be extended to a complete seven segment LCD display as shown in
Figure 19.19.
D
BCD to d
C
seven
segment LCD
B
decoder/driver
e a
A a
b
c f b
f
d g
e
g f e c
g
d
Backplane
40 Hz
Figure 19.19 Circuit for driving the seven segment LCD.
In general, CMOS devices are used to drive LCDs for two reasons. First, they require much
less power than that by TTL and are more suited to the battery-operated applications where LCDs
are used. Second, as the TTL LOW state voltage is not exactly 0 V, and can be as much as 0.4 V,
it produces a dc component of voltage between the segment and the backplane which considerably
shortens the life of an LCD.
REVIEW QUESTIONS
1. What is the difference between the retriggerable and non-retriggerable one shots?
2. Describe the operation and applications of monostable multivibrators, astable multivibrators,
bistable multivibrators, and Schmitt trigger inverters?
3. Explain the difference in operation of a monostable and an astable multivibrator.
4. What are the advantages of a crystal clock generator?
5. Name the commonly used displays in the digital electronic field.
6. How are displays classified?
7. What are the applications of LEDs?
8. What are the advantages of using LEDs in electronic displays?
9. Explain the working of dynamic scattering type LCD.
10. Explain the working of field effect type LCD.
PROBLEMS
19.1 Design a one-shot using the 555 timer to generate a pulse of width 1 ms.
19.2 Determine the values of Rext and Cext that will produce a pulse width of 2 ms when connected to
a 74123 as shown in Figure 19.7.
19.3 Design an astable multivibrator using the 555 timer to generate a square wave of 1 kHz with
60 per cent duty cycle.
19.4 Design an astable multivibrator using the 555 timer to generate a square wave of 5 kHz with
40 per cent duty cycle.
19.5 For the astable multivibrator using an op-amp as shown in Figure 19.14, R = 20 kW, C = 0.05 mF
and R1 = 10 kW. It is desired to make the frequency of the output square wave adjustable from
15 kHz through 150 kHz by making R2 adjustable. Through what range of values should R2 be
made adjustable to obtain the required frequency range?
Appendix
NUMBER DESCRIPTION
7400 Quad 2-input NAND gates
7401 Quad 2-input NAND gates (open collector)
7402 Quad 2-input NOR gates
7403 Quad 2-input NOR gates (open collector)
7404 Hex inverters
7405 Hex inverters (open collector)
7406 Hex inverter buffers/drivers
7407 Hex buffer-drivers (open collector high voltage outputs)
7408 Quad 2-input AND gates
7409 Quad 2-input AND gates (open collector)
7410 Triple 3-input NAND gates
7411 Triple 3-input AND gates
7412 Triple 3-input NAND gates (open collector)
7413 Dual 4-input NAND Schmitt trigger
7414 Hex Schmitt-trigger inverters
74H15 Triple 3-input AND gate (open collector)
7416 Hex inverter buffer drivers
7417 Hex buffer drivers
7420 Dual 4-input NAND gates
7421 Dual 4-input AND gates
1005
1006 Appendix: COMMONLY USED TTL ICs
NUMBER DESCRIPTION
7422 Dual 4-input NAND gates (open collector)
7423 Dual 4-input NOR gates with strobe
7425 Dual 4-input NOR gates
7426 Quad 2-input TTL-MOS interface NAND gates
7427 Triple 3-input NOR gates
7428 Quad 2-input NOR buffers
7430 8-input NAND gate
74S31 Delay elements
7432 Quad 2-input OR gates
7433 Quad 2-input NOR buffers (open collector)
7437 Quad 2-input NAND buffers
7438, 39 Quad 2-input NAND buffers (open collector)
7440 Dual 4-input NAND buffers
7441, 42 BCD-to-Decimal decoder
7443, 43A Excess-3-to-Decimal decoder
7444, 44A Gray-to-Decimal decoder
7445 BCD-to-Decimal decoder/driver
7446 BCD-to-Seven segment decoder/drivers (30 v output)
7447 BCD-to-Seven segment decoder/drivers (15 v output)
7448 BCD-to-Seven segment decoder/driver
7450 Expandable dual 2-input 2-wide AOI gates
7451 Dual 2-input 2-wide AOI gates
7452 Expandable 2-input 4-wide AND/OR gates
7453 Expandable 2-input 4-wide AOI gates
7454 2-input 4-wide AOI gates
7455 Expandable 4-input 2-wide AOI gates
7459 Dual 2/3-inputs 2-wide AOI gates
7460 Dual 4-input expanders
7461 Triple 3-input expanders
7462 2-2-3-3 input 4-wide A/O expanders
7464 2-2-3-4 input 4-wide AOI gates
7465 4-wide AOI gates (open collector)
7470 AND gated positive edge-triggered J-K FF with preset and clear
7471 JK master-slave FF with preset
7472,74H72 AND gated J-K master-slave FF with PRESET and CLEAR
7473 Dual J-K master-slave FF with active-LOW CLEAR
7474 Dual positive edge-triggered D FF
7475 Quad D-latch
7476 Dual positive edge-triggered J-K flip-flops
74LS76A Dual negative edge-triggered J-K flip-flops
7480 Gated full-adder
7482 2-bit binary full-adder
Appendix: COMMONLY USED TTL ICs 1007
NUMBER DESCRIPTION
7483 4-bit binary full-adder with fast carry
7485 4-bit magnitude comparator
7486 Quad X-OR gate
7489 64-bit random access read/write memory
7490 Decade counter
7491 8-bit shift register
7492 Divide-by-12 counter
7493 4-bit binary counter
7494 4-bit shift register
7495 4-bit bidirectional shift register
7496 5-bit parallel-in parallel-out shift register
74100 4-bit bistable latch
74H103 Dual J-K negative edge-triggered FF with CLEAR
74104 J-K master-slave flip-flop
74105 J-K master-slave flip-flop
74H106 Dual J-K negative edge-triggered FF with PRESET and CLEAR
74107 Dual J-K master-slave FF with CLEAR
74LS107A Dual J-K negative edge-triggered FF
74109 Dual J-K positive edge-triggered FF
74110 AND gated J-K master-slave FF with data lock-out
74111 Dual J-K master-slave FF with data lock-out
74116 Dual 4-bit latches with CLEAR
74121 Non-retriggerable one-shot
74122, 23 Retriggerable one-shot with CLEAR
74125, 26 3-state quad bus-buffer
74128 Quad 2-input NOR buffer
74132 Quad 2-input NAND schmitt trigger
74133 13-input NAND gate
74134 12-input NAND gate
74136 Quad 2-input X-OR gate
74137,38 1:8 demultiplexer
74LS138 3-line to 8-line decoder/demultiplexer
74139 Dual 1:4 demultiplexer
74141 BCD-to-Decimal decoder/driver
74142 BCD counter/latch/decoder/ driver
74145 BCD-to-Decimal decoder/driver
74147 Decimal-to-BCD priority encoder
74148 Octal-to-Binary priority encoder
74150 16-line to 1-line multiplexer
74151 8-channel digital multiplexer
74152 8-channel data selector/MUX
74153 Dual 4-line to 1-line multiplexer
1008 Appendix: COMMONLY USED TTL ICs
NUMBER DESCRIPTION
74154 4-line to 16-line decoder/D MUX
74155,156 Dual 2-line to 4-line demultiplexer
74157 Quad 2-line to 1-line data selector
74160 Decade counter with asynchronous CLEAR
74161, 62, 63 Synchronous 4-bit counter
74164 8-bit parallel-out serial shift register
74165,66 Parallel load 8-bit serial shift register
74S168 Synchronous up/down decade counter
74S169 Synchronous up/down binary counter
74170 4 × 4 register files
74173 4-bit D type 3-state register
74174 Hex D flip-flops with CLEAR
74175 Quad D flip-flops with CLEAR
74176 35 MHz presettable decade counter
74177 35 MHz presettable binary counter
74179 4-bit parallel access shift register
74180 8-bit odd/even parity generator/checker
74181 Arithmetic logic unit
74182 Look-ahead carry generator
74184 BCD-to-Binary converter
74185 Binary-to-BCD converter
74189 3-state 64-bit RAM
74190 Synchronous up/down decade counter
74191,93 Synchronous binary up/down counter
74192 Synchronous BCD up/down counter
74194 4-bit bidirectional universal shift register
74195 4-bit parallel access shift register
74196 Presettable decade counter
74197 Presettable binary counter
74198 8-bit shift register
74199 8-bit parallel-access shift register
74221 Dual one-shot with schmitt trigger inputs
74245 Octal transceiver
74246, 47, 48 BCD-to-Seven segment decoder/driver
74251 3-state 8-channel multiplexer
74LS253 Dual 4-to-1 data MUX with 3-state output
74256 Dual 4-bit addressable latch
74257 Quad 2-1 multiplexer
74258 Data selector / multiplexer
74259 8-bit addressable latch
74LS266 Quad 2-input X-NOR gates
74279 Quad latches
Appendix: COMMONLY USED TTL ICs 1009
NUMBER DESCRIPTION
74LS280 9-bit odd/even parity generator/checker
74283 4-bit binary full-adder with fast carry
74284, 285 3-state 4-bit by 4-bit parallel binary multipliers
74290 Decade counter
74293 4-bit binary counter
74295 4-bit bidirectional shift register with 3-state outputs
74LS320 Crystal controlled oscillator
74365, 66, 67 3-state hex buffers
74373,74 Latches/ flip-flop
74390 Individual clocks with flip-flops
74393 Dual 4-bit binary counter
CMOS
CD 4000 Series pin configuration
4510 BCD up/down counter
4511 BCD to seven segment decoder
4514 4-16 line decoder
4515 Binary up/down counter
4518 Dual up counter
4528 Monostable multivibrator
4543 BCD to seven segment decoder
4581 4-bit arithmetic logic Unit
GLOSSARY
Active-HIGH (LOW) input Input which is normally LOW (HIGH) and goes HIGH (LOW)
when circuit operation is required.
Active logic level Logic voltage level at which a circuit is considered active.
A/D converter The circuit which converts an analog signal into its digital form.
Address The number that uniquely identifies the location of a word in memory.
Alphanumeric codes The codes that represent numbers, alphabetic characters, and symbols.
Analog Being continuous or having a continuous range of values as opposed to a discrete set of
values.
Analog system Interconnection of devices designed to manipulate physical quantities that are
represented in analog form.
AND gate A digital logic circuit used to implement the AND operation. The output of this
circuit is a 1 only when each one of its inputs is a 1.
ANSI American National Standards Institute.
Anti-coincidence gate An X-OR gate which outputs a HIGH only when its two inputs differ.
Arbitration Selection of the input with the highest priority out of a number of inputs which are
simultaneously high in an encoder.
Arithmetic Logic Unit (ALU) A digital circuit used in computers to perform arithmetic and
logic operations.
ASCII code American Standard Code for Information Interchange. A seven-bit alphanumeric
code used by most computer manufacturers.
1011
1012 GLOSSARY
ASIC Application specific integrated circuit. An IC designed to meet the specific requirements
of a circuit.
ASM chart A special flow chart that has been developed specifically to define digital hardware
algorithms.
Asserted level A term synonymous with active level, the level of the signal required to initiate
the process.
Astable multivibrator A digital circuit with no stable state; it oscillates between two quasi-
stable states.
Asynchronous Having no fixed time relationship.
Asynchronous counter A type of counter in which the external clock signal is applied only to
the first FF and the output of each FF serves as the clock input to the next FF in the chain.
Asynchronous inputs Also called the overriding inputs of FFs. They can affect the operation of
the FF independent of the clock and synchronous inputs.
Asynchronous transfer Transfer of data performed without the aid of clock.
Backplane Electrical connection common to all segments of the LCD.
Base The number of symbols in a number system. Also, one of the three regions in a BJT.
BCD Binary coded decimal, a digital code.
BCD adder An adder containing two 4-bit parallel adders and a correction detector circuit.
BCD counter A mod-10 counter that counts from 00002 to 10012.
Bidirectional shift register Shift-left, shift-right, shift register, in which data can be shifted in
either direction.
Bilateral switch A CMOS circuit which acts like a single-pole, single-throw switch controlled
by an input logic level.
Binary Having two values or states.
Binary counter A counter in which the states of FFs represent the binary number equivalent to
the number of pulses that have occurred at the input of the counter.
Binary multiplier A digital circuit capable of performing the arithmetic operation of
multiplication on two binary numbers.
Binary number system A number system with only two values, 0 and 1.
Binary point A mark which separates the integer and fractional parts of a binary number.
Bipolar DAC A DAC whose output can assume a positive or negative value depending on the
signed binary input .
Bipolar ICs The ICs which use BJTs as the main circuit elements.
Bistable multivibrator A multivibrator which can remain indefinitely in any one of its two
states. It is commonly known as flip-flop.
Bit Binary Digit, a 1 or a 0.
Block parity A method of providing parity row wise and column wise for a block of information
words.
Boolean algebra It is the study of mathematical logic.
Bubbled AND gate The AND gate with inverted inputs. It performs the NOR operation.
Bubbled OR gate The OR gate with inverted inputs. It performs the NAND operation.
GLOSSARY 1013
Buffer driver A circuit with greater output current and/or voltage capability than an ordinary
logic circuit.
Buffer register The register that holds digital data temporarily.
Byte A group of 8 bits.
Capacity The amount of storage space in a memory expressed as number of bits or number of
words.
Carry A digit that is carried to the next column when two digits are added.
CCD Charge-coupled device, a type of semiconductor technology.
Cell A single storage element in a memory.
Check sum A special data word that is derived from the addition of all other data words. It is
used for error checking purposes.
Circulating shift register A shift register in which the output of the last FF is connected as the
input to the first FF.
CLEAR An asynchronous FF input that makes Q = 0 instantaneously.
Clock The basic timing signal in a digital system.
Clock skew Arrival of a clock signal at different times at the clock inputs of different FFs as a
result of propagation delays.
Clock transition times Minimum rise and fall times for the clock signal transitions.
Closed subgraph A subgraph in which for every vertex all outgoing arcs and their terminating
vertices also belong to the subgraph.
CMOS Complementary Metal Oxide Semiconductor. The IC technology which uses both NMOS
and PMOS FETs as the principal circuit elements.
Code A combination of binary digits that represents information such as numbers, alphabets,
and other symbols.
Code converter An electronic digital circuit that converts one type of coded information into
another coded form.
Coincidence gate The X-NOR gate which outputs a HIGH only when its two inputs are the
same.
Combinational logic circuit A combination of logic devices having no storage capability and
used to generate a specified function.
Compatibility graph A graph whose vertices correspond to all compatible pairs and whose
directed arcs lead from one vertex to another vertex if and only if the compatible pair of the
first vertex implies the compatible pair of the second vertex.
Complement An invert function in Boolean algebra
Computer word The group of bits used as the primary unit of information in a computer.
Conditional output box A rectangular box with rounded corners or an oval shaped box which
lists the outputs that occur when the path to a conditional output box is satisfied.
Control inputs Input signals synchronized with the active clock transition that determine the
output state of a FF.
Control Subsystem A sequential circuit whose internal states decide the control commands for
the system.
Cyclic code A code in which the successive code words differ in only one bit.
1014 GLOSSARY
D/A converter The circuit which converts a digital input into an analog output.
Data Information in numeric, alphanumeric, or other form.
Data lock-out FFs A master-slave FF that has a dynamic clock input.
Datapath Also known as data processing path manipulates data in registers according to system’s
requirements.
DC CLEAR Asynchronous FF input used to clear the FF.
DC SET Asynchronous FF input used to set the FF.
De Morgan’s theorems (1) The complement of an OR operation on variables is equal to an
AND operation on the complemented variables. (2) The complement of an AND operation on
variables is equal to the OR operation on complemented variables.
Decade counter A digital counter having 10 different states.
Decimal number system The number system with 10 different symbols.
Decision box A diamond shaped box with one input path and two or more output paths to describe
the effect of an input on the control subsystem.
Decoder A digital circuit that converts coded information into familiar form.
Demultiplexer (DMUX) The logic circuit that channels its data input to one of several data
outputs.
Dependency notation A notational system for logic symbols that specifies the input and output
relationships.
Digit A symbol representing a given quantity in a number system.
Digital ICs Self-contained digital circuits, made by using one of several IC technologies.
Digital system A combination of devices designed to manipulate physical quantities that are
represented in digital form.
DIP Dual-in-line-package; the most common type of IC package.
Dominating column In a prime implicants chart, a column which has a ‘X’ in every row in
which another column has a ‘X’.
Dominating row In a prime implicants chart, a row which has a ‘X’ in every column in which
another row has a ‘X’.
Don’t care A condition in a logic circuit in which the output is independent of the state of a
given input.
DRAM Dynamic RAM: a type of semiconductor memory that stores data as capacitor charges
that need to be refreshed periodically.
Dynamic shift register A register in which data continually circulates through the register under
the control of a clock.
EAROM Electrically alterable read only memory.
EBCDIC code Extended Binary Coded Decimal Interchange Code: an alphanumeric code.
ECL Emitter Coupled Logic. Also referred to as current mode logic (CML).
Edge detector A circuit that produces a narrow positive spike, coincident with the active transition
of a clock pulse.
Edge-triggered FF A type of FF which is activated by the clock signal transition.
EEPROM Electrically erasable programmable read only memory.
Encoder A digital circuit that converts information into coded form.
GLOSSARY 1015
Inhibit circuits Logic circuits that control the passage of an input signal through to the output.
Interfacing Joining of dissimilar devices in such a way that they are able to function in a
compatible and coordinated manner; connection of the output of a system to the input of a
different system with different electrical characteristics.
Invert Causing a logic level to go to the opposite state.
Inverter A logic circuit that implements the NOT operation.
J-K FF A type of FF that can operate in the ‘no change’, ‘set’, ‘reset’ and ‘toggle’ modes.
Johnson counter A type of shift register counter in which the inverted output of the last FF is
connected as data input to the first FF.
Karnaugh map An arrangement of cells representing the combinations of variables in a
Boolean expression and used for a systematic simplification of the expression.
Latch A non-clocked FF.
Linearity error The maximum deviation in step size from the ideal step size in a DAC.
Lock-out The state of a counter when successive clock pulses take the counter only from one
invalid state to another invalid state.
Logic circuit A circuit that behaves according to a set of logic rules.
Logic level State of a voltage variable. States HIGH and LOW correspond to the two usable
voltage levels of a digital device.
Look-ahead carry A method of binary addition whereby carries from the preceding stages are
anticipated, thus avoiding the carry propagation delays.
Looping Combining of adjacent squares in a K-map containing 1s (0s) for the purpose of
simplification of a SOP (POS) expression.
LSB The least significant bit, i.e. the rightmost bit in the binary number.
LSD The least significant digit, i.e. the digit that carries the least weight in a particular number.
LSI Large scale integration. A level of integration in which 100 to 9999 gate circuits are integrated
on a single chip.
Magnetic bubble A tiny magnetic region in magnetic material created by an external magnetic
field.
Magnetic bubble memory (MBM) Solid state, non-volatile, sequential access, mass storage
memory device consisting of tiny magnetic domains (bubbles).
Magnetic core memory Non-volatile random access memory made up of small ferrite cores.
Magnetic disk memory Mass storage memory that stores data as magnetized spots on a rotating
flat disk surface.
Magnetic tape memory Mass storage memory that stores data as magnetized spots on an
iron-coated plastic tape.
Magnitude comparator A digital circuit used to compare the magnitudes of two binary
numbers and indicate whether they are equal or not, and if not which one has larger magnitude.
Mass storage Storage of large amounts of data, not part of the computer’s internal memory.
Master slave FF A type of FF in which the input data affects the first of its two FFs at the
leading edge of the clock pulse and then the contents of the first FF appear at the output of the
second FF at the trailing edge of clock pulse.
Maxterm The product term in the standard POS form.
GLOSSARY 1017
Mealy model A sequential circuit in which the output is a function of the present state as well as
the present input.
Memory array An arrangement of memory cells.
Memory cell An individual storage element in a memory.
Memory word Groups of bits in memory that represent instructions or data of some type.
Merger graph A graph whose vertices correspond to all the states of the machine and whose
vertices are joined by lines with compatible pairs written in the line break. It is a state reducing
tool used to reduce states in the incompletely specified machine.
Merger table A table whose each cell corresponds to one compatible pair.
Microprocessor A large-scale integrated circuit that can be programmed to perform arithmetic
and logic functions and to manipulate data.
Minimal cover table A table consisting of states of minimal state machine.
Minterm The sum term in the standard SOP form.
Modified modulus counter A counter that does not sequence through all of its natural states.
Modulus The maximum number of states in a counter sequence.
Monostable multivibrator A multivibrator having only one stable state. The other one is a
quasi-stable state. It is also called one-shot.
Monotonicity A property whereby the output of a DAC either increases or stays at the same
value, but never decreases as the input is increased.
Moore model A sequential circuit in which the output is a function of the present state only.
MROM A type of ROM whose storage locations are written into by the manufacturer.
MSB The most significant bit. The leftmost bit in a binary number.
MSD The most significant digit. The digit that carries the most weight in a particular number,
i.e. the extreme left digit in the number.
MSI Medium scale integration. A level of integration in which 12–99 gate circuits are
fabricated on a single chip.
Multiplex To put information from several sources on to a single line or transmission path.
Multiplexer (MUX) A digital circuit, depending on the status of its control inputs, that
channels one of several data inputs to its output.
NAND gate The logic gate that outputs a 0 only when all its inputs are 1s. It gives the complement
of the AND output.
NAND-gate latch Basic flip-flop constructed using two cross-coupled NAND gates.
Negative logic The system of logic in which a LOW represents a 1 and a HIGH represents
a 0.
NMOS N-channel metal oxide semiconductor.
Noise Unwanted (spurious) signals.
Noise immunity The ability of a circuit to tolerate noise voltages on its inputs.
Noise margin Quantitative measure of the noise immunity. It is the maximum noise voltage that
can be added at the input of a gate without affecting its operation.
Non-retriggerable one-shot A type of one-shot that does not respond to a trigger input signal
while in its quasi-stable state.
1018 GLOSSARY
Non-volatile memory Memory that is able to keep its information stored in the event of failure
of electrical power.
NOR gate A logic circuit that outputs a 1 only when each one of its inputs is a 0. It is equivalent
to an OR gate followed by an inverter.
NOR-gate latch A flip-flop constructed using two cross-coupled NOR gates.
NOT circuit A logic circuit that inverts its only input.
Octal number system A number system with 8 digits (0, 1, 2, 3, 4, 5, 6, 7).
Octet A group of 8 1s or 0s that are adjacent to each other in a Karnaugh map.
Offset error The voltage present at the output of a DAC when the input is all 0s.
One’s complement form A form of representation obtained by complementing each bit of a
binary number.
One-shot A multivibrator with only one stable state—the other name of monostable multivibrator.
Open-collector gates The TTL gates which use only one transistor with a floating collector in
the output structure.
OR gate A logic circuit that outputs a HIGH whenever one of its inputs is a HIGH.
Override inputs Asynchronous inputs in a FF which override the effects of all other input signals.
Oscillator An electronic circuit that switches back and forth between two states.
PAL A type of PLD with programmable AND array and a fixed OR array.
Parallel adder A digital circuit with full-adders that adds all the bits from two numbers
simultaneously.
Parallel counter A counter in which all the FFs are triggered simultaneously—the other name
of synchronous counter.
Parallel data transfer The operation by which the entire contents of a register are transferred to
another register.
Parallel-in, parallel-out, shift register A type of shift register that can be loaded with parallel
data and has also parallel outputs available.
Parallel-in, serial-out, shift register A type of shift register that can be loaded with parallel
data but has only one serial output terminal.
Parallel transmission Simultaneous transfer of all bits of a binary number from one place to
another.
Parity bit An additional bit that is attached to each code group so that the total number of 1s
being transmitted is either odd or even.
Parity checker A circuit that is used to check parity among the group of bits received.
Parity generator A digital circuit that takes a set of data bits and produces the correct parity bit
for the data.
Partition technique A procedure for minimization of completely specified sequential machines.
Percentage resolution The ratio of the step size to the full-scale value of a DAC. It can also be
defined as the reciprocal of the maximum number of steps of a DAC.
PLA A type of PLD with programmable AND array and a programmable OR array.
PLD An IC that is user configurable and capable of implementing logic functions.
PMOS P-channel metal oxide semiconductor.
GLOSSARY 1019
POS form Product of sums form: A form of Boolean expression in which a number of sum
terms are multiplied.
Positional-value system The system in which the value of a digit is dependent on its relative
position.
Positive logic system The system of logic in which a HIGH represents a 1 and a LOW represents
a 0.
PRESET Asynchronous input used to instantaneously set Q = 1.
Presettable counter A counter that can be PRESET to any initial count either synchronously or
asynchronously.
Prime implicant A term which cannot be combined further in the tabular method.
Priority encoder An encoder that produces a coded output corresponding to the highest-valued
input when two or more inputs are applied simultaneously.
Programming Fuse blowing process of PLDs.
PROM A ROM that can be programmed by the user. It cannot be erased and reprogrammed.
Propagation delay The time interval between the occurrence of an input transition and the
corresponding output transition.
Pulse A sudden change from one level to another followed by a sudden change back to the
original level.
Quantization error The error caused by non-zero resolution of an ADC; it is an inherent error
of the device.
Quasi-stable state A temporary stable state. A monostable circuit is triggered to this state
before returning to the normal stable state. Both the states of an astable multivibrator are
quasi-stable.
Quine-McClusky method A tabular method used to minimize Boolean expressions.
Race A condition in a logic network in which the differences in propagation times through two
or more signal paths in the network can produce an erroneous output.
Radix The base of a number system. The number of symbols in a given number system.
RAM Random access memory-—a memory in which the access time is the same for all locations.
Read The process of retrieving information from a memory.
Read/write memory A memory that can be both read from and written into.
Redundant states States whose functions can be accomplished by other states.
Reflected code A code with the property that an N-bit code can be obtained by reflecting an
N – 1 bit code about an axis at the end of the code and putting 0s above the axis and 1s below
the axis.
Refresh The process of renewing the contents of a dynamic memory.
Register A group of flip-flops capable of storing data.
RESET The state of a FF, register or counter when 0s are stored. This term is synonymous with
CLEAR.
Resolution In a DAC, the smallest change that can occur in the output for a change in the digital
input. Also, called the step size. In an ADC, the smallest amount by which the analog input
must change to produce a change in the digital output.
1020 GLOSSARY
Retriggerable one-shot A type of one-shot that will respond to a trigger input signal while in its
quasi-stable state.
Ring counter Serial-in, serial-out, shift register in which the output of the last FF is connected
to the input of the first FF.
Ripple counter A counter in which the external clock signal is applied to the first FF and then
the clock input to every other FF is the output of the preceding FF.
ROM Read only memory.
Schmitt trigger A digital circuit that converts a slow-changing signal into a fast-changing signal.
Schottky TTL A TTL subfamily that uses the basic standard TTL circuit except that it uses a
Schottky barrier diode between the base and collector of each transistor.
Self-complementing code A code in which the code word of the 9’s complement of N, i.e. of
9 – N can be obtained from the code word of N by interchanging all 0s and 1s.
Sequential code A code in which each succeeding code word is one binary number greater than
its preceding code word.
Sequence detector A digital circuit used to detect a sequence in the input.
Sequential logic A system of logic in which the logic output states and the sequence of operations
depend on both the present and the past input conditions.
Serial adder A type of adder which adds two numbers by taking the bits from them serially with
a carry.
Serial data transmission Transfer of data from one place to another one bit at a time on a single
line.
Serial-in, parallel-out, shift register A type of shift register that can be loaded with data serially,
but has parallel outputs available.
Serial-in, serial-out, shift register A type of shift register that can be loaded with data serially,
and also has a serial output terminal available.
SET The state of a flip-flop when it is in the binary 1 state.
Set-up time The time interval for which the control signals must be held constant at the input
terminals of a FF, prior to the arrival of the triggering edge of the clock pulse.
Settling time The time taken by the output of a DAC to rise and settle within one-half step size
of its full scale value as the input is changed from all 0s to all 1s.
Shift register A digital circuit capable of storing and shifting binary data.
Sign bit A binary digit that is inserted at the leftmost position of a binary number to indicate
whether that number represents a positive or negative quantity.
SOP form Sum of products form: A form of Boolean expression in which a number of product
terms are summed that is, the ORing of ANDed terms.
Speed power product Numerical value (in joules) often used to compare different logic
families. It is obtained by multiplying the propagation delay (ns) by the power dissipation
(mW) of a logic gate.
SSI Small scale integration (less than 12 gates per chip).
Stage One storage element in a register or counter.
Standard POS form A form of Boolean expression in which each sum term contains all the
variables of the function and all these sum terms are multiplied together.
GLOSSARY 1021
Standard SOP form A form of Boolean expression in which each product term contains all the
variables of the function and all these product terms are summed together.
State assignment The process of assigning the states of a physical device to the states of a
sequential machine.
State box A rectangle shaped box with one input path and one output path used in ASM charts
to indicate a state of the machine.
State diagram A picture showing the relationship between the present state, the input, the next
state and the output of a sequential machine.
State machine Any sequential circuit exhibiting a specified sequence of states.
State table A table showing the relationship between the present state, the input, the next state
and the output of a sequential machine.
State variables The output values of the physical device in a sequential machine.
SRAM (Static RAM) A RAM that stores information in FF cells which do not have to be
refreshed unlike those of the DRAM.
Storage The memory capability of a digital device. Also, the process of storing digital data for
later use.
Straight binary coding Representation of a decimal number by its equivalent binary number.
Strobing A technique often used to eliminate decoding spikes.
Strongly connected machine A sequential machine in which for every pair of states Si–,–, Sj of
the machine there exists an input sequence which takes the machine from Si– to Sj.
Subgraph Any part of a compatibility graph.
Substrate A piece of semiconductor material over which the components are fabricated in
an IC.
Synchronous Having a fixed time relationship.
Synchronous counter A counter in which the circuit outputs can change states only on the
transitions of a clock.
Synchronous inputs Input signals synchronized with the active clock transition that determine
the output state of a FF.
Synchronous systems Systems in which the circuit outputs can change states only on the transition
of a clock.
Synchronous transfer Data transfer performed by using synchronous and clock inputs of a FF.
Terminal count The final state of a counter sequence.
Terminal state A state with no outgoing arcs which start from it and terminate in other states.
Threshold function A logic function that can be realized by a single threshold element.
Threshold gate A logic element with one or more binary inputs with associated weights
outputting a 1 when the weighted sum of inputs is greater than or equal to a threshold value
and outputting a 0 other wise.
Threshold logic A form of logic realization using threshold elements.
Timing diagram Depiction of logic levels as related to time.
Toggle mode The mode in which a FF changes state for each clock pulse.
Totem-pole A term used to describe the way in which two bipolar transistors are connected one
above the other at the outputs of most TTL gates.
1022 GLOSSARY
CHAPTER 1
CHAPTER 2
Answers to Fill in the Blanks
1. base, radix 2. position-weighted system 3. base or radix point
4. LSD, MSD 5. bit 6. nibble 7. four
8. hex 9. 1, 128 10. 10 11. sign
12. binary 13. (b – 1)’s complement, b’s complement
14. ignored, add to the LSD 15. original number 16. unique, two
17. double precision, triple precision 18. two 19. floating point
20. ease of conversion to and from binary 21. 1/3rd, 1/4th 22. 3-bit binary equivalent
23. 4-bit binary equivalent
Answers to Problems
2.1 (a) 188 (b) –522 (c) 294.9 (d) –389.3
2.2 (a) 11 (b) 109 (c) 13.75 (d) 110.375
2.3 (a) 100101 (b) 11100
(c) 11000101.100011 (d) 11001101.000011
2.4 (a) 101000 (b) 110000 (c) 1001110.111 (d) 110001.11
2.5 (a) 0110 (b) 1011 (c) 101.01 (d) 1.10
2.6 (a) 1000001 (b) 110010 (c) 1001011.101 (d) 110111
2.7 (a) 11.0101 (b) 110 (c) 1010.11001 (d) 1011.000111
2.8 (a) 0010 0001 (b) 0010 1101 (c) 0100 1000 (d) 0011 1100
2.9 (a) R = 0001, Q = 0101 (b) R = 0000, Q = 1010
(c) R = 1001, Q = 0111 (d) R = 0100, Q = 0011
2.10 (a) 1111 1101 1011 (b) 1111 0101 0011
(c) 1011 1110.1000 (d) 0011 1010.1000
2.11 (a) 1111 1001 1110 (b) 1111 0001 1111
(c) 0011 0010.0011 (d) 1110 0010.1001
2.12 (a) 27 (b) – 48 (c) 78.5 (d) –52.75
2.13 (a) 35 (b) – 38 (c) 46.25 (d) –39.25
2.14 (a) 0000 1110 0000 1110 0000 1110
(b) 0001 1011 0001 1011 0001 1011
(c) 0010 1101 0010 1101 0010 1101
(d) 1001 0001 1110 1110 1110 1111
(e) 1010 0101 1101 1010 1101 1011
(f) 1100 1100 1011 0011 1011 0100
ANSWERS 1025
CHAPTER 3
Answers to Problems
3.1 (i) (a) 0010, 1000, 0110 (b) 1000, 0000, 0111
(c) 0100, 0010, 1001.0101 (d) 0001, 0101, 1000.0111
(ii) (a) 0101, 1011, 1001 (b) 1011, 0011, 1010
(c) 0111, 0101, 1100.1000 (d) 0100, 1000, 1011.1010
(iii) (a) 0010, 1110, 1100 (b) 1110, 0000, 1101
(c) 0100, 0010, 1111.1011 (d) 0001, 1011, 1110.1101
(iv) (a) 0011, 1110, 1010 (b) 1110, 0000, 1100
(c) 0111, 0011, 1111.1000 (d) 0001, 1000, 1110.1100
(v) (a) 0010, 1010, 0110 (b) 1010, 0000, 1101
(c) 0100, 0010, 1111.1011 (d) 0101, 1011, 1010.1101
(vi) (a) 0110, 1000, 1010 (b) 1000, 0000, 1001
(c) 0100, 0110, 1111.1011 (d) 0111, 1011, 1000.1001
3.2 (a) 846 (b) 679.8 (c) 697.5 (d) 860.8
3.3 (a) 793 (b) 284.6 (c) 697.4 (d) 418.5
3.4 (i) (a) 0111, 0110,1000 (b) 1000, 1000, 0111
(c) 0011, 0101, 0100.0101 (d) 0011, 1001, 0000.0001, 0110
(ii) (a) 1010, 1001,1011 (b) 1011, 1011, 1010
(c) 0110, 1000, 0111.1000 (d) 0110, 1100, 0011.0100, 1001
3.5 (i) (a) 0101, 0110, 0100 (b) 0101, 0010
(c) 0010, 0001, 0111.1000 (d) 0011, 0000, 0101.1001
(ii) (a) 1000, 1001, 0111 (b) 1000, 0101
(c) 0101, 0100,1010.1011 (d) 0110, 0011, 1000.1100
3.6 (a) 1100 (b) 11100 (c) 1010000 (d) 10001101
3.7 (a) 1110 (b) 111111101111 (c) 101101011 (d) 110001
3.8 (a) 1010 (b) 110100 (c) 111100100 (d) 10111010
3.9 (a) 1010000 (b) 1100111 (c) 11010010 (d) 1010111
3.10 (a) and (d)
3.11 (b) and (d)
3.12 (i) (a) 00110,10100 (b) 00101,01010 (c) 10001,11000 (d) 01001,01100,10001
(ii) (a) 00011,11000 (b) 00001,01111 (c) 11110,10000 (d) 00111,11111,11110
(iii) (a) 00011,11110 (b) 00001,01111 (c) 11000,11111 (d) 00111,10000,11000
3.13 (i) (a) 10 00010 (b) 01 10000 (c) 10 01000 (d) 01 00100,10 00001
(ii) (a) 0001000000 (b) 0000010000
(c) 0100000000 (d) 0000000100,0000100000
3.14 (a) 1000011, 1001100, 0100101, 1100110, 0001111, 1110000, 0011001, 1011010, 0110011,
0111100.
(b) 0101011, 0100100, 1001101, 0001110, 1100111, 0011000, 1110001, 0110010,1011011,
1010100.
ANSWERS 1027
CHAPTER 4
Answers to Problems
4.1 Arrangement using X-OR
4.2 (a)
(b)
ANSWERS 1029
(c)
1030 ANSWERS
4.3 (a)
(b)
4.4
ANSWERS 1031
4.5
CHAPTER 5
Answers to Fill in the Blanks
1. (a) AND operation, (b) OR operation, (c) NOT operation
2. corresponding element of hardware 3. SOP, POS 4. active-LOW input
5. an AND gate 6. an OR gate 7. A + B = B + A; AB = BA
8. (A + B) + C = A+ (B + C); (AB) ◊ C = A ◊ (BC)
9. A ◊ (B + C) = AB + AC; A + BC = (A + B)(A + C)
10. A + AB = A + B; A( A + B) = AB
11. A ◊ A = A; A + A = A 12. A + AB = A; A(A + B ) = A
13. AB + AC + BC = AB + AC 14. included factor
15. AB + AC = (A + C)( A + B) 16. A + B = A ◊ B; AB = A + B
17. f(A, B, C, ...) = A ◊ f(1, B, C, ...) + A ◊ f(0, B, C, ...)
f(A, B, C, ...) = [A + f(0, B, C, ...)] ◊ [ A + f(1, B, C, ...)]
18. logic design 19. active, inactive 20. signal
21. multilevel, non uniform, logic race 22. two-level, uniform, logic race
23. SOP 24. POS
Answers to Problems
5.1 (a)
(b)
CHAPTER 6
14. Gray code 15. reduction of cost 16. squares, rectangles 17. SOP and POS
18. a pair 19. a quad 20. an octet 21. adjacent to each other
22. four 23. don’t care 24. two-level 25. two-level
26. hybrid 27. variable mapping 28. looping 29. index, weight
30. literal 31. fully algorithmic, programmable 32. prime implicants
33. essential prime implicants 34. prime implicant chart
35. columns, rows 36. subcube 37. essential prime implicant
38. redundant prime implicant 39. selective prime implicant
40. false prime implicant
Answers to Problems
6.6 A BC + BD + AB + AD = ABC ◊ BD ◊ AB ◊ AD
CHAPTER 7
Answers to Problems
7.1 If A, B, C and D are the BCD inputs and f3, f2, f1 and f0 are the 2421 outputs, then
f3 = A + BC + BD, f2 = A + BC + BD, f1 = A + BC + B CD, f0 = D
7.2 If A, B, C and D are the 2421 inputs and f4, f3, f2, f1 and f0 are the 51111 outputs, then
f4 = A, f3 = B, f2 = AB + BC + BD + ACD, f1 = AB + A C + BC,
f0 = AB + AC + AD + BCD
7.3 If A, B, C, and D are the excess-3 code inputs, the decimal digits are given by
D0 = A BCD D1 = AB CD D2 = AB CD D3 = ABC D
D4 = ABCD D5 = A B CD D6 = A B CD D7 = A BCD
D8 = A BCD D9 = AB C D
7.4 If A, B, C and D are the 2421 code bits, the decimal digits are given by
D0 = A B C D D1 = A B CD D2 = A BCD D3 = A BCD
D4 = AB C D B
D5 = A CD D6 = AB C D D7 = AB CD
D8 = ABC D D9 = ABCD
7.5 If A, B, C and D are the 2421 code bits, fe = (A ≈ B) + (C ≈ D)
7.6 If A, B, C and D are the 3321 BCD code bits, f0 = (A ≈ B) + (C D)
7.7 (a) If A, B, C and D are the 5211 inputs, and f3, f2, f1 and f0 are the 2421 outputs,
f3 = A, f2 = AB + C D + BC, f1 = A BC + ABC + AB C + A B C, f0 = CD + AD + A C
(b) If A, B, C and D are the binary inputs and f6, f5, f4, f3, f2, f1 and f0 are the Excess-3 outputs,
then
f6 = AB + AC, f5 = A + B C = f4, f3 = A B C + ABD + ABC + BCD,
f2 = BD + B C D + AB D + AB C + A BC, f1 = A C D + ACD + AC D + A BD + AB CD, f0 = D
(c) If A, B, C and D are the BCD inputs and G3, G2, G1 and G0 are the gray code outputs, then
G3 = A, G2 = A + B, G1 = B C + BC, G0 = CD + CD
ANSWERS 1037
7.8 (a) f = A ≈ B ≈ C
(b) f = A ≈ B ≈ C
7.9
7.10
1038 ANSWERS
7.11
7.12
ANSWERS 1039
7.13
7.14
7.15
1040 ANSWERS
7.16
CHAPTER 8
Answers to Problems
8.1 For PROM
E3 = B3B2 B1B0 + B3B2B1 B0 + B3B2B1B0 + B3 B2 B1 B0 + B3 B2 B1B0
E2 = B3 B2 B1B0 + B3 B2B1 B0 + B3 B2B1B0 + B3B2 B1 B0 + B3 B2 B1B0
E1 = B3 B2 B1 B0 + B3 B2B1B0 + B3B2 B1 B0 + B3B2B1B0 + B3 B2 B1 B0
E0 = B3 B2 B1 B0 + B3 B2B1 B0 + B3B2 B1 B0 + B3B2B1 B0 + B3 B2 B1 B0
For PAL
E3 = B3 + B2B1 + B2B0
E2 = B2 B1 B0 + B2B0 + B2B1
E1 = B1 B0 + B1B0
E0 = B0
ANSWERS 1041
For PLA
E3(T) = B3 + B2B1 + B2B0
E2(C) = B2 B1B0 + B2 B1 + B2 B0
E1(T) = B1 B0 + B1B0
E0(T) = B0
8.2 For PROM
B3 = E3 E 2E1E0 + E3E2 E1 E 0
B2 = E 3E2E1E0 + E3 E 2 E1 E0 + E3 E2 E1E0 + E3 E 2E1 E0
B1 = E 3E2 E 1E0 + E 3E2E1 E 0 + E3 E 2 E 1E0 + E3 E 2E1 E 0
B0 = E 3E2 E1 E 0 + E3E2E1 E 0 + E3 E2 E 1 E0 + E3 E2E1 E0 + E3E2 E 1 E0
For PAL
B3 = E3E2 + E3E1E0
B2 = E2E1E0 + E2 E 0 + E 2 E1
B1 = E 1E0 + E1 E 0
B0 = E0
For PLA
B3(C) = E 3 + E1 E 0 + E2 E 1
B2(T) = E2E1E0 + E2 E 0 + E2 E 1
B1(T) = E 1E0 + E1 E 0
B0(T) = E 0
8.3 F1(C) = A C + AB + B C
F2(C) = A C + B C + A BC
AC 1 – 0 1 1
BC – 1 0 1 1
AB 1 1 – 1 –
A BC 0 0 1 – 1
1042 ANSWERS
8.4
Product term AND inputs Outputs
W X Y Z F3
1 – 0 – 0 – F1 = x z + wx y + wxz
2 1 1 0 – –
3 0 1 – 1 –
4 – – – – 1 F2 = F3 + wy z + w x y
5 0 – 1 0 –
6 1 0 0 – –
7 – 0 0 0 – F3 = x y z + wxy
8 1 1 1 – –
9 – – – – –
10 – 0 0 – – F4 = x y + x z + w y
11 – 0 – 0 –
12 0 – 0 – –
8.5 F1(T) = C + A B
F2(T) = A C + AB
F3(C) = B + AC + AC
F4(C) = C
C – – 0 – 1 – – 1
AB 0 0 – – 1 – – –
AC 0 – 0 – – 1 1 –
AB 1 1 – – – 1 – –
B – 0 – – – – 1 –
AC 1 – 1 – – – 1 –
CHAPTER 9
Answers to Problems
9.1 (a) Unate function
(b) Unate function
9.2 (a) No
(b) No
9.3 (a)
(b)
9.4 (a)
(b)
(c)
CHAPTER 10
Answers to Problems
10.1
10.2
10.3
10.4
ANSWERS 1045
10.5
10.6
10.7 0 1 1 1 0 0 0 0 0
CHAPTER 11
CHAPTER 12
Answers to Problems
CHAPTER 13
Answers to Problems
13.1 J1 = y2x, K1 = y2, J2 = y1 x + y1 x, K2 = y1 + x , z = y1y2x
13.2 D3 = Q2, D2 = Q 3 Q 2 + Q3Q1, D1 = Q 2 Q1 + Q2 Q1
13.3 S1 = y2 x, R1 = y2, S2 = y1x, R2 = y1 , z1 = y1, z2 = y2
13.4 T1 = y2 x + y2y3 + y1x + y1y3, T2 = y1y2 + y1 y3x + y2 y3 x + y1 x + y3 y2 x
T3 = y1 y2 x + y2y3 x + y1y3x, z = y1x
13.5 S1 = y2y3x, R1 = y1, S2 = y1 x + y2 y3 x , R2 = y2y3 + x, S3 = y2 y3 + y3 x,
R3 = y2y3 + y3 x ,
13.6 D1 = y1 y2 x y1 y 2 x , D2 = y1 y2 x
13.7 J1 = K1 = 1, J2 = K2 = y1M + y1M , J3 = K3 = y1y2M + y1 y2 M
M = clock ANDed with control x and applied to J-K FFs.
13.8 D1 = y1 y2 y3 x + y3 y 4 x + y2 y 4 x + y4 y3 x + y4 y2 x
D2 = y2 y3 x + y2 y3 x + y3 y4 x + y4 y3 x + y2 y4 y1x
D3 = y2 y3 x + y4 y2 x + y2 y3 x + y2 y 4 x; D4 = y2 y3 y4 x + y2 y3 y4 x
13.9 J1 = y2y3, K1 = 1, J2 = y1 y3 x , K2 = x + y3, J3 = y1 x , K3 = x + y2 , z = y1y3 x + y1 y3 x
CHAPTER 14
Answers to Problems
14.1 (a) P2 = (A)(C, D)(B)(E, F)
(b) P4 = (C)(H)(A)(B)(E)(D)(G)(F) and no minimization is possible.
(c) P3 = (A)(B, D)(C)(E)(F)(G)(H)
(d) P4 = (A, B)(C)(D)(E)(F, G)
(a) PS NS, Z
X=0 X=1
A C, 0 A, 1
B E, 1 C, 1
C C, 0 E, 1
E C, 1 C, 1
(c) PS NS, Z
X=0 X=1
A E, 0 B, 1
B F, 0 B, 1
C E, 0 B, 0
E C, 0 F, 0
F B, 0 C, 0
G B, 1 C, 1
H B, 1 A, 1
(d) PS NS, Z
X=0 X=1
A F, 0 A, 1
C D, 0 C, 1
D C, 0 A, 1
E D, 0 A, 1
F E, 1 F, 1
CHAPTER 15
Answers to Problems
15.1 (a)
15.6 (a)
(b)
ANSWERS 1055
CHAPTER 16
CHAPTER 17
Answers to Fill in the Blanks
1. A/D, D/A 2. ADCs, DACs 3. true analog, pseudo analog
4. resolution 5. offset voltage 6. monotonic 7. step size
8. full scale error 9. R-2R ladder type 10. switched current, switched voltage
11. switched voltage 12. quantization 13. counter, flash 14. flash
15. flash 16. dual-slope 17. successive approximation
18. voltage, current 19. voltage to frequency, flash, dual slope
20. successive approximation 21. dual-slope 22. digital ramp.
Answers to Problems
17.1 6 bits
17.2 3.1 V; 2.1 V
17.3 (a) 55/32 V (b) 215/64 V
17.4 11001100
17.5 Rf = 10 kW, R = 7.8125 kW, 2R = 15.625 kW, 4R = 31.25 kW, 8R = 62.4 kW, V0 = –8.8 V
17.6 10 mA
17.7 I3 = 0.75 mA, I2 = 0.375 mA, I1 = 0.1875 mA, I0 = 0.09375 mA
17.8 1.8125 mA, 9.0625 V
17.9 6.875 V
17.10 0.625
17.11 fmax = 5 MHz
ANSWERS 1057
CHAPTER 18
Answers to Fill in the Blanks
1. stored program type 2. an address 3. word
4. cell 5. semiconductor 6. auxiliary 7. writing
8. reading 9. software 10. firmware 11. static memory
12. access time 13. D, S 14. ECL RAMs 15. optical disk memory
16. serial 17. dynamic 18. faster 19. more
20. CMOS 21. bit-organized 22. word-organized
23. mass storage and backup
24. speed, reduced complexity, space, power consumption 25. memory expansion.
Answers to Problems
18.1
1058 ANSWERS
18.2
18.3
ANSWERS 1059
CHAPTER 19
Answers to Problems
19.1 Let C = 1 mF, then R = 900 W.
19.2 Let Rext = 10 kW, then Cext = 714 pF.
19.3 Let C = 0.05 mF, then RA = 17.31 kW, RB = 11.54 kW.
19.4 Let C = 0.1 mF, then RA = 1.47 kW.
19.5 592 kW through 6087 kW.
INDEX