Beruflich Dokumente
Kultur Dokumente
clock
: used for synchronization to indicate when
data is valid.
Data
:
From keyboard: 8
-
bit (byte)
scan code
to indicate
which key was pressed.
30 Khz
parity is odd
scan code
Logic
Design : PS2 Keyboard
7
S. Yoder ND
,
2013
Scan Codes in Hex
Logic
Design : PS2 Keyboard
8
S. Yoder ND
,
2013
Sequence of Events
key pressed: 11
-
bit code is sent
start bit, 8
-
bit scan code, odd parity bit, stop bit
key
released: two 11
-
bit codes are sent
this is the
architecture.
4.
Identify all the unique states. Refer to the functional description to help iden
tify
the different states
5.
Draw the state diagram(s). There may be multiple FSMs.
6.
Write the Verilog modules for each block identified in step 3.
7.
Verify consistency between the Verilog description and the documentation
generated in steps 1
5.
8.
Write test benches for each module.
9.
Simulate and verify correct functionality.
10.
Make necessary design changes.
11.
Integrate the module in a
top
-
level module
and repeat steps 8
10.
12.
Implement the prototype and verify and validate the design.
Logic
Design : PS2 Keyboard
13
S. Yoder ND
,
2013
Block Diagram
Keyboard
keyClk
data
11
-
bit shift register
8
-
bit data register
d0
d7
System
Controller
scan code
d0
d7
sysClk
bitcounter
clear
load
d0 ... d7
reset
TC
Logic
Design : PS2 Keyboard
14
S. Yoder ND
,
2013
System Controller States
Initial
Start
CheckCode
SaveCode
ReadCode
In the previous state diagram the second sending of the scan code
for the key when it is released is left up to external circuitry to handle.
The following two slides include additional states for handling FO and
the repeat of the scan code for the key that is released.
Logic
Design : PS2 Keyboard
17
S. Yoder ND
,
2013
Alternative Approach for Key Released
Initial
Start
checkCode
SaveCode
keyUp
keyPressed
Ignore