Uploaded by Mim Y

12345

advertisement
PDS0101
INTRODUCTION TO DIGITAL SYSTEMS
2020/2021 Trim. 2
Exercise 4
Question 1 [3 marks]
Consider this scenario:
You have installed a first-person shooting game into your PC. However, you do not have a
gaming controller as an input device to play the game. Therefore, you have use the keyboard as
the controller. Before this is possible, you are required to map specific keys to the respective
buttons of a gaming controller. Perform the following steps to design a decoder that would map
the required keyboard keys to the needed controller buttons.
Main task: Map the keys W, S, A, and D to Up, Down, Left, and Right respectively.
Hint: W, S, A, and D provides the binary inputs; Up, Down, Left, and Right are outputs.
a) Assuming the binary codes of some keys are as follows:
Key
Binary
A
000
D
001
G
010
J
011
M
100
P
101
S
110
W
111
Construct a 3-bit decoder truth table with active LOW output (no Enable needed and assume
unrelated keys to not activate any output).
b) Design the logic diagram of the 3-bit decoder based on the truth table.
Question 2 [2 marks]
Given the waveform below, derive the output waveform (Q) for the respective devices. All
outputs start at RESET (Q = 0) state.
C
A
B
a)
b)
c)
d)
S-R latch assuming A = S and B = R.
Gated D latch assuming C = EN and B = D.
Negative Edge-triggered D Flip-flop assuming C = CLK and A = D.
Positive Edge-triggered J-K Flip-flop assuming C = CLK, A = J, and B = K.
1
LYP
Download