Professional Documents
Culture Documents
Stream Tutorial11 Slides Only
Stream Tutorial11 Slides Only
• Counters
• D Flip-Flop counter
• JK up down counter
1-Load Register
Problem I: Using D flip-flops and 2×1 multiplexers, implement a 4 - bit parallel-input
register
𝑖 0 𝐷 0 𝑜 0
• Input is
𝑄 𝑡 +1 = 𝐷
clk
𝑖 0 𝑖 2 𝑜 2
𝐷 2
𝑜 0
𝑖 3 𝐷 3 𝑜 3
Problem I: Using D flip-flops and 2×1 multiplexers, implement a 4 - bit parallel-input
register
1 0 1 1 0 1
101101 1011
1 0 1 1
Serial
Input 𝐷 0 𝑂
0 𝐷 1 𝑂
1 𝐷 2 𝑂
2 𝐷 3 𝑂
3
Serial Register :
Input
Serial input : -- 1
1 0
0 1
1 1
1
1 0 1 1 0 1 1 1 1 0 1
1 1 1 0 1
0
0 0
0 1
1 1
1 0
0
1
1 1
1 0
0 1
1 1
1
1
1 1
1 1
1 0
0 1
1
0
0 0
0 1
1 1
1 0
0
1
1 1
1 0
0 1
1 1
1
Serial 1 0 1 1
𝐷0
Input
𝐷0 𝐷0 𝐷0
𝑂0
𝑂 1 𝑂 2
𝑂3
3-Universal Shift Register
Problem IV: Sketch the logic diagram of a 2 -bit universal shift
register
• 2 output bits :
Input
𝑖𝑝
:serial input for shift right
Operation Output
00 No change 𝑖𝑝 𝑄 1
01 Shift Right :serial input for shift left
10 Shift Left
11 𝑖 1 𝑖 0 𝑖𝑝
Parallel Load
2) Design of Universal Shift Register
Input Operation Output
𝑖 0 𝐷 0 𝑄
0
No change
Shift Right
𝑖 0
Shift Left
Parallel Load
𝑖 1 𝑄 1
𝐷 1
No change
Shift Right 𝑖 1
Shift Left
Parallel Load
2) Design of Universal Shift Register (connections)
Input Operation Output
00 No change
01 Shift Right
10 Shift Left
11 Parallel Load 𝑖 1 𝑖 0
𝐷
1
Ip
𝑄 1 𝐷 0 𝑄 ip0
𝑆 11
00𝑆
01
10
1 0 𝑆 11
00𝑆
01
10
1 0
𝑄1 𝑖 𝑝 𝑄0 𝑖1 𝑄
𝑄00
𝑄
𝑄 𝑖𝑄
00𝑄𝑄
1𝑝
𝑖111
𝑄 ¿0𝑖 𝑖¿
¿
𝑖𝑝
¿
𝑖𝑝 0 1
Solve This !
• Implement a 3 bit-universal Shift Register
Counters
Problem III: Design a 3 -bit synchronous up counter that starts at state 000 and only goes through
the states with an even decimal equivalent. The safest-possible circuit should be implemented in
your design. Assume that the counter is cyclic (i.e. upon reaching the last possible state, it would go
back to 000).
𝑄 𝑡 +1 𝐷
1. Define inputs, outputs, possible states
• S0 :000
• S2 :010 3.State Table
• S4: 100 Prsnt Nxt FF.inp
• S6: 110
ABC ABC
S0 000 010 010
2. State Diagram: 𝑄
𝑡 +1 =𝐷
001 000 000
S2 010 100 100
S0 000
011 000
S4 100 110 110
S6 S2
101 000 000
S4 S6 110 000 000
111 000 000
Problem III: Design a 3 -bit synchronous up counter that starts at state 000 and only goes through
the states with an even decimal equivalent. The safest-possible circuit should be implemented in
your design. Assume that the counter is cyclic (i.e. upon reaching the last possible state, it would go
back to 000).
4. Draw Circuit
Presen Next BC 00 01 11 10
t A mo m1 m3 m2
0 1 𝐷
𝐴 =𝐶 ′ ( 𝐴 𝑥𝑜𝑟𝐵)
ABC ABC m4 m5 m7 m6
1 1
000 010 010
001 000 0 BC
001 000 0000
0 00 01 11 10
C’ 𝐷 𝐵 𝑄 𝐵
′
𝐷 𝐵 =𝐶 𝐵 ′ ¿ B’
0 𝐷 𝐶 𝑄 𝐶
𝐷 𝑐 =0
Problem II: Consider the following synchronous 4 - bit binary counter. How can the addition of 2×1
multiplexers to the circuit allow it to be used as a count up/down counter? Sketch a new logic
diagram
for such a circuit.
0 0 0 0
0 0 0 0
0 0 0 1
0 0 0 1
0 0 1 0
0 0 1 0
0 0 1 1
0
0 0
1 1
0 1
0
0
0 1
1 0
0 0
1
0 1 0
1 1
0
𝐴
3 𝐴2 𝐴 1 𝐴 0 0 1 1 1
0
1
0 0
1 0
1 0
1
• Let Count Enable(E ) = 1 1
1
0
0
0
0
1
0
• FF0: ,always toggle 1
1
0
0
1
0
0
1
• FF1:.E 1
1
0
0
1
1
1
0
1 1 0 0
• FF2: = . . 1
1
0
1
1
0
1
1
• FF3: = . = . 1
1 1
1 0
1 0
0
1
1 1
1 0
1 1
1
1 1 1 0
1 1 1 1
0 0 0 0 11 1
0 0 0 1
11 0
0 0 1 0
11 1
0 0 1 1 11 0
0 1 0 0 11 1
0 1 0 1 11 0
0 1 1 0
11 1
0 1 1 1
11 0
1 0 0 0 11 1
1 0 0 1 11 0
1 0 1 0 11 1
1 0 1 1
11 0
•
•
Let Count Enable(E ) = 1
FF0: ,always toggle
1 1 0 0
11 1
1 1 0 1 11 0
1 1 1 0 11 1
1 1 1 1 11 0
0 0 0 0 00 11 0 1
0 0 0 1 11 11 1 0
0 0 1 0 00 11 1 1
0 0 1 1 11 11 0
0
0 1 0 0 00 11 0 1
0 1 0 1 11 11 1 0
0 1 1 0 00 11 1 1
0 1 1 1 11 11 0 0
1 0 0 0 00 11 0 1
1 0 0 1 11 11 1 0
1 0 1 0 00 11 1 1
1 0 1 1 11 11 0 0 • Let Count Enable(E ) = 1
1 1 0 0 00 11 0 1 • FF0: ,always toggle
1 1 0 1 •
11 11 1 0
FF1:.E
1 1 1 0 00 11 1 1
1 1 1 1 11 11 0 0
0 0 0 0 00 00 11 0 0 1
0 0 0 1 00 11 11 0 1 0
0 0 1 0 00 00 11 0 1 1
0 0 1 1 11 11 11 0
1 0
0 1 0 0 00 00 11 1 0 1
0 1 0 1 00 11 11 1 1 0
0 1 1 0 00 00 11 1 1 1
0 1 1 1 11 11 11 0 0 0
1 0 0 0 00 00 11 0 0 1
1 0 0 1 00 11 11 0 1 0
1 0 1 0 00 00 11 0 1 1
1 0 1 1 11 11 11 1 0 0
1 1 0 0 00 00 11 1 0 1
1 1 0 1 00 11 11 1 1 0 • Let Count Enable(E ) = 1
1 1 1 0 00 00 11 1 1 1 • FF0: ,always toggle
• FF1:.E
1 1 1 1 11 11 11 0 0 0 • FF2: = . .
.
0 0 0 0 0 0 00 0 0 11 0 0 0 1
0 0 0 1 0 0 00 1 1 11 0 0 1 0
0 0 1 0 0 0 00 0 0 11 0 0 1 1
0 0 1 1 0 0 11 1 11 0
1 0 1 0
0 1 0 0 0 0 00 0 11 0
0 1 0 1
0 1 0 1 0 0 00 1 1 11 0 1 1 0
0 1 1 0 0 0 00 0 0 11 0 1 1 1
0 1 1 1 1 1 11 1 1 11 1 0 0 0
1 0 0 0 0 0 00 0 11
0 1 0 0 1
1 0 0 1 0 0 00 1 11
1 1 0 1 0
1 0 1 0 0 0 00 0 0 11 1 0 1 1
1 0 1 1 0 0 11 1 1 11 1 1 0 0 • Let Count Enable(E ) = 1
1 1 0 0 0 0 00 0 0 11 1 1 0 1 • FF0: ,always toggle
• FF1:.E
1 1 0 1 0 0 00 1 11
1 1 1 1 0 • FF2: = . .
1 1 1 0 0 0 00 0 0 11 1 1 1 1
• FF3: = . = .
1 1 1 1 1 1 11 1 1 11 0 0 0 0
𝐴 0 ′ 𝑄 0
0 0 0 0 1 1 1 1
0 0 0 1 1 1 1 0
𝑠
0 0 1 0 1 1 0 1
𝐴 1 ′ 𝑄1 ❑ 0 0 1 1 1 1 0 0
0 1 0 0 1 0 1 1
𝑠 0 1 0 1 1 0 1 0
0 1 1 0 1 0 0 1
𝐴 2 ′ 𝑄 2
0 1 1 1 0 0 0 0
1 0 0 0 0 1 1 1
𝑠 1 0 0
𝑄 1 0 1 1 0
𝐴 3 ′ 𝑄 3 1 0 1 0
𝑄′ 0 𝑄 0 1 0 1
1 0 1 1 0 1 0 0
𝑠 1 1 0 0 𝑠 0 0 1 1
1 1 0 1 0 0 1 0
1 1 1 0 0 0 0 1
If s=0 up counter 1 1 1 1 0 0 0 0
If s=1 down counter
Please send
On-Line Assignment if you have any question or
an e-mail
need any help
Stay Safe
Eng. Yasmin Massoud
yasmin.massoud@guc.edu.eg