DD Lab 7 Zobiya
DD Lab 7 Zobiya
Hardware runs
Components Required
Diagram
Name & ID:……………………………………Date: ……………………….
Truth Table
Flip-Flops
Latches respond to changes in the levels of clock pulses. On the other hand, a flip-flop
responds to only a transition in the clock pulse i.e. flip-flops are edge-triggered and
change state either at the positive or negative edges at the clock. We will be studying
three flip-flops-D, JK and T. Flip-flops find extensive applications in data storage,
frequency division and in the construction, of counters, state machines etc.
JK flip flop- a versatile and widely used flip-flop. IC 7476 is a dual master-slave J K flip-
flop with preset and clear. The pin assignment of IC 7476 is given in Appendix A. Note
down the function table below.
Diagram
Truth Table
Diagram
Truth Table
Name & ID:……………………………………Date: ……………………….
4A. Write the Verilog code for clocked SR latch as shown in run-1 of this experiment
using four NAND gates (Gate level modeling). Write the testbench also for all
possible scenarios before and after S=R=0 and also check for undefined case in
waveforms when both S = R = ‘1’.
Name & ID:……………………………………Date: ……………………….
4A
: Verilog Code-
Truth Table
Q: Paste the Image of your Simvision window where you get the waveforms for the above code.
4A: FPGA OUTPUT
Name & ID:……………………………………Date: ……………………….
4B. Write Verilog code and testbench for clocked JK flip-flop and compare their
response in waveforms. (Hint: part of code is below).
VERILOG CODE
Q: Paste the Image of your Simvision window where you get the waveforms for the above code.
4B: FPGA OUTPUT
Name & ID:……………………………………Date: ……………………….
Run 5: D-Flipflop
● Write Verilog code and testbench for positive edge triggered D-Flip-flop with
asynchronous set and reset. (Hint: part of code is given below)
VERILOG CODE
Truth Table
Q: Paste the Image of your Simvision window where you get the waveforms for the above code.
5: FPGA OUTPUT
Name & ID:……………………………………Date: ……………………….
Assignment All assignments are to be submitted strictly before start of next lab session
through online only. Late assignments will not be entertained and will be awarded ‘0’
marks.
1. Verilog code and testbench for T Flip-Flop for positive edge triggered.
Ans: Link1
https://www.edaplayground.com/x/75SF
2. Identify the logic from the Verilog code below. (hint: Create testbench to identify).
module circuit_1 (input A,B, output C);
assign C = A ? B : C;
// ? : is the conditional operator (e.g. w=x ? y : z ; if x=true, then w=y if x
=false then w=z)
endmodule
Ans: Link2
https://www.edaplayground.com/x/b9wK
Name & ID:……………………………………Date: ……………………….