LAB3prep Group03
LAB3prep Group03
HỒ CHÍ MINH
TRƯỜNG ĐẠI HỌC BÁCH KHOA
KHOA KHOA HỌC VÀ KỸ THUẬT MÁY TÍNH
EXPERIMENT 3
Digital System
Group: 03
Member:
Name ID
Lê Minh Gia Bảo 2052396
Quách Gia Bảo 2452141
Nguyễn Hoài Phong 2452960
Thoại Hào 2452305
EXERCISES:
1.Exercise 2.3.1
Design, simulate and implement a D Flip-flop using J-K Flip-flops
(allowed to use other logic gates if necessary)
----------
Truth Table for D Flip-flop
D CLK Q
0 PGT/NGT 0
1 PGT/NGT 1
1 1 PGT/NGT D D
(else: no change)
1
J K CLK Q
1 0 PGT/NGT 1
0 1 PGT/NGT 0
Reset J K CLK Q
1 0 0 PGT/NGT No change
1 1 0 PGT/NGT 1
1 0 1 PGT/NGT 0
1 1 1 PGT/NGT Toggle
D Q0 J K Q
0 0 0 x 0
0 1 x 1 0
1 0 1 x 1
1 1 x 0 1
2
K-map method:
For J:
D/Q0 0 1
0 0 x
1 1 x
=> J = D
For K:
D/Q0 0 1
0 x 1
1 x 0
=> K = D’
So it should look like this:
Reset CLK D Q Q0
0 X X 0 1
1 NGT 1 1 0
1 NGT 0 0 1
1 0 X No change
1 1 X No change
1 PGT X No change
3
Netlist:
Start End
2.Exercise 2.3.2:
Design, simulate and implement the following logic circuit.
4
a. Assume that QA, QB, QC are connected to the LEDs. What is the
phenomenon of the LEDs? What is the difference among LEDs?
b. How many minimum D Flip-flops required to build a circuit in which
the output frequency is 16 times less than the Clock In frequency?
------------------
We got: QA connect to LEDA, QB connect to LEDB, QC connect to LEDC
U1 U2
Netlist:
5
Start End
5V U1:14, U2:14
U1:5 U1:11
U1:9 U2:3
U2:5 Wire
Timing diagram:
6
CLK 1 2 3 4 5 6 7 8
(*)
QA 0 1 0 1 0 1 0 1
QB 0 0 1 1 0 0 1 1
QC 0 0 0 0 1 1 1 1
Question B:
finput = foutput x 2N (with N is the number of D Flip-flops)
+ In the circuit above:
foutput = fC = fin / 23 = 1/8 x finput.
+ When frequency of output is 16 less than the input CLK frequency:
2N = 16 = 24 => N = 4.
So the minimum D Flip-flops required is 4.
3.Exercise 2.3.3:
Given the circuit and waveform as follows.
7
a. Design and simulate the circuit in Logisim.
b. Complete the timing diagram for A, B, and z based on the given
waveform.
--------------------
a. Logisim circuit:
1 1 X X INVALID
1 0 X X 1 0
0 1 X X 0 1
0 0 NGT 0 0 1
0 0 NGT 1 1 0
0 0 ELSE X NO CHANGE
1 1 X X X Invalid
1 0 X X X 1 0
0 1 X X X 0 1
8
0 0 NGT 0 0 NO CHANGE
0 0 NGT 0 1 0 1
0 0 NGT 1 0 1 0
0 0 NGT 1 1 TOGGLE
0 0 ELSE X X NO CHANGE
Timing Diagram: