VLSI Design Lab Manual for ECE Students
VLSI Design Lab Manual for ECE Students
FOR
OBJECTIVE:
Objective of this lab is to learn the Virtuoso tool as well learn the first
step in flow of the Full Custom IC design cycle. In this process you will design
the circuit and verify its functionality using simulation. You will create a new
cell with schematic view and hence build the schematic by instantiating various
components. Once schematic is done, this circuit is verified by doing various
simulations using spectre. In the process, you will learn to use spectre,
waveform window options, waveform calculator, etc...
csh
source cshrc1
cd cadence_ms_labs_613
virtuoso
A command interpreter window will open.
Procedure to create Schematic
Go to file -> library -> Create Library and cell view.
A virtuoso schematic window opens, then create your own schematic.
To create schematic, go to create -> instance (I). Add instance window opens, then
browse Library -> gpdk180/analog lib ->pmos /nmos/Vdd/Vdc/gnd -> symbol and then
close.
To connect the terminals, go to create -> wire narrow (W).
For input, output or input-output pins, go to create -> pin (P).
To change the properties of any component, select the component and press „Q‟.
Using the above steps required schematic can be created.
Go to file -> check & save.
Procedure for the Transient Analysis:
Go to launch -> ADEL. Virtuoso Analog Design Environment window will open.
Click on setup->select stimuli to apply inputs.
Click on analyses -> choose. For transient response, enable „trans‟ and enter some value
for stop time. Enable „moderate‟ and then click apply & OK.
Go to outputs -> to be plotted -> select on schematic. Select the input and output wires in
the schematic and return to ADE window. Go to simulation ->netlist& run.
After few seconds, the transient response will be displayed. In that, click on „strip chart
mode‟, to split the plotted waveforms.
7. Full Adder
8. Full Subtractor
9. 2to 8 DECODER
10. 8X1 MULTIPLEXER
11. Flip Flop’s
12. Binary counter
2. A window given below will be appearing. Write the project name like “and
gate” then click next.
3. The below window will be displayed. In the project device options select the
following options shown in the fig. and then click on Next.
5. Then the following window will be displayed. Select VHDL Module and
write the file name as same as project name. And click Next button.
9. Make the changes in the program according to your requirements and save
the program.
2. Select VHDL Test bench and give the file name as “tb_Program name” and
click next. A dummy test bench will be created. Provide the test bench and save
the test bench.
[Link] DATE:
[Link] INVERTER
AIM:-
To design a CMOS Inverter and verify its functionality using transient response.
TOOLS USED:
Cadence Virtuoso
Gpdk 180nm Technology
THEORY:
The inverter is universally accepted as the most basic logic gate doing a Boolean operation on
a single input variable and CMOS is sometimes referred to as complementary-symmetry metal–
oxide–semiconductor. The words "complementary-symmetry" refer to the fact that the typical digital
design style with CMOS uses complementary and symmetrical pairs of p-type and n-type metal oxide
semiconductor field effect transistors (MOSFETs) for logic functions. Two important characteristics
of CMOS devices are high noise immunity and low static power consumption. Significant power is
only drawn while the transistors in the CMOS device are switching between on and off states.
Consequently, CMOS devices do not produce as much waste heat as other forms of logic, for
example transistor-transistor logic (TTL) or NMOS logic, which uses all n-channel devices without p-
channel devices.
The CMOS inverter, a logic gate which converts high input to low and low to high. When the input is
high, the n-MOSFET on the bottom switches on, pulling the output to ground. The p-MOSFET on top
switches OFF. When the input is low, the gate-source voltage on the n-MOSFET is below its
threshold, so it switches off, the p-MOSFET switches on to pull the output high. It consists of only
two transistors, a pair of one N-type and one P-type transistor. If the input voltage is „1‟ (VCC) the P-
type transistor on top is non-conducting and provides a path from GND to the output Y. The output
level therefore is „0‟. On the other hand, if the I/P level is „0‟, the P-transistor is conducting and
provides a path from VCC to the output Y, so that the output level is „1‟ while N-type transistor is
blocked.
SYMBOL:
__
Vdd Vout=(Vin)‟
Vi Vout
n
gnd
TRUTH TABLE:
0(0v) 1(1.8v)
1(1.8v) 0(0v)
TRANSIENT ANALYSIS:
RESULT:
1) What is the latch up problem that arises in bulk CMOS technology? How is it overcome?
2) Explain the operation of CMOS Inverter using transfer characteristic curves.
3) Distinguish between the bulk CMOS technology with the SoI technology fabrications?
4) In CMOS inverter, PMOS is preferably in pull up stage and NMOS in pull down stage. Why?
5) How CMOS inverter will acts if we interchange NMOS and PMOS positions?
6) Draw the ideal characteristics of a CMOS inverter and compare it with the actual
characteristics?
7) What is noise margin? Find out the noise margin from the actual characteristics the inverter.
8) What is the lower limit of supply voltage of a CMOS inverter? What happens if the supply
voltage is further reduced?
9) What are the various ways to reduce the delay time of a CMOS inverter?
10) Explain the commonly used technique to estimate the delay time of a CMOS inverter?
11) Define nMOS and pMOS transistors.
12) Differentiate enhancement and depletion mode transistors.
13) Compare nMOS and CMOS.
14) What is the abbreviation of ECAD.
15) What is meant by Gpdk 180nm Technology.
NAND GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
[Link] DATE:
NAND and NOR GATES
AIM:-
To design a two-input CMOS NAND and NOR gates and verify their functionalitiesusing
transient response.
TOOLS USED:
Cadence Virtuoso
Gpdk 180nm Technology
THEORY:
NAND GATE:
NAND gate is actually a combination of two logic gates: AND gate followed by NOT gate.
The first part is an AND gate and second part is a dot after it represents a NOT gate. So it is clear
that during the operation of NAND gate, the inputs are first going through AND gate and after that
the output is reversed and we get the final [Link] its output is complement of the output of an
AND gate.
The NAND gate and the NOR gate can be said to be universal gates since combinations of
them can be used to accomplish any of the basic operations and can thus produce an Inverter, an OR
gate or an AND gate. The non-inverting gates do not have this versatility since they can‟t produce an
invert.
The output of NAND gate is high if any of the inputs are low. In the NAND gate the P-type
transistors are connected in parallel between VCC and the output Y, while the N-type transistors are
connected in series from GND to the output Y. If any of the input is LOW, one of two PMOS
transistor will ON and path is established between Output and VDD, hence Output is HIGH. If both
the two inputs are LOW, then both the PMOS transistors are ON and both the NMOS transistors are
OFF. Therefore, path is established between output and VDD and no path is existed between GND
and Output. Hence, Output is HIGH. If the both inputs are HIGH, then both the NMOS transistors
are ON and both the PMOS transistors are OFF. Therefore, path is established between output and
GND and no path is existed between VDD and Output. Hence, the Output is LOW.
NOR GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
NOR GATE:
THEORY:
NOR gate is actually a combination of two logic gates: OR gate followed by NOT gate. The
first part is an OR gate and second part is a dot after it represents a NOT gate. So it is clear that
during the operation of NOR gate, the inputs are first going through OR gate and after that the output
is reversed and we get the final [Link] its output is complement of the output of an OR gate.
The NAND gate and the NOR gate can be said to be universal gates since combinations of
them can be used to accomplish any of the basic operations and can thus produce an Inverter, an OR
gate or an AND gate. The non-inverting gates do not have this versatility since they can‟t produce an
invert.
.The output of NOR gate isLOW if any of the inputs are HIGH. In the NOR gate the N-type
transistors are connected in parallel between GND and the output Y, while the P-type transistors are
connected in series fromVDD to the output Y. If any of the input is HIGH, one of two NMOS
transistor will ON and path is established between Output and GND, hence Output is LOW. If both
the two inputs are HIGH, then both the PMOS transistors are OFF and both the NMOS transistors
are ON. Therefore, path is established between output and GND and no path is existed between
VDD and Output. Hence, Output is LOW. If the both inputs are LOW, then both the PMOS
transistors are ON and both the NMOS transistors are OFF. Therefore, path is established between
output and VDD and no path is existed between GND and Output. Hence, the Output is HIGH.
NAND GATE:
TRUTH TABLE:
a b Therical Y Practical Y
0(0v) 0(0v) 1(1.8v)
0(0v) 1(1.8v) 1(1.8v)
1(1.8v) 0(0v) 1(1.8v)
SYMBOL:
Y = (a.b)’
TRANSIENT ANALYSIS:
NOR GATE:
TRUTH TABLE:
Vin1 Vin2 Theoretical Practical
Vout Vout
0(0v) 0(0v) 1(1.8v)
0(0v) 1(1.8v) 0(0v)
1(1.8v) 0(0v) 0(0v)
1(1.8v) 1(1.8v) 0(0v)
SYMBOL:
Vout = ( a+b)’
TRANSIENT ANALYSIS:
RESULT:
1. How the transfer characteristic of a CMOS NAND gate is affected with increase in fan-in?
2. How the transfer characteristic of a CMOS NOR gate is affectedwith increase in fan-in?
3. How switching characteristic of a CMOS NAND gate is affectedwith increase in fan-in?
4. How switching characteristic of a CMOS NOR gate is affectedwith increase in fan-in?
5. How noise margin of a CMOS NAND/NOR gate is affected withincrease in fan-in?
6. What are universal gates? Why called so.
7. Draw the pull up section of NAND gate and NOR gates?
8. Draw the pull down section of NAND gate and NOR gates?
9. Explain the logical operation of NAND gate with the help of a truth table?
10. Explain the logical operation of NOR gate with the help of truth table.
[Link] the 3 input CMOS NAND gate.
[Link] the 3 input CMOS NOR gate.
AND GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
[Link]: 03 DATE:
AND and OR GATES
AIM:-To design a two-input CMOS AND and OR gates and verify their functionalities using transient
response.
TOOLS USED:
Cadence Virtuoso
Gpdk 180nm Technology
AND GATE:
THEORY:
The AND gate is a basic digital logic gate that implements logical conjunction. A HIGH
output (1) results only if both the inputs to the AND gate are HIGH (1). If neither or only one input to
the AND gate is HIGH, a LOW output results. In another sense, the function of AND effectively finds
the minimum between two binary digits. Therefore, the output is always 0 except when all the inputs
are [Link] available Digital Logic AND Gate IC‟s include:
TTL Logic AND GatesCMOS Logic AND Gates
If no specific AND gates are available, one can be made from NAND or NOR gates, because NAND
and NOR gates are considered the "universal gates," meaning that they can be used to make all the
others. XOR Gates can also be used to simulate AND functions, but are rarely used to do so.
OR GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
OR GATE:
THEORY:
The OR gate is a digital logic gate that implements logical disjunction. A HIGH output (1)
results if one or both the inputs to the gate are HIGH (1). If neither input is high, a LOW output (0)
results. In other sense, the function of OR effectively finds the maximum between two library digits.
Commonly available Digital Logic OR Gate IC‟s include:
TTL Logic OR GatesCMOS Logic OR Gates
If no specific OR gates are available, one can be made from NAND or NOR gates in the configuration
shown in the image below. Any logic gate can be made from a combination ofNAND or NOR gates.
AND GATE:
TRUTH TABLE:
X Y Z Z
Theoretical Practical
0(0v) 0(0v) 0(0v)
0(0v) 1(1.8v) 0(0v)
1(1.8v) 0(0v) 0(0v)
1(1.8v) 1(1.8v) 1(1.8v)
SYMBOL:
Z = ( X.Y)
TRANSIENT ANALYSIS:
RESULT:
OR GATE:
SYMBOL:
TRUTH TABLE:
Vin1 Vin2 Theoretical Practical
Vout Vout
0(0v) 0(0v) 0(0v)
0(0v) 1(1.8v) 1(1.8v)
1(1.8v) 0(0v) 1(1.8v)
1(1.8v) 1(1.8v) 1(1.8v)
TRANSIENT ANALYSIS:
Ex-OR GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
[Link] DATE:
EX-OR and EX-NOR GATES
AIM :-To design a two-input CMOS EX-OR and EX-NOR gates verify their functionalities using
transient response.
TOOLS USED:
Cadence Virtuoso
Gpdk 180nm Technology
EX-OR GATE:
THEORY:
The X in the EXOR gate stands for “exclusive.” This means that the output from this gate will
be a 1 only when one or the other of the inputs is a 1. If an XOR gate has more than two inputs, then
its behaviour depends on implementation. In the vast majority of cases, an XOR gate will output true
if and odd number of its inputs is true. However, it‟s important to note that this behaviour differs from
the strict definition or exclusive OR, which insists that exactly one input must be true for the output to
be true.
Exclusive-OR Gates are used mainly to build circuits that perform arithmetic operations and
calculations especially Adders and Half-Adders as they can provide a “carry-bit” function or as a
controlled inverter, where one input passes the binary data and the other input is supplied with a
control signal.
Commonly available Digital Logic Exclusive-OR Gate IC‟s include:
Ex-NOR GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
EX-NOR GATE:
THEORY:
An XNOR gate is a digital logic gate with two or more inputs and one output that performs
logical equality. The output of an XNOR gate is true when all of its inputs are true or when all of its
inputs are false. If some of its inputs are true and others are false, then the output of XNOR gate is
false. XNOR gates are represented in most TTL and CMOS IC families. The standard 4000 series
CMOS IC is the 4077 and the TTL IC is the 74266. Both include four independent, two-input, XNOR
gates. OUTPUT is high only if all its inputs are the same.
Ex-NOR gates are used mainly in electronic circuits that perform arithmetic operations and
data checking such as Adders, Subtractors or Parity Checkers, etc. As the Ex-NOR gate gives an
output of logic level “1” whenever its two inputs are equal it can be used to compare the magnitude of
two binary digits or numbers and so Ex-NOR gates are used in Digital Comparator circuits.
Commonly available Digital Logic Exclusive-NOR Gate IC‟s include:
TTL Logic Ex-NOR Gates CMOS Logic Ex-NOR Gates
Ex-OR GATE:
TRUTH TABLE:
A B Y (Theoretical) Y( Practical)
0(0v) 0(0v) 0(0v)
0(0v) 1(1.8v) 1(1.8v)
1(1.8v) 0(0v) 1(1.8v)
1(1.8v) 1(1.8v) 0(0v)
SYMBOL:
Y = a‟ b + a b‟
TRANSIENT ANALYSIS:
0v 1.8v 1.8v
1.8v 0v 1.8v
1.8v 1v 0v
0v 1.8v 1.8v
1.8v 0v 1.8v
1.8v 1v 0v
RESULT:
Ex-NOR GATE:
TRUTH TABLE:
A B Y Y
(Theoretical) (Practical)
0(0v) 0(0v) 1(1.8v)
SYMBOL:
Y = (a‟ b + a b‟)‟
TRANSIENT ANALYSIS:
1. How the transfer characteristic of a CMOS Ex-OR gate is affected with increase in fan-in?
2. How the transfer characteristic of a EX-NOR gate is affected with increase in fan-in?
3. How switching characteristic of a CMOS Ex-OR gate is affected with increase in fan-in?
4. How switching characteristic of a CMOS Ex-NOR gate is affected with increase in fan-in?
5. How noise margin of a CMOS Ex-OR/ Ex-NOR gate is affected with increase in fan-in?
6. What are arithmetic gates? Why called so.
7. Draw the pull up section of Ex-OR gate and Ex-NOR gates?
8. Draw the pull down section of Ex-OR gate and Ex-NOR gates?
9. Explain the logical operation of Ex-OR gate with the help of a truth table?
10. Explain the logical operation of Ex-NOR gate with the help of a truth table?
11. What is equivalence gate.
AOI GATE:
BLOCK DIAGRAM WITH ITS BEHAVIOUR:
SCHEMATIC DIAGRAM:
[Link] GATE
AIM:-To design anAOI gate and verify their functionalities using transient response.
TOOLS USED:
Cadence Virtuoso
Gpdk 180nm Technology
THEORY:
The AOI gate, as its name suggests, enables the sum-of-products realization of a
BooleanFunction in one logic stage. The pull-down net of the AOI gate consistsofparallel branches of
series-connected N-MOS driver transistors. The corresponding p-typepull-up network can simply be
found using the dual-graph concept.
TRUTH TABLE:
A B C D Theoretical Practical
Y Y
0(0v) 0(0v) 0(0v) 0(0v) 1(1.8v)
0(0v) 0(0v) 0(0v) 1(1.8v) 1(1.8v)
0(0v) 0(0v) 1(1.8v) 0(0v) 1(1.8v)
0(0v) 0(0v) 1(1.8v) 1(1.8v) 0(0v)
0(0v) 1(1.8v) 0(0v) 0(0v) 1(1.8v)
0(0v) 1(1.8v) 0(0v) 1(1.8v) 1(1.8v)
0(0v) 1(1.8v) 1(1.8v) 0(0v) 1(1.8v)
0(0v) 1(1.8v) 1(1.8v) 1(1.8v) 0(0v)
1(1.8v) 0(0v) 0(0v) 0(0v) 1(1.8v)
1(1.8v) 0(0v) 0(0v) 1(1.8v) 1(1.8v)
1(1.8v) 0(0v) 1(1.8v) 0(0v) 1(1.8v)
1(1.8v) 0(0v) 1(1.8v) 1(1.8v) 0(0v)
1(1.8v) 1(1.8v) 0(0v) 0(0v) 0(0v)
1(1.8v) 1(1.8v) 0(0v) 1(1.8v) 0(0v)
1(1.8v) 1(1.8v) 1(1.8v) 0(0v) 0(0v)
1(1.8v) 1(1.8v) 1(1.8v) 1(1.8v) 0(0v)
LOGIC DIAGRAM:
TRANSIENT ANALYSIS:
RESULT:
13) For a complex/compound CMOS logic gate, how do you realize the pull-up and the pull-
down networks?
14) Give the two possible topologies AND-OR-INVERT AND-ORINVERT (AOI) and OR-
AND-INVERT (OAI) to realize CMOS logic gate. Explain with an example.
15) Give the AOI and OAI realizations for the sum and carry functions of a full adder.
16) what are Compound Gate? Explain why.
17) Explain the operation of AOI gate with the help of truth table?
18) Draw all possible ways to implement AOI Gates?
19) Draw all possible ways to implement OAI Gates?
20) Draw the Digital implementation of AOI gates with help of universal gates?
21) Draw the Digital implementation of OAI gates with help of universal gates?
22) Compare the PULL DOWN sections of XOR GATES AND AOI gates?
6. Logic Gates
Aim: Design of all Basic gates, Universal gates and simulates it on Xilinx Software.
Theory:
A logic gate is an elementary building block of a digital circuit. Most of the logic gates have two
inputs and one output. At any given moment, every terminal is in one of the two binary conditions low
(0) or high (1), represented by different voltage levels. The logic state of a terminal can, and generally
does, change often, as the circuit processes data. In most logic gates, the low state is approximately
zero volts (0 V), while the high state is approximately five volts positive (+5 V).There are seven basic
logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.
Algorithm:
Make sure that Logic Diagram/Symbol and truth table should be known for all the logic gates.
For all logic gates input have to instantiated in the entity declarations.i.e., A,B is declared as
inputs and Z is declared as output is of signal type std_logic
Inside the Architecture body, all the logic gates inputs have to assigned to the output by using
signal assignment statement ( Z<=A and B).
7. Full Adder
Aim: Design of afull adderusing 3 modeling stylesand simulate it on Xilinx Software.
Theory:
Half Adder:
A combinational circuit that performs an addition of two bits is called half adder. For this the circuit
needs two binary inputs and two binary outputs. The input variables designate the augend and addend
bits; the output variable produces the sum and carry.
Algorithm 2:
1. Make sure that Logic Diagram and truth table should be known for the Full Adder .
2. For all Full Adder inputs have to instantiated in the entity declarations i.e., A,B,C in is declared
as inputs and sum,carry is declared as outputs and is of signal type std_logic
3. Full adder can be implemented either in dataflow,structural and behavioral style of modeling.
Results:
8. Full Subtractor
Aim: Design of full subtractor using 3 modeling styles and simulate it on Xilinx Software.
Theory:
Full Subtractor:
A full subtractor is a combinational circuit that performs a difference of three input bits. For this the
circuit needs three binary inputs and two binary outputs. Two of the input variables represent two
significant bits to be subtracted. The third input represents a borrow from the previous lower
significant position. A two-output variable represents the difference and borrow.
Algorithm 1:
1. Make sure that Logic Diagram and truth table should be known for the Full Subtarctor .
2. For all Full Subtractor inputs have to instantiated in the entity declarations i.e., A,B,Bin is
declared as inputs and Difference, Borrow is declared as outputs and are of signal type
std_logic
3. Full Subtractor can be implemented in dataflow, structural and behavioral style of modeling.
Results:
9. 2to 8 DECODER
Aim:Design & Write a VHDL code for 2-4 Decoder and verify its functionality by writing test bench.
Theory:
A decoder is a multiple-input, multiple-output logic circuit that converts coded inputs into
coded outputs, where the input and output codes are different.
The input code generally has fewer bits than the output code, and there is a one-to-one
mapping from input code words into output code words.
In a one-to-one mapping, each input code word produces a different output code word.
2-4Decoder
This Decoder has one enable input which is active high and 4 outputs which are active high.
The binary decoder‟s truth table introduces a “don‟t-care” notation for input combinations. If
one or more input values do not affect the output values for some combination of the remaining inputs,
they are marked with an “x” for that input combination. This convention can greatly reduce the
number of rows in the truth table, as well as make the functions of the inputs more clear.
Truth Table:
Inputs outputs
EN I1 I0 Y3 Y2 Y1 Y0
0 X X 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
Algorithm:
2-to-4 Decoder has 2 code inputs (I1,I0) and 4 code outputs (Y3downto Y0).
1 enable input (E), one is active high enable.
Declare the code inputs, Enable inputs and code outputs in Entity declaration part.
Declare the required components and signals in Architecture definition part. (STRUCTURAL
STYLE)
Declare the component label, name and port map with required component instantiation
statement for structural style. Otherwise based on VHDL styles define Architecture body.
(STRUCTURAL STYLE)
Logic Diagram:
Test Bench:
Result:
Theory:
Multiplexer is a digital switch or Many into One and also called Data Selector. Multiplexer allows
digital information from several sources routed on to single data out put.
Logic Symbol:
Truth Table:
Logic Diagram:
Result:
AIM: Design & Write a VHDL code for Flip-Flop‟s and verify its functionality by writing test bench,
using any two VHDL Styles.
Theory:
D flip-flop:
The D flip-flop is widely used. It is also known as a "data" or "delay" [Link] D flip-flop captures
the value of the D-input at a definite portion of the clock cycle (such as the rising edge of the clock).
That captured value becomes the Q output. At other times, the output Q does not change.[21][22] The D
flip-flop can be viewed as a memory cell, a zero-order hold, or adelay line.
SR Flip Flop:
The simplest way to make any basic single bit set-reset SR flip-flop is to connect together a pair of
cross-coupled 2-input NAND gates as shown, to form a Set-Reset Bistable also known as an active
LOW SR NAND Gate Latch, so that there is feedback from each output to one of the other NANDgate
inputs. This device consists of two inputs, one called the Set, S and the other called the Reset,R with
two corresponding outputs Q and its inverse or complement Q (not-Q) as shown logic diagram
Consider the circuit shown above. If the input R is at logic level “0” (R = 0) and input S is at logic
level “1” (S = 1), the NAND gate Y has at least one of its inputs at logic “0” therefore, its
output Q must be at a logic level “1” (NAND Gate principles). Output Q is also fed back to input “A”
and so both inputs to NAND gate X are at logic level “1”, and therefore its output Q must be at logic
level “0”.
JK Flip Flop:
T Flip Flop:
D-Flip Flop:
PIN DIAGRAM:
Reset State
In this second stable state, Q is at logic level “0”, (not Q = “0”) its inverse output at Q is at logic level
“1”, (Q = “1”), and is given by R = “1” and S = “0”. As gate X has one of its inputs at logic “0” its
outputQ must equal logic level “1” (again NAND gate principles). Output Q is fed back to input “B”,
so both inputs to NAND gate Y are at logic “1”, therefore, Q = “0”.
If the set input, S now changes state to logic “1” with input R remaining at logic “1”, output Q still
remains LOW at logic level “0” and there is no change of state. Therefore, the flip-flop circuits
“Reset” state has also been latched and we can define this “set/reset” action in the following truth
table.
.JK flip-flop:
The JK flip-flop augments the behavior of the SR flip-flop (J=Set, K=Reset) by interpreting the S = R
= 1 condition as a "flip" or toggle command. Specifically, the combination J = 1, K = 0 is a command
to set the flip-flop; the combination J = 0, K = 1 is a command to reset the flip-flop; and the
combination J = K = 1 is a command to toggle the flip-flop, i.e., change its output to the logical
complement of its current value. Setting J = K = 0 does NOT result in a D flip-flop, but rather, will
hold the current state. To synthesize a D flip-flop, simply set K equal to the complement of J.
Similarly, to synthesize a T flip-flop, set K equal to J. The JK flip-flop is therefore a universal flip-
flop, because it can be configured to work as an SR flip-flop, a D flip-flop, or a T flip-flop.
T flip-flop
If the T input is high, the T flip-flop changes state ("toggles") whenever the clock input is strobed. If
the T input is low, the flip-flop holds the previous value. This behavior is described by the
characteristic equation:
Truth Table:
D Flip Flop:
JK Flip Flop:
T-Flip Flop:
Algorithm:
D-Flip Flop: (74X74)
Identify the how many inputs and outputs are required for developing of Dflipflop& Next write
the entity declaration.
In between of the architecture develop the function of Dflipflop 7474 with help of truth table.
For simulation to develop the test bench.
Give the sufficient time dimensions.(observe the model graphs).
SR Flip Flop:
Identify the how many inputs and outputs are required for developing of SR flipflop&Next
write the entity declaration.
Declare the required components and signals in Architecture definition part.
Declare the component label, name and port map with required component instantiation
statement for structural style. Otherwise based on VHDL styles define Architecture body.
VHDL Code:
JK Flip Flop:
D Flip Flop:
SR Flip Flop:
T-Flip Flop:
Test Bench:
Result:
Theory:
The modulus of a counter is the number of states in the cycle. A counter with m states is called a
modulo-m counter or, sometimes, a divide-by-m counter. A counter with a nonpower- of-2 modulus
has extra states that are not used in normal operation.
An n-bit binary counter can be constructed with just n flip-flops and no other components, for any
value of n.
T flip-flop changes state (toggles) on every rising edge of its clock input. Thus, each bit of the counter
toggles if and only if the immediately preceding bit changes from 1 to 0. This corresponds to a normal
binary counting sequence—when a particular bit changes from 1 to 0, it generates a carry to the
next most significant bit. The counter is called a ripple counter because the carry information ripples
from the less significant bits to the more significant bits, one bit at a time.
Algorithm:
First write the entity for T FF by describing T, CLK, CLR as inputs and Q as INOUT.
Initialize Q as „0‟
Write the architecture body declaration
Declare process statement with clk, clr as sensitivity list
Use the IF statement to declare conditions for clk, clr
Create a test bench for T FF for functional verification.
Now write the program for decade counter using T FF using following instructions.
Write the entity for decade counter with clock as input and Q(3)Q(2)Q(1)Q(0) as inout.
Write the architecture body for decade counter by its syntax.
Create 4 T FF instances using component instantiation statements or port map statements.
Create a test bench for the above decade counter program.
Give the clock stimuli and check the functional behavior of the Binary counter.
Truth Table:
Present state Next state
Clock( Negative Edge Transition) Q(3)Q(2)Q(1)Q(0) Q(3)Q(2)Q(1)Q(0)
1-0 0000 0001
1-0 0001 0010
1-0 0010 0011
1-0 0011 0100
1-0 0100 0101
1-0 0101 0110
1-0 0110 0111
1-0 0111 1000
1-0 1000 1001
1-0 1001 1010
1-0 1010 1011
1-0 1011 1100
1-0 1100 1101
1-0 1101 1110
1-0 1110 1111
1-0 1111 0000
VHDL Code:
Test Bench:
Result: