Dec Lab Manual
Dec Lab Manual
Department of
Electronics and Instrumentation
Engineering
Evaluation Scheme
Daily Lab Test/
Attendance Record Viva-voce Total
Performance Mini Project
10 30 15 30 15 100
Detailed Syllabus
Experiment # Assignment / Experiment
1 Digital Logic Gates: Investigate logic behaviour of AND, OR, NAND, NOR,
EXOR,EX-NOR, Invert and Buffer gates, use of Universal NAND Gate.
2 Combinational Circuit Design: Design, assemble and test: adders and subtractors.
3 Combinational Circuit Design: Code Converters, Gray code to Binary and 7
Segment Display.
4 Universal Gates: Design, implement and test a given design example with (i)
NAND Gates only (ii) NOR Gates only and (iii) using minimum number of
Gates.
5 Multiplexer and De-multiplexer: Design with multiplexers and de-multiplexers.
6 Flip-Flop: Assemble, test and investigate operation of SR, D & J-K flip-flops.
7 Shift Registers: Design and investigate the operation of all types of shift registers.
8 Counters: Design, assemble and test various ripple and synchronous counters -
decimal counter, Binary counter with parallel load.
9 Parallel Adder and Accumulator: Design, implement and test.
10 Binary Multiplier: design and implement a circuit that multiplies 4-bit unsigned
numbers to produce an 8-bit product.
11 Memory Unit: Investigate the behaviour of RAM unit and its storage capacity –
16×4 RAM: testing, simulating and memory expansion.
12 Clock-pulse generator: Design, implement and test.
13 Verilog/VHDL Simulation and implementation of Experiments 2 to 12.
Digital circuits form the backbone of communication systems, recording devices and many more
systems. Digital Electronics may also refer to the portion of an electronic circuitry responsible for
digital signal conversion. Some devices in this field include multiplexers, gates and decoders. Digital
Electronics is that it is the foundation of modern computers and digital communications. It is
complex digital logic circuits with millions of gates can be built onto a single integrated circuit known
as a microprocessor and these circuits can perform millions of operations per second.
Digital electronics is a fast-expanding field with scope for significant development. This manual
discusses the basics of designing circuits and the functioning of intricate components of a digital
circuit. It presents the fundamental concepts and serves as an excellent guide for an introductory
course on digital electronics. Digital electronic circuits are main thing in digital electronics which
is usually made from large assemblies of logic gates. The system which process discrete values is
known as digital system. The significance of digital electronics is that are inherently more reliable
than analog, in terms of information processing.
LABORATORY ORIENTATION:
OVERALL PURPOSE:
The laboratory portion of this course is designed
• To provide hand-on experience in Circuit design in hardware and using software.
• To provide hands on experience in assembly and Testing of electronics circuit.
• Each laboratory station is equipped with a Power supply, Universal trainer kit.
• Students work in groups, but maintain individual laboratory notebooks and submit
individual reports.
GENERAL COMMENTS:
Every week before the lab, each student should read and prepare for the experiment to be
performed. He/She should work out on the various calculations that are outlined. The student
should refer to the text as prescribed in the course description for the fundamental theory.
The student’s grade will be given on how well he/she has prepared for the lab. Well-
maintenance of laboratory equipment is also the responsibility of students. A constant effort to
CONTENTS
Exp. No. LIST OF EXPERIMENTs Page
1 Digital Logic Gates: Investigate logic behavior of AND, OR, NAND, NOR, EX-OR, 1-9
EX-NOR, Invert and Buffer gates, use of Universal (NAND & NOR) Gates.
2 Gate-level minimization: Two level and multi-level implementation of Boolean 10-13
functions.
3 Design, implement and test a given design example with (i) NAND Gates only 14-21
(ii)NOR Gates only and (iii) using minimum number of Gates.
4 Combinational Circuits: design, assemble and test: adders and subtractors. 22-29
5 Design, assemble and test code converters: binary code to gray code, gray code 30-34
to binary and 7 segment displays.
6 Study of Multiplexer, Demultiplexer. Design with multiplexers & de-multiplexer. 35-41
7 Design of Binary to Octal decoder and Implementation of Boolean function 42-46
using decoder
8 Flip-Flop: assemble, test and investigate operation of SR, D, J-K & T flip-flops. 47-55
9 Shift Registers: Design and investigate the operation of all types of shift 56-64
registers with parallel load.
10 Counters: Design, assemble and test various ripple and synchronous counters 65-71
11 Design, assemble and test decimal counter, Binary counter with parallel load. 72-76
12 Memory Unit: Investigate the behavior of RAM unit and its storage capacity – 77-81
16 X4 RAM: testing, simulating and memory expansion.
13 Clock-pulse generator: design, implement and test. 82-86
14 Parallel adder and accumulator: design, implement and test. 87-89
15 Binary Multiplier: design and implement a circuit that multiplies 4-bit unsigned 90-93
numbers to produce a 8-bitproduct.
16 Design, implement and test two-bit magnitude comparator. 94-97
17 Design of special type of counters (four-bit ring counter & Johnson counter) 98-103
using JK flip-flops.
18 Verilog/VHDL simulation and implementation of logic gates. 104-115
19 Verilog/VHDL simulation and implementation of different combinational 116-126
circuits in dataflow and behavioral modeling.
𝒀 = 𝑨. 𝑩
2-INPUT OR GATE
The OR gate is a digital logic gate with ‘n’ I/Ps ( n≥2) and one O/P, that performs a logical
conjunction based on the combinations of its inputs. The output of the OR gate is true only
when one or more inputs are true. If all the inputs of the gate are false, then only the output
of the OR gate is false.
• The OR gate gives an output of 1 if either one or more inputs are 1, it gives 0 otherwise.
• The OR gate gives an output of 0 if all inputs are 0, it gives 1 otherwise.
Mathematically, 𝒀 = 𝑨+𝑩
2-input OR Gate Truth Table of 2-Input OR Pin diagram of 7432 quad 2 I/Ps
Gate OR Gate
𝒀 = 𝑨+𝑩
̅
𝒀=𝑨
• The NAND gate (negated AND) gives an output of 0 if all the inputs are 1, it gives 1
otherwise.
• If one or more I/Ps are ‘0’ the O/P will be ‘1’.
Mathematically, 𝒀 = ̅̅̅̅̅
𝑨. 𝑩
2-input NAND Truth Table of 2-Input NAND Pin diagram of 7400 quad 2 I/Ps
Gate Gate NAND Gate
𝒀 = ̅̅̅̅̅
𝑨. 𝑩
2-input NOR Gate Truth Table of 2-Input NOR Pin diagram of 7402 quad 2 I/Ps
Gate NOR Gate
𝒀 = ̅̅̅̅̅̅̅̅
𝑨+𝑩
If odd numbers of the inputs of this gate is high, then the output of the EX-OR gate will be
high.
• The XOR gate gives an output of 1 if odd numbers of Inputs are 1, it gives 0 otherwise.
Mathematically,
̅ + 𝑨
𝒀 = 𝑨. 𝑩 ̅. 𝑩
2-input XOR Gate Truth Table of 2-Input Pin diagram of 7486 quad 2 I/Ps XOR
XOR Gate Gate
̅ + 𝑨
𝒀 = 𝑨. 𝑩 ̅. 𝑩
̅. 𝑩
𝒀 = 𝑨 ̅ + 𝑨. 𝑩
Out of the seven logic gates discussed above, NAND and NOR are known as universal gates
since they can be used to implement any digital circuit without using any other gate. This
means that every gate can be created by NAND or NOR gates only.
Realization of Basic Logic gates& NOR Realization of Basic Logic gates & NAND
Gate from NAND Gate Gate from NOR Gate
Note – For implementing XNOR gate, a single NAND or NOR gate can be added to the above
PRECAUTION
• Make the connections according to the IC Pin diagram.
• Make sure the connections are tight.
• The VCC and ground potential should be applied carefully at the specified pin only.
PROCEDURE
• Fix the ICs on breadboard horizontally but don’t switch on the power supply.
• Connect the positive terminal of the IC i.e., pin 14 to +5volt dc and pin 7 is to be
grounded.
• Give input at pin 1, 2 from input switches & connect pin 3 to an output LED of
breadboard.
• Again, verify the said connection and switch on the ac power supply as well as
breadboard power supply.
• Note the values of output for different combination of inputs (depending on input
switches are ON or OFF mod) & verify the truth table for each gate.
• The output LED will glow when the truth table output is high and will be off when
the truth table output is low.
• Follow the same connection step and verify the truth table for the ICs
7400,7408,7432,7486,74266 except for the ICs 7402,7404.
• Since IC7404 is Hex Inverter (used for NOT gate), it contains six not gates and each
gate is having single input and single output.
• For this, +Vcc and ground pin connections will be same as previous ICs and pin
number 1 will be connected to input switch and pin number 2 will be connected to
output Led of breadboard.
• Then verify the output according to the truth table.
• Similarly, in case of IC7402, +Vcc (+5v dc) and ground will be connected to pin no.14
& pin no. 7 respectively (same as other IC connections).
• Here pin no.2 & 3 will be connected to input switches and pin no.1 will be connected
to output LED of breadboard (reverse as compared to IC7400,7408,7432 etc.)
• Verify the truth table of NOR gate.
[NB: you can verify any one gate of the IC]
• To test the universal NAND and NOR gates or to design any logic gate using NAND or
NOR gate see the connections carefully.
• On the circuit diagram give pin numbers to each input and output as in the ICs and
make connections accordingly (like one output is input of another.
• Again, verify the said connection and switch on the ac power supply as well as
breadboard power supply.
• Verify the truth table of designed logic gate which is designed using the universal
logic gates.
RESULT ANALYSIS
Observe the truth table of each gate after circuit connection is completed.
CONCLUSION
After completing this experiment
• We became more familiar with the truth tables of logic gates.
• Identified the 74 Series Integrated circuits (ICs) belong to logic gates and their pin
configurations.
• Tested logic behavior (truth tables) of Basic Gates (AND, OR, INVERT) and Derived
Gates (NAND, NOR, EX-OR, EX-NOR) ICs.
• Used universal Gates (NAND & NOR) to realize other gates and justified through truth tables.
QUESTIONNAIRE
1. Realize 2i/p AND gate using NAND gate.
2. Realize 2i/p OR gate using NAND gate.
3. Realize 2i/p EXOR gate using NOR gate.
4. Realize Buffer gate using NOR gate.
5. Define logic gates.
6. What are the basic logic gates?
7. How many universal gates exist? Name them.
8. State the level of input and output of logic gates.
9. Symbol and truth table of AND gate.
10. Why NAND and NOR gates are called universal gates?
11. What is different between Ex-or & Ex-nor gate?
12. Realize XNOR gate.
13. Explain buffer gate?
14. Draw truth table of XOR gate.
15. What is truth table?
16. Draw the pin configuration of IC 7400.
17. How many numbers of pins are available in IC 7432?
18. Mention the pin numbers of IC 7408 connected to supply and gnd.
19. What do you mean by DIP, PDIP,CDIP?
20. Why IC 7404 is called HEX Inverter?
21. Which logic is followed by74 series ICs?
22. How many gates are available in IC 74266 and name the gate?
23. In the IC it is mentioned HD74LS00P.What is the full form of “LS”.
24. What is the minimum and maximum power supply can be given to 74 series ICs?
25. How many buffer gates are available in IC 7407? Mention the i/p and o/p pin for 4 th
gate.
COMPONENTS REQUIRED
• IC 7408,IC 7432,IC 7404,IC 7486
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
The complexity of the digital logic gates that implements a Boolean function is directly
related to the complexity of the algebraic expression from which the function is
implemented. The simplified expression will be assured that the simplest algebraic
expression is one with fewest possible numbers of literals in each term. This produces a
minimum number of inputs for the gate. The simplest expression is not unique. It is
sometimes possible to find two or more expression that satisfies the minimization criteria.
While two level circuit representation of circuits strictly refers to the flattened view of the
circuit in terms of SOPs (sum of products).Design of a multilevel representation in a more
generic view of the circuit in terms of arbitrarily connected SOP, POS(product of sum)
factorized form etc.
TWO LEVEL MINIMISATION
EXAMPLE- CIRCUIT DIAGRAM
𝑭𝟏 = 𝑨𝑩’ + 𝑩’𝑪 + 𝑨𝑩’𝑪
= AB’(1 + C) + B’C A
C B’(A+C)
= AB’ + B’C
= B’(A + C) B LEVEL-2
TRUTH TABLE
A B C B’ A+C B’(A+C)
0 0 0 1 0 0
0 0 1 1 1 1
0 1 0 0 0 0
0 1 1 0 1 0
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 0 1 0
1 1 1 0 1 0
= 𝑩𝑪 + 𝑨’(𝑩(+)𝑪)
B
C
LEVEL-1 LEVEL-2 LEVEL-3
3 LEVEL MINIMISATION
TRUTH TABLE
A B C A’ BC B(+)C (B(+)C)A’ BC+A’(B(+)C)
0 0 0 1 0 0 0 0
0 0 1 1 0 1 1 1
0 1 0 1 0 1 1 1
0 1 1 1 1 0 0 1
1 0 0 0 0 0 0 0
1 0 1 0 0 1 0 0
1 1 0 0 0 1 0 0
1 1 1 0 1 0 0 1
PRECAUTION
• Make the connections according to the IC Pin diagram.
• Make sure the connections are tight.
• The VCC and ground potential should be applied carefully at the specified pin only.
PROCEDURE
For two-level Implementation
• Insert the ICs 7432, 7404, 7408 on the breadboard horizontally.
• Pin no. 14 and pin no.7 of all ICs should be connected to +5v dc and ground of
breadboard respectively (you can short pin no. 14 of all ICs and pin no. 7 of all ICs
individually. Then you can connect +5v dc to any IC pin no 14 through single wire.
Similarly, you can connect ground to any IC pin no 7 through single wire)
• Connect three wires from input switches of breadboard named as A,B,C.
• A &C inputs will be connected to pin no 1 and 2 of 7432 (OR gate) IC.
• B inputs will be connected to pin no 1 of 7404 (NOT gate) IC.
• Pin no 3 of 7432 IC will be connected to pin no 1 of 7408 (AND gate) IC.
• Pin no 2 of 7404 IC will be connected to pin no 2 of 7408 (AND gate) IC.
• Pin no 3 of 7408 IC will be connected to LED output of breadboard which is the
required output of the circuit.
• After verification of the connection switch on the trainer kit and power supply.
• Apply input to the circuit according to the truth table (by ON OFF mode).
• Observe the output on 8-bit LED display.
• Repeat steps for different input as per truth table and observe the output.
For multi-level Implementation
• Insert the ICs 7486, 7404, 7408 on the breadboard horizontally.
• Pin no. 14 and pin no.7 of all ICs should be connected to +5v dc and ground of
breadboard respectively (you can short pin no. 14 of all ICs and pin no. 7 of all ICs
individually. Then you can connect +5v dc to any IC pin no 14 through single wire.
Similarly, you can connect ground to any IC pin no 7 through single wire).
• Connect three wires from input switches of breadboard named as A,B,C.
[Note: Before circuit connections better number the IC pins of all ICs.
• For e.g. :IC 7486-1st gate is pin 1,2,3
IC 7404-1st gate is pin no 1,2
IC 7408-1st gate is pin no 1,2,3
2nd gate is pin no 4,5,6
3rd gate is pin no 9,10,8
• Short pin no.1 of 7486 IC to pin no 1 of 7408 IC.
• Short pin no.2 of 7486 IC to pin no 2 of 7408 IC.
• Input A will be connected to pin no.1 of 7404 IC.
• B & C inputs will be connected according to the circuit diagram.
• Short pin no.3 of 7486 IC to pin no 4 of 7408 IC.
OBJECTIVE
• To form, analyse and design the truth table for Half adder, Full Adder, Half Subtractor and
Full Subtractor.
• From the truth table the output may be expressed as function of input variable in SOP/POS
form and simplified if required.
• The same may be implemented like Boolean function implementation.
COMPONENTS REQUIRED
• IC 7408, IC 7432, IC 7404, IC 7486
• Digital Trainer Kit
• Connecting wires
• Twizer
APPLICATIONS
Combinational circuits are logic circuits whose outputs respond immediately to the inputs
as there is no memory.
THEORY
Combinational Logic Circuits are memory less digital logic circuits whose output at any
instant in time depends only on the combination of its inputs present at that instant of time.
A hierarchical structure of a combinational logic circuit is shown in Fig. 3.1.
An adder is a digital logic circuit in electronics that implements addition of numbers. In many
computers and other types of processors, adders are used to calculate addresses, similar
operations and table indices in the ALU and also in other parts of the processors. Adders are
classified into two types: Half Adder and Full Adder.
The Binary Subtractor is another type of combinational arithmetic circuit that produces an
output which is the subtraction of two binary numbers7. Subtractors are classified into two
types: Half Subtractor and Full-Subtractor.
CIRCUIT DIAGRAM
TRUTH TABLE
PROCEDURE
• Fix three ICs 7486 (XOR), 7432 (OR) and 7408 (AND) on the breadboard.
• Make proper connection of + Vcc and ground to all ICs.
• Before connection on the breadboard, give number to the pins of the gates of the ICs.
• Apply input to the circuit from input switches of breadboard trainer kit as A, B and Cin
as shown in the diagram.
• The second XOR gate output will be connected to the output LED, which is the Sum (S).
• The output will be connected to another output LED which is the Carry (Cout ).
• Now switch on the breadboard trainer kit.
• Taking different combinations of inputs, observe the output on 8-bit LED (Repeat steps
for different inputs as per truth table).
HALF-SUBTRACTOR (Subtracting 2-Bits)
• Subtracting a single-bit binary value B from another A (i.e., A -B) produces a difference
bit (D) and borrow out bit (𝐵𝑜𝑢𝑡 ).
• This operation is called half subtraction and the circuit to realize it is called a half
subtractor.
• The half subtractor is constructed using X-OR and AND Gate. The difference can be
applied using X-OR Gate𝐵𝑜𝑢𝑡 can be implemented using an AND Gate and an inverter.
• The Boolean functions describing the Half-Subtractor are:
𝐷 =𝐴⊕𝐵
𝐵𝑜𝑢𝑡 = 𝐴̅ . 𝐵
TRUTH TABLE
PROCEDURE
• Fix four ICs 7486 (XOR), 7404 (NOT), 7432 (OR) and 7408 (AND) on the breadboard.
• Make proper connection of + Vcc and ground to all ICs.
• The circuit connections are same as Full Adder connections except two NOT gates
are added to the circuit.
• Apply input to the circuit from input switches of breadboard trainer kit as A, B and
Bin as shown in the diagram.
• IC 7486 will be connected to the output LED, which is the Difference (D).
• IC 7432 will be connected to another output LED which is the Borrow (B).
• Now switch on the breadboard trainer kit.
• Observe the output on 8bit LED.
• Repeat steps for different inputs as per truth table.
RESULT ANALYSIS
• Observe the truth table after circuit connection is completed.
CONCLUSION
• With the help of truth tables, we observed that the theoretical values and the
experimental results of the designed circuits are same. Hence, the experiment is
completed successfully.
QUESTIONNAIRE
1. If A and B are the inputs of a half adder, the sum is given by __________
2. How many AND, OR and EXOR gates are required for the configuration of full adder?
3. What are the applications of full adder circuit?
4. Half subtractor is used to perform subtraction of how many bits.
5. What is the major difference between half adder and full adder?
6. How many 7486,7408,7404,7432 Ics are required to design a full subtractor?
7. What is the major difference between half adder and half subtractor?
8. Mention the name of ICs to design a half subtractor?
9. Find the Boolean function for sum in Full adder.
10. Half adder is used to perform the addition of how many bits.
OBJECTIVE
• To form the truth table taking Binary inputs and derive corresponding gray code
output. (3-bits/4 bits may be taken for testing purpose). From each column gray
output may be expressed as a function of binary variable and simplified if required.
• The simplified output may be implemented and truth table may be verified.
• The above steps may be repeated taking gray code as inputs and Binary output for 3
or 4 variables. Binary output may now be expressed as function of gray code inputs
and truth table may be verified.
COMPONENTS REQUIRED
• IC 7486,IC 7447,
• 7 segment display devices
• Resister (560 Ω)
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
CODECONVERTER
A Code converter is a combinational logic circuit whose inputs are bit patterns representing
numbers in one code and whose outputs are the corresponding representations in a
different code.
➢ Binary to Gray Code Converter
Code is a symbolic representation of discrete information. Codes are of different types. Gray
Code is one of the most important codes. It is a non-weighted code which belongs to a class
of codes called minimum change codes. In this code, while traversing from one step to
another step only one bit in the code group changes. In case of Gray Code two adjacent code
numbers differs from each other by only one bit.
PRECAUTION
• Make the connections according to the IC Pin diagram.
• Make sure the connections are tight.
• The VCC and ground potential should be applied carefully at the specified pin only.
PROCEDURE FOR CODE CONVERTER
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• The Vcc and GND should be applied carefully at the specified pin only.
• Apply input to the circuit according to the circuit diagram.
• In case of binary to gray conversion, the inputs are given at respective pins and
outputs are taken for all the combinations and same for gray to binary conversion.
• Switch on the trainer kit.
• Observe the output AND VERIFY THR TRUTH TABLE
• Repeat steps for different input as per truth table.
PROCEDURE FOR CODE CONVERTER
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• In 7-segment display, connect four switches to the four inputs of your decoder
inputs (D, C, B, and A) respectively& check the display for corresponding output.
• Connect the positive terminal of supply to pin 16 and pin 8 is to be grounded.
• Give input at corresponding pins & connect output pins to an output LED.
• Switch on the trainer kit.
• Note the values of output for different combination of inputs & verify the logic table
for each circuit.
• Observe the output and verify the truth table
• Repeat steps for different input as per truth table.
RESULT ANALYSIS
• Observe the output and verify the truth table
CONCLUSION
• With the help of truth tables, we observed that the theoretical values and the
experimental results of the designed circuits are same. Hence, the experiment is
completed successfully.
QUESTIONNAIRE
1. What is magnitude comparator?
2. What is IC?
3. What is most significant bit?
4. What is seven segment displays?
5. Covert gray to binary 01101.
6. What is equality?
7. What is inequality?
8. What is D’morgans theorem?
OBJECTIVE
• Use of Universal Gates (NAND & NOR) to implement given Boolean function and
justify through truth tables.
• Simplify the Boolean function using algebraic laws or using KMAP.
• Design the simplified Boolean function with minimum number of gates (NAND &
NOR) and verify the truth table.
COMPONENTS REQUIRED
• IC 7400,IC7402
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
NAND and NOR gate are said to be universal gate because any digital system can be
implemented with these two gates. Digital circuits are frequently constructed with NAND
and NOR gates are easier to design and used in all digital circuits. Designing a circuit with
minimum number of gates is more advantageous for digital systems as it requires minimum
space and a smaller number of gates, so less complex. We can use Boolean algebraic rules
and laws or KMAP to simplify a given Boolean function.
Boolean function
𝐹 = 𝐴𝐵’𝐶 + 𝐴’𝐵𝐶’ + 𝐷
A B C D F
0 0 0 0 0
0 0 0 1 1
0 0 1 0 0
0 0 1 1 1
0 1 0 0 1
0 1 0 1 1
0 1 1 0 0
0 1 1 1 1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
A B C D F
0 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
0 1 1 0 0
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 0
1 1 0 1 1
1 1 1 0 0
1 1 1 1 1
PRECAUTION
• Make the connections according to the IC Pin diagram.
• Make sure the connections are tight.
• The VCC and ground potential should be applied carefully at the specified pin only.
PROCEDURE
FOR NAND GATE ONLY:
The function 𝐹 = 𝐴𝐵′𝐶 + 𝐴′𝐵𝐶′ + 𝐷 designed with NAND gate only and it requires seven
numbers of NAND gate out of which 3 are 3 input NAND and 4 are 2 input NAND gate as
shown in the diagram.
Since one 7400(2 input NAND gate) IC contains 4 no. of NAND gate and 7410 (3 input NAND
gate) IC contains 3 no. of NAND gate. In this experiment we require one 7400 (NAND) IC and
one 7410 (3 input NAND gate).
Before connecting the circuits, your number the IC pins for better understanding.
• Fix one 7400 (2 input NAND) ICs and one 7410 (3I/P NAND) IC on the Breadboard.
• Make the connection for +VCC and ground to both the ICs.
• You should be clear about the input pins and the output pins of 3 input NAND (7410)
IC.
• Connect 4nos of connecting wires to input switch of Breadboard and all will be
connected to input of NAND gates such as A,B,C,D as shown in the diagram.
• Make internal connections having seen the diagram carefully.
• 'F' will be the final output which will be taken from third 3 input NAND gate output.
• 'F' will be connecting to the output LED of Breadboard.
• Verify the connections once again and then power ON the trainer kit.
• Give the inputs to A,B,C,D and at 'F' verify the Truth table.
You should be clear about the output pins and input pins of IC 7402 and 7427.
In this Experiment we require one 7402 (NOR) IC and one 7427(3 input NOR) IC.
RESULT ANALYSIS
Verify the truth table of Boolean functions F & F1 for both the circuits (using NAND & NOR gate).
CONCLUSION
• With the help of truth table, we observed that the circuit designed using universal
gates for Boolean function F is same.
• After simplification of Boolean function F1 it is designed using NAND gate and truth
table is verified.
• It is understood that any Boolean function can be designed using NAND & NOR gates
hence called universal gates.
• To reduce the cost as well as the path delay time we need to simplify the function.
QUESTIONNAIRE
1. Why NAND and nor GATES ARE CALLED UNIVERSAL GATES?
2. Draw the truth table and logic symbol of 2input NAND gate.
3. Draw the truth table of 2input NAND gate.
4. Implement the given Boolean function using NAND gates only. F=AB+C
5. Implement the given Boolean function neither using nor gates only. F=AB+C
6. Implement the given Boolean function using nor gates only F=A’B+C
7. Which logic gates are called the basic gates?
8. Implement the given Boolean function using basic gates and NAND gates. F=AB+CD.
9. Simplify the Boolean function using KMAP and implement using universal gates.𝐹 =
∑ 𝑚 (0, 1, 2, 3, 4, 5, 6, 7 ).
10. Simplify the Boolean function using KMAP and implement using universal gates. 𝐹 =
∏(0, 4) .
OBJECTIVES
• Identify the 74 Series Integrated circuits (ICs) belong to logic gate and MUX and
their pin configurations.
• Test logic behavior (truth tables) of 3 input AND gate.
• Design of 4:1 MUX and 1:4 DEMUX using basic gates(NOT,AND,OR) and justify
through truth tables.
• Implement Full Adder using 4:1 MUX (IC 74153) and verify the truth table of full
adder.
COMPONENTS REQUIRED
• IC 7411,IC 74153,IC7404,IC7432
• Trainer Kit
• Connecting wires
• Twizer
APPLICATIONS
• Multiplexers are also used in communications; the telephone network is an example
of a very large virtual Mux built from many smaller discrete ones.
• Instead of having a direct connection from every telephone to every telephone -
which would be physically impossible - the network "MUXes" individual telephones
onto one of a small number of wires as calls are placed.
• At the receiving end, a de-multiplexer, or "DEMUX", chooses the correct destination
from the many possible destinations by applying the same principle in reverse.
THEORY
MULTIPLEXER
• Multiplexer is a combinational circuit that has maximum of 2n data inputs, ‘n’
selection lines and single output line. One of these data inputs will be connected to
the output based on the values of selection lines. Multiplexer is also called as Mux
or MPX.
• Multiplexers are also known as “Data n selector, parallel to serial convertor, many
to one circuit, universal logic circuit”. Multiplexers are mainly used to increase
amount of the data that can be sent over the network within certain amount of time
and bandwidth.
4:1 MULTIPLEXER
4:1 Multiplexer has four data inputs I3, I2, I1 & I0, two selection lines S1 & s0 and one output Y.
PROCEDURE
• Fix the ICs on the Breadboard such as 7404 (NOT gate), 7411 (3 Input AND) and 7432
(OR Gate) IC.
• Insert 2 no. of 7411 ICs because within one 7411 IC. It contains only 3 no. of 3 input
AND gate.
• Connect 6 no of wires to switching input of Breadboard out of which 2 input will be
selection lines S0and S1.Rest 4 inputs are input to the circuits such as I0, I1, I2 and I3.
• You should be clear about the output pins and input pins of IC 7411,7432 and 7404
• Design the circuit according to the diagram given.
• Final output will be 'Y' which is the MUX output.
• 'Y' will be connected to output LED of Breadboard.
• Verify the connections Once again and then Power ON the Trainer Kit.
• Depending on the input select lines S0 and S1 States, at output 'Y' which data will be
transferred from input lines to output it will display.
• Finally verify the Truth Table.
VERIFICATION TABLE
Selection Lines Output
S1 S0 Y
0 0 I0
0 1 I1
1 0 I2
1 1 I3
DEMULTIPLEXER
De-Multiplexer is a combinational circuit that performs the reverse operation of
Multiplexer. Demultiplexer is in fact a circuit which can distribute or deliver multiple
outputs from a single input. It can often refer as data distributor or DEMUX. It can perform
as single input many output switches.
It has single input, ‘n’ selection lines and maximum of 2n outputs. The input will be
connected to one of these outputs based on the values of selection lines.
The 1 to 4 Demultiplexer consists of one input, four outputs, and two control lines to make
selections.
VERIFICATION TABLE OF
Implementing Full-Adder
• A full adder is a combinational circuit that forms the arithmetic sum of three bits. It
consists of three inputs (two significant bits to be added and a carry from the
previous lower significant position) and two outputs (sum and carry).
OBJECTIVES
• To learn about the functionality of Decoder.
• To give Binary input and Obtain Octal output.
• To express and implement higher order Decoder using lower order Decoders.
HARDWARE REQUIRED
• IC 74hc238,
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
A Decoder is a combinational circuit that converts binary information from n input lines to
a maximum of 2n unique output lines. (A decoder is a device which does the reverse
operation of an encoder, undoing the encoding so that the original information can be
retrieved. The same method used to encode is usually just reversed in order to decode). In
digital electronics, a decoder can take the form of a multiple- input, multiple-output logic
circuit that converts coded inputs into coded outputs, where the input and output codes are
different. e.g. n-to-2 n , binary-coded decimal decoders. Enable inputs must be on for the
decoder to function, otherwise its outputs assume a single "disabled" output code word. In
case of decoding all combinations of three bits eight (23 =8) decoding gates are required.
This type of decoder is called 3-8 decoder because 3 inputs and 8 outputs. For any input
combination decoder outputs are 1 i.e. at any time one of the output must be true and rest
are false. If inverted output is considered then one output must be false for any valid input
combination when rest is true. The truth table for binary to octal converter (which is 3 to 8
Decoder. It implies there are 3 input lines and 8 output lines).
VERIFICATION TABLE
INPUTS OUTPUTS
̅𝟏
𝑬 ̅𝟐
𝑬 𝑬𝟑 𝑨𝟎 𝑨𝟏 𝑨𝟐 𝒀𝟎 𝒀𝟏 𝒀𝟐 𝒀𝟑 𝒀𝟒 𝒀𝟓 𝒀𝟔 𝒀𝟕
H X X X X X L L L L L L L L
X H X X X X L L L L L L L L
X X L X X X L L L L L L L L
L L H L L L H L L L L L L L
L L H H L L L H L L L L L L
L L H L H L L L H L L L L L
L L H H H L L L L H L L L L
L L H L L H L L L L H L L L
L L H H L H L L L L L H L L
L L H L H H L L L L L L H L
L L H H H H L L L L L L L H
NOTE: -H – High Voltage Level, L – Low Voltage level, X – Don’t care
IMPLEMENTATION OF FULL ADDER USING 3:8 DECODER
SUM = ∑m (1, 2, 4, 7)
Cout = ∑m( 3, 5, 6, 7)
[Figure 7.2: - Circuit Diagram of Full Adder Using 3:8 Line Decoder]
PROCEDURE
• Fix the IC 74238 on the breadboard.
• Fix the IC 74HC4072 (4 Dual input OR gate) IC on breadboard. [In case of non-
availability of 74HC4072, you can use 7427 and 7432 ICs].
• Give inputs to the IC 74238 named as A, B, and Cin.
• Connect the output pins of 74238 to Dual 4 inputs OR IC.
• First OR output, will be connected to one output LED which is SUM of Full Adder.
• Second OR output will be connected to another output LED which is carry, named as
Cout.
• Verify the connections once again and then power ON the broadband Trainer.
• Giving the inputs to decoder observe the output at LEDs and verify the Full adder
Truth table.
CONCLUSION
The output shown in the verification table was verified from the truth table.
QUESTIONNAIRE
1. How many 3-to-8-line decoders with an enable input are needed to construct a 6-to-64-
line decoder without using any other logic gates?
2. A 4-digit number of the form aabb is a perfect square. What is the value of a – b?
3. Design a 2 to 4 decoder with inverted output.
4. A decoder is a combinational/Sequential Circuit? Justify your answer.
5. How many inputs and outputs will a decimal-to-BCD encoder have?
6. How is an encoder different from a decoder?
7. If we record music in any recorder it is called as___________.
(Decoding/demultiplexing/multiplexing/Encoding)
8. Can a Decoder be used as a demultiplexer? If so how.
9. For an 8-bit Encoder how many valid input combinations are there?
10. If two inputs are active on a priority encoder simultaneously, what will be the output?
OBJECTIVES
Design and verification SR, D, J-K,T flip flops.
COMPONENTS REQUIRED
1. IC7400,IC 7410, IC7404, 2. Digital Trainer Kit 3. Connecting wires 4. Twizer
APPLICATIONS
Flip-flops are the most common and basic memory devices used for storage of one
bit information in sequential circuits.
It is a basic building block for counters, registers, and other sequential control logic.
A flip-flop can stay in one of two logical states. To change its state, we need a new
input signal. This makes the flip-flop a 1-bit memory device.
A flip-flop circuit can maintain a binary state indefinitely until directed by an input
signal to switch state.
The major differences among various types of flip-flops are in the number of inputs
they possess and in the manner in which the inputs affect the binary state.
There are three basic types of flip-flops:
➢ Memory flip-flops have special inputs to be set or reset. The flip-flop preserves its
state as long as there is no new input signal.
➢ Delay flip-flops output the state their input had one cycle ago. If the input signal
changes at step ‘n’ the output changes at step ‘n+1’.
➢ Toggle flip-flop or “T” flip-flop changes its output on each clock cycle if the input
given to T is high (or 1). If the input of T is low (or 0) the output does not change,
meaning it is preserved.
PROCEDURE
• Fix the IC 7400 (Quad, 2 I/P NAND) on the bread board.
• Give +Vcc(+5V dc) to pin no. 14 and ground to pin no. 7 of the IC.
• Connect pin no. 1 (S) and 5 (R) of the IC from the input switch through wire
separately and pin no. 2 & 4 will be connected to the CLK input.
• Pin no. 3 will be connected to pin no. 9 and pin no. 6 will be connected to pin no. 13.
• Pin no. 8 will be get shorted with pin no. 12 and pin no. 10 will be get shorted with
pin no. 11.
• Pin no. 8 will be connected to o/p LED of the bread board which will be referred as
‘Q’ (output).
• Recheck the connection and then switch on the power supply of the bread board.
• Give the CLK i/p high (ON) condition.
• Give the input to the ‘S’ and ‘R’ through input switches of bread board and observe
the output through two outputs 𝑄 𝑎𝑛𝑑 𝑄̅ of the SR flip-flop.
CLK S R Q CONDITION
H 0 0 X No Change
H 0 1 0 Reset
H 1 0 1 Set
H 1 1 ? Invalid
Delay (D) Flip-flop
PROCEDURE
• The connection is almost same as the procedure SR flip-flop with a few deviations.
• Fix the IC 7400 (Quad, 2 I/P NAND) and 7404 (NOT) on the bread board.
• Give +Vcc(+5V dc) to pin no. 14 and ground to pin no. 7 of the IC.
• Assuming the connection same as S and R inputs. Connect the input (D) from the
input switch to the pin no. 1 (S) of 7400 IC & 7404 IC whereas the pin no. 2 of 7404
IC will be connected to pin no. 5 (R) of the 7400 IC.
• The pin no. 2 & 4 of 7400 IC will be connected to the CLK input.
• (For 7400 IC) Pin no. 3 will be connected to pin no. 9 and pin no. 6 will be connected
to pin no. 13.
• (For 7400 IC) Pin no. 8 will be get shorted with pin no. 12 and pin no. 10 will be get
shorted with pin no. 11.
• (For 7400 IC) Pin no. 8 will be connected to o/p LED of the bread board which will
be referred as ‘Q’ (output).
• Recheck the connection and then switch on the power supply of the bread board.
• Give the CLK input high (ON) condition.
• Give the input to the ‘D’ through input switches of the bread board and observe the
output through two outputs 𝑄 𝑎𝑛𝑑 𝑄̅ of the D flip-flop.
• Pin no. 3 and Pin no. 4 of 7400 IC will get shorted with each other.
• Pin no. 3 (J) and 6 (K) of 7400 IC will be connected to the output LED as ‘𝑄’ 𝑎𝑛𝑑 ′𝑄̅′
respectively.
• Now, pin no. 6 of 7400 IC will be connected to pin no. 13 of 7410 IC.
• Again, connect pin no. 5 of 7410 IC will be connected to pin no. 3 of 7400 IC.
• Recheck the connection and then switch on the power supply of the bread board.
• Give the CLK i/p high (ON) condition.
• For different values of the ‘J’ and ‘K’ as input, observe the output through two outputs
𝑄 𝑎𝑛𝑑 𝑄̅ of the JK flip-flop with different input combinations.
• Recheck the connection and then switch on the power supply of the bread board.
• Give the CLK i/p high (ON) condition.
• For different inputs of T, observe the output through two outputs 𝑄 𝑎𝑛𝑑 𝑄̅ of the T
flip-flop with different input combinations.
VERIFICATION TABLE
1. SR FLIP-FLOP
CLK S R Qn Qn+1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 ?
1 1 1 1 ?
0 X X 0 0
0 X X 1 1
2. D FLIP-FLOP
CLK D Qn Qn+1
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 1
0 X 0 0
0 X 1 1
3. JK FLIP-FLOP
CLK J K Qn Qn+1
1 0 0 0 0
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
0 X X 0 0
0 X X 1 1
4.T FLIP-FLOP
CLK T Qn Qn+1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
0 X 0 0
0 x 1 1
PRECAUTION
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• The Vcc and ground should be applied carefully at the specified pin only.
PROCEDURE
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• The Vcc and ground should be applied carefully at the specified pin only.
• Apply input to the circuit according to the circuit diagram.
• In case of gray to binary conversion, the inputs are given at respective pins and
outputs are taken for all the combinations.
• Switch on the trainer kit.
• Observe the output.
• Repeat steps for different input as per truth table.
• Verify the truth table.
CONCLUSION
All the Flip-Flops are designed and verified. It is observed that the observation table is
matching with the truth table.
QUESTIONNAIRE
1. Draw the truth table of SR FF.
2. Write the excitation table of SR FF?
3. Write the characteristic equation of D ff?
4. Why DFF is called Delay FF?
5. Why DFF is called transparent FF?
6. If j=K=0 what will be the behavior of output?
7. Why TFF is called Toggle FF?
8. Differentiate between negative and positive edge trigger.
9. Differentiate between edge trigger and level trigger.
10. Mention the name of IC used for D FF.
OBJECTIVE
• Identify the 74 Series Integrated circuits (ICs) belong to logic gate and D Flip Flop
and their pin configurations.
• To design Shift Registers (SISO, SIPO, PIPO,PISO) using D flip flops and investigate
the operation of all types of shift registers.
• To verify the truth tables.
COMPONENTS REQUIRED
• IC7474 (DUAL D FLIPFLOP),IC7432,IC7408,IC7404
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
Shift registers are the sequential logic circuits, consisting of flip-flops which are important in
applications involving the storage and transfer of data in a digital system. They are generally
found in calculators, computers and data-processing systems. The storage capacity of a shift
register is the total number of bits (1’s and 0’s) of digital data it can retain. Each stage (flip-
flop) represents one bit of storage capacity; therefore, the number of stages determines its
storage capacity. The shifting capability permits the movement of binary information from
stage to stage within the register or into or out of the register upon application of clock
pulses. They are basically classified into following types:
Serial-In/Serial-Out (SISO)
Serial-In/Parallel-Out (SIPO)
Parallel-In/Parallel-Out (PIPO)
Parallel-In/Serial-Out (PISO)
Serial-In/Serial-Out (SISO)
The SISO shift register accepts data serially, that is, one bit at a time on a single data line. It
produces the stored information on its output also in serial manner. The Circuit Diagram
represents a 3-bit SISO shift register which consists of three D-type flip-flops (positive edge
triggered) connected in cascade arrangement.
VERIFICATION TABLE
No of positive edge of Clock Serial Input Q2 Q1 Q0
0 - 0 0 0
1 1LSB 1 0 0
2 1 1 1 0
3 0MSB 0 1 1LSB
4 - - 0 1
5 - - - 0MSB
PROCEDURE
• Fix two nos. of 7474 IC (dual ‘D’ flip-flop) on the bread board horizontally (since it
requires 3 nos. of D-flip flop and it is 3 bit SISO).
• The two 7474 IC should be identical.
• Connect +Vcc (+5V dc) to pin no. 14 and ground to pin no. 7 to both the 7474 ICs.
• Connect four wires from input switches of bread board separately.
• First wire is the SET connection and will be connected to pin no. 4 of first 7474 IC.
• Short the pin no. 4 and 10 of first of first IC and again connected it to pin no. 4 of
second 7474 IC.
• Second wire is the clock (CLK) connection and will be connected to pin no. 3 of
second again connect it to pin no. 3 of second 7474 IC.
• Third wire is the RESET connection and will be connected to pin no. 1 and 13 of first
IC and again connect pin no. 1 of second 7474 IC.
• Fourth wire is the serial input (I/P Data) connection and will be connected to pin no.
2 of first 7474 IC. (i.e., first D-flip flop input).
• First D-flip flop output will be connected to 2nd D-flip flop input. (i.e., pin no. 5 of first
7474 IC will be connected to pin no. 12 of same IC).
• The output of second D-flip flop will be connected to input of the third D-flip flop
(i.e., pin no. 9 of first 7474 IC will be connected to pin no. 2 of second 7474 IC).
• Pin no. 5 of second IC will be connected to output LED and that is serial output (Q 0)
of the register.
• Verify the ICs connections once again.
• Now switch ON the power supply as well as bread board.
• Give the input data through serial input point.
• Give three clock (CLK) pulses and the data ‘1’ will be appear at serial output point
(Q0) which is the required output.
• Similarly, all other data can be sent serially and study the output at serial output point.
EXPLANATION
• Let us see the working of 3-bit SISO shift register by sending the binary
information “011” from LSB to MSB serially at the input.
• Assume, initial status of the D flip-flops from leftmost to rightmost is Q2Q1Q0=000.
• The initial status of the D flip-flops in the absence of clock signal is Q2Q1Q0=000.
• Here, the serial output is coming from Q0. So, the LSB 1 is received at 3rd positive
edge of clock and the MSB 0is received at 5th positive edge of clock.
• Therefore, the 3-bit SISO shift register requires five clock pulses in order to produce
the valid output.
• Similarly, the N-bit SISO shift register requires 2N-1 clock pulses in order to shift ‘N’
bit information.
Serial-In/Parallel-Out (SIPO)
The Circuit Diagram illustrates a SIPO shift register, into which the data bits are entered
serially (right-most bit first). The difference is the way in which the data bits are taken out
of the register; in the parallel output register, the output of each stage is available. Once the
data are stored, each bit appears on its respective output line and all bits are available
simultaneously, rather than on a bit-by-bit basis as with the serial output.
PROCEDURE
• Fix two nos. of 7474 IC (dual ‘D’ flip-flop) on the bread board horizontally (since it
requires 3 nos. of D-flip flop and it is 3-bit SIPO).
• The two 7474 IC should be identical.
• Connect +Vcc (+5V dc) to pin no. 14 and ground to pin no. 7 to both the 7474 ICs.
• Connect four wires from input switches of bread board separately.
• First wire is the SET connection and will be connected to pin no. 4 of first 7474 IC.
• Short the pin no. 4 and 10 of first of first IC and again connected it to pin no. 4 of
second 7474 IC.
• Second wire is the clock (CLK) connection and will be connected to pin no. 3 of
second again connect it to pin no. 3 of second 7474 IC.
• Third wire is the RESET connection and will be connected to pin no. 1 and 13 of first
IC and again connect pin no. 1 of second 7474 IC.
• Fourth wire is the serial input (I/P Data) connection and will be connected to pin no.
2 of first 7474 IC. (i.e., first D-flip flop input).
• First D-flip flop output will be connected to 2nd D-flip flop input. (i.e., pin no. 5 of first
7474 IC will be connected to pin no. 12 of same IC).
• The output of second D-flip flop will be connected to input of the third D-flip flop
(i.e., pin no. 9 of first 7474 IC will be connected to pin no. 2 of second 7474 IC).
• Pin no. 5 of second IC will be connected to output LED.
• In this case three outputs (Q2, Q1, Q0) will be taken instead of one and all these
outputs will be connected to output of bread board separately.
• Pin no. 5 of first 7474 IC is connected to Q0, Pin no. 9 of first 7474 IC is connected to
Q1, Pin no. 5 of second 7474 IC is connected to Q2. Accordingly, the outputs will be
taken from these pins.
• Verify the ICs connections once again.
• Now switch ON the power supply as well as bread board.
• Give the input data through serial input point. (As in the truth table)
• It will require three clock pulses to get the data at the output terminals.
• Similarly, all other data can be sent serially and study the output at parallel output
point.
VERIFICATION TABLE
No of positive edge of Clock Serial Input Q2 Q1 Q0
0 - 0 0 0
1 1LSB 1 0 0
2 1 1 1 0
3 0MSB 0 1 1
EXPLANATION
• Let us see the working of 3-bit SIPO shift register by sending the binary
information “011” from LSB to MSB serially at the input.
• Assume, initial status of the D flip-flops from leftmost to rightmost is Q2Q1Q0=000.
Here, Q2 & Q0 are MSB & LSB respectively.
• The initial status of the D flip-flops in the absence of clock signal is Q2Q1Q0=000. The
binary information “011” is obtained in parallel at the outputs of D flip-flops for
third positive edge of clock.
• So, the 3-bit SIPO shift register requires three clock pulses in order to produce the
valid output. Similarly, the N-bit SIPO shift register requires N clock pulses in order
to shift ‘N’ bit information.
Parallel-In/Parallel-Out (PIPO)
The Circuit Diagram illustrates a PIPO shift register the data bits are entered simultaneously
into their respective stages on parallel lines rather than on a bit-by-bit basis on one line as
with serial data inputs. Also, the output of each stage is available simultaneously.
• Pin no. 5 of first 7474 IC is connected to Q0, Pin no. 9 of first 7474 IC is connected to
Q1, and Pin no. 5 of second 7474 IC is connected to Q2. Accordingly, the outputs will
be taken from these pins.
• Verify the ICs connections once again.
• Now switch ON the power supply as well as bread board.
• Give the input data through input switches (D2, D1, D0) in parallel and the data will
be transferred to output (Q2, Q1, Q0) with single clock pulse. (As in the truth table)
• It will require three clock pulses to get the data at the output terminals.
• Similarly, all other data can be sent serially and study the output at parallel output
point.
VERIFICATION TABLE
No of positive edge of Parallel Input
Q2 Q1 Q0
Clock D2 D1 D0
0 0 0 0 0 0 0
1 1 0 0 1 0 0
2 1 1 0 1 1 0
3 0 1 1 0 1 1
EXPLANATION
• The binary information “000” is obtained in parallel at the outputs of D flip-flops
before applying positive edge of clock.
• Therefore, the 3-bit PIPO shift register requires zero clock pulses in order to produce
the valid output. Similarly, the N-bit PIPO shift register doesn’t require any clock
pulse in order to shift ‘N’ bit information.
Parallel-In/Serial-Out (PISO)
Fig illustrates a 3-bit PISO shift register. D0 and D1 are the two-parallel data-input lines and an
input allow 3 bits of data to load in parallel into the register. When goes LOW, the rightmost
AND gate is enabled, allowing the data bit to be applied to D1 of 2nd flip-flop. When it is HIGH,
the 1st AND gate is enabled, thereby permitting the data bit to shift right from one stage to
the next stage. The OR gate allow either the normal shifting operation or the parallel data-
entry operation, depending on which AND gate is enabled by the level of.
PROCEDURE
• Fix the following ICs on the Breadboard as per the circuit diagram for 3-bit PISO Shift
register.
o NOT gate (7404) IC ---1no.
o OR gate (7432) IC----1no.
o AND gate (7408) IC---2nos.
o Dual D Flip-flop (7474) IC-2nos.
• ICs should be tight and properly inserted.
• Short all pin 14 of the ICs and connect it to +VCC (+5V dc) of the Breadboard.
• Short all pin 7 of the ICs and connect it to ground of the Breadboard.
• Connect five input wires from the input switches of Breadboard.
• First input will be connected as clock (CLK) input and will be connected to pin no. 3
& 11 of 1st D Flip-flop (7474) IC and will be shorted to pin no. 3 of 2nd D Flip flop
(7474) IC.
• Second input will be connected as Load /Shift (active low) input and will be
connected to pin no. 1 of NOT (7404) IC.
• Pin no. 2 of 7404 IC will be connected to pin no. 1 and 9 of 1st AND (7408) IC and
again it will be shorted to pin no, 1 of 2nd AND (7408) IC.
• Second input also shorted to pin no. 5 of 1st AND (7408) IC and pin no. 13 of 2nd AND
(7408) IC.
• Third, Fourth and Fifth inputs are data lines named as D 0, D1 and D2.
• D2 will be connected to pin no. 2 of 1st AND (7408) IC.
• D1 will be connected to pin no. 10 of 1st AND (7408) IC.
• D0 will be connected to pin no. 2 of 2nd AND (7408) IC.
• Pin no. 3 of 1st AND (7408) IC will be connected to pin no. 2 of 1st D Flip-flop, i.e.D2.
• Q2 of 1st D Flip flop (i.e., pin no. 5) will be connected to pin no. 4 of 1stAND (7408) IC.
• Pin no. 6 and pin no. 8 of 1st AND (7408) IC will be connected to pin no. 1 and 2 of OR
(7432) IC respectively.
• Q1 of 1st D Flip flop(i.e., pin no.9) will be connected to pin no 12 of 1stAND (7408) IC.
• Pin no. 11 of 1st AND (7408) IC will be connected to pin no. 4 of OR (7432) IC.
• Pin no. 3 of 2nd AND (7408) IC will be connected to pin no. 5 of OR (7432) IC.
• Pin no. 6 of OR (7432) IC will be connected to pin no. 2 of 2nd D Flip flop (7474) IC and
i.e., D0.
• Pin no. 5 of 2nd D Flip flop (7474) IC i.e., Q0 will be connected to output LED and that
is Serial Data output.
• Verify the connections once again according to the circuit diagram with step-by-step
procedure.
• Switch ON the Breadboard now.
• Give the inputs through D0, D1 and D2 (Example- Input data is “011”) and find the
output at Q0 after two clock pulse.
VERIFICATION TABLE
No of positive edge of Clock Q2 Q1 Q0
0 0 1 1LSB
1 - 0 1
2 - - 0LSB
EXPLANATION
• Let us see the working of 3-bit PISO shift register by applying the binary
information “011” in parallel through preset inputs.
• Since the preset inputs are applied before positive edge of Clock, the initial status
of the D flip-flops from leftmost to rightmost will be Q2Q1Q0=011.
• Here, the serial output is coming from Q0. So, the LSB ‘11’ is received before applying
positive edge of clock and the MSB ‘00’ is received at 2ndpositive edge of clock.
• Therefore, the 3-bit PISO shift register requires two clock pulses in order to produce
the valid output. Similarly, the N-bit PISO shift register requires N-1 clock pulses in
order to shift ‘N’ bit information.
CONCLUSION
We have designed all the Shift Registers (SISO, SIPO, PIPO, PISO) and investigated the
operation of all types of shift registers after identifying the 74 Series Integrated circuits (ICs)
belong to logic gate and D Flip Flop and their pin configurations. Also verified the truth
tables.
QUESTIONNAIRE
1. What type of shift register is fastest?
2. Based on how binary information is entered or shifted out, shift registers are
classified into _______ categories.
3. What is meant by parallel load of a shift register?
4. The group of bits 11001 is serially shifted (right-most bit first) into a 5-bit parallel
output shift register with an initial state 01110. After three clock pulses, the register
contains ________
5. Assume that a 4-bit serial in/serial out shift register is initially clear. We wish to store
the nibble 1100. What will be the 4-bit pattern after the second clock pulse? (Right-
most bit first)
6. With a 200 kHz clock frequency, eight bits can be serially entered into a shift register
in ________
7. An 8-bit serial in/serial out shift register is used with a clock frequency of 2 MHz to
achieve a time delay (td) of ________
8. In a parallel in/parallel out shift register, D0 = 1, D1 = 1, D2 = 1, and D3 = 0. After
three clock pulses, the data outputs are ________
9. What type of register would have a complete binary number shifted in one bit at a
time and have all the stored bits shifted out one at a time?
10. The register is which type of circuit.
11. How many methods of shifting of data are available?
OBJECTIVES
Design and Implement MOD-8 Asynchronous UP &Down Counter using JK flip flop.
To verify the truth table of asynchronous counter by applying clock pulse and
changing the input.
Design and Implement MOD-8 Synchronous Counter.
To verify the truth table of synchronous counter by applying clock pulse and changing
the input. Also draw the timing diagram using the truth table.
COMPONENTS REQUIRED
• IC 7476(DUAL JK FLIPFLOP)
• IC7408
• Digital Trainer Kit
• Connecting wires
• Twizer
Theory
A Digital Counter is a set of Flip Flops (FFs) whose states change in response to pulses applied
at the input to the counter. The FFs are interconnected such that their combined state at
any time is the binary equivalent of the total no. of pulses that have occurred up to that
time. We know that JK flip-flop toggles the output either for every positive edge of clock
signal or for every negative edge of clock signal. An ‘N’ bit binary counter consists of ‘N’ JK
flip-flops. If the counter counts from 0 to 2𝑁 − 1, then it is called as binary up counter.
Similarly, if the counter counts down from 2 𝑁 − 1 to 0, then it is called as binary down
counter. Counter may be synchronous or asynchronous counter.
• Asynchronous counters are also called as ripple counter where the FFs are not triggered
simultaneously i.e. the FFs are not made to change the state (o/p) exactly at the same
time. Only the first flip-flop is externally clocked using clock pulse while the clock input
for the successive flip-flops will be the output from a previous flip-flop.
✓ In The 3-bit Asynchronous binary up counter contains three JK flip-flops and the
JK-input of all the flip-flops are connected to '1'. All these flip-flops are negative
edge triggered but the outputs change asynchronously. The clock signal is directly
applied to the first JK flip-flop.
✓ The output of first T flip-flop is applied as clock signal for second JK flip-flop. So,
the output of second JK flip-flop toggles for every negative edge of output of first
JK flip-flop. Similarly, the output of third JK flip-flop toggles for every negative edge
of output of second JK flip-flop, since the output of second JK flip-flop acts as the
clock signal for third JK flip-flop.
✓ The block diagram of 3-bit Asynchronous binary down counter is similar to the
block diagram of 3-bit Asynchronous binary up counter. But the only difference is
that instead of connecting the normal outputs of one stage flip-flop as clock signal
for next stage flip-flop, connect the complemented outputs of one stage flip-flop
as clock signal for next stage flip-flop. Complemented output goes from 1 to 0 is
same as the normal output goes from 0 to 1.
In a ‘Synchronous counter’, all the flip-flops change their state simultaneously, the operation
of each being initiated by the clock. This is done by connecting the input clock to each flip-
flop of the counter; hence all flip-flops are clocked simultaneously. These counters are
classified according to, a) Sequence of states, b) Number of states, c) Number of flip-flops
(stages) used in the counter. Here all flip-flops are triggered simultaneously. Hence, these
counters are called “parallel counters”.
Synchronous binary counter: In a synchronous binary counter, we must note the following,
1. Clock pulse is applied common to all flip-flops.
2. The flip-flop in the lowest-order position is complemented with every clock pulse
and the JK inputs are maintained at logic 1 (to get toggling action).
3. The flip-flop in any other position is complemented with a pulse, provided all the
bits in the lower-order positions are equal to 1.
4. The binary count dictates the next bit to be complemented.
The above procedures are illustrated by taking a 3-bit synchronous counter.
CIRCUIT DIAGRAM OF [MOD-8 (3-BIT) SYNCHRONOUS COUNTER]
• This condition is detected by AND gate and applied to JC and KC inputs of flip-flop C.
• Whenever both QA& QB both are at logic 1, the output of the AND gate makes the J
and K inputs of flip-flop C HIGH, and flip-flop C toggles on the clock pulse. At other
times (i.e., other than QA& QB= 1), the J and K inputs of flip-flop ‘C’ are held LOW by
the AND gate output, and the flip-flop does not change its state.
CONCLUSION
We have designed and Implemented MOD-8 Asynchronous UP & Down Counter and MOD-
8 Synchronous Counter using JK flip flop. Also verified the truth table of counters by applying
clock pulse and changing the input and drawn the timing diagram using the truth table.
QUESTIONNAIRE
1. How many natural states will there be in a 4-bit ripple counter?
2. Mention major drawbacks to the use of asynchronous counters.
3. Internal propagation delay of asynchronous counter is removed by which type of
counter.
4. What happens to the parallel output word in an asynchronous binary down counter
whenever a clock pulse occurs?
5. How many different states does a 3-bit asynchronous counter have?
6. A 5-bit asynchronous binary counter is made up of five flip-flops, each with a 12 ns
propagation delay. The total propagation delay (tp(total)) is ____________
7. An asynchronous 4-bit binary down counter changes from count 2 to count 3. How
many transitional states are required?
8. A 4-bit ripple counter consists of flip-flops, which each have a propagation delay from
clock to Q output of 15 ns. For the counter to recycle from 1111 to 0000, it takes a
total of ____________
9. A 4-bit counter has a maximum modulus of ____________
10. What is the maximum possible range of bit-count specifically in n-bit binary counter
consisting of ‘n’ number of flip-flops?
11. How many different states does a 3-bit asynchronous down counter have?
12. In a down counter, which flip-flop doesn’t toggle when the inverted output of the
preceding flip-flop goes from HIGH to LOW.
OBJECTIVE
Design, Implement and Verification of
• MOD-10 Asynchronous (Decimal) Counter
• Binary Counter with Parallel Load.
COMPONENTS REQUIRED
• IC 7476(DUAL JK FLIPFLOP)
• IC7404
• IC 74161(For Binary counter with parallel load)
• Trainer Kit
• Connecting wires
• Twizer
THEORY:
MOD-10 Asynchronous (Decimal) Counter: A decimal (MOD-10 Asynchronous) counter
follows a sequence of ten states and returns to 0 after the count of 9. The counters with
ten states in their sequence called are ‘decade counters’. These counters are useful in
display applications in which BCD is required for conversion to a decimal read out. A
counter with a count sequence of 0 (0000) through 9 (1001) is called a BCD counter,
because it’s ten-states sequence is the BCD code. The sequence of states is shown in the
state diagram as follows,
Pin Configuration of IC 74161(Used for 4 bit Binary counter with parallel load)
PROCEDURE:
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• The Vcc and ground should be applied carefully at the specified pin only.
• Apply input to the circuit according to the circuit diagram.
• Switch on the trainer kit.
• Observe the output.
• Repeat steps for different input as per truth table.
• Verify the truth table.
CONCLUSION
We have designed and implemented MOD-10 Asynchronous (Decimal) Counter and Binary
Counter with Parallel Load. Also verified through truth table.
QUESTIONNAIRE
1. BCD counter is also known as ____________
2. What do you mean by BCD counter?
3. Draw state diagram of BCD counter.
4. How many flip-flops are required to make a MOD-32 binary counter?
5. The terminal count of a modulus-11 binary counter is ________.
6. Why Synchronous counters eliminate the delay problems encountered with
asynchronous counters?
7. What do you understand by counter?
8. What is asynchronous counter?
9. What is synchronous counter?
10. What do you understand by modulus?
11. What do you understand by state diagram?
12. Why Asynchronous counter is known as ripple counter?
13. Which type of counter is used in traffic signal?
OBJECTIVES
• To learn about the function of RAM.
• To calculate the total memory capacity of RAM from its given specifications.
• To understand the difference between Static and Dynamic RAM and how is it
different from ROM.
HARDWARE REQUIRED
1-bit RAM 16*4 RAM
• IC 2114 • Oscilloscope
• Patch Cords • Signal generator
• IC Trainer Kit. • Two TTL 16x4 RAM (7489)
• One TTL binary counter (7493)
• One TTL inverter (7404)
• Four LEDs and limiting resistors
THEORY
Static random-access memory (static RAM or SRAM) is a type of random-access
memory (RAM) that uses latching circuitry (flip-flop) to store each bit. SRAM is volatile
memory, data is lost when power is removed. A typical SRAM cell is made up of
six MOSFETs. Each bit in an SRAM is stored on four transistors (M1, M2, M3, M4) that form
two cross-coupled inverters. This storage cell has two stable states which are used to
denote 0 and 1. Two additional access transistors serve to control the access to a storage
cell during read and write operations
The term static differentiates SRAM from DRAM (dynamic random-access memory) which
must be periodically refreshed. Unlike dynamic RAM (DRAM), which stores bits in cells
consisting of a capacitor and a transistor, SRAM does not have to be periodically refreshed.
SRAM provides faster access to the data and more expensive than DRAM, it is typically used
for CPU cache while DRAM is used for a computer's main memory.
The size of an SRAM with m address lines and n data lines is 2m words, or 2m × n bits. The
most common word size is 8 bits, meaning that a single byte can be read or written to each
of 2m different words within the SRAM chip. Several common SRAM chips have 11 address
lines (thus a capacity of 2m = 2,048 = 3d words) and an 8-bit word, so they are referred to as
"2k × 8 SRAM".
16*4 RAM
RAM circuits on the market have different configurations depending upon how the memory
cell array is organized. A memory cell array organized with N by M cells can store N words
with each word being M bits long. For example, the IC type 7489 is a 16 by 4 RAM chip. It
can store up to 16 different words, and each word is 4 bits long. Apart from memory cell
array, RAM circuits also need address decoding logic and read/write control logic. The
address decoding logic translates the data address (usually in binary format) into the
physical location of a particular word in the memory cell array. Therefore, the memory cells
in the specified memory word are activated and ready to either put the data on to the data
output pins (read process), or to receive data from the data input pins (write
process). Whether the process is read or writes, depends upon the read/write control
logic. Read and write processes are also referred to as data fetch and data load respectively.
IC 7489 pin assignment to the inputs and outputs is shown in Fig.
The four address inputs select one of the 16 words in the memory. The least significant bit
of the address is A, and the most significant bit is D. The read/write control logic has two
control inputs. The memory enable (ME) input must be equal to low to enable the memory.
If ME is high, the memory is disabled and all four outputs are at high impedance level. The
write operation is performed when WE is low. This is a transfer of the binary data from the
data inputs lines into the selected word in memory. The read operation is performed
when WE is high. This transfers the value stored in the selected word into the output data
lines (complemented). The inverted outputs are open-collector to allow external wired logic
for memory expansion.
TESTING
An open-collector gate requires an external resistor for proper operation. However, an
open-collector gate can be operated without an external resistor if its output is connected
to the input of another gate. Since the outputs of the 7489 produce complemented values,
we might as well insert four inverters to change the outputs to their normal values and, at
the same time, avoid the need for external resistors. Let’s connect the address inputs to a
binary counter using IC 7493 as shown in Fig. Below
Address inputs connection to a binary counter using IC 7493
Now Let’s connect the four data inputs to toggle switches and the data outputs to four 7404
inverters. Provide four LEDs for the address and four more for the outputs of the inverters.
Connect ME to ground and WE to a pulser that provides a negative pulse. Store a few
words into the memory and then read them to verify that the write and read operations
function properly. Leave the WE in the read mode (high), unless you want to write into
memory. The proper way to write is first set the address using the counter and the inputs
with the four toggle switches. To store the word in memory, pulse the WE switch to the
write position. Be careful not to change the address or the inputs when WE is asserted.
EXPANSION
The memory unit may be expanded to a 32 by 4 RAM using two 7489 ICs. The ME input may
be used to select between the two ICs. Since the data outputs are open-collector, we can tie
pairs of terminals together to obtain a logic wired-OR operation in conjunction with the
output inverter.
PROCEDURE
• Connections are made as appropriate to the IC 2114 as shown in the logic diagram
using the pin details of the gates.
• Connect Vcc and GND to respective pins of each IC.
• For writing the data make the CS and WR to low.
• For a 4-bit data, select any address input from A0 to A9, e.g. select A0 to A3 and
connect the data input/outputs I/O4-I/O1.
• Write a 4-bit data in each address input or memory location.
• By doing repeatedly above 3 steps data will be stored in the memory locations.
• Similarly, for reading the data:
• Make WR to high and CS to low.
• Disconnect the data inputs I/O4-I/O1 from input lines and connect them to
output lines.
• Give the address inputs of the data which you have stored and observe the
output through I/O4-I/O1.
• Switch on the supply on the Trainer.
CONCLUSION
The circuit is designed and tested.
QUESTIONNAIRE:
OBJECTIVE
To design, implement and verify the Clock-pulse generator circuit
COMPONENTS REQUIRED
• A 555 Timer IC (NE555P)
• Capacitors (10nF, 47uF)
• Resistors (1kΩ, 10kΩ, 4.7kΩ)
• Light Emitting Diode – Green
• Trainer Kit
• Connecting wires
• Twizer
THEORY
In this experiment we are going to design a circuit that generates an automatic clock signal,
which we can use to drive our digital circuits. The digital circuits can be clocked manually,
but an automatic solution would be preferred if we wish to clock many times in a row. Also,
one limitation is that we need a clock signal that is slow enough to see what is happening in
the circuit - if we were to have a clock signal of 1 MHz, we would not be able to observe the
changes in the circuit as they would occur at the rate of 1,000,000 times per second. We will
examine the use of the 555 Timer to output a very low frequency rectangular clock pulse of
approximately 1Hz.
As discussed earlier the flip-flops have two stable states; therefore, they are bistable
multivibrators. There is also a type of circuit that has no stable stages – this is called as an
astable multivibrator.
The 555 Timer as an Astable Multivibrator
The 555 Timer is a TTL compatible IC that operates in three modes: Monostable, Bistable
and Astable. The astable mode allows the timer to operate as an oscillator that outputs a
continuous rectangular pulse of a designed frequency. This is a very popular chip that is used
widely in electronic circuits because of its stability and its low cost. It can be used to generate
clock signals of a very high frequency, but we will use the timer to output a very low
frequency rectangular clock pulse of approximately 1Hz, i.e., 1 cycle per second. This will
allow us to see the effects of the clock pulse on our circuit.
Figure 2, illustrates a 555-timer configuration for astable mode operation. The capacitor C2
is optional and is dependent on the application, but decoupling CONT to GND through a
capacitor can improve operation. We will use a value of 10nF for C2. Now, we must choose
values for the other three components - in astable mode the frequency (f) of the clock signal
can be designed by choosing appropriate values of R1, R2 (in Ω (ohms)) and C1 (in farads) as
follows:
These equations describe how we can choose these 3 values to decide on the frequency of
our signal and the high and low times of our signal. The ratio of high to low time in a single
period of our signal is called the duty-cycle, or more particularly the fraction of the time that
the signal is high. With the 555 timer the minimum value of R1 in this configuration is
typically 1kΩ and this means that we cannot get a perfect 50% duty cycle - If we make R2 >>
R1 then we can get close. If we set R1 < 1kΩ it will draw excessive current and could damage
the 555 IC.
PRECAUTION
Before starting to configure the 555 chip, we must ground ourselves since static electricity
can give a lethal jolt. Also, we must be careful when soldering the 1µF capacitor (C1) and the
LED as they are polarized. The negative side of the capacitor will be marked with negative
symbols on the capacitor’s body. The flat edge on the LED indicates the negative side or you
can look at the LED's legs. The shorter leg is the negative lead.
PROCEDURE
1.1 Let’s configure the above circuit. When looking at the chip from above (top view), the
pin to the left of the notch is pin #1. The chip is powered by a 5 V DC source. The
resistors and capacitors of standard values are mentioned which many be connected
and the circuit may look like as shown below.
1.2 The RC combinations control the timer's threshold at pin #6. The output of the timer
(pin#3) oscillates between high (on) and low (off). The oscillation frequency is
obviously a function of the values of the resistors and the capacitor. A large RC time
constant results in lower blinking frequency (longer duration). We may select C1 in the
range of 1 µF - 100 µF. A larger capacitance value may be chosen if the blinking speed
is too fast. We may repeat the experiment with higher capacitance value to control
interval i.e., the frequency in a way.
CONCLUSION
This experiment has provided us with a useful tool for future experiments. Rather than
manually clocking our flip-flop or counter circuits, we will be able to automatically clock our
circuits. The 555 timers also work at much higher frequencies and is a useful timer for small
circuits that you may wish to build - which explains why up to a billion of these timers are
sold annually.
QUESTIONNAIRES
1. What is a 555 IC?
2. List a few applications of 555 IC?
3. What is a 7555 IC?
4. What are astable, monostable and bistable multivibrators?
5. Write the formula to calculate the time period of the astable and monostable
multivibrator?
6. What is called frequency and duty cycle?
7. How to calculate frequency and duty cycle of an astable multivibrator output?
8. Why the Reset pin of IC 555 is normally connected to Vcc?
9. Why the control voltage pin (pin 5) of 555 timers is connected to ground through a
0.01µf capacitor?
10. Calculate the ON time, OFF time, Total time period, Duty cycle and Frequency of the
output generated by an astable multivibrator using resistors RA = 5k, RB =5K and
capacitor C = 10µf.
OBJECTIVE
• To design and implement 4-bit parallel adder.
• To observe the output of 4-bit Parallel adder.
• To design an Accumulator circuit.
COMPONENTS REQUIRED
• IC 7483 (4-bit parallel adder).
• Digital Trainer Kit
• Connecting wires
• Twizer
THEORY
Ripple Carry Adder is a combinational logic circuit. It is used for the purpose of adding two
n-bit binary numbers. It requires n full adders in its circuit for adding two n-bit binary
numbers. A 4-bit adder is a circuit which adds two 4-bits numbers, say, A and B. In addition,
a 4-bit adder will have another single-bit input which is added to the two numbers called
the carry-in (Cin). The output of the 4-bit adder is a 4-bit sum (S) and a carry-out (Cout) bit.
Using ripple carry adder, this addition is carried out as shown by the following logic diagram.
Any two 4-bit binary numbers A3A2A1A0 and B3B2B1B0 are added as shown below.
QUESTIONARIES
1. What do you understand by parallel adder?
2. What happens when an N-bit adder adds two numbers whose sum is greater than or
equal to2N?
3. Is Excess-3 code a weighted code or not? Ans. Excess-3 is not a weighted code.
4. What is IC no. of parallel adder?
5. What is the difference between Excess-3 & Natural BCD code?
6. What is the Excess-3 code for (396)10?
7. Can we obtain 1’s complement using parallel adder?
8. Can we obtain 2’s complement using parallel adder?
9. How many bits can be added using IC7483 parallel adder?
10. Can you obtain subtractor using parallel adder?
OBJECTIVE
To extend the application of adder circuits to implement a multiplier.
HARDWARE REQUIRED
• IC 7408,
• IC 7483,
• Patch Cords
• IC Trainer Kit
THEORY
Multiplication is a very common arithmetic operation and under digital logic the same can
be performed using Digital Multiplier designing which is our aim. Digital Multiplier is a type
of combinational logic circuit which multiplies two numbers. The numbers are represented
in binary form. The two numbers are more specifically known as multiplicand and multiplier
and the result is known as a product. The multiplicand & multiplier can be of various bit size.
The product’s bit size depends on the bit size of the multiplicand & multiplier. The bit size
of the product is equal to the sum of the bit size of multiplier & multiplicand. Binary
multiplication method is same as decimal multiplication. Binary multiplication of more than
1-bit numbers contains 2 steps. The 1st step is single bit-wise multiplication known as partial
product and the 2nd step is adding all partial products into a single product. Partial products
or single bit products can be obtained by using AND gates. However, to add these partial
products we need full adders & half adders. The design becomes complex with the increase
in bit size of the multiplier.
Saying unsigned number just means that two numbers are positive and no negative number
has been considered i.e., no extra bit is reserved for representing the sign. So all the binary
bits represent the magnitude of the equivalent decimal number.
4×4 Bit Multiplier
This multiplier can multiply a binary number of 4-bit size & gives a product of 8-bit size
because the bit size of the product is equal to the sum of bit size of multiplier and
multiplicand. The maximum number it can calculate us 15 x 15 = 225. You can also evaluate
the number of bits from the maximum output range. Suppose multiplicand A3 A2 A1 A0 &
multiplier B3 B2 B1 B0 & product as P7 P6 P5 P4 P3 P2 P1 P0 for 4×4 multiplier.
In 4×4 multiplier, there are 4 partial products and we need to add these partial products to
get the product of multiplier.
They can be added using 4-bit full adders or single bit adders (half-adder & full-adder). The
design using Single bit adders is very complicated compared to using 4-bit full adders. The
implementation of 4×4 multiplier using 4-bit full adders While A and B are two 4-bit numbers
consisting of A0-A3 and B0-B3 respectively the product is shown below.
As shown above that there is one to one topological correspondence with manual
multiplication. The same may be implemented as shown below.
If we want to display the final output on 7-segment displays, but since the output of the
multiplier is in binary, we have to convert it before we can display it. (We may do the same
using the Decoder which we have already discussed).
The chip diagram for the implementation is shown in the figure below.
Pin Diagram of IC 7483
PROCEDURE
• Make the connections according to the IC pin diagram.
• The connections should be tight.
• The Vcc and ground should be applied carefully at the specified pin only.
• Apply input to the circuit according to the circuit diagram.
• In case of gray to binary conversion, the inputs are given at respective pins and
outputs are taken for all the combinations and same for gray to binary conversion.
• In 7-segment display connect four switches to the four inputs of your decoder inputs
(D, C, B, and A) respectively& check the display for corresponding output.
• Switch on the trainer kit.
• Observe the output.
• Repeat steps for different input as per truth table.
• Verify the truth table.
• Connect the positive terminal of supply to pin 14 and pin 7 is to be grounded.
• Give input at corresponding pins & connect output pins to an output LED.
• Note the values of output for different combination of inputs & verify the logic table
for each circuit.
CONCLUSION
The 4-bit multiplier was designed successfully and output was verified. The logic may be
applied for implementation of higher order multipliers.
QUESTIONNAIRE:
1. Design a 2-bit multiplier.
2. What is the maximum number that may result if you design a 3-bit multiplier?
3. How to convert from binary to BCD?
4. What is the difference between binary and BCD?
5. What is the difference between signed number and unsigned number?
6. Using 8 bits what is the range of signed number that can be represented?
7. Multiplier is combinational /Sequential? Why?
8. Can you extend the application for designing a divider circuit?
OBJECTIVE
• To learn and understand the working of IC 7485 used for magnitude comparator.
• To realize One- & Two-Bit Comparator and verify the function table.
• To learn about various applications of comparator.
COMPONENTS REQUIRED
IC 7411, IC 7432, IC 7408, IC 7404, IC 7485, Patch Cords & IC Trainer Kit
THEORY
Magnitude Comparator is a type of Combinational logic circuit, which compares two signals
A and B and generates output depending on their values. There are three logical outputs,
which are A > B, A = B and A< B. IC 7485 is a high speed 4-bit Magnitude Comparator, which
compares two 4-bit words. The A and B input must be held appropriately for proper compare
operation. The logic applied here is we must check the MSB of the two numbers irrespective
of LSB. If one MSB is higher that number is higher. But if for both numbers MSB are equal
then we must check the next LSB. This process continues if no of bits increase for the two
numbers under comparison.
There are two main types of Digital Comparator available and these are
1. Identity Comparator – an Identity Comparator is a digital comparator that has only one
output terminal for when A = B either “HIGH” A = B = 1 or “LOW” A = B = 0
2. Magnitude Comparator – a Magnitude Comparator is a digital comparator which has
three output terminals, one each for equality, A = B greater than, A > B and less than A < B.
Digital or Binary Comparators are made up from standard AND, NOR and NOT gates that
compare the digital signals present at their input terminals and produce an output
depending upon the condition of those inputs.
TRUTH TABLE OF 1-BIT COMPARATOR
Input Output
A B Y1: A=B Y2: A<B Y3: A>B
0 0 1 0 0
0 1 0 1 0
1 0 0 0 1
1 1 1 0 0
KMAP
We can also design a two bit magnitude comparator using the chip configuration may be
drawn as shown below. The lower order comparators may be analyzed too considering zero
to the higher order bits.
PROCEDURE
• Connections are made as shown in the logic diagram using the pin details of the
gates.
• Connect + Vcc& GND to respective pins of each IC.
• Switch on the Trainer kit.
• Connect the A > B and A < B cascading inputs to logic 0 level and A = B input to logic
1 level.
• Connect the input bits to be compared to the toggle switches and outputs A > B, A =
B and A = B the LED‟s and verify the compare operation for different input
combinations.
CONCLUSION
The magnitude comparator was designed and the output was verified.
QUESTIONNAIRE
1. For 2-bit comparison draw the logic gate for A=B.
2. For 2-bit comparison draw the logic gate for A<B.
3. What do you mean by MSB?
4. Why MSB carries important role in making comparison.
5. Draw logic diagram for 3-bit comparator.
6. If A and B are 4-bit numbers applied to a 4-bit comparator then for no of
combinations A greater than B is …………...?
7. What’s the basic difference between subtractor and comparator?
8. Comparator circuit is Combinational/sequential? Why?
OBJECTIVE
To learn about Ring Counter and its application.
To learn about Johnson Counter and its application.
COMPONENTS REQUIRED
- Digital trainer kit
- Patch chords
- +5v power supply
- IC 7476
- IC 7495.
THEORY
RINGCOUNTER
The ring counter is a shift-register (cascaded connection of flip flops), in which the output of
last flip flop is connected to input of first flip flop. In ring counter if the output of any stage
is 1, then its reminder is 0. The Ring counters transfers the same output throughout the
circuit.
That means if the output of the first flip flop is 1, then this is transferred to its next stage i.e.
2nd flip flop. By transferring the output to its next stage, the output of first flip flop becomes
0. And this process continues for all the stages of a ring counter. If we use n flip flops in the
ring counter, the ‘1’ is circulated for every ‘n’ clock cycles.
A basic ring counter can be slightly modified to produce another type of shift register
counter called Johnson counter. Here complement of last output is connected back to the
not gate input and not gate output is connected back to serial input. A four bit Johnson
counter gives 8 state output.
PROCEDURE
- Initially a low clear (CLR) pulse is applied to all flip-flops. Hence FF-3, FF-2, FF-1 will be
reset but FF-0 will be set. So, outputs are: QD QC QB QA = 0001
- The clear terminal is made inactive by applying a high level to it. The clock signal is then
applied to all the flip-flops simultaneously. Note that all the flip-flops are negative edge
triggered
- On first negative going CLK edge: As soon as first falling edge of clock hits, only FF-1 will
be set Q0=J1=1. The FF-0 will reset because J0=Q3=0 and there is no change in the status
of FF-2 and FF-3. Hence after the first clock pulse the outputs are: QD QC QB QA = 0010
- On the second falling edge of clock: At the second falling edge of clock, only FF-2 will be
set as J2 = Q1 = 1. The FF-1 will reset since J1 = Q0 = 0. There is no change in status of
FF-3 and FF-0. So, after second clock pulse the outputs are, QD QC QB QA = 0100.
- Similarly after third clock pulse outputs are: QD QC QB QA = 1000
- After fourth pulse outputs are: QD QC QB QA = 0001
APPLICATIONS
• Ring counters are used to count the data in a continuous loop.
• They are also used to detect the various numbers values or various patterns within a
set of information, by connecting AND & OR logic gates to the ring counter circuits.
• 2 stage, 3 stage and 4 stage ring counters are used in frequency divider circuits as
divide by 2 and divide by 3 and divide by 4 circuits, respectively.
• The 3 stage Johnson counter is used as a 3-phase square wave generator which
produces 1200 phase shift.
• The 5 stage Johnson counter circuit is generally used as synchronous decade (BCD)
counter and also as divider circuit.
• The 2 stage Johnson counters are also known as “Quadrature oscillator” which is used
to produce 4 level individual outputs which are out of phase with 900 with each other.
This quadrature generator is used to produce 4 phase timing signals.
PROCEDURE
- Initially a short negative going pulses is applied to the clear input of all the flip-flop. This
will reset all the flip-flops. Hence initially the outputs are QD QC QB QA=0000.
- But ̅̅̅̅
Q D = 1and since it is coupled to J0 it is also equal to 1. Hence, J0=1 and K0 =0 ……
initially.
On the first falling edge of clock pulse:
1) As soon as the first negative edge of clock arrives, FF-0 will be set Hence QA will
become 1.
2) But there is no change in the status of any other flip-flop.
3) Hence after the first negative going edge of clock the flip –flop outputs areQD QC
QB QA = 0001
On the second negative going clock edge:
1) ̅̅̅̅
Before the second negative going clock edge, QD=0 &Q D = 1, Hence J0=1and K0 =0.
2) Hence the second falling clock edge arrives, FF-1 continues to be in the set mode
̅̅̅̅
and FF-1 will now set. Hence Q1 will become 1 &Q A = 0.
- Similarly, after the third clock pulses, the outputs are QD QC QB QA=0111.
- And after the fourth clock pulses, the outputs are QD QC QB QA=1111.
- Hence as soon as the fifth negative going clock pulses strikes FF-0 will reset. But the
outputs of the other flip-flops will remain unchanged, So after the fifth clock, the outputs
are, QD QC QB QA= 1110.
- This operation will continue till we reach to all zero-output state QD QC QBQA=0000.
CONCLUSION
We have designed four-bit ring counter & Johnson counter using JK flip-flops and verified
the truth tables.
QUESTIONNAIRE
1. In a 4-bit Johnson counter sequence; there are a total of how many states, or bit
patterns?
2. If a 10-bit ring counter has an initial state 1101000000, what is the state after the
second clock pulse?
3. How much storage capacity does each stage in a shift register represent?
4. Ring shift and Johnson counters are called what type of counters.
5. What is the difference between a shift-right register and a shift-left register?
6. What is the preset condition for a ring shift counter?
7. To design a8 bit ring counter how many ffs are required?
8. Draw the state diagram of a ring counter, where the initial data is 1000.
9. Draw the state diagram of a ring counter, where the initial data is 1000.
10. Design a 3-bit ring counter using D FF
OBJECTIVE:
• To learn the software Xilinx ISE Simulator (VHDL), ORCAD (Verilog)
• To develop the coding skill to write a program (VHDL/Verilog) in dataflow modeling
style.
• Synthesize the program of different logic gates in frontend so that the RTL schematic
will be developed at the backend.
• Simulate the program to see the output as a waveform.
• Verify the truth table of the logic gates from the waveform.
SOFTWARE REQUIRED:
Xilinx ISE Simulator (VHDL), ORCAD (Verilog)
THEORY:
HARDWARE DESCRIPTION LANGUAGE (HDL)
A language used for describing a digital system like a network switch or a microprocessor
or a memory or a flip−flop. It means, by using a HDL we can describe any digital hardware
at any level. Designs, which are described in HDL are independent of technology, very easy
for designing and debugging, and are normally more useful than schematics, particularly for
large circuits.
There are now two industry standard hardware description languages, VHDL and Verilog
supported by IEEE.
• Verilog is easier to understand and use. For several years it has been the language of
choice for industrial applications that required both simulation and synthesis. It
lacks, however, constructs needed for system level specifications.
• VHDL is more complex, thus difficult to learn and use. However, it offers a lot more
flexibility of the coding styles and is suitable for handling very complex designs.
INTRODUCTION TO VHDL
VHDL stands for VHSIC (Very High-Speed Integrated Circuits) Hardware Description
Language. This was developed from an initiative by US. Dept. of Defense.
• It is not case sensitive and a strongly typed language which needs to declare always
the type of every object that can have values such as signals, constants, variables,
etc.
• Every VHDL design description consists of at least one entity / architecture pair, or
one entity with multiple architectures. The entity section of the HDL design is used
to declare the I/O ports of the circuit, while the description code resides within
architecture portion.
• A system library IEEE library is used in case of VHDL and is included prior to the entity
declaration. This is accomplished by including the code "library ieee;" and "use
ieee.std_logic_1164.all;".
BASIC STRUCTURE OF VHDL
• Entity declaration
• An architecture body
ENTITY DECLARATION
• The entity declaration defines the NAME of the
entity and lists the input and output ports.
• The general form is as follows
entity NAME_OF_ENTITY is
port(signal names: mode type;
signal names: mode type;
signal names: mode type);
end NAME_OF_ENTITY;
• Where, The NAME_OF_ENTITY is a user-selected identifier.
THE ARCHITECTURE BODY:
• It specifies how the circuit operates and how it is implemented.
• The architecture body looks as follows
Architecture
Architecture name of NAME_OF_ENTITY is
-- Declarations
-- Components declarations
-- signal declarations
-- Constant declarations
-- Function declarations
begin
-- Statements
:
endarchitecture_name;
Create a new folder in any drive in your computer or system to save the program.
STEPS TO SIMULATE THE XILINX 14.7 SOFTWARE WITH VHDL LANGUAGE
1. Double click on the icon iSE Design Suite 14.7
• Go to File → New project
• It will display Create new project window. Give the project name.
• As example:-‘SIT’
2. Click on Next
• It will display New project Wizard window. Set the property, family, device,
package and language etc as shown.
7. Click on Next.
• It will display New source wizard where you have to define the modules.
Change the architecture name as dataflow (since it is dataflow model). Give
inputs and output as given. Then click on Next →Finish
8. It will open the program window where you have to write the program.
18. Write the program code as written for OR gate and delete the clock related lines as
well as the comment lines for your better understanding.
19. Select simulation view in design window.
20. Double click on simulate behavioral model which is in the process window and wait
for output.
21. Now you can see the simulated output in the simulation window.
• You can adjust’ Zoom to Full’ View and ‘zoom in’ in that simulated screen.
Likewise we can write the VHDL/Verilog program for AND,NAND, EX-OR, EX-NOR, Invert and
Buffer gates in dataflow modeling.
OBSERVATION:
The two major purposes of HDLs are logic simulation and synthesis.
• During simulation, inputs are applied to a module, and the outputs are checked to
verify that the module operates correctly.
• The test bench checks whether the output results are correct (only for simulation
and cannot be synthesized).
• A simulator interprets the HDL description and produces a readable output, such as
a timing diagram, that predicts how the hardware will behave before it is actually
fabricated.
• During synthesis, the textual description of a module is transformed into logic gates.
Circuit descriptions in HDL resemble code in a programming language.
CONCLUSION:
• After learn the software Xilinx ISE Simulator (VHDL), ORCAD (Verilog) we wrote
programs (VHDL/Verilog) in dataflow modeling style.
• Synthesized the programs of different logic gates in frontend and studied the RTL
schematic developed at the backend.
• Simulated the program to see the output as a waveform and verified the truth table
of the logic gates from the waveform.
QUESTIONNAIRES
1. Write the correct syntax for entity declaration?
2. To write name of entity what are the rules to be followed.
3. Write a VHDL Code in dataflow model of a three input NAND gate?
4. In what aspect, HDLs differ from other computer programming languages?
5. Why do we need concurrent processing for describing digital systems in HDLs?
6. What are the differences between assignments in initial and always constructs?
7. What are the different approaches of connecting ports in a hierarchical design?
8. What do VHDL stand for?
9. A VARIABLE y is declared of STD_LOGIC_VECTOR type of 4 bits, if you want to
assign 1001 to “y”, then what is the write assignment statement?
10. ______ operator is unary as well as binary operator.
SOFTWARE REQUIRED:
Xilinx ISE Simulator (VHDL), ORCAD (Verilog).
THEORY:
In VHDL the modeling of architecture body can be described in any one (or a combination)
of the following modeling techniques.
• DATAFLOW MODEL:
➢ The flow of data through the entity is expressed using concurrent signal
assignment statements.
➢ This makes the concurrent signal assignment statements even triggered
which implies that any concurrent is executed only when any event occurs on
the signal that are used in the expression of concurrent signal assignment
statement.
• BEHAVIORAL MODEL:
➢ In this the behavior of the entity is expressed using statements which are
executed sequentially. Generally, process statement is used.
➢ One important aspect of behavioral code is that it is not limited to sequential
logic. Indeed, with it, we can build sequential circuits as well as
combinational circuits.
➢ The behavioral statements are IF, WAIT, CASE, and LOOP. VARIABLES are also
restricted and they are supposed to be used in sequential code only.
PROGRAM
VHDL Code in Dataflow Modeling Verilog Code in Dataflow Modeling
1.Half Adder 1.Half Adder
library ieee; modulehalf_adder (input a, b, output s, c);
use ieee.std_logic_ 1164.all; assign s = a ^ b;
use ieee.std_logic_unsigned.all;
assign c = a & b;
-------------------------------------------------
entity half_adder is endmodule
port (a: in std_logic;
b: in std_logic;
s: out std_logic;
c: out std_logic);
end half_adder;
architecture dataflow of half_adder is
begin
s<= a xor b;
c<= a and b;
end dataflow;
2.Full Adder 2.Full Adder
library ieee; module fulladder( input a, input b, input
use ieee.std_logic_ 1164.all; cin,outputsum,output carry );
use ieee.std_logic_unsigned.all; assign x=a ^ b;
------------------------------------------------- assign sum=a^b^cin;
entity full_adder is assign y=(a^b) &cin;
port (a,b,c: in std_logic; assign z=a & b;
s,cout: out std_logic); assign carry= y | z;
end full_adder; endmodule
-------------------------------------------------
architecture dataflow of full_adder is
begin
s<= a xor b xor c;
cout<= (a and b) or (a and c) or (b and
c);
end dataflow;
3. Half Subtractor 3. Half Subtractor
library ieee; module Half_Subtractor_2(output D, B, inp
use ieee.std_logic_1164.all; ut X, Y);
entity half_sub is assign D = X ^ Y;
port(a,c:in bit; diff,borrow:out bit); assign B = ~X & Y;
end half_sub; endmodule
---------------------------------------
Diff<='1'; Borrow<='1';
elsif(A='0' and B='1' and C='1') THEN
Diff<='0'; Borrow<='1';
elsif(A='1' and B='0' and C='0') THEN
Diff<='0'; Borrow<='0';
elsif(A='1' and B='0' and C='1') THEN
Diff<='0'; Borrow<='0';
elsif(A='1' and B='1' and C='0') THEN
Diff<='0'; Borrow<='0';
elsif(A='1' and B='1' and C='1') THEN
Diff<='1';Borrow<='1';
else
Diff<='Z'; Borrow<='Z';
end if; end process; end Behavioral;
5. 4*1 Multiplexer 5. 4*1 Multiplexer
libraryieee; module m41 ( a, b, c, d, s0, s1, out);
use ieee.std_logic_ 1164.all; input wire a, b, c, d;
use ieee.std_logic_unsigned.all; input wire s0, s1;
useieee.std_logic_arith.all; outputreg out;
entity MUX_4*1is always @ (a or b or c or d or s0, s1)
Port ( S : in std_logic _vector(1 begin
downto 0); case (s0 | s1)
I : in std_logic _vector (3 2'b00 : out <= a;
downto 0); 2'b01 : out <= b;
Y : out std_logic); 2'b10 : out <= c;
end MUX_4*1; 2'b11 : out <= d;
----------------------------------------------------- endcase
architecture Behavioral of MUX_SOURCE is
end
begin
process (S,I) endmodule
begin
if (S <= "00") then
Y <= I(0);
elsif (S <= "01") then
Y <= I(1);
elsif (S <= "10") then
Y <= I(2);
else
Y <= I(3);
end if; endprocess;end behavioral;
CONCLUSION:
After learning the coding skill to write a program (VHDL/Verilog) in dataflow and behavioral
modeling style we Synthesized the program of Half Adder, Full Adder, half subtractor, Full
subtractor, Decoder, Multiplexer in frontend so that the RTL schematic can be checked at
the backend. Also run the simulation to see the output as a waveform and truth table is
verified.
QUESTIONAIRES
1. What is the type of result of MOD operator?
2. The operators like =, /=, <, >, >= are called _________
3. The most basic form of behavioral modeling in VHDL is _______
4. The signal assignment is considered as a ________
5. The sequential assignment statement is activated, whenever ________
6. Who developed the Verilog?
7. ______ operator usually comes before the operand.
8. What is the difference between dataflow and behavioral modeling in Verilog?
9. What is test bench?
10. What are the different levels of design abstraction at physical design?
OBJECTIVE:
• To develop the coding skill to write a program (VHDL/Verilog) in structural modeling
style.
• Synthesize the program of full adder,8-bit adder in frontend so that the RTL
schematic can be checked at the backend.
• Run the simulation to see the output as a waveform.
SOFTWARE REQUIRED:
Xilinx ISE Simulator (VHDL), ORCAD (Verilog).
THEORY:
A Full adder is a combinational circuit that adds two one-bit numbers along with a carry from
the lower stage and produces the sum and the carry as output.
This 1-bit FA can be cascaded to perform multi-bit addition. The block diagram shown below
gives details of multibit addition. To design a 8-bit adder we need 8 FAs.
Orgate as a component
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity mor is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : out STD_LOGIC);
end mor;
architecture dataflow of mor is
begin
c<=a or b;
end dataflow;
CONCLUSION
We learn the coding skill to write a program (VHDL/Verilog) in structural modeling style
and synthesize the program of full adder,8-bit adder in frontend so that the RTL schematic
can be checked at the backend. Also run the simulation to see the output as a waveform.
QUESTIONAIRES
1. What is the basic unit of structural modeling?
2. What do you mean by component instantiation?
6. How many ways are there in VHDL to map the components and what are they?
7. It is not necessary that the order of the arguments in PORT MAP is taken as the
order in which ports are declared.
8. How to declare a 2 input OR gate in the structural modeling?
9. What is the correct syntax for mapping a GENERIC parameter in structural
modeling?
10. It is possible to use a GENERIC parameter as a separate component.
OBJECTIVE
• To develop the coding skill to write a program (VHDL/Verilog) in behavioral modeling
style.
• Synthesize the program of SR-FF, D-FF, JK-FF, T-FF in behavioral modeling in frontend
so that the RTL schematic can be checked at the backend.
• Run the simulation to see the output as a waveform.
SOFTWARE REQUIRED
Xilinx ISE Simulator (VHDL)/ORCAD(Verilog)
THEORY
A flip flop is an electronic circuit with two stable states and hence they are bistable
multivibrators. The two stable states are High (logic 1) and Low (logic 0). The term flip flop
is used as they can switch between the states under the influence of a control signal (clock
or enable) i.e. they can ‘flip’ to one state and ‘flop’ back to other state that can be used to
store binary data. Flip – flops are edge sensitive or edge triggered devices i.e. they are
sensitive to the transition rather than the duration or width of the clock signal. The stored
data can be changed by applying varying inputs. Flip-flops are fundamental building blocks
of digital electronics systems used in computers, communications, and many other types of
systems. It is the basic storage element in sequential logic. Each flip flop can store one bit of
data. These are also called as sequential logic circuits.
Some of the most common flip flops are SR lip flop (Set – Reset), D Flip – flop (Data or Delay),
JK Flip – flop and T Flip – flop.
PROGRAM
VHDL Code in behavioral modeling Verilog Code in behavioral modeling
1. SR FlipFlop 1. SR FlipFlop
library IEEE; module srff_behave(s,r,clk, q, qbar);
use IEEE.STD_LOGIC_1164.ALL; input s,r,clk;
entity SRFF is output reg q, qbar;
Port ( S,R,CLK : in STD_LOGIC; always@(posedgeclk)
Q,QBAR : inout STD_LOGIC); begin
end SRFF; if(s == 1)
architecture Behavioral of SRFF is begin
begin q = 1;
PROCESS(CLK) qbar = 0;
begin end
if (CLK='1' AND CLK'EVENT ) then else if(r == 1)
if (S='0' AND R='1') then begin
Q<='0'; q = 0;
QBAR<= '1'; qbar =1;
elsif (S='0' AND R='0') then end
Q<=Q; else if(s == 0 & r == 0)
QBAR<= not (Q); begin
elsif (S='1' AND R='0') then q <= q;
Q<='1'; qbar<= qbar
QBAR<= '0'; end
else end
Q<='Z'; endmodule
QBAR<= 'Z'; 2. D FlipFlop
end if;end if; module dff_behavioral(d,clk,clear,q,qbar);
end PROCESS; input d, clk, clear;
end Behavioral; output reg q, qbar;
always@(posedgeclk)
2. D FlipFlop begin
library IEEE; if(clear== 1)
use IEEE.STD_LOGIC_1164.ALL; q <= 0;
entity DFLIPFLOP is qbar<= 1;
Port ( D,clk : in STD_LOGIC; else
Q : out STD_LOGIC); q <= d;
end DFLIPFLOP; qbar= !d;
T Flipflop:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Tff is
Port ( t : in STD_LOGIC;
clk : in STD_LOGIC;
q : out STD_LOGIC;
qn : out STD_LOGIC);
end Tff;
architecture Behavioral of Tff is
signal tmp:std_logic:='0';
begin
PROCESS(clk)
begin
if (CLK='1' AND CLK'EVENT) then
if (t='0') then
tmp<=tmp;
elsif t='1' then
tmp<=not(tmp);
end if;
end if;
end PROCESS;
q<=tmp;
qn<=NOT(tmp);
end Behavioral;
); begin
END COMPONENT; if(t==0)
--Inputs q=q;
signal t :std_logic := '0'; else
signal clk :std_logic := '0'; q=qb;
--Outputs qb=~q;
signal q :std_logic; end
signal qn :std_logic; endmodule
-- Clock period definitions `timescale 1ns/1ns
constant clk_period : time := 100 ns; module tff_tb;
BEGIN reg a,b;
-- Instantiate the Unit Under Test wire y,yb;
(UUT) tff out(.t(a), .clk(b),.q(y),.qb(yb));
uut: Tff PORT MAP ( initial
t => t, begin
clk =>clk, a=0; b=0; #100;
q => q, b=1; #100;
qn =>qn a=1; b=0; #100;
); b=1; #100;
-- Clock process definitions end
clk_process :process endmodule
begin
clk<= '0';
wait for clk_period/2;
clk<= '1';
wait for clk_period/2;
end process;
-- Stimulus process
stim_proc: process
begin
-- hold reset state for 100 ns.
--wait for 100 ns;
wait for clk_period*1;
-- insert stimulus here
t<='0';
wait for 100 ns;
t<='1';
wait for 100 ns;
end process;
END;
CONCLUSION
We have developed the code (VHDL/Verilog) in behavioral modeling style and synthesized
the program of SR-FF, D-FF, JK-FF, T-FF in frontend so that the RTL schematic can be checked
at the backend. Also run the simulation to see the output as a waveform.
QUESTIONAIRES
1. What is the basic unit of structural modeling?
6. How many ways are there in VHDL to map the components and what are they?
7. It is not necessary that the order of the arguments in PORT MAP is taken as the
order in which ports are declared.
8. Draw the truth table of SR FF.
9. Write the excitation table of SR FF?
10. Write the characteristic equation of D ff?
11. Why DFF is called Delay FF?
12. Why DFF is called transparent FF?
13. If j=K=0 what will be the behavior of output?
14. Why TFF is called Toggle FF?
15. Differentiate between negative and positive edge trigger.
16. Differentiate between edge trigger and level trigger.
Appendix-1
IC 7400 specifications:
• The voltage supply is 5 V.
• Propagation delay for each gate will be 10 ns.
• Maximum toggle speed is 25 MHz.
• Power utilization for each gate is 10 mW.
• Independent 2-i/p NAND Gates- 4.
• The output can be interfaced with TTL, NMOS, CMOS.
• The range of operating voltage will be large.
• Operating conditions are extensive.
• Not suitable for new designs which use 74LS00.
• Using 7400 family-based integrated circuits, an engineer can design flip-flops (FFs),
counters, buffers, and logic gates in different packages, and these can be connected
as preferred to solve an exact problem.
IC 7402 specifications:
• Operating voltage range: +4.75 to +5.25V
• Maximum supply voltage:7V
• Maximum current allowed to draw through each gate output: 8mA
• TTL outputs
• Low power consumption
• Maximum ESD: 3.5KV
• Typical Rise Time: 15ns
• Typical Fall Time: 15ns
• Operating temperature:0°C to 70°C
• Storage Temperature: -65°C to 150°C
IC 7404 specifications:
• Supply voltage range: +4.75V to +5.25V
• Maximum supply voltage: +7V
• Maximum current allowed to draw through each gate output: 8mA
• Totally lead free
• TTL outputs
• Maximum Rise Time: 15ns
• Maximum Fall Time: 15ns
• Operating temperature:0°C to 70 °C
IC 7408 specifications:
• Operating voltage range: +4.75 to +5.25V
• Recommended operating voltage: +5V
• Maximum supply voltage:7V
• Maximum current allowed to draw through each gate output: 8mA
• TTL outputs
IC 7410 specifications:
• 3 input NAND Gates
• Large operating voltage range.
• Wide Operating Conditions.
• Supply Voltage : 7V
• Input Voltage : 5.5V
• Operating Free Air Temperature : 0°C to +70°C
• Storage Temperature Range : -65°C to +150°C
IC 74151 specifications:
Appendix-2