Lab3 Week3
Lab3 Week3
Computer Systems
Week 3
Overview
In this laboratory session we start using Flip Flops to build useful things like counters
registers, and shift registers.
Purpose: To consolidate your knowledge of Flip Flops, and how they can be used.
Task:
Submission Details
You must submit the following files to Canvas:
■
A document containing all required work as described below.
Computer Systems Week 3 Laboratory
Instructions
6. Set the pins in the following order and record the states for Q and Q’
Set Reset Q Q’
1 0 1 0
1 1 0 0
0 1 0 1
1 1 0 0
Page 2 of
16
Computer Systems Week 3 Laboratory
Page 3 of
16
Computer Systems Week 3 Laboratory
7. Describe in a sentence, the behaviour of the circuit when one of the inputs is 1
(but not both) and why this is useful for digital circuit design.
- When one input of the R-S flip-flop is 1 (Set or Reset), but not both, the circuit sets or
resets the output Q to 1 or 0 respectively, while maintaining a stable state until the next
input change; this is useful in digital circuit design for reliably storing and controlling
binary data with clear and predictable state transitions.
8. What do you notice about the two times you set both inputs to 1. Briefly
explain what is happening here and why this is an issue for digital circuit
design ?
- When both inputs of the R-S flip-flop are set to 1 simultaneously, both outputs
(Q and Q') are forced to 0, which creates an undefined or invalid state because Q
and Q' are supposed to be complementary (one should always be the inverse of
the other). This is an issue for digital circuit design because it breaks the
fundamental rule of flip-flop behavior, leading to unpredictable circuit
performance, potential data loss, and malfunctioning of sequential logic systems
that rely on stable and defined outputs.
Discuss 7 and 8 with your lab demonstrator and provide your answer in your
submis- sion document, along with the truth table in Step 6.
Page 4 of
16
Computer Systems Week 3 Laboratory
9. So the unclocked R-S flip flop has issues. Lets talk about the D Flip-Flop then.
Review the lectures on the D Flip-Flop, and when you feel comfortable, wire up
a D Flip Flip using AND gates and NOR gates, with output LEDS labeled Q and
Q’.
■
For this you will have only 1 input pin, as well as a clock input. The clock can
be pulsed on and off by clicking it with the operation pointer (the finger in the
top left of screen), or you can simple enable clock ticking from the menu
(under “Simulate”).
Export your circuit as an image and include it in your submission document.
10. Explore the behaviour of the D Flip Flop by filling out the following truth table
Clock Pin Q Q’
0 0 0 1
0 1 0 1
1 1 1 0
1 0 0 1
11. Briefly explain the behaviour of a D Flip Flop and how it is useful for digital circuit
design.
- Behaviour:
A D Flip-Flop stores the value of the D input at the moment of the clock's edge (usually rising
edge) and outputs it at Q, keeping Q stable until the next clock pulse. This predictable behavior
makes it ideal for data storage and synchronization in digital circuits.
- Usefulness:
Data Latching: Holds data until the next clock pulse, making it useful for registers and
memory.
Edge-Triggered Operation: Synchronizes data with the clock signal, ensuring reliable
timing.
Simplifies Circuit Design: Only one data input (D) eliminates uncertain states, making
sequential logic design straightforward and efficient.
12. What is the role of the clock? How does it impact the changing of state of Q and Q’?
Page 6 of
16
Computer Systems Week 3 Laboratory
Synchronizes State Changes: The clock signal controls when the flip-flop reads the
input values and updates the outputs, usually on the rising or falling edge of the clock
pulse.
The D Flip-Flop is generally preferred over the R-S Flip-Flop because it simplifies circuit
design and avoids potential issues associated with R-S flip-flops. Here’s why:
Eliminates Invalid States: The RS flip-flop has an undefined state when both R (Reset)
and S (Set) inputs are 1 simultaneously. The D flip-flop, with its single data input (D),
avoids this issue entirely, making it more reliable.
Simplified Input: The D flip-flop has only one input (D) compared to the RS flip-flop's
two inputs (R and S), making it simpler to use in designs since you only need to control
one signal.
Predictable Behavior: The D flip-flop directly transfers the D input to the output Q on a
clock edge, leading to a straightforward and predictable operation. This is more intuitive
than the RS flip-flop, where the behavior depends on the combination of R and S inputs.
Data Synchronization: D flip-flops are excellent for synchronizing data with clock
signals, making them ideal for applications like registers, counters, and memory
elements where data integrity and precise timing are crucial.
Discuss 11 -13 with your lab demonstrator and provide your answer in your submission
document, along with the truth table above.
14. J-K Flip Flops are like your general purpose Flip Flop because they are
programmable. Review the video on JK Flip Flops, and when you’re feeling
comfortable, wire up a J-K FF using NAND gates. Two of your NAND gates
will need to deal with three inputs.
Logisim will not be able to simulate this circuit, but export your completed circuit
as an image and include it in your submission document.
Page 7 of
16
Computer Systems Week 3 Laboratory
15. Complete and include this truth table for JK Flip Flops in your
submission docu- ment.
J K Q (when clocked) Q’ (when clocked)
0 0 No change No change
1 0 1 0
0 1 0 1
1 1 1 (Oscillation 1 (Oscillation
apparent) apparent)
1. Case 1: J = 0; K = 0
2. Case 2: J = 1; K = 0
Page 8 of
16
Computer Systems Week 3 Laboratory
3. Case 3: J = 0; K = 1
4. Case 4: J = 1; K = 1
16. How can a J-K Flip Flop be made to behave like a D Flip Flop?
- To make a J-K Flip Flop behave like a toggle (T Flip Flop), we need to do 2 changes. One,
connect the two inputs J and K into one input only. Second, set that new input as Toggle
(T) input. The circuit will be like this after making two changes on the original J-K Flip
Flop in Question 14, 15:
Case 1: When Input = 1 that J = 0 and K = 1 so the Output will set Q = 1 and Q’ = 0
Page 9 of
16
Computer Systems Week 3 Laboratory
Case 2: When Input = 0 that J = 1 and K = 0 so the Output will set Q = 0 and Q’ = 1
17. How can a J-K Flop Flop be made to behave like a toggle (T Flip Flop)?
Page 10 of
16
Computer Systems Week 3 Laboratory
Discuss these questions with your lab demonstrator and provide your answer
in your submission document, along with the truth table in Step 15.
22. Use your register to fill out the following test schedule:
Page 11 of
16
Computer Systems Week 3 Laboratory
0 0000 0000
1 0001 0001
2 0010 0010
3 0011 0011
5 0101 0101
A 1010 1010
B 0010 0010
Page 12 of
16
Computer Systems Week 3 Laboratory
C 0011 0011
D 0100 0100
E 0101 0101
F 0110 0110
Page 13 of
16
Computer Systems Week 3 Laboratory
When complete:
■
Submit your answers (screen shots, etc) in a single document using Canvas
■
Show your lab demonstrator your working circuits in class (you must do this to
get the cred- it). Your lab demonstrator may request you to resubmit if issues
exist.
Page 14 of
16