Module 2 DSDV
Module 2 DSDV
MODULE - 2
Notes (as per VTU Syllabus)
III SEMESTER – B. E
SYLLABUS
Module – 1
Principles of Combinational Logic: Definition of combinational logic, Canonical forms,
Generation of switching equations from truth tables, Karnaugh maps- up to 4 variables,
Quine-McCluskey Minimization
Technique. Quine-McCluskey using Don’t Care Terms. (Section 3.1 to 3.5 of Text 1).
8 Hrs.
Module – 2
Logic Design with MSI Components and Programmable Logic Devices: Binary Adders and
Subtractors, Comparators, Decoders, Encoders, Multiplexers, Programmable Logic Devices
(PLDs)(Section 5.1 to 5.7 of Text 2) 8 Hrs
Module – 3
Flip-Flops and its Applications: The Master-Slave Flip-flops (Pulse-Triggered flip-flops):
SR flip-flops, JK flip flops, Characteristic equations, Registers, Binary Ripple Counters,
Synchronous Binary Counters, Counters based on Shift Registers, Design of Synchronous
mod-n Counter using clocked T, JK, D and SRflip-flops. (Section 6.4, 6.6 to 6.9 (Excluding
6.9.3) of Text 2)8 Hrs.
Module – 4
Introduction to Verilog: Structure of Verilog module, Operators, Data Types, Styles of
Description. (Section 1.1 to 1.6.2, 1.6.4 (only Verilog), 2 of Text 3)
Verilog Data flow description: Highlights of Data flow description, Structure of Data flow
description. (Section 2.1 to 2.2 (only Verilog) of Text 3)8Hrs
Module – 5
Verilog Behavioral description: Structure, Variable Assignment Statement, Sequential
Statements, Loop Statements, Verilog Behavioral Description of Multiplexers (2:1, 4:1,
8:1). (Section 3.1 to 3.4 (only Verilog) of Text 3)
Verilog Structural description: Highlights of Structural description, Organization of structural
description, Structural description of ripple carry adder. (Section 4.1 to 4.2 of Text 3)
Dept. of ECE/SJBIT Page 2
Digital Communication 18EC61
8Hrs
COURSE OUTCOMES:
Course Outcomes: At the end of the course, the students will be able to
Explain the concept of combinational and sequential logic circuits and PLD.
Design the combinational logic circuits.
Design the sequential circuits using SR, JK, D, and T flip-flops.
Understand the various Verilog HDL descriptions and verify the functionality in the
digital circuit systems.
Synthesize Verilog programs for Combinational, sequential circuits and interface the
peripherals on FPGA.
TEXTBOOK:
REFERENCE BOOKS:
MODULE–2
Dept. of ECE/SJBIT Page 3
Digital Communication 18EC61
DESIGNOFCOMBINATIONALCIRCUITS
Thedesignofcombinationalcircuitsstartsfromtheverbaloutlineoftheproblemandendsinalogi
ccircuit diagram. Theprocedureinvolves thefollowingsteps:
1. State the given problem completely and exactly
2. Interpret the problem and determine the available input variables and required output
variables.
3. Assign a letter symbol to each input and output variables.
4. Design the truth table, which defines the required relations between inputs and outputs.
5. Obtain the simplified Boolean expression for each output using k-maps.
6. Draw the logic circuit diagram to implement the Boolean expression.
ARITHMETICCIRCUITS
HALF– ADDER
ALogiccircuitusedfortheadditionoftwoone-bitnumbersisreferredtoasahalf-adder.Fromthe
verbal explanation of a half adder, we find that this circuit needs two binary inputs and
twobinary outputs. The input variables designate the augend and addend bits; the output
variablesproduce the sum and carry. We assign the symbols A and B to the two inputs
and S (for sum)andC (for carry) to theoutputs. Thetruth tablefor thehalf-adder is
shownbelow.
Here the C output is 1 only when both inputs are 1. The S output represents the least
significantbit of the sum. The logic expression for the sum output can be obtained from
the truth table.
ItcanbewrittenasaSOPexpressionbysumminguptheinputcombinationsforwhichthesumiseq
ualto 1.
Inthetruthtable,thesumoutputis1for A′BandAB′.Therefore,theexpressionforthesumis
S=A′B+ AB′=A⊕B.
Similarly, the logic expression for carry output can be written as a SOP expression by
summingup the input combinations for which the carry is equal to 1.In the truth table, the
carry is 1
forAB.ThereforeC=ABThisexpressionforCcannotbesimplified.Thesumoutputcorresponds
to a logic Ex-OR function while the carry output corresponds to an AND function.So the
half-addercircuit can beimplemented using Ex-ORand AND gateas shown below.
Fig1:HalfAdderLogiccircuit
ThiscircuitiscalledHalf-Adder,becauseitcannotacceptaCARRY-
INfrompreviousadditions.Thisisthereasonthathalf–
addercircuitcanbeusedforbinaryadditionoflowermostbitsonly.Forhigher ordercolumns
weusea3-input adder called full-adder
FULL–ADDER
A combinational logic circuit for adding three bits. As seen, a half-adder has only two
inputsandthereisnoprovisiontoaddcarrycomingfromthelowerbitorderwhenmultibitaddition
isperformed.Forthispurposeweusealogiccircuitthatcanaddthreebits,thethirdbitisthecarry
from the lower column. This implies that we need a logic circuit with 3 inputs and 2
outputs.Suchacircuit iscalledafull– adder.Thetruth table forthefull-adder isas shown
below.
As shown there are 8 possible input combinations for the three inputs and for each case
the Sand Cout values are listed. From the truth table, the logic expression for S can be
written bysummingup theinput combinations forwhich thesum outputis 1 as:
S=A′B′Cin+A′BC′in+AB′C′in+ABCin
=A′(B′Cin+BC′in) +A(B′C′in+BCin)
=A′(B⊕Cin)+A(B⊕Cin)′ Let
B⊕Cin = XNow,S=A′X+AX′=A ⊕X ReplacingXin theabove
expression we get
S= A⊕B⊕Cin
FromthesimplifiedexpressionsofSandCthefulladderCircuitcanbeimplementedusingtwo2-
input XOR gates, Three 2 –input AND gates and one 3-input OR gate a shown below fig
(a).Thelogicsymbol is also shown as fig (b).
Fig2:FullAdderLogic Circuit
The logic symbol has two inputs A and B plus a third input Cin called the Carry-in and
twooutputsSUMandtheCarrycalledCarryout,Coutgoingtothenexthighercolumn..Afulladde
rcanbemadeby using two halfadders and anOR gate asshown below.
Fig3:Fulladdercircuitusingtwohalfadders
Dept. of ECE/SJBIT Page 7
Digital Communication 18EC61
HALF–SUBTRACTOR
A logic circuit that subtracts Y (subtrahend) from X(minuend), where X and Y are 1-
bitnumbers, is known as a half-subtractor. It has two inputs X (minuend) and Y
(subtrahend) andtwooutputs D (difference) andB (borrow),as shownin theblock diagram.
The operation of this logic circuit is based on the rules of binary subtraction given in the
truthtablereproduced on the basis of thesubtraction process.
The difference output in the third column has the same logic pattern as when X is XORed
withY (same as in the case of sum). Hence an Ex-Or gate can be used to give difference
of two bits.The borrow output in the 4th column can be obtained by using a NOT gate
and AND gate, asshownin thecircuit diagram below.
Thelogicalequationsforthedifference D andborrowB are givenas
D = X′Y + XY′ = X ⊕ Y.
B= X′Y
Fig4:HalfSubtractorLogiccircuit
FULL–SUBTRACTOR
Thefull-
subtractorisacombinationalcircuitwhichisusedtoperformsubtractionofthreesinglebits
INPUT OUTPUT
X Y Z D B
0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 1
As shown there are 8 possible input combinations for the three inputs and for each case
the Dand B values are listed. From the truth table, the logic expression for D can be
written bysummingup theinput combinations forwhichtheDifference output is 1 as:
D=X’Y'Z +X’YZ’+XY’Z'+XYZ
=X’(Y’Z+YZ’) +X(Y’Z'+YZ)
X’(Y ⊕Z) + X(Y ⊕Z)’
D=X⊕Y⊕Z
B=X’Y'Z+X’YZ’+X’YZ+XYZ
=Z (X’Y+XY’)+ X’Y(Z’+Z)
B=Z(X⊕Y)+X’Y
4- BITPARALLELADDER
The 4-bit binary adder performs the addition of two 4-bit numbers. Let the 4-bit
binarynumbers, A=A3 A2 A1 A0 and B=B3 B2 B1 B0. We can implement 4-bit binary
adder in oneof thetwo following ways.
Use one Half adder for doing the addition of two Least significant bits and three
Full adders for doing the addition of three higher significant bits.
Use four Full adders for uniformity. Since, initial carry C0 is zero, the Full adder
which is used for adding the least significant bits becomes Half adder.
For the time being, we considered second approach. The block diagram of 4-bit binary
adder is shown in the following figure.
Here, the 4 Full adders are cascaded. Each Full adder is getting the respective bits of two
parallel inputs A & B. The carry output of one Full adder will be the carry input of
subsequent higher order Full adder. This 4-bit binary adder produces the resultant sum
having at most 5 bits. So, carry out of last stage Full adder will be the MSB.
In this way, we can implement any higher order binary adder just by cascading the
requirednumberofFulladders.Thisbinaryadderisalsocalledas ripplecarry(binary)adder
becausethecarry propagates (ripples)from one stagetothenextstage.
BINARYSUBTRACTOR
Thecircuit,whichperformsthesubtractionoftwobinarynumbersisknownas
Binarysubtractor.Wecan implement Binarysubtractor in following twomethods.
CascadeFullsubtractors
2’scomplementmethod
Infirstmethod,wewillgetann-
bitbinarysubtractorbycascading‘n’Fullsubtractors.So,firstyoucanimplementHalfsubtracto
randFullsubtractor,similartoHalfadder&Fulladder.Then,you can implement an n-bit
binary subtractor, by cascading ‘n’ Full subtractors. So, we will behavingtwoseparate
circuitsforbinaryaddition andsubtraction oftwo binarynumbers.
In second method, we can use same binary adder for subtracting two binary numbers
just bydoing some modifications in the second input. So, internally binary addition
operation takesplacebut, theoutput is resultant subtraction.
A−B=A+(2′scomplement ofB)
4-bitBinarySubtractor
The4-bitbinarysubtractorproducesthe subtractionoftwo4-
bitnumbers.Letthe4bitbinarynumbers, A = A3 A2 A1 A0 and B = B3 B2 B1 B0 .
Internally, the operation of 4-bit Binarysubtractor is similar to that of 4-bit Binary adder.
If the normal bits of binary number A, complemented bits of binary number B and initial
carry (borrow), Cin as one are applied to 4-bit Binary adder, then it becomes 4-bit Binary
subtractor. The block diagram of 4-bit binarysubtractoris shown in the following
figure.
Fig7:4-Bit BinarySubtractorCircuit
This4-bitbinarysubtractorproducesanoutput,whichishavingatmost5bits.IfBinarynumberA
is greater than Binary number B, then MSB of the output is zero and the remaining bits
holdthe magnitude of A-B. If Binary number A is less than Binary number B, then MSB
of theoutputis one. So, takethe 2’scomplement ofoutputin order to get themagnitudeof
A-B.
Inthisway,wecanimplementanyhigherorderbinarysubtractorjustbycascadingtherequiredn
umberof Full adders with necessary modifications.
The 4-bit binary adder / subtractor produces either the addition or the subtraction of two
4-bit numbers based on the value of initial carry or borrow, C0. Let the 4-bit binary
numbers, A = A3 A2 A1 A0 and B = B3 B2 B1 B0. The operation of 4-bit Binary
adder / subtractor is similar tothatof4-bit Binary adderand 4-bit Binarysubtractor.
Apply the normal bits of binary numbers A and B & initial carry or borrow, C0 from
externally to a 4-bit binary adder. The block diagram of 4-bit binary adder / subtractor is
shown in the following figure.
Fig8:4-BitBinaryAdder/Subtractor Circuit
If initial carry, C0 is zero, then each full adder gets the normal bits of binary numbers A
& B.So,the4-bitbinaryadder/subtractorproducesanoutput,whichisthe
additionoftwobinarynumbersA & B.
If initial borrow, 𝐶0 is one, then each full adder gets the normal bits of binary number A
&complemented bits of binary number B. So, the 4-bit binary adder / subtractor
produces anoutput,which is thesubtraction oftwo binary numbersA &B.
Therefore, with the help of additional Ex-OR gates, the same circuit can be used for
bothadditionand subtractionof two binary numbers.
Fig9:4-BitCarryLookAheadAdderBlockDiagram
Pi = Ai ⊕ Bi Carry
propagateGi = AiBBi
Carry generateFori=0
c1=g0+p0c
0Fori=1
c2=g1+p1c1
=g1+p1(g0+p0c0)
=g1+p1g0+p1p0c0
Fori=2
c3=g2+p2c2
=g2+p2g1+p2p1g0+p2p1p0c0F
ori=3
c4=g3+p3c3=g3+p3g2+p3p2g1+p3p2p1g0+p3p2p1p0c0
ComplexProgrammableLogicDevices(CPLD’s)
As number of Boolean expression increases, designing a digital circuit using PLD’s becomes
difficult.
Using CPLDs we can implement more than 20 Boolean expression in a digital circuit.
FeaturesofCPLD
• High Performance
Applicationsof CPLD
• It is used in a digital circuit where Number of input and output are > 32.
FieldProgrammableGateArrays(FPGA)
• Field Programmable Gate Arrays (FPGAs) are semiconductor devices that are
based around a matrix of configurable logic blocks (CLBs) connected via
programmable interconnects.
• An FPGA can be reprogrammed until the processor design is final and bug-free.
FPGAArchitecture
• An FPGA has a regular structure of logic cells or modules and interlinks which is
under the developers and designers complete control. The FPGA is built with
mainly three major blocks such as Configurable Logic Block (CLB), I/O Blocks
or Pads and Switch Matrix/ Interconnection Wires. Each block will be discussed
below in brief.
CLB (Configurable Logic Block): These are the basic cells of FPGA. It consists
of one8-bitfunctiongenerator,two16-bitfunctiongenerators,tworegisters(flip-
flopsor latches), and reprogrammable routing controls (multiplexers). The CLBs
are applied toimplement other designed function and macros. Each CLBs have
inputs on each sidewhichmakes them flexileforthe mappingand partitioning of
logic.
• I/O Pads or Blocks: The Input/Output pads are used for the outside peripherals to
access the functions of FPGA and using the I/O pads it can also communicate
with FPGA for different applications using different peripherals.
Configurablelogicblocks:
InterconnectionSwitches:
Application:
CPLD FPGA
1. Instant-on.CPLDsstartworkingassoonas Since FPGA has to load configuration
they arepoweredup datafromexternalROMandsetupthefabricbefor
e it can start functioning, there is a timedelay
between power ON and FPGA startsworking.
The time delay can be as large asseveraltens
of milliseconds.
2. Non- FPGAsusesSRAMbasedconfigurationstorage.
volatile.CPLDsremainprogrammed,and The contents of the memory is lost assoonas
retaintheir power is disconnected.
circuitafterpoweringdown.FPGAsgobla
nkassoon as powered-off.
3. Deterministic Timing Analysis. Size and complexity of FPGA logic can
SinceCPLDs are comparatively simpler behumongous compared to CPLDs. This
toFPGAs,andthenumberofinterconnects opensupthepossibilitylessdeterministicsignalr
areless,thetiminganalysiscanbedonemu outing and thus causing complicated
chmoreeasily. timingscenarios.Thankfullyimplementationto
olsprovided by FPGA vendors have
mechanismsto assist achieving deterministic
timing.
Butadditionalstepsbytheuserisusuallynecessar
yto achievethis.
4. Loweridlepowerconsumption.Newer Relativelyhigheridlepowerconsumption.
CPLDs such as CoolRunner-
IIusearound50 uA inidleconditions.
5. Mightbecheaperforimplementingsimple FPGAsaremuchmorecapablecomparedtoCPLD
rcircuits sbutcan bemore expensiveaswell.