Digital Electronics 2-1
Digital Electronics 2-1
Number Systems - Arithmetic Operations - Binary Codes- Boolean Algebra and Logic Gates - Theorems and
Properties of Boolean Algebra - Boolean Functions - Canonical and Standard Forms - Simplification of Boolean
Functions using Karnaugh Map - Logic Gates – NAND and NOR Implementations.
Introduction
Basically there are two types of signals in electronics,
i) Analog
ii) Digital
Digital
systems
Advantages:
The usual advantages of digital circuits when compared to analog circuits are:Digital systems
interface well with computers and are easy to control with software. New features can often be added
to a digital system without changing hardware.
Often this can be done outside of the factory by updating the product's software. So, the product's
design errors can be corrected after the product is in a customer's hands.
Information storage can be easier in digital systems than in analog ones. The noise- immunity of
digital systems permits data to be stored and retrieved without degradation.
In an analog system, noise from aging and wear degrade the information stored.
In a digital system, as long as the total noise is below a certain level, the information can be
recovered perfectly.
Disadvantages:
In some cases, digital circuits use more energy than analog circuits to accomplish the same tasks, thus
producing more heat as well. In portable or battery-powered systems this can limit use of digital
systems.
Digital circuits are sometimes more expensive, especially in small quantit ies.The sensed world is
analog, and signals from this world are analog quantities.
Digital circuits are sometimes more expensive, especially in small quantities. The sensed world is
analog, and signals from this world are analog quantities.
For example, light, temperature, sound, electrical conductivity, electric and magnetic fields are
analog.
B.ARUNKUMAR, Asst. Prof.,/ECE Page 1
B.ARUNKUMAR, Asst. Prof.,/ECE Page 2
REVIEW OFNUMBER SYSTEMS
Many number systems are in use in digital technology. The most common are the decimal,
binary, octal, and hexadecimal systems. The decimal system is clearly the most familiar to us because it
is tools that we use every day.
Convertingfromonecodeformtoanothercodeformiscalledcodeconversion,likeconvertingfrom binaryto
decimal orconverting from hexadecimal to decimal.
Binary-To-DecimalConversion:
Anybinarynumbercanbeconvertedtoitsdecimalequivalent simplybysummingtogether
theweights of the variouspositions in the binarynumber whichcontaina1.
Binary Decimal
110112
=24 3 1 1 0 =16+8+0+2+1
+2 +0 +2 +2
Result 2710
Binary to octal:
Example: 100 1110102=(100)(111)(010)2=4 7 28
Octal to Binary:
Decimal to octal:
Division Result Binary
177/8 =22+remainder of1 1 (LeastSignificantBit)
22/ 8 =2 +remainder of6 6
2/8 =0 +remainder of2 2 (Most Significant Bit)
Result 17710 =2618
Binary =0101100012
Decimal to Hexadecimal:
Binary-To-Hexadecimal:
Example: 1011 0010 11112= (1011) (0010) (1111)2=B2F16
Hexadecimal to binary:
Octal Hexadecimal
=2 6 5 0
= 010 110101000 =0101 1010 1000(Binary)
Result =(5A8)16
Hexadecimal Octal
(5A8)16 =0101 1010 1000(Binary)
=010 110101000(Binary)
Result =2 6 5 0(Octal)
Complements are used in digital computers to simplify the subtraction operation and for logical
manipulation.
ThereareTWOtypesofcomplementsforeachbase-rsystem: theradixcomplementand the diminished
radix complement.
The first is referred to as there’s complement and the second as the (r-
1)'scomplement,whenthevalueofthebaserissubstitutedinthename.Thetwo typesarereferredtoasthe
2's complement and 1's complement for binary numbers and the 10’s complement and 9's
complement for decimal numbers.
Note:
The1 ’ scompl ement ofabinarynumberi sthenumbert hat result sw henw
echangeall 1 ’ s to zeros and the zeros t o ones.
The2 ’ s complement is the bi nary number t hat result s whenweadd 1 t o the
1’ s compl ement .
I t is used t o represent negati venumbers.
0111
For examples:
The10’scomplementof 012398 is 987602
The10’scomplementof246700 is 753300
Model 2:
Using10’scomple ment, subtract3250-72532.
M = 03250
10>s complementofN = +27468
Sum = 30718
Model 3:
Given the two binary numbers X = 1010100andY= 1000011, performthesubtraction
(a)X-Y and (b) Y-Xbyusing2’scomple ments. [NOV – 2019]
(a) X= 1010100
2’s complementofY= + 0111101
Sum = 10010001
Discard endcarry27 = -10000000
Answer:X-Y= 0010001
(b) Y= 1000011
**********************************************
ARITHMETIC OPERATIONS
Binary Addition:
Example:
Add: 00011010+00001100=00100110
1 1
0 0 0 1 1 0 1 0
+0 0 0 0 1 1 0 0
0 0 1 0 0 1 1 0
0 -0 =0
0 -1 =1,and borrow 1fromthe nextmoresignificantbit
1 -0 =1
1 -1 =0
Example:
Sub: 00100101-00010001= 00010100
0 0 1 0 0 1 0 1
-0 0 0 1 0 0 0 1
0 0 0 1 0 1 0 0
Binary Multiplication:
RulesofBinaryMultiplication
0 x 0 =0
0 x 1 =0
1 x 0 =0
1 x 1 =1,andnocarryorborrowbits
************************************************
BINARYCODES
Explain the various codes used in digital systems with an example.(or)Explain in detail about Binary
codes with an example
In digital systems a variety of codes are used to serve different purposes, such as data entry,
arithmetic operation, error detection and correction, etc.
Selection of a particular codedepends on the requirement.
Binarycodesarecodeswhicharerepresentedinbinarysystemwithmodification from the original ones.
Codes can be broadly classified into five groups.
(i) Weighted Binary Codes
(ii) Non-weighted Codes
(iii) Error-detection Codes
(iv) Error-correcting Codes
(v) Alphanumeric Codes
Weighted Binary Codes
If each position of a number represents a specific weight then the coding scheme is called weighted
binary code.
BCD Code or 8421 Code:
The full form of BCD is ‘Binary-Coded Decimal’. Since this is a coding scheme relating decimal and
binary numbers, four bits are required to code each decimal number.
B.ARUNKUMAR, Asst. Prof.,/ECE Page 10
A decimal number in BCD (8421) is the same as its equivalent binary number only when the number
is between 0 and 9. A BCD number greater than 10 looks different from its equivalent binary
number, even though both contain 1’s and 0’s. Moreover,the binary combinations 1010 through 1111
are not used and have no meaning in BCD.
Consider decimal 185 and its corresponding value in BCD and binary:
For example, (35)10 is represented as 0011 0101 using BCD code, rather than (100011)2
Example: Give the BCD equivalent for the decimal number 589.
The decimal number is 5 8 9
BCD code is 0101 1000 1001
Hence, (589)10 = (010110001001)BCD
2421 Code:
Another weighted code is 2421 code. The weights assigned to the four digits are 2, 4,2, and 1.
The 2421 code is the same as that in BCD from 0 to 4. However, it varies from5 to 9.
For example, in this case the bit combination 0100 represents decimal 4; whereas the bit combination
1101 is interpreted as the decimal 7, as obtained from 2 × 1 + 1 × 4+ 0 × 2 + 1 × 1 = 7.
This is also a self- complementary code.
BCD Addition:
Examples:
Consider the addition of 184 + 576 = 760 in BCD:
Add the following BCD numbers: (a) 1001 and 0100, (b) 00011001 and 00010100
Example:
Binary toGray CodeConversion:
Any binary number can be converted into equivalent Gray code by the following steps:
i) the MSB of the Gray code is the same as the MSB of the binary number;
ii) the second bit next to the MSB of the Gray code equals the Ex-OR of the MSB and second bit of
the binary number; it will be 0 if there are same binary bits or it will be 1 for different binary
bits;
iii) the third bit for Gray code equals the exclusive-OR of the second and third bits of the binary
number, and similarly all the next lower order bits follow the same mechanism.
Errordetectingcodes
Whendataistransmittedfromonepointtoanother,likeinwirelesstransmission, or
itisjuststored, likeinharddisksandmemories,therearechancesthatdata maygetcorrupted.
Todetectthesedata errors,weusespecialcodes,whichareerrordetection codes.
Twotypes ofparity
Evenparity:Checksifthereisanevennumberofones;ifso,paritybitiszero.Whenthenumberof
one’sisoddthenparitybitissetto 1.
OddParity:Checksifthereisanoddnumberofones;ifso,paritybitiszero. Whenthenumberof
one’siseventhenparitybitis set to 1.
Errorcorrectingcode
Error-correctingcodesnotonlydetecterrors,butalsocorrectthem.
Thisisused normallyinSatellite communication,whereturn-arounddelayisveryhighasisthe
Hamming codes
Hammingcodeaddsaminimumnumberofbitstothedatatransmitted inanoisychannel,tobeableto
correct everypossible one-bit error.
It candetect(not correct)two-biterrorsandcannotdistinguish between1-bitand2-bits
inconsistencies. Itcan't- ingeneral-detect 3(ormore)-bits errors.
Alphanumeric Codes
An alphanumeric code is a binary code of a group of elements consisting of ten decimal digits,
the 26 letters of the alphabet (both in uppercase and lowercase), and a certain number of special
symbols such as #, /, &, %, etc.
EBCDIC codes
EBCDICstandsforExtendedBinary CodedDecimalInterchange.
It is also an alphanumeric code generally used in IBM equipment and in large computersfor
communicating alphanumeric data.
For the different alphanumeric characters the code grouping in this code is different from the
ASCII code. It is actually an 8-bit code and a ninth bit is added as the parity bit.
******************************************************
Duality Principle:
The duality principle states that every algebraic expression deducible from the postulates of
Boolean algebra remains valid if the operators and identity elements are interchanged. If the dual of an
algebraic expression is desired, we simply interchange OR and AND operators and replace 1’s b y 0’s
and 0’s by 1’s.
DeMorgan’s theorem:
1. The complement of product is equal to the sum of their complements. (X.Y)’=X’+Y’
2. The complement of sum is equal to the product of their complements. (X+Y)’ = X’.Y’
Basic Theorems:
State and prove postulates and theorems of Boolean algebra.
Boolean algebra is an algebra that deals with binary variables and logic operations. A Boolean
function described by an algebraic expression consists of binary variables, the constants 0 and 1, and
the logic operation symbols.
For a given value of the binary variables, the function can be equal to either 1 or 0.
Complement of a function:
The complement of a function F is obtained from an interchange of 0’s for 1’sand 1’s for 0’s in the
value of F.
Example:
1.
3. Find the complement of the functions F1 = x’yz’ + x’y’z and F2 = x(y’z’ + yz) by taking their
duals and complementing each literals.
Solution:
****************************************************
Canonical and Standard forms:
Explain canonical SOP & POS form with suitable example.
Binary logic values obtained by the logical functions and logic variables are in binary form. An
arbitrary logic function can beexpressed in the following forms.
(i) Sum of the Products (SOP)
(ii) Product of the Sums (POS)
Boolean functions expressed as a sum of minterms or product of maxterms are said to be in
canonical form.
Product term:
The AND function is referred to as a product. The variable in a product term can appear either in
complementary or uncomplimentary form. Example: ABC’
Sum term:
The OR function is referred to as a Sum. The variable in a sum term can appear either in
complementary or uncomplimentary form. Example: A+B+C’
Sum of Product (SOP):
The logical sum of two or more logical product terms is called sum of product expression. It is
basically an OR operation of AND operated variables. Example: Y=AB+BC+CA
Product of Sum (POS):
The logical product of two or more logical sum terms is called product of sum expression. It is
basically an AND operation of OR operated variables. Example: Y=(A+B).(B+C).(C+A)
Maxterm:
A sum term containing all the K variables of the function in either complementary or
uncomplimentary form is called Maxterm or standard sum.
Example:Obtain the canonical sum of product form of the following function. (May 2014)
*********************************
Using Boolean algebra to simplify Boolean expressions can be difficult. The Karnaugh map provides
a simple and straight- forward method of minimizing Boolean expressions which represent
combinational logic circuits.
A Karnaugh map is a pictorial method of grouping together expressions with common factors and
then eliminating unwanted variables.
A Karnaugh map is a two-dimensional truth-table. Note that the squares are numbered so that the
binary representations for the numbers of two adjacent squares differ in exactly one position.
If A is a variable that has value 0 in all of the squares in the grouping, then the complemented
form A is in the product term.
If A is a variable that has value 1 in all of the squares in the grouping, then the true form A is in
the product term.
K-Maps of 2 Variables:
K-Maps of 3 Variables:
Simplify the boolean function F (x, y, z) =
The Karnaugh map uses the following rules for the simplification of expressions by grouping
together adjacent cells containing ones
There should be as few groups as possible, as long as this does not contradict any of
the previous rules.
Summmary:
1. No zeros allowed.
2. No diagonals.
3. Only power of 2 numbers of cells in each group.
4. Groups should be as large as possible.
5. Everyone must be in at least one group.
6. Overlapping allowed.
7. Wrap around allowed.
8. Fewest numbers of groups possible.
In certain digital systems, some input combinations never occur during the process of normal
operation because those input conditions are guaranteed never to occur. Such input combinations are
don’t care conditions.
If a function is completely specified, it assumes the value 1 for some input combinations and the
value 0 for others.
There are functions which assume the value 1 for some combinations and 0 for some other and
either 0 or 1 for the remaining combinations. Such a functions are called incompletely specified .
Prime Implicants:
**************************************
From the set of prime implicants, a set of essential implicants must be determined by
preparing a prime implicant chart.
The minterm which are not covered by the essentia l implicants are taken into
consideration and a minimum cover is obtained from the remaining prime implicants.
Step:1
Step:4
*************************************************
Logic gates
Explain about different types of logic gates.(OR) What are Universal gates? Construct any four
basic gates using only NOR gates and using only NAND gates. (May 2011)[NOV – 2019]
A logic gate is an idealized or physical device implementing a Boolean function; that is, it performs
a logical operation on one or more logical inputs, and produces a single logical output.
Universal Gates
The OR, AND and NOT gates are the three basic logic gates as they together can be used to
construct the logic circuit for any given Boolean expression.
The NOR and NAND gates have the property that they individually can be used to hardware-
implement a logic circuit corresponding to any given Boolean expression.
That is, it is possible to use either only NAND gates or only NOR gates to implement any
Boolean expression. This is so because a combination of NAND gates or a combination of NOR
gates can be used to perform functions of any of the basic logic gates. It is for this reason that
NAND and NOR gates are universal gates.
NAND–NOR implementations:
AND gate:
AND gate:
OR gate:
NAND–NOR implementations:
Digital circuits are frequently constructed with NAND or NOR gates rather than with AND and
OR gates.
NAND and NOR gates are easier to fabricate with electronic components and are the basic gates
used in all IC digital logic families.
Because of the prominence of NAND and NOR gates in the design of digital c ircuits, rules and
procedures have been developed for the conversion from Boolean functions given in terms of
AND, OR, and NOT into equivalent NAND and NOR logic diagrams.
2. Implement the following Boolean function with NAND gates:F (x, y, z) = (1, 2, 3, 4, 5, 7) (Apr
2018)
COMBINATIONAL CIRCUITS
A combinational circuit consists of logic gates whose outputs at any time are determined from only the
present combination of inputs.
A combinational circuit performs an operation that can be specified logically by a set of Boolean
functions.
Sequential circuits:
Sequential circuits employ storage elements in addition to logic gates. Their outputs are a function of
the inputs and the state of the storage elements.
Because the state of the storage elements is a function of previous inputs, the outputs of a sequential
circuit depend not only on present values of inputs, but also on past inputs, and the circuit behavior must
be specified by a time sequence of inputs and internal states.
ANALYSIS PROCEDURE
Explain the analysis procedure. Analyze the combinational circuit the following logic diagram.
(May 2015)
The analysis of a combinational c ircuit requires that we determine the function that
the c ircuit implements.
The analysis can be performed manua lly by f inding the Boolean functions or t ruth
table or by using a computer s imulation program.
The f irs t step in the analys is is to make that the g iven c ircuit is combinational or
sequential.
Once the logic d iagram is verified to be combinational, one can proceed to obtain the
output Boolean functions or the t ruth table.
To obtain the output Boolean functions from a logic diagram,
Label all gate outputs that are a function of input variables with arbitrary symbols or names.
Determine the Boolean functions for each gate output.
Label the gates that are a function of input variables and previously labeled gates with other
arbitrary symbols or names. Find the Boolean functions for these gates.
Repeat the process in step 2 until the outputs of the circuit are obtained.
By repeated substitution of previously defined functions, obtain the output Boolean functions in
terms of input variables.
Page 1
Logic diagram for analysis example
Proceed to obtain the truth table for the outputs of those gates which are a function of previously
defined values until the columns for all outputs are determined.
Page 2
DESIGNPROCEDURE
Explain the procedure involved in designing combinational circuits.
The design of combinational circuits starts from the specification of the design objective and
culminates in a logic circuit diagram or a set of Boolean functions from which the logic diagram can be
obtained.
The procedure involved involves the following steps,
From the specifications of the circuit, determine the required number of inputs and outputs and assign
a symbol to each.
Derive the truth table that defines the required relationship between inputs and outputs.
Obtain the simplified Boolean functions for each output as a function of the input variables.
Draw the logic diagram and verify the correctness of the design.
**************************************************
Half adder:
Construct a half adder with necessary diagrams. (Nov-06,May- 07)
A half-adder is an arithmetic circuit block that can be used to add two bits and produce two outputs
SUM and CARRY.
The Boolean expressions for the SUM and CARRY outputs are given by the equations
Truth Table:
*************************
Page 3
Page 4
Full adder:
Design a full adder using NAND and NOR gates respectively. (Nov -10)
A Full-adder is an arithmetic circuit block that can be used to add three bits and produce two outputs
SUM and CARRY.
The Boolean expressions for the SUM and CARRY outputs are given by the equations
Truth table:
Karnaugh map:
Logic diagram:
Page 5
The Boolean expressions of S and C are modified as follows
****************************
Page 6
Half subtractor:
Design a half subtractor circuit. (Nov-2009)
A half-subtractor is a combinational circuit that can be used to subtract one binary digit from anotherto
produce a DIFFERENCE output and a BORROW output.
The BORROW output here specifies whether a ‘1 ’ has been borrowed to perform the subtraction. The
Boolean expression for difference and borrow is:
Logic diagram:
*************************************
Full subtractor:
Page 7
K-Map:
*************************************
Page 8
Parallel Binary Adder: (Ripple Carry Adder):
Explain about four bit adder. (or) Design of 4 bit binary adder – subtractor circuit. (Apr – 2019)
A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers. It can be
constructed with full adders connected in cascade, with the output carry from each full adder connected
to the input carry of the next full adder in the chain.
Addition of n-bit numbers requires a chain of n- full adders or a chain of one-half adder and n-1 full
adders. In the former case, the input carry to the least significant position is fixed at 0.
Figure shows the interconnection of four full-adder (FA) circuits to provide a four-bit binary ripple carry
adder.
The carries are connected in a chain through the full adders. The input carry to the adder is C0, and it
ripples through the full adders to the output carry C4. The S outputs generate the required sum bits.
Example: Consider the two binary numbers A = 1011and B = 0011. Their sum S = 1110 is formed with
the four-bit adder as follows:
The carry output of lower order stage is connected to the carry input of the next higher order stage.
Hence this type of adder is called ripple carry adder.
In a 4-bit binary adder, where each full adder has a propagation delay of tp ns, the output in the fourth
stage will be generated only after 4tp ns.
The magnitude of such delay is prohibitive for high speed computers.
One method of speeding up this process is look-ahead carry addition which eliminates ripple carry
delay.
**********************************
Complement of a number:
1’s comple ment:
The 1’s complement of a binary number is formed bychanging 1 to 0 and 0 to 1.
Example:
1. The 1’s complement of 1011000 is 0100111.
2. The 1’s complement of 0101101 is 1010010.
Page 9
2’s comple ment:
The 2’s complement of a binary number is formed by adding 1 with 1’s complement of a binary
number.
Example:
1. The 2’s complement of 1101100 is 0010100
2. The 2’s complement of 0110111 is 1001001
****************************
The subtraction of unsigned binary numbers can be done most conveniently by meansof compleme nts.
The subtraction A - B canbe done by taking the 2’s complement of B and adding it to A . The 2’s
complement canbe obtained by taking the 1’s complement and adding 1 to the least significant pair
Page 10
ofbits. The 1’s complement can be implemented with inverters, and a 1 can be added tothe sum through
the input carry.
The circuit for subtracting A - B consists of an adder with inverters placed betweeneach data input B and
the corresponding input of the full adder. The input carry C in mustbe equal to 1 when subtraction is
performed. The operation thus performed becomes A,plus the 1’s complement of B , plus 1. This is equal
to Aplus the 2’s complement of B.
For unsigned numbers, that gives A-B if A>=B or the 2’s complement of B - Aif A <B. For signed
numbers, the result is A - B, provided that there is no overflow.
****************************
Consider the circuit of the full adder shown in Fig. If we define two new binaryvariables
Gi is called a carry generate, and it produces a carry of 1 when both Ai and Bi are 1,regardless of
the input carry Ci. Pi is called a carry propagate, because it determines whether a carry into stage i will
propagate into stage i + 1 (i.e., whether an assertion of Ci will propagate to an assertion of Ci+1 ).
We now write the Boolean functions for the carry outputs of each stage and substitutethe value
of each Ci from the previous equations:
Page 11
The construction of a four-bit adder with a carry lookahead scheme is shown in Fig.
Each sum output requires two exclusive-OR gates.
The output of the first exclusive-OR gate generates the Pi variable, and the AND gate generates the Gi
variable.
The carries are propagated through the carry look ahead generator and applied as inputs to the second
exclusive-OR gate.
All output carries are generated after a delay through two levels of gates.
Thus, outputs S1 through S3 have equal propagation delay times. The two- level circuit for the output
carry C4 is not shown. This circuit can easily be derived by the equation-substitution method.
Page 12
******************************
4 bit-Parallel adder/subtractor:
Explain about binary parallel / adder subtractor. [NOV – 2019]
The addition and subtraction operations can be combined into one circuit with one common binary adder
by including an exclusive-OR gate with each full adder. A four-bit adder–subtractor circuit is shown in
Fig.
The mode input M controls the operation. When M = 0, the circuit is an adder, and when M = 1, the
circuit becomes a subtractor.
Page 13
It performs the operations of both addition and subtraction.
It has two 4bit inputs A3A2A1A0 and B3B2B1B0.
The mode input M controls the operation when M=0 the circuit is an adder and when M=1 the circuits
become subtractor.
Each exclusive-OR gate receives input M and one of the inputs of B .
When M = 0, we have B xor0 = B. The full adders receive the value of B , the input carry is 0, and the
circuit performs A plus B . This results in sum S3S2S1S0and carry C4.
When M = 1, we have B xor 1 = B’ and C0 = 1. The B inputs are all complemented and a 1 is added
through the input carry thus producing 2’s complement of B.
Now the data A3A2A1A0will be added with 2’s complement of B3B2B1B0to produce the sum i.e., A-B if
A≥B or the 2’s complement of B-A if A<B.
*************************
Comparators
Design a 2 bit magnitude comparator. (May 2006)
It is a combinational circuit that compares two numbers and determines their relative magnitude. The
output of comparator is usually 3 binary variables indicating:
A<B, A=B, A>B
1-bitcomparator: Let’s begin with 1bit comparator and from the name we can easily make out that this
circuit would be used to compare 1bit binary numbers.
Page 14
A B A>B A=B A<B
0 0 0 1 0
1 0 1 0 0
0 1 0 0 1
1 1 0 1 0
For a 2-bit comparator we have four inputs A1 A0 and B1 B0 and three output E (is 1 if two numbers are
equal) G (is 1 when A>B) and L (is 1 when A<B) If we use truth table and K-map the result is
Page 15
Truth table:
K-Map:
Page 16
Logic Diagram:
********************
Input
Page 17
Function Equation
*************************
Page 18
BCD Adder:
Design to perform BCD addition.(or) What is BCD adder? Design an adder to perform arithmetic
addition of two decimal bits in BCD. (May -08)(Apr 2017,2018)[Nov – 2019]
Consider the arithmetic addition of two decimal digits in BCD, together with an input carry from a
previous stage. Since each input digit does not exceed 9, the output sum cannot be greater than 9 + 9 + 1
= 19, the 1 in the sum being an input carry.
Suppose we apply two BCD digits to a four-bit binary adder. The adder will form the sum in binary and
produce a result that ranges from 0 through 19. These binary numbers are listed in Table and are labeled
by symbols K, Z8, Z4, Z2, and Z1. K is the carry, and the subscripts under the letter Z represent the
weights 8, 4, 2, and 1 that can be assigned to the four bits in the BCD code.
Page 19
A BCD adder that adds two BCD digits and produces a sum digit in BCD is shown in Fig. The two
decimal digits, together with the input carry, are first added in the top four-bit adder to produce the
binary sum.
When the output carry is equal to 0, nothing is added to the binary sum. When it is equal to 1, binary
0110 is added to the binary sum through the bottom four-bit adder.
The condition for a correction and an output carry can be expressed by the Boolean function
C = K + Z8Z4 + Z8Z2
The output carry generated from the bottom adder can be ignored, since it supplies information already
available at the output carry terminal.
A decimal parallel adder that adds n decimal digits needs n BCD adder stages. The output carry from
one stage must be connected to the input carry of the next higher order stage.
******************************
Binary Multiplier:
Explain about binary Multiplier.
Multiplication of binary numbers is performed in the same way as multiplication of decimal numbers.
The multiplicand is multiplied by each bit of the multiplier, starting from the least significant bit. Each
such multiplication forms a partial product.
Successive partial products are shifted one position to the left. The final product is obtained from the
sum of the partial products.
A combinational circuit binary multiplier with more bits can be constructed in a similar fashion.
A bit of the multiplier is ANDed with each bit of the multiplicand in as many levels as there are bits in
the multiplier.
The binary output in each level of AND gates is added with the partial product of the previous level to
form a new partial product. The last level produces the product.
Page 20
*************************************
Page 21
CODE CONVERSION
Design a binary to gray converter. (Nov-2009)(Nov
2017) Binary to Grayconverter
Truth Table
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
G3=B3 G2=B3’B2+B3B2’=B3 B2
Page 22
K-MAP FORG1: K-MAP FORG0:
Logic diagram:
Page 23
Truth Table:
K-Map:
Page 24
Logic Diagram:
Page 25
Truth table:
K-Map:
Page 26
Logic Diagram
Truth table:
Page 27
Page 28
Page 29
Design Binary to BCD converter.
Truth table:
K-map:
Page 30
Logic diagram:
******************************
Page 31
DECODERS AND ENCODERS
Decoder:
Explain about decoders with necessary diagrams. (Apr 2018)(Nov 2018)
A decoder is a combinational circuit that converts binary information from n input lines to a maximum
of 2n unique output lines. If the n -bit coded information has unused combinations, the decoder may
have fewer than 2n outputs.
The purpose of a decoder is to generate the 2n (or fewer) minterms of n input variables, shown below for
two input variables.
2 to 4 decoder:
3 to 8 Decoder:
Design 3 to 8 line decoder with necessary diagram. May -10)
Truth table:
Page 32
Logic diagram:
Not that the two to four decoder design shown earlier, with its enable inputs can be used to build a
three to eight decoder as follows.
Page 33
Implementation of Boolean function using decoder:
Since the three to eight decoder provides all the minterms of three variables, the realisation of a
function in terms of the sum of products can be achieved using a decoder and OR gates as follows.
Sum is given by ∑m(1, 2, 4, 7) while Carry is given by ∑m(3, 5, 6, 7) as given by the minterms
each of the OR gates are connected to.
Design for 4 to 16 decoder using 3 to 8 decoder: Design 5 to 32 decoder using 3 to 8 and 2 to 4 decoder:
**********************************
Page 34
Truth table:
K-Map:
Page 35
Logic Diagram:
The specification above requires that the output be zeroes (none of the segments are lighted up) when
the input is not a BCD digit.
In practical implementations, this may defer to allow representation of hexadecimal digits using the
seven segments.
**************************
Page 36
Encoder:
Explain about encoders. (Nov 2018)
An encoder is a digital circuit that performs the inverse operation of a decoder. An encoder has 2 n (or
fewer) input lines and n output lines. The output lines, as an aggregate, generate the binary code
corresponding to the input value.
The encoder can be implemented with OR gates whose inputs are determined directly from the truth
table. Output z is equal to 1 when the input octal digit is 1, 3, 5, or 7.
Output y is 1 for octal digits 2, 3, 6, or 7, and output x is 1 for digits 4, 5, 6, or 7. These conditions can
be expressed by the following Boolean output functions:
Truth table:
Another ambiguity in the octal-to-binary encoder is that an output with all 0’s is generated when all the
inputs are 0; but this output is the same as when D0 is equal to 1. The discrepancy can be resolved by
providing one more output to indicate whether at least one input is equal to 1.
Page 37
Logic Diagram:
************************
Priority Encoder:
Design a priority encoder with logic diagram.(or) Explain the logic diagram of a 4 – input priority
encoder. (Apr – 2019)
A priority encoder is an encoder circuit that includes the priority function. The operationof the
priority encoder is such that if two or more inputs are equal to 1 at the same time,the input having the
highest priority will take precedence.
Truth table:
Page 38
K-Map:
Logic Equations:
Logic diagram:
*******************************************
Page 39
MULTIPLEXERS AND DEMULTIPLEXERS
Multiplexer: (MUX)
Design a 2:1 and 4:1 multiplexer.
A multiplexer is a combinational circuit that selects binary information from one of many input lines
and directs it to a single output line. The selection of a particular input line is controlled by a set of
selection lines.
Normally, there are 2n input lines and n selection lines whose bit combinations determine which input is
selected.
2 to 1 MUX:
A 2 to 1 line multiplexer is shown in figure below, each 2 input lines A to B is applied to one input of an
AND gate. Selection lines S are decoded to select a particular AND gate. The truth table for the 2:1 mux
is given in the table below.
To derive the gate level implementation of 2:1 mux we need to have truth table as shown in figure. And
once we have the truth table, we can draw the K- map as shown in figure for all the cases when Y is
equal to '1'.
Truth table:
Logic Diagram:
Page 40
4 to 1 MUX:
A 4 to 1 line multiplexer is shown in figure below, each of 4 input lines I0 to I3 is applied to one input
of an AND gate.
Selection lines S0 and S1 are decoded to select a particular AND gate.
The truth table for the 4:1 mux is given in the table below.
Logic Diagram:
Truth Table:
SELECT OUTPUT
INPUT
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
Problems :
Example: Implement the Boolean expression using MUX
F(A,B,C,D) = ∑m(0,1,5,6,8,10,12,15) (Apr 2017, Nov 2017)
Page 41
Example: Implement the boolean function using Multiplexer. [NOV – 2019]
F (x, y, z) = Σm (1, 2, 6, 7)
Solution:
Implementation table:
Multiplexer Implementation:
Example: 32:1 Multiplexer using 8:1 Mux (Nov 2018) (Apr – 2019)
Page 42
DEMULTIPLEXERS:
Explain about demultiplexers.
The de- multiplexer performs the inverse function of a multiplexer, that is it receives information on
one line and transmits its onto one of 2n possible output lines.
The selection is by n input select lines. Example: 1-to-4 De- multiplexer
INPUT OUTPUT
E D S0 S1 Y0 Y1 Y2 Y3
1 1 0 0 1 0 0 0
1 1 0 1 0 1 0 0
1 1 1 0 0 0 1 0
1 1 1 1 0 0 0 1
Page 43
Example:
1. Implement full adder using De-multiplexer.
***************************
Page 44
Parity Checker / Generator:
A parity bit is an extra bit included with a binary message to make the number of 1’s either odd or
even. The message, including the parity bit, is transmitted and then checked at the receiving end for
errors. An error is detected if the checked parity does not correspond with the one transmitted.
The circuit that generates the parity bit in the transmitter is called a parity generator. The circuit that
checks the parity in the receiver is called a parity checker.
In even parity system, the parity bit is ‘0’ if there are even number of 1s in the data and the parity bit
is ‘1’ if there are odd number of 1s in the data.
In odd parity system, the parity bit is ‘1’ if there are even number of 1s in the data and the parity bit
is ‘0’ if there are odd number of 1s in the data.
Logic Diagram:
Page 45
4- bit Even parity checker:
Truth Table:
Logic Diagram:
INTRODUCTION TO HDL
In electronics, a hardware description language or HDL is any language from a class of computer
languages and/or programming languages for formal description of digital logic and electronic circuits.
HDLs are used to write executable specifications of some piece of hardware.
A simulation program, designed to implement the underlying semantics of the language statements,
coupled with simulating the progress of time, provides the hardware designer with the ability to model a
piece of hardware before it is created physically.
Logic synthesis is the process of deriving a list of components and their interconnection (called net list)
from the model of a digital system.
Logic Simulation is the representation of the structure and behavior of a digital logic synthesis through
the use of a computer.
The standard HDLs that supported by IEEE.
VHDL (very High Speed Integrated Circuit HDL)
Verilog HDL
Page 46
HDL MODELS OF COMBINATIONAL CIRCUITS
The Verilog HDL model of a combinational circuit can be described in any one of the following
modeling styles,
Gate level modeling- using instantiations of predefined and user defined primitive gates.
Dataflow modeling using continuous assignment with the keyword assign.
Behavioral modeling using procedural assignment statements with the keyword always.
In this type, a circuit is specified by its logic gates and their interconnections. Gate level modeling
provides a textual description of a schematic diagram. The verilog HDL includes 12basic gates as
predefined primitives. They are and, nand, or, nor, xor, xnor, not &buf.
Data flow modeling of combinational logic uses a number of operators that act on operands to produce
desired results. Verilog HDL provides about 30 different operators. Data flow modeling uses continuous
assignments and the keyword assign. A continuous assignment is a statement that assigns a value to a
net. The data type family net is used to represent a physical connection between circuit elements.
Page 47
Behavioral modeling
Behavioral modeling represents digital circuits at a functional and algorithmic level. It is used mostly to
describe sequential circuits, but can also be used to describe combinational circuits.
Behavioral descriptions use the keyword always, followed by an optional event control expression and a
list of procedural assignment statements.
Page 48
UNIT III
SYN CHRONOUS SEQUENTIAL LOGIC
Sequential Circuits - Storage Elements: Latches , Flip-Flops - Analysis of Clocked Sequential Circuits - State
Reduction and Assignment - Design Procedure - Registers and Counters - HDL Models of Sequential
Circuits
SEQUENTIAL CIRCUITS
Sequential circuits:
Sequential circuits employ storage elements in addition to logic gates. Their outputs are a function of
the inputs and the state of the storage elements.
Because the state of the storage elements is a function of previous inputs, the outputs of a sequential
circuit depend not only on present values of inputs, but also on past inputs, and the circuit behavior
must be specified by a time sequence of inputs and internal states.
Page 1
A storage element in a digital circuit can maintain a binary state indefinitely (as long as power is
delivered to the circuit), until directed by an input signal to switch states.
The major differences among various types of storage elements are in the number of inputs they
possess and in the manner in which the inputs affect the binary state.
Latch:
The storage elements that operate with signal levels (rather than signal transitions) are referred to as
latches; those controlled by a clock transition are flip-flops.Latches are said to be level sensitive
devices; flip-flops are edge-sensitive devices.
Realize SR Latch using NOR and NAND gates and explain its operation.
The SR latch is a circuit with two cross-coupled NOR gates or two cross-coupled NAND gates, and
two inputs labeled S for set and R for reset.
The SR latch constructed with two cross-coupled NOR gates is shown in Fig.
The latch has two useful states. When output Q = 1 and Q‟= 0, the latch is said to be in the set state .
When Q = 0 and Q‟ = 1, it is in the reset state . Outputs Q and Q‟ are normally the complement of
each other.
However, when both inputs are equal to 1 at the same time, a condition in which both outputs are
equal to 0 (rather than be mutually complementary) occurs.
If both inputs are then switched to 0 simultaneously, the device will enter an unpredictable or
undefined state or a metastable state. Consequently, in practical applications, setting both inputs to 1
is forbidden.
Page 2
FLIP FLOPS
Triggering of Flip Flops:
Explain about triggering of flip flops in detail.
The state of a latch or flip-flop is switched by a change in the control input. This momentary change
is called a trigger, and the transition it causes is said to trigger the flip-flop.
Level Triggering:
SR, D, JK and T latches are having enable input.
Latches are controlled by enable signal, and they are level triggered, either positive level triggered or
negative level triggered as shown in figure (a).
The output is free to change according to the input values, when active level is maintained at the
enable input.
Edge Triggering:
A clock pulse goes through two transitions: from 0 to 1 and the return from 1 to 0.
As shown in above Fig (b) and (c)., the positive transition is defined as the positive edge and the
negative transition as the negative edge.
*******************************
Explain the operation of flipflops.(Nov 2017)
The purpose is to convert a given type A FF to a desired type B FF using some conversion logic.
Page 3
The key here is to use the excitation table, which shows the necessary triggering signal (S,R, J,K, D
The table is then completed by writing the values of S and R required to get each Qp+1 from the
corresponding Qp. That is, the values of S and R that are required to change the state of the flip flop from
Qp to Qp+1 are written.
Page 4
2. JK Flip Flop to SR Flip Flop
This will be the reverse process of the above explained conversion. S and R will be the external
inputs to J and K. As shown in the logic diagram below, J and K will be the outputs of the combinational
circuit. Thus, the values of J and K have to be obtained in terms of S, R a nd Qp. The logic diagram is
shown below.
A conversion table is to be written using S, R, Qp, Qp+1, J and K. For two inputs, S and R, eight
combinations are made. For each combination, the corresponding Qp+1 outputs are found. The outputs
for the combinations of S=1 and R=1 are not permitted for an SR flip flop. Thus the outputs are
considered invalid and the J and K values are taken as “don‟t cares”.
Page 5
3. SR Flip Flop to D Flip Flop
As shown in the figure, S and R are the actual inputs of the flip flop and D is the external input of
the flip flop. The four combinations, the logic diagram, conversion table, and the K-map for S and R in
terms of D and Qp are shown below.
Page 6
5. JK Flip Flop to T Flip Flop
J and K are the actual inputs of the flip flop and T is taken as the external input for conversion.
Four combinations are produced with T and Qp. J and K are expressed in terms of T and Qp. The
conversion table, K- maps, and the logic diagram are given below.
Page 7
*******************************************
MEALY AND MOORE MODELS
Moore machine:
In the Moore model, the outputs are a function of present state only.
Mealy machine:
In the Mealy model, the outputs are a function of present state and external inputs.
Page 8
Difference between Moore model and Mealy model.
Example:
A sequential circuit with two ‘D’ Flip-Flops A and B, one input (x) and one output (y).
The Flip-Flop input functions are:
DA= Ax+ Bx
DB= A’xand
the circuit output function is, Y= (A+ B) x’.
(a) Draw the logic diagram of the circuit, (b) Tabulate the state table, (c) Draw the state diagram.
Solution:
Page 9
State table:
State diagram:
***************************************
*****************************************
COUNTERS
Counter:
A counter is a register (group of Flip-Flop) capable of counting the number of clock pulse
arriving at its clock input.
A counter that follows the binary number sequence is called a binary counter.
Counter are classified into two types,
1. Asynchronous (Ripple) counters.
2. Synchronous counters.
Page 10
In ripple counter, a flip- flop output transition serves as clock to next flip-flop.
o With an asynchronous circuit, all the bits in the count do not all change at the same time.
In a synchronous counter, all flip-flops receive common clock.
o With a synchronous circuit, all the bits in the count change synchronously with the
assertion of the clock
A counter may count up or count down or count up and down depending on the input control.
Uses of Counters:
The most typical uses of counters are
To count the number of times that a certain event takes place; the occurrence of event to be
counted is represented by the input signal to the counter
To control a fixed sequence of actions in a digital system
To generate timing signals
To generate clocks of different frequencies
Page 11
At the fourth clock pulse Flip-Flop A triggers, therefore QA changes from 1 to 0, This triggers
FlipFlop B therefore QB changes from 1 to 0. The change in QB from 1 to 0 triggers C Flip-Flop,
Therefore QC changes from 0 to 1. Therefore QA=QB=QD=0, QC=1.
QDQCQBQA=0100
Truth table:
Page 12
Timing diagram:
**********************************
Modulo 16 /4 bit Ripple Down counter/ Asynchronous Down counter
Explain about Modulo 16 /4 bit Ripple Down counter.
The output of down-counter is decremented by one for each clock transition.
A 4-bit asynchronous down-counter consists of 4JK Flip-Flops.
The external clock signal is connected to the clock input of the first Flip-Flop.
The clock inputs of the remaining Flip-Flops are triggered by the Q output of the previous stage.
Page 13
We know that in JK Flip-Flop, if J=1 , K=1 and clock is triggered the past output will be
complemented.
During the first clock pulse, Flip-Flop A triggers, therefore QA changes from 0 to 1 also QA
changes from 1 to 0.This triggers Flip-Flop B, therefore QB changes from 0 to 1, also QB changes
from 1 to 0which triggers Flip-FlopC. Hence QC changes from 0 to 1 and QC changes from 1 to
0, which further triggers, Flip-Flop D.
QDQCQBQA=1111
QD QC QB QA=0000
During the second clock pulse Flip-Flop A triggers, therefore QA changes from 1 to 0 also QA
changes from 0 to 1 which never triggers B Flip-Flop. Therefore C and D Flip-Flop are not
triggered.
QDQCQBQA =1110
The same procedure repeats until the counter decrements upto 0000.
Page 14
Page 15
***************************
Page 16
Asynchronous Up/Down Counter:
Explain about Asynchronous Up/Down counter.
The up-down counter has the capability of counting upwards as well as downwards. It is also
called multimode counter.
In asynchronous up-counter, each flip-flop is triggered by the normal output Q of the preceding
flip- flop.
In asynchronous down counter, each flip-flop is triggered by the complement output Q of the
preceding flip- flop.
In both the counters, the first flip- flop is triggered by the clock output.
If Up/Down =1, the 3-bit asynchronous up/down counter will perform up-counting. It will count
from 000 to 111. If Up/Down =1 gates G2 and G4 are disabled and gates G1 and G3 are enabled.
So that the circuit behaves as an up-counter circuit.
If Up/Down =0, the 3-bit asynchronous up/down counter will perform down-counting. It will
count from 111 to 000. If Up/Down =0 gates G 2 and G4 are enabled and gates G1 and G3 are
disabled. So that the circuit behaves as an down-counter circuit.
******************************
Page 17
Page 18
4- bitSynchronous up-counter:
Explain about 4-bit Synchronous up-counter.
In JK Flip-Flop, If J=0, K=0 and clock is triggered, the output never changes. If J=1 and K=1 and
the clock is triggered, the past outpit will be complemented.
Initially the register is cleared QDQCQBQA= 0000.
During the first clock pulse, JA= KA = 1, QA becomes 1, QB, QC, QD remains 0.
QDQCQBQA= 0001.
During second clock pulse, JA= KA = 1, QA=0.
JB= KB = 1, QB =1, QC, QD remains 0.
QDQCQBQA= 0010.
During third clock pulse, JA= KA = 1, QA=1.
JB= KB = 0, QB =1, QC, QD remains 0.
QDQCQBQA= 0011.
During fourth clock pulse, JA= KA = 1, QA=0.
JB= KB = 1, QB =0
JC= KC = 1, QC=1
QD remains 0
QDQCQBQA= 0100.
The same procedure repeats until the counter counts up to 1111.
Page 19
*******************************************
Page 20
4- bit Synchronous down-counter:
Explain about 4-Bit Synchronous down counter.
In JK Flip-Flop, If J=0, K=0 and clock is triggered, the output never changes. If J=1 and K=1 and the
clock is triggered, the past outpit will be complemented.
Initially the register is cleared QDQCQBQA= 0000
QDQCQBQA= 1111
************************************
Page 23
Modulo 8 Synchronous Up/Down Counter:
Explain about Modulo 8 Synchronous Up/Down Counter.
In synchronous up-counter the QA output is given to JB, KBand QA. QB is given to JC, KC. But in
synchronous down –counter QAoutput is given toJB, KB and QA. QB is given to JC, KC.
If Up/Down =1, the 3-bit asynchronous up/down counter will perform up-counting. It will count from
000 to 111. If Up/Down =1 gates G2 and G4 are disabled and gates G 1 and G3 are enabled. So that the
circuit behaves as an up-counter circuit.
If Up/Down =0, the 3-bit asynchronous up/down counter will perform down-counting. It will count from
111 to 000. If Up/Down =0 gates G2 and G4 are enabled and gates G1 and G3 are disabled. So that the
circuit behaves as an down-counter circuit.
*******************************************
Page 24
Page 25
******************************************
DESIGN OF RIPPLE COUNTERS
3-Bit Asynchronous Binary Counter/ modulo -7 ripple counter:
Design a 3-bit binary counter using T-flip flops. [NOV – 2019]
Explain about 3-Bit Asynchronous binary counter. (Nov -2009)
The following is a three-bit asynchronous binary counter and its timingdiagram for one cycle. It
works exactly the same way as a two-bitasynchronous binary counter mentioned above, except it has
eight statesdue to the third flip- flop.
Asynchronous counters are commonly referred to as ripple counters forthe following reason: The
effect of the input clock pulse is first “felt” byFFO. This effect cannot get to FF1 immediately because of
thepropagation delay through FF0. Then there is the propagation delaythrough FF1 before FF2 can be
Page 26
triggered. Thus, the effect of an inputclock pulse “ripples” through the counter, taking some time, due
topropagation delays, to reach the last flip- flop.
**********************************
ANALYSIS OF CLOCKED SEQUENTIAL CIRCUIT
Design and analyze of clocked sequential circuit with an example.
The analysis of a sequential circuit consists of obtaining a table or a diagram for the time sequence of
inputs, outputs and internal states.
Consider the sequential circuit is shown in figure. It consists of two D flip- flops A and B, an input x and
an output y.
A state equation specifies the next state as function of the present state and inputs.
A(n +1)= A(n )x (n )+B(n )x (n )
B(n +1)= A (n )x (n)
They can be written in simplified form
as, A(n+1) = Ax +Bx
B(n +1) = Ax
Page 27
The present state value of the output can be expressed algebraically as,
y(n) =(A+ B) x
State Diagram:
State diagram is the graphical representation of the information available in a state table.
In state diagram, a state is represented by a circle and the transitions between states are indicated by
directed lines connecting the circles.
State Table:
A state table gives the time sequence of inputs, outputs ad flip flops states. The table consists of
four sections labeled present state, next state, input and output.
The present state section shows the states of flip flops A and B at any given time „n‟. The
input section gives a value of x for each possible present state.
The next state section shows the states of flip flops one clock cycle later, at time n+1.
The state table for the circuit is shown. This is derived using state equations.
Page 28
The above state table can also be expressed in different forms as follows.
Page 29
The flip flop input equations for the circuit is given by,
DA =Ax +Bx
DB =A x
**************************************
****************************************
Design of a Synchronous Decade Counter Using JK Flip- Flop (Apr 2018, Nov 2018)
A synchronous decade counter will count from zero to nine and repeat thesequence.
State diagram:
The state diagram of this counter is shown in Fig.
Excitation table:
K-Map:
Page 30
Page 31
Logic Diagram:
*************************************
Page 32
**************************************
Truth table:
K-Map:
Page 33
Logic Diagram:
SHIFT REGISTERS
Explain various types of shift registers. (or) Explain the operation of a 4-bit bidirectional shift
register. (Or) What are registers? Construct a 4 bit register using D-flip flops and explain the
operations on the register.(or) With diagram explain how two binary numbers are added serially using
shift registers. (Apr – 2019)[NOV – 2019]
A register is simply a group of Flip-Flops that can be used to store a binary number.
There must be one Flip-Flop for each bit in the binary number.
For instance, a register used to store an 8-bit binary number must have 8 Flip-Flops.
Page 34
The Flip-Flops must be connected such that the binary number can be entered (shifted) into the
register and possibly shifted out.
A group of Flip-Flops connected to provide either or both of these functions is called a shift register.
A register capable of shifting the binary information held in each cell to its neighboring cell in
a selected direction is called a shift register.
As seen, it accepts data serially .i.e., one bit at a time on a single input line. It produces the stored
information on its single output also in serial form.
Data may be shifted left using shift left register or shifted right using shift right register.
Page 35
As shown in above figure,the clock pulse is applied to all the flip-flops simultaneously.
The output of each flip-flop is connected to D input of the flip- flop at its right.
Each clock pulse shifts the contents of the register one bit position to the right.
New data is entered into stage A whereas the data presented in stage D are shifted out.
For example, consider that all stages are reset and a steady logical 1 is applied to the serial input
line.
When the first clock pulse is applied, flip- flop A is set and all other flip-flops are reset.
When the second clock pulse is applied,the „1‟ on the data input is shifted into flip-flop A and
„1‟ that was in flip flop A is shifted to flip- flop B.
This continues till all flip-flop sets.
The data in each stage after each clock pulse is shown in table below
Page 36
The clock is applied to all the flip- flops simultaneously. The output of each flip-flop is connected
to D input of the flip- flop at its left.
Each clock pulse shifts the contents of the register one bit position to the left.
Let us illustrate the entry of the 4-bit binary number 1111 into the register beginning with the
right most bit.
When the first clock pulse is applied, flip flop A is set and all other flip- flops are reset.
When second clock pulse is applied, ‟1‟ on the data input is shifted into flip-flop A and „1‟ that
was in flip flop A is shiftedtoflip- flop B. This continues fill all flip- flop are set.
The data in each stage after each clock pulse is shown in table below.
Page 37
It consists of one serial input and outputs are taken from all the flip- flops simultaneously.
The output of each flip- flop is connected to D input of the flip- flop at its right. Each clock pulse
shifts the contents of the register one bit position to the right.
For example, consider that all stages are reset and a steady logical „1‟ is applied to the serial
input line.
When the first clock pulse is applied flip flop A is set and all other flip- flops are reset.
When the second pulse is applied the „1‟ on the data input is shifted into flip flop A and „1‟ that
was in flip flop A is shifted into flip- flop B. This continues till all flip- flops are set. The data in
each stage after each clock pulse is shown in table below.
Page 38
When SHIFTS/LOAD is low, gates G1 through G3 are enabled, allowing the data at parallel
inputs to the D input of its respective flip- flop. When the clock pulse is applied the flip- flops
with D=1 will set and those with D=0 will reset, thereby storing all four bits simultaneously.
When SHIFT/LOADis high. AND gates G1 through G3 are disabled and gates G4 through G6are
enabled, allowing the data bits to shifts right from one stage to next. The OR gates allow either
the normal shifting operation or the parallel data entry operation, depending on which AND gates
are enabled by the level on the SHIFT/LOAD input.
Page 39
Page 40
When SHIFT/LOAD is low, gates G1 through G3 are enabled, allowing the data at parallel inputs
to the D input of its respective flip- flop. When the clock pulse is applied, the flip- flops with D
=1 willset those with D=0 will reset thereby storing all four bits simultaneously. These are
immediately available at the outputs QA,QB,QC and QD.
When SHIFT/LOAD is high, gates G1, through G3 are disabled and gates G4 through G6 are
enabled allowing the data bits to shift right from one stage to another. The OR gates allow either
the normal shifting operation or the parallel data entry operation, depending on which AND gates
are enabled by the level on the SHIFT/LOAD input.
**************************************
Page 41
Page 42
3. A shift right control to enable the shift right operation and the associated serial input
and output lines.
4. A shift left control to enable the shift left operation and the associated serial input and
output lines.
5. A parallel load control to enable a parallel transfer and the n input lines.
6. n parallel output lines.
7. A control state that leaves the information in the register unchanged in the presence of
the clock.
The diagram of 4-bit universal shift register that has all that capabilities listed above is shown in
figure. It consists of four D flip-flop and four multiplexers.Allthe multiplexers have two common
selection inputs S1 and S0. Input 0 is selected when S1S0=00, input 1 is selected when S1S0=01
and similarly for other two inputs.
Page 43
The selection inputs control the mode of operation of the register. When S1S0=00, the present
value of the register is applied to the D inputs of the flip- flop. The next clock pulse transfers
into each flip-flop the binary value it held previously, and no change of state occurs.
When S1S0=01,terminal 1 of the multiplexer inputs has a path to be the D inputs of the flip- flops.
This causes a shift right operation, with the serial input transferred into flip-flop A3.
When S1S0=10, a shift left operation results with the other serial input going into flip- flop A0.
Finally, when S1 S0 = 11, the binary information on the parallel input lines is transferred into the
register simultaneously during the next clock edge. The function table is shown below.
****************************************
SHIFT REGISTER COUNTERS:
Explain about Johnson and Ring counter. (Nov 2018)
Most common shift register counters are Johnson counter and ring counter.
Johnson counter:
A 4 bit Johnson counter using D flip- flop is shown in figure. It is also called shift counter or
twisted counter.
The output of each flip-flop is connected to D input of the next stage. The inverted output of last
flip- flop QDis connected to the D input of the first flip-flop A.
Initially, assume that the counter is reset to 0. i.e., Q A QB QC QD =0000. The value at DB =
DC=DD=0, whereas DA =1 since QD.
Page 44
Page 45
When the first clock pulse is applied, the first flip- flop A is set and the other flip- flops are reset.
i.e., QA QB QC QD =1000.
When the second clock pulse is applies, the counter is QA QB QC QD = 1100. This continues and
the counter will fill up with 1‟s from left to right and then it will fill up with 0‟s again.
The sequence of states is shown in the table. As observed from the table, a 4-bit shift counter has
8 states. In general, an n-flip-flop Johnson counter will result in 2n states.
Ring Counter:
Page 46
As shown in figure, the true output of flip- flop D. i.e., QD is connected back to serial input of flip-
flop A.
Initially, 1 preset into the first flip-flop and the rest of the flip- flops are cleared i.e.,
QAQBQCQD=1000.
When the first clock pulse is applied, the second flip- flop is set to 1while the other three flip
flops are reset to 0.
When the second clock pulse is applied, the „1‟ in the second flip-flop is shifted to the third flip-
flop and so on.
The truth table which describes the operation of the ring counter is shown below.
As seen a 4-bit ring counter has 4 states. In general, an n-bit ring counter has n states. Since a
single „1‟ in the register is made to circulate around the register, it is called a ring counter. The
timing diagram of the ring counter is shown in figure.
Page 47
***********************************
Page 48
Page 49
Page 50
Page 51
Page 52
Page 53
Test Bench:
Page 54
Write the VHDL Code for 4-Bit Binary Up Counter and explain. (Apr 2019)
VHDL Code for 4-Bit Binary Up Counter
The clock inputs of all the flip-flops are connected together and are triggered by the input pulses. Thus,
all the flip-flops change state simultaneously (in parallel).
libraryieee;
use ieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityvhdl_binary_counter is
port(C, CLR : in std_logic;
Q : out std_logic_vector(3 downto 0));
endvhdl_binary_counter;
architecturebhv of vhdl_binary_counter
is signaltmp: std_logic_vector(3 downto
0); begin
process (C,
CLR) begin
if (CLR=‟1′) then
tmp<= "0000";
elsif (C‟event and C=‟1′) then
tmp<= tmp + 1;
Page 55
end if;
end process;
Q <= tmp;
Page 56
UNIT IV
ASYNCHRONOUS SEQUENTIAL LOGIC
Analysis and Design of Asynchronous Sequential Circuits – Reduction of State and FlowTables – Race-free State
Assignment – Hazards.
Draw the block diagram of a typical asynchronous sequential circuit and explain. Also write the
procedure for obtaining transition table from circuit diagram of an asynchronous sequential circuit.
[Nov – 2019]
Sequential circuits without clock pulses are called Asynchronous Sequential Circuits. They are
classified into 2 types:
1. Fundamental mode circuits
2. Pulse mode circuits
Fundamental Mode Circuits:
It assumes that:
The input variables should change only when the circuit is stable.
Only one input variable can change at a given instant of time.
Inputs and outputs are represented by levels
. Page1
The communication oftwo units, with each unithavingits own independent clock, must be donewith
asynchronous circuits.
Stable state:
If the circuit reaches a steady state condition with present state yi = next state Yi for i=1,2,3…K
then the circuit is said to be stable state. A transition from one stable to another occurs only in response
to a change in an input variable.
Unstable state:
In a circuit,ifpresent state yi ≠ next state Yi for i=1,2,3…K then the circuit is said to be unstable
state. The circuit will be in continuous transition till it reached a stable state.
**************************************
ANALYSISPROCEDURE OF FUNDAMENTAL MODE SEQUENTIAL CIRCUITS
Explain in detail about analysis procedure of fundamental mode sequential circuits. (or) Outline the
procedure for analyzing asynchronous sequential circuits. (Apr 2019) (Dec2011)
The analysis of asynchronous sequential circuits consists of obtaining a table or a diagram that
described the sequence of internal states and outputs as a function of changes in the input
variables.
Let us consider the asynchronous sequential circuit is shown in figure.
The analysis of the circuit starts by considering the excitation variables (Y1 and Y2) as outputs and
the secondary variables (y1 and y2) as inputs.
Step1:
The Boolean expressions
are, Y1= xy1 +xꞌy2
Y2= x y1ꞌ+xꞌy2
Step 2:
Thenext step is to plottheY1and Y2 functions in amap
. Page2
Combiningthe binaryvalues in correspondingsquares, the followingtransition table is obtained.
ThetransitiontableshowsthevalueofY=Y1Y2insideeachsquare.ThoseentrieswhereY=yarecircled to
indicateastable condition.
The circuit has four stable total states, y1y2 x=000,011,110, and 101 and four unstable total
states- 001, 010, 111 and 100.
The state table of the circuit is shown below:
The transition table is a table which gives the relation between present state, input and next
. Page3
state. If the secondary variables y1 y2 is same as excitation variables Y1 Y2, the state is said to be stable.
The stable states are indicated by circles. An uncircled entry represents an unstable state.
In a transition table, usually there will be at least one stable state in each row. Otherwise,
all the states in that row will be unstable.
Step 4:
Primitive Flowtable
Ina flow table thestatesarenamed bylettersymbols. Examples of flow tables areas follows:
A cycle occurs when an asynchronous circuit makes a transition through a series of unstable state.
When a state assignment is made so that it introduces cycles, care must be taken that it
terminates with a stable state.
Otherwise, the circuit will go from one unstable state to another, until the inputs are changed.
Examples of cycles are:
. Page4
RaceConditions
Araceconditionexistsinanasynchronouscircuitwhentwoormorebinary state variableschangevalue
inresponsetoachangeinaninputvariable.
Whenunequaldelaysare encountered,araceconditionmay cause thestatevariableto changein an
unpredictable manner.
Ifthe final stable statethat the circuitreachesdoes not depend on the orderin which
thestatevariables change, theraceis calledanoncritical race.
Ifthe final stable statethat the circuitreachesdepends on the orderin which thestatevariables
change, theraceis calleda critical race.
Examples of noncritical racesareillustratedin the transition tables below:
Initial stable state is y1y2x = 000 and then input changes from 0 to 1.
The state variables y1y2 must change from 00 to 11,(race
condition). Possible transitions are
00 11
00 01(y2 faster) 11
00 10(y1 faster) 11
In all cases final stable state is same, which results in a non-critical race condition.
Examples of critical racesareillustratedin the transition tables below:
. Page5
Fig: Examples ofcritical races
The initial stable state is y1y2 x=000 and let us consider that the input changes from 0 to 1. Then ,
the state variables must change from 00 to 11.
If they change simultaneously, the final total state is 111.
Due to unequal propagation delay, if y2 changes to 1 before y1 does, then the circuit goes to total
stable state y1y2 x=011 and remains there.
If y1 changes first, then the circuit will be in total stable state is y1y2 x=101.
Hence the race is critical because the circuit goes to different stable states depending on the order
in which the state variables change.
**************************
CIRCUITSWITH SRLATCHES
TheSRlatchisusedasatime-delayelementinasynchronoussequentialcircuits.TheNORgateSRlatch and
its truth table are:
. Page6
TheBoolean function ofthe output is:
The behavior of the SR latch can be investigated from the transition table. The condition to
be avoided is that both S and R inputs must not be 1 simultaneously.
This condition is avoided when SR = 0 (i.e., ANDing of S and R must always result in 0). When
SR = 0 holds at all times, the excitation function derived previously:
. Page7
Fig: SR latchwith NAND gates
TheconditiontobeavoidedhereisthatbothSandRnotbe0simultaneouslywhichissatisfiedwhenS′R′=0.
The excitation functionforthe circuitis:
. Page8
Fig: Example ofa circuit with SR latches
The first step is to obtain the Booleanfunctions forthe S and R inputs in each latch:
The next step is to derive the transition table of the circuit. The excitation functions are derived from the
relation Y = S + R′y as:
. Page9
Investigation of the transition table reveals that the circuit is stable.
There is a critical race condition when the circuit is initially in total state y1y2x1x2 = 1101 and x2
changes from 1 to 0.
If Y1 changes to 0 before Y2, the circuit goes to total state 0100 instead of 0000.
***************************
SR LatchExcitationTable:
FromtheinformationgiveninthetransitiontableandtheSRlatchexcitationtable,wecanobtainmaps forthe S
and R inputs of thelatch:
. Page10
X represents a don’tcarecondition.
Themaps arethen used to derivethe simplifiedBoolean functions:
ThelogicdiagramconsistsofanSRlatchandgatesrequiredtoimplementtheSandRBoolean functions.
The circuitwhen aNOR SR latch is usedis as shown below:
DESIGNPROCEDURE
Explain in detail about design procedure. May
2011 Thereareanumberofstepsthatmustbecarriedoutinordertominimizethecircuitcomplexityandto
produceastable circuitwithoutcritical races.Briefly, thedesign steps areas follows:
Obtain a primitive flow table from thegivenspecification.
Reducethe flow table bymerging rows inthe primitive flow table.
Assign binarystates variables to eachrowof the reduced flowtable to obtain thetransition table.
Assign outputvalues to thedashes associated with the unstable states to obtainthe output maps.
Simplifythe Boolean functions of the excitation and output variables and draw the
logic diagram.
Thedesign process will be demonstrated bygoingthrough aspecificexample:
Designagatedlatchcircuitwithtwoinputs,G(gate)andD(data),andoneoutputQ.Thegatedlatchis amemory
. Page11
elementthatacceptsthevalueofDwhenG=1andretainsthisvalueafterGgoesto0.Once G =0, a change in D
does notchangethe valueofthe output Q.
(Or)
Design an asynchronous sequential circuit with two inputs D and G with one output Z. Whenever G is
1, input D is transferred to Z. When G is 0, the output does not change for any change in D. Use SR
latch for implementation of the circuit.
PrimitiveFlowTable
Aprimitiveflowtableisaflowtablewithonlyonestabletotalstateineachrow.Thetotalstateconsists ofthe
internal statecombined with the input.
To derivethe primitive flow table, first a tablewithallpossible total states in thesystem is
needed:
. Page12
. Page13
Reduction of primitive flow table:
Two or more rows in the primitive flow table can be merged into one row if there are non-
conflicting states and outputs on each of the columns.
This can be done by implication table and merger diagram.
The implication table has all states except the first vertically and all states except the last across
bottom horizontally.
The tick ( ) mark denotes that the pair (rows) is compatible.
Two states are compatible, if the states are identical with non-conflicting outputs.
The cross (x) mark implies non-compatible.
Merger Diagram:
The maximum compatible sets can be obtained from merger diagram as shown in figure.
The merger diagram is a graph in which each state is represented by a dot placed along the
circumference of a circle.
Lines are drawn between any two corresponding dot that form a compatible pair.
Based on the geometrical patterns formed by the lines, all the possible compatibilities can be
obtained.
. Page14
An isolated dot represents a state that is not compatible with any other state.
A line represents a compatible pair.
A triangle constitutes a compatible with three states.
An n-state compatible is represented in the merger diagram by an n-sided polygon with all its
diagonal connected.
So, the maximal compatibilities are
(a,b) , (a,c,d) , (b,e,f)
. Page15
A race free binary assignment is made and transition table and
output map is obtained.
a -> 0, b-> 1
. Page16
************************
Design an asynchronous sequential circuit that has two inputs X2 and X1 and one output Z. the output
is to remain a 0 as long as X1 is 0. The first change in X2 that occurs while X1 is a 1 will cause output Z
to be 1. The output Z will remain 1 until Xreturns to 0. (Apr 2018)
Step 1:
. Page17
Step 3: A reduced flow table is obtained using implication table and merger diagram.
Step 4: In order to avoid critical race, one more stable state is added and values are assigned for states.
. Page18
Step 5: The transition table and output maps are as follows:
. Page19
***********************************
Design an asynchronous sequential circuit with inputs X1 and X2 and one output Z. Initially and at
any time if both the inputs are 0, output is equal to 0. When X 1 and X2 becomes 1, Z becomes 1.
When second input also becomes 1, Z = 0; The output stays at 0 until circuit goes back to initial
state.
Step 1:
. Page20
Step 3: A reduced flow table is obtained using Implication table and merger diagram.
The compatible pairs are (a,b) (a,c) (b,c) (b,e) (c,f) (d,e) (d,f) (e,f).
Merger Diagram:
. Page21
(c,f) and (b,e) can be removed. Since the remaining terms themselves cover all six states.
**********************************
Practice Problems:
. Page22
Design a sequential circuit with two D flip flops A and B and one input X. When X = 0, the state
of the circuit remains the same. When X = 1, the circuit goes through the state transitions from 00
to 10 to 11 to 01, back to 00 and then repeats. (Apr 2019)
*************************************
REDUCTION OFSTATE AND FLOW TABLES
Explain in detail about reduction of state and flow tables. Dec.2012
The procedure for reducing the number of internal states in an asynchronous sequential circuit
resembles the procedurethat is used forsynchronous circuits.
Considerfor examplethestatetableshowninabovetable.
Thepresentstatesaandbhavethesame outputforthesameinput.
Theirnextstatesarec anddforx=0andband aforx=1.
Ifwe canshow thatthe pair of states(c,d) are equivalent,thenthe pair ofstates(a
,b) willalsobeequivalent,because they willhavethesameorequivalentnextstates.
Whenthisrelationshipexists,wesaythat(a.b)imply (c,d)inthesensethatifaandbare
equivalentthenranddhavetobeequivalent.
Similarly,fromthe lasttworowsofabovetable,wefindthatthepairofstales(c,d)implies
thepairofstates(a,b).
The characteristicofequivalentstatesisthatif(a,b)imply (c,d)and(c,d)imply (a,b),thenbothpairsof
statesare equivalentthatis,aandbare equivalent,andsoare candd.
Asaconsequence,thefour rows oftable can bereduced to tworows bycombining a and b into onestate
. Page23
and c and d into asecond state.
The implicationtableisshowninFig.Ontheleftsidealongtheverticalarelistedallthestates
definedinthestatetableexceptthefirstandacrossthebottomhorizontallyarelistedallthestates exceptthelast.
Theresultisadisplayofallpossiblecombinationsoftwostareswithasquareplacedin
theintersectionofarowandacolumnwhere thetwostatescanbetestedfor equivalence.Twostates
havingdifferent outputs forthe same input arenot equivalent.
. Page24
Merging oftheFlowTable
Incompletelyspecifiedstatescanbecombinedtoreducethenumberofstateintheflowtable.Such stares
cannotbe called equivalentbecause theformaldefinitionof equivalencerequiresthatalloutputs and
nextstatesbe specified forallinputs.
Instead, twoincompletely specified states that can be
combinedaresaidtobeCompatible.Theprocessthatmustbeappliedinordertofindasuitablegroup of
compatibles forthe purpose ofmerging a flow table can bedivided into threesteps:
1. Determine allcompatible pairs byusingthe implication table.
2. Find themaximal compatibles with the useof amergerdiagram.
3. Find a minimal collection of compatibles that covers allthe states andis closed.
CompatiblePairs-
Theentriesineachsquareofprimitiveflowtablerepresentthenextstate
andoutputThedashesrepresenttheunspecifiedstatesoroutputs.
Theimplicationtable
isusedtofmdcompatiblestatesjustasitisusedtofindequivalentstalesinthecompletely
specifiedcase.Theonly
differenceisthat,whencomparingrows,weareatlibertytoadjustthedashestofitany desired condition.
. Page25
The compatiblepairsare,
MaximalCompatibles
. Page26
Themaximal compatiblesof fig (a)are
(b)are
Closed-Covering Condition
Theconditionthatmustbesatisfiedformergingrowsisthatthesetofchosencompatiblesmustcover
allthestatesandmustbeclosed.
Thesetwillcoverallthestatesifitincludesallthestatesofthe originalstatetable.The closureconditionis
satisfiedifthereare noimpliedstatesorif theimplied states are
includedwithintheset.Aclosedsetofcompatiblesthatcoversallthestatesiscalledaclosed covering.
***********************************
Explain in detail about race -free state assignment. May 2012,Dec. 2014
Once areducedflow tablehasbeenderivedfor anasynchronoussequentialcircuit,thenextstepinthe
designistoassignbinary variablestoeachstablestate.
Thisassignmentresultsinthetransformationof
theflowtableintoitsequivalenttransitiontable.Theprimaryobjectiveinchoosing aproperbinary state
assignmentisthepreventionofcriticalraces.
. Page27
Criticalracescanbeavoidedbymakingabinarystate assignmentinsuchawaythatonly
onevariablechangesatanygiventimewhenastatetransitionoccurs in the flow table.
. Page28
Three-RowFlow-Table Example
Toavoidcriticalraces,wemustfindabinarystateassignmentsuchthatonly onebinaryvariable
changesduring eachstatetransition.
Anattempttofindsuchanassignmentisshowninthetransition diagram.Statea isassignedbinary
00,andstatecisassignedbinary 11.
Thisassignmentwillcausea
criticalraceduringthetransitionfromatocbecausetherearetwochangesinthebinary statevariables
andthetransitionfromatocmay occurdirectlyorpassthroughb.
Notethatthetransitionfromctoaalsocausesaracecondition,butitisnoncriticalbecausethetransitiondoesn
otpassthroughother states
Fig: Transitiontable
Four-RowFlow-Table Example
A flow tablewith four rows requiresaminimum of two statevariables.
Although arace- freeassignment issometimespossiblewithonly twobinary
statevariables,inmany casestherequirementofextrarows to avoid critical races willdictate
theuse of threebinarystate variables
Fig:Four-rowflow-table example
Thefollowing figureshowsastateassignmentmapthatissuitableforany four-
rowflowtable.Statesa, b,canddaretheoriginalstatesande,fandgareextrastates.
Thetransitionfromatodmustbe directedthroughtheextrastateetoproduceacyclesothatonly
onebinaryvariablechangesatatime.
Similarly,thetransitionfromctoaisdirectedthroughgandthetransitionfromdtocgoesthroughf.
Byusingtheassignmentgivenby themap,thefour-rowtablecanbeexpandedtoaseven-rowtablethat is
freeofcritical races.
. Page30
Fig: Choosing extrarowsfor theflowtable
Notethatalthoughtheflowtablehas sevenrowsthereareonlyfourstablestates.
Theuncircledstatesin the three extra rowsaretheremerelyto providearace- freetransition between
thestablestates.
. Page31
Fig:Multiple rowassignment
Therearetwobinary statevariablesforeachstablestate,eachvariablebeingthelogicalcomplementof the
other.
Forexample,the originalstatea is replacedwithtwoequivalentstates a1=000anda2=111.
Theoutputvalues,notshownheremustbethesameina1anda2.
Notethata1 isadjacenttob1,c2and d1,anda2 isadjacenttoc1,
b2andd2,andsimilarlyeachstateisadjacenttothreestateswithdifferent letterdesignations.
Theexpandedtableisformedbyreplacingeachrowoftheoriginaltablewithtworows.Inthemultiple-
rowassignment,thechange fromonestablestate10another willalwayscauseachangeofonly one
binarystate variable.
Each stable stalehastwo binaryassignmentswith exactlythe sameoutput.
***********************************
Practice Problems:
A sequential Circuit with two D flip flops A and B, two inputs X and Y, and one output Z is
specified by the following input equations:
A( t + 1) = x’y + xA
B( t + 1) = x’B + xA
Z=B
Draw the logic diagram of the circuit. Derive the state table and state diagram and state whether it
is a Mealy or a Moore machine. (Apr 2019)
***************************
HAZARDS
Discuss about the possible hazards and methods to avoid them in combinational circuits. (or) Explain
in detail about hazards. May 2011, Dec. 2013, Apr 2017, Nov 2017, Apr 2018, Nov 2018, Apr 2019
. Page32
Hazardsareunwantedswitchingtransientsthatmay appearattheoutputofacircuitbecausedifferent
pathsexhibitdifferentpropagationdelays.
Hazardsoccurincombinationalcircuits,wheretheymay causeatemporary falseoutputvalue.But
inasynchronous sequentialcircuits hazardsmay resultin a transitionto awrongstable state.
Types of Hazards
Static Hazard
Dynamic Hazard
Essential Hazard
Static Hazard
Static Hazard is a condition which results in a single momentary incorrect output due to change in
a single input variable when the output is expected to remain in the same state.
The static hazard may be either static-0 or Static -1.
Assumethatallthreeinputsareinitially equalto1.Thiscausestheoutputofgate110be1,thatofgate
2tobe0andthatofthecircuittobe1.Nowconsiderachangeinx2from1to0.
. Page33
momentarilygoto0ifthepropagationdelaythroughtheinverteristakenintoconsideration.
Thedelay in theinvertermaycausetheoutput ofgate1 to changeto 0 beforethe output of gate2
changes to1.
Thetwo circuits shown in Figimplement theBoolean function in sum-of-products form:
This type of implementation may cause the output to go to 0 when it should remain a 1. If however,
theCircuit is implemented instead in product-of-sums form namely,
then the output may momentarily go to 1 when it should remain 0. The first case is referred to a
static1-hazard and the second case as static 0-hazard.
Athirdtypeofhazard,knownasdynamichazard,causestheoutputtochangethreeormoretimes
when itshould changefrom1 to 0 or from 0 to 1.
. Page34
. Page35
general,hazardsincombinationalcircuitscanberemoved by coveringany twomintermsthatmay
producea hazardwithaproducttermcommontoboth.
Theremovalofhazardsrequirestheadditionof redundantgates to thecircuit.
Hazards in SequentialCircuits
Innormalcombinational-circuitdesignassociatedwithsynchronoussequentialcircuits,hazardsareof
noconcern,sincemomentaryerroneoussignalsare notgenerallytroublesome.
However,ifamomentary incorrectsignalisfed backinanasynchronoussequentialcircuit,itmay
causethecircuittogotothe wrongstable state.
. Page36
andthecircuitwillswitchtotheincorrecttotalstablestate 010.
Thismalfunctioncanbe eliminatedby adding an extragate.
Essential Hazards
Essentialhazardiscausedby unequaldelaysalongtwoormorepathsthatoriginatefromthesame input.
Anexcessivedelaythroughaninvertercircuitincomparisontothedelayassociatedwiththe feedback path
maycausesuchahazard.
Essentialhazards cannotbecorrectedby addingredundantgatesasinstatichazards.The problemthat they
imposecanbecorrectedbyadjustingtheamountofdelay intheaffectedpath.
Toavoidessential
hazards,eachfeedbackloopmustbehandledwithindividualcaretoensurethatthedelayinthe
feedbackpathislongenoughcomparedwithdelaysofothersignalsthatoriginate fromtheinput terminals.
***********************************
. Page37
. Page38
. Page39
*********************
. Page40
Problems on hazards: (Nov 2018)
. Page41
. Page42
. Page43
. Page44
. Page45
UNIT V MEMORY AND PROGRAMMABLE LOGIC 12
51 INTRODUCTION
A memory unit is a collection of storage cells with associated circuits needed
to transfer information in and out of the device The binary information is transferred
for storage and from which information is available when needed for processing
When data processing takes place, information from the memory is transferred to
selected registers in the processing unit Intermediate and final results obtained in the
processing unit are transferred back to be stored in memory
1
Programmable Logic Devices, Memory
The location of a unit of data in a memory array is called its address For
example, in Figure (a), the address of a bit in the 3-dimensional array is specified by
the row and column In Figure (b), the address of a byte is specified only by the row
in the 2-dimensional array So, as you can see, the address depends on how the
memory is organized into units of data Personal computers have random-access
memories organized in bytes This means that the smallest group of bits that can be
addressed is eight
2
Programmable Logic Devices, Memory
The capacity of a memory is the total number of data units that can be stored
For example, in the bit-organized memory array in Figure (a), the capacity is 64 bits
In the byte-organized memory array in Figure (b), the capacity is 8 bytes, which is
also 64 bits Computer memories typically have 256 MB (megabyte) or more of
internal memory
Since a memory stores binary data, data must be put into the memory and
data must be copied from the memory when needed The write operation puts data
into a specified address in the memory, and the read operation copies data out of a
specified address in the memory The addressing operation, which is part of both the
write and the read operations, selects the specified memory address
Data units go into the memory during a write operation and come out of the
memory during a read operation on a set of lines called the data bus As indicated
in Figure, the data bus is bidirectional, which means that data can go in either
directional (into the memory or out of the memory)
3
Programmable Logic Devices, Memory
To store a byte of data in the memory, a code held in the address register is
placed on the address bus Once the address code is on the bus, the address decoder
decodes the address and selects the specified location in the memory The memory
then gets a write command, and the data byte held in the data register is placed on
the data bus and stored in the selected memory address, thus completing the write
operation When a new data byte is written into a memory address, the current data
byte stored at that address is overwritten (replaced with a new data byte)
A code held in the address register is placed on the address bus Once the
address code is on the bus, the address decoder decodes the address and selects the
specified location in the memory The memory then gets a read command, and a
"copy" of the data byte that is stored in the selected memory address is placed on the
data bus and loaded into the data register, thus completing the read operation When
a data byte is read from a memory address, it also remains stored at that address
This is called nondestructive read
4
Programmable Logic Devices, Memory
56 Classification of Memories
There are two types of memories that are used in digital systems:
5
Programmable Logic Devices, Memory
Classification of memories
RAMs are read/write memories in which data can be written into or read
from any selected address in any sequence When a data unit is written into a given
address in the RAM, the data unit previously stored at that address is replaced by
the new data unit When a data unit is read from a given address in the RAM, the
data unit remains stored and is not erased by the read operation This nondestructive
read operation can be viewed as copying the content of an address while leaving the
content intact
A RAM is typically used for short-term data storage because it cannot retain
stored data when power is turned off
The two categories of RAM are the static RAM (SRAM) and the dynamic
RAM (DRAM) Static RAMs generally use flip-flops as storage elements and can
therefore store data indefinitely as long as dc power is applied Dynamic
RAMs use capacitors as storage elements and cannot retain data very long without
the capacitors being recharged by a process called refreshing Both SRAMs and
DRAMs
will lose stored data when dc power is removed and, therefore, are classified as
volatile memories
Data can be read much faster from SRAMs than from DRAMs However,
DRAMs can store much more data than SRAMs for a given physical size and cost
because the DRAM cell is much simpler, and more cells can be crammed into a given
chip area than in the SRAM
6
Programmable Logic Devices, Memory
Storage Cell:
The cell is selected by an active level on the Select line and a data bit (l or 0) is
written into the cell by placing it on the Data in line A data bit is read by taking it
off the Data out line
The memory cells in a SRAM are organized in rows and columns All the cells
in a row share the same Row Select line Each set of Data in and Data out lines go to
each cell in a given column and are connected to a single data line that serves as
both an input and output (Data I/O) through the data input and data output buffers
SRAM chips can be organized in single bits, nibbles (4 bits), bytes (8 bits), or
multiple bytes (16, 24, 32 bits, etc) The memory cell array is arranged in 256 rows
and
128 columns, each with 8 bits as shown below There are actually 215 = 32,768
addresses and each address contains 8 bits The capacity of this example memory is
32,768 bytes (typically expressed as 32 Kbytes)
7
Programmable Logic Devices, Memory
Operation:
The SRAM works as follows First, the chip select, CS, must be LOW for the
memory to operate Eight of the fifteen address lines are decoded by the row decoder
to select one of the 256 rows Seven of the fifteen address lines are decoded by the
column decoder to select one of the 128 8-bit columns
Read:
In the READ mode, the write enable input, WE‘ is HIGH and the output
enable, OE‗ is LOW The input tri state buffers are disabled by gate G1, and the
column output tristate buffers are enabled by gate G2 Therefore, the eight data bits
from the selected address are routed through the column I/O to the data lines (I/O 1
through I/O7), which are acting as data output lines
Write:
In the WRITE mode, WE‘ is LOW and OE‘ is HIGH The input buffers are
enabled by gate G1, and the output buffers are disabled by gate G2 Therefore the
eight input data bits on the data lines are routed through the input data control and
the column I/O to the selected address and stored
8
Programmable Logic Devices, Memory
During each read cycle, one unit of data, a byte in this case is read from
the memory
For the write cycle shown in Figure (b), a valid address code is applied to the
address lines for a specified time interval called the write cycle time, tWE Next,
the chip select (CS) and the write enable (WE) in puts go LOW The required time
interval from the beginning of a valid address until the WE input goes LOW is called
the address setup time, t s(A) The time that the WE input must be LOW is the
write pulse width The time that the input WE must remain LOW after valid data are
applied to the data inputs is designated t WD; the time that the valid input data must
remain on the data lines after the WE input goes HIGH is the data hold time, t h(D)
During each write cycle, one unit of data is written into the memory
9
Programmable Logic Devices, Memory
10
Programmable Logic Devices, Memory 511
and connect the HIGH (1) to the associated column lines
ROM Cells
At row/column junctions where there are no gate connections, the column lines
remain LOW (0) when the row is addressed
5622 PROM (Programmable Read-Only Memory)
A PROM uses some type of fusing process to store bits, in which a memory
link is burned open or left intact to represent a 0 or a 1 The fusing process is
irreversible; once a PROM is programmed, it cannot be changed
The fusible links are manufactured into the PROM between the source of
each cell's transistor and its column line In the programming process, a sufficient
current is injected through the fusible link to bum it open to create a stored O The
link is left intact for a stored 1 All drains are commonly connected to VDD
11
Programmable Logic Devices, Memory
Three basic fuse technologies used in PROMs are metal links, silicon
links, and pn junctions A brief description of each of these follows
1. Metal links are made of a material such as nichrome Each bit in the memory
array is represented by a separate link During programming, the link is either
"blown" open or left intact This is done basically by first addressing a given cell
and then forcing a sufficient amount of current through the link to cause it to
open When the fuse is intact, the memory cell is configured as a logic 1 and
when fuse is blown (open circuit) the memory cell is logic 0
12
Programmable Logic Devices, Memory
Two basic types of erasable PROMs are the ultraviolet erasable PROM (UV
EPROM) and the electrically erasable PROM (EEPROM)
x UV EPROM:
You can recognize the UV EPROM device by the transparent quartz lid on the
package, as shown in Figure below The isolated gate in the FET of an ultraviolet
EPROM is "floating" within an oxide insulating material The programming process
causes electrons to be removed from the floating gate Erasure is done by exposure
of the memory array chip to high-intensity ultraviolet radiation through the quartz
window on top of the package
The positive charge stored on the gate is neutralized after several minutes to an
hour of exposure time In EPROM‘s, it is not possible to erase selective information,
when erased the entire information is lost The chip can be reprogrammed
During programming, address and datas are applied to address and data pins
of the EPROM The program pulse is applied to the program input of the EPROM
The program pulse duration is around 50msec and its amplitude depends on
EPROM IC It is typically 115V to 25V
The EEPROM (Electrically Erasable PROM), also uses MOS circuitry Data is
stored as charge or no charge on an insulating layer, which is made very thin (<
200Å) Therefore a voltage as low as 20- 25V can be used to move charges across the
thin barrier in either direction for programming or erasing ROM
13
Programmable Logic Devices, Memory
Advantages of ROM:
14
Programmable Logic Devices, Memory
Disadvantages of ROM:
SNo RAM RO M
RAMs have both read and write
1 ROMs have only read operation capability
1 It contains less memory cells It contains more memory cells per unit area
per unit area
2 Its access time is less, hence Its access time is greater than static RAM
faster memories
3 It consists of number of flip- It stores the data as a charge on the capacitor
flops Each flip-flop stores It consists of MOSFET and capacitor for each
one bit cell
4 Refreshing circuitry is not Refreshing circuitry is required to maintain
required the charge on the capacitors every time after
every few milliseconds Extra hardware is
required to control refreshing
5 Cost is more Cost is less
15
Programmable Logic Devices, Memory
581 INTRODUCTION:
A combinational PLD is an integrated circuit with programmable gates
divided into an AND array and an OR array to provide an AND-OR sum of product
implementation The PLD‘s can be reprogrammed in few seconds and hence gives
more flexibility to experiment with designs Reprogramming feature of PLDs also
makes it possible to accept changes/modifications in the previously design circuits
16
Programmable Logic Devices, Memory
Programmable Arrays:
The OR Array:
It consists of an array of OR gates connected to a programmable matrix with
fusible links at each cross point of a row and column, as shown in the figure below
The array can be programmed by blowing fuses to eliminate selected variables from
the output functions For each input to an OR gate, only one fuse is left intact in
order to connect the desired variable to the gate input Once the fuse is blown, it
cannot be reconnected
Another method of programming a PLD is the antifuse, which is the opposite of the fuse
Instead of a fusible link being broken or opened to program a variable, a normally
open contact is shorted by ―melting‖ the antifuse material to form a connection
17
Programmable Logic Devices, Memory
18
Programmable Logic Devices, Memory
19
Programmable Logic Devices, Memory
The basic PAL consists of a programmable AND array and a fixed OR array
The AND gates are programmed to provide the product terms for the
Boolean functions, which are logically summed in each OR gate
It is developed to overcome certain disadvantages of the PLA, such as
longer delays due to the additional fusible links that result from using two
programmable arrays and more circuit complexity
20
Programmable Logic Devices, Memory
PROMs are used for code conversions, generating bit patterns for characters
and as look-up tables for arithmetic functions
2n x m PROM
F2 (A, B, C) = ∑m (1, 2, 5, 6)
0 0 0 1 0
0 0 1 1 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 0
1 0 1 1 1
1 1 0 0 1
1 1 1 1 0
21
Programmable Logic Devices, Memory
2. Design a combinational circuit using PROM The circuit accepts 3-bit binary and
generates its equivalent Excess-3 code
B2 B1 B0 E3 E2 E1 E0
0 0 0 0 0 1 1
0 0 1 0 1 0 0
0 1 0 0 1 0 1
0 1 1 0 1 1 0
1 0 0 0 1 1 1
1 0 1 1 0 0 0
1 1 0 1 0 0 1
1 1 1 1 0 1 0
22
Programmable Logic Devices, Memory
The PLA is similar to the PROM in concept except that the PLA does not
provide full coding of the variables and does not generate all the minterms
The decoder is replaced by an array of AND gates that can be programmed to
generate any product term of the input variables The product term are then
connected to OR gates to provide the sum of products for the required Boolean
functions The AND gates and OR gates inside the PLA are initially fabricated with
fuses among them The specific boolean functions are implemented in sum of
products form by blowing the appropriate fuses and leaving the desired
connections
23
Programmable Logic Devices, Memory
The block diagram of the PLA is shown above It consists of ‗n‘ inputs, ‗m‘
outputs, ‗k‘ product terms and ‗m‘ sum terms The product terms constitute a group of ‗k‘
AND gates and the sum terms constitute a group of ‗m‘ OR gates Fuses are inserted
between all ‗n‘ inputs and their complement values to each of the AND gates Fuses are
also provided between the outputs of the AND gate and the inputs of the OR gates
Another set of fuses in the output inverters allow the output function to be
generated either in the AND-OR form or in the AND-OR-INVERT form With the inverter fuse
in place, the inverter is bypassed, giving an AND-OR implementation With the fuse blown,
the inverter becomes part of the circuit and the function is implemented in the AND -OR-
INVERT form
A B C F1 F2
0 0 0 1 1
0 0 1 1 0
0 1 0 1 0
0 1 1 0 0
24
Programmable Logic Devices, Memory
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 0 1
Now select, F1‘ and F2, the product terms are AC, AB, BC and A‘B‘C‘
25
Programmable Logic Devices, Memory
In the PLA program table, first column lists the product terms numerically as
1, 2, 3, and 5 The second column (Inputs) specifies the required paths between the
AND gates and the inputs For each product term, the inputs are marked with 1, 0, or
- (dash) If a variable in the product form appears in its normal form, the
corresponding input variable is marked with a 1 If it appears complemented, the
corresponding input variable is marked with a 0 If the variable is absent in the
product term, it is marked with a dash ( - ) The third column (output) specifies the
path between the AND gates and the OR gates The output variables are marked with
1‘s for all those product terms that formulate the required
The PLA diagram uses the array logic symbols for complex symbols Each
input and its complement is connected to the inputs of each AND gate as indicated
by the intersections between the vertical and horizontal lines The output of the AND
gate are connected to the inputs of each OR gate The output of the OR gate goes to
an EX-OR gate where the other input can be programmed to receive a signal equal to
either logic 1 or 0
26
Programmable Logic Devices, Memory
The output is inverted when the EX-OR input is connected to 1 ie, (x †1= x’)
The output does not change when the EX-OR input is connected to 0 ie, (x †0= x)
F2 (A, B, C) = ∑m (0, 2, 4, 7)
Solution:
A B C F1 F2
0 0 0 0 1
0 0 1 0 0
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
27
Programmable Logic Devices, Memory
Now select, F1‘ and F2, the product terms are B’C’, A’C’, A’B’ and ABC
Step 3: PLA Program table
Inpu t
Prod uct s Outputs
term A B C F1 (C) F2 (T)
B‘C‘ 1 - 0 0 1 1
A‘C‘ 2 0 - 0 1 1
A‘B‘ 3 0 0 - 1 -
ABC 4 1 1 1 - 1
28
Programmable Logic Devices, Memory
F2 (A, B, C) = ∑m (0, 1, 6, 7)
F3 (A, B, C) = ∑m (2, 6)
Solution:
A B C F1 F2 F3
0 0 0 0 1 0
0 0 1 1 1 0
0 1 0 1 0 1
0 1 1 0 0 0
1 0 0 1 0 0
1 0 1 0 0 0
1 1 0 1 1 1
1 1 1 0 1 0
29
Programmable Logic Devices, Memory
30
Programmable Logic Devices, Memory
Solution:
Step 1: Truth table for the given functions
A B C F1 F2
0 0 0 0 0
0 0 1 0 0
0 1 0 0 0
0 1 1 1 0
1 0 0 0 1
1 0 1 1 1
1 1 0 0 0
1 1 1 1 1
Step 2: K-map Simplification
31
Programmable Logic Devices, Memory
A B C F1 F2
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 1 0
1 0 0 0 0
1 0 1 1 1
1 1 0 0 1
1 1 1 0 1
32
Programmable Logic Devices, Memory
With this simplification, total number of product term is 5 But we require only 3
product terms Therefore find out F1‘ and F2‘
Now select, F1‘ and F2, the product terms are AC, AB and C’
Step 3: PLA Program table
Inpu t
Prod uct s Outputs
term A B C F1 (C) F2 (T)
AB 1 1 1 - 1 1
C‘ 2 - - 0 1 -
AC 3 1 - 1 - 1
33
Programmable Logic Devices, Memory
A B C F1 F2
0 0 0 1 0
0 0 1 1 1
0 1 0 0 1
0 1 1 1 1
1 0 0 1 1
1 0 1 0 1
1 1 0 0 0
1 1 1 0 0
34
Programmable Logic Devices, Memory
35
Programmable Logic Devices, Memory
Solution:
A B C D F G
0 0 0 0 0 0
0 0 0 1 0 1
0 0 1 0 0 0
0 0 1 1 1 0
0 1 0 0 1 0
0 1 0 1 1 1
0 1 1 0 0 0
0 1 1 1 1 1
1 0 0 0 0 0
1 0 0 1 0 0
1 0 1 0 1 0
1 0 1 1 0 1
1 1 0 0 0 0
1 1 0 1 0 0
1 1 1 0 1 0
1 1 1 1 1 1
36
Programmable Logic Devices, Memory
The product terms are A‘BC‘, A‘CD, BCD, ACD‘, A‘C‘D, ACD
37
Programmable Logic Devices, Memory
8 Design a BCD to Excess-3 code converter and implement using suitable PLA
Solution:
Step 1: Truth table of BCD to Excess-3 converter is shown below,
BCD code Excess-3 code
Decima l
B3 B2 B1 B0 E3 E2 E1 E0
0 0 0 0 0 0 0 1 1
1 0 0 0 1 0 1 0 0
2 0 0 1 0 0 1 0 1
3 0 0 1 1 0 1 1 0
4 0 1 0 0 0 1 1 1
5 0 1 0 1 1 0 0 0
6 0 1 1 0 1 0 0 1
7 0 1 1 1 1 0 1 0
8 1 0 0 0 1 0 1 1
9 1 0 0 1 1 1 0 0
Step 2: K-map Simplification
The product terms are B3, B2B0, B2B1, B2B1’B0’, B2’B0, B2’B1, B1’B0’, B1B0, B0’
38
Programmable Logic Devices, Memory
B3 1 1 - - - 1 - - -
B2B0 2 - 1 - 1 1 - - -
B2B1
3 - 1 1 - 1 - - -
B2B1‘B0‘
4 - 1 0 0 - 1 - -
B2‘B0
5 - 0 - 1 - 1 - -
B2‘B1
6 - 0 1 - - 1 - -
B1‘B 0‘
7 - - 0 0 - - 1 -
B1B0
8 - - 1 1 - - 1 -
B0‘
9 - - - 0 - - - 1
39
Comparison between PROM, PLA, and PAL:
40