Reconfigurable Computing Laboratory

advertisement
Lebanese American University
COE425 Digital Systems Laboratory
Department of Electrical and Computer Engineering
Laboratory #5
Spring 2016
Interfacing with a PS/2 Keyboard
Purpose
Use the knowledge acquired earlier and the DE2-115 manuals and demos to interface
with a PS/2 keyboard.
Required
Let us play a guessing game!
This game is similar to “hangman”.
It is a 2-player game:
Administrator: provides the word to be guessed.
Guesser: tries to guess the word.
The game administrator is required to input a less than 15-character word.
This word shall be guessed by the guesser while showing the number of guesses
made.
The game scenario goes as follows:
Once the board is turned on, the LCD shall display “Welcome” for 5 seconds.
After that, the LCD shall display “Plz enter word”.
The administrator shall now provide a less than 15-character word, which shall not be
displayed on the LCD.
When the administrator presses the Enter button of the keyboard, the guessing game
starts.
The LCD shall display the number of characters of the word on its first line (e.g. if the
administrator inputs the word “ball”, the LCD shall display 4 as the number of
characters of the word, please note that the empty space character shall be discarded
and treated as unacceptable input by both the administrator and the guesser).
The LCD shall display the guessed word on the second line, character by character, as
provided by the guesser.
Note that if the user presses a backspace the last character shall be replaced by
an empty space.
After the guesser presses the Enter button of the keyboard, the entered word shall be
compared to the one entered by the administrator.
If they match, a LED shall blink with an 8 Hz frequency and the LCD shall
display “YOU WON!”.
If they do not match, a 7-segment display shall be incremented by 1 notifying
the number of guesses made by the guesser (use 2 7-segment displays).
Steps:
a. Use the provided DE2-115 manuals (and you can always use the internet) to
understand how the PS/2 interface works and how to deal with it using a
keyboard. Summarize how the keyboard communicates with the FPGA from
1
b.
c.
d.
e.
f.
the moment you press a button (on the keyboard) until the FPGA understands
it.
Use the demonstrations directory in the System CD and locate the appropriate
PS/2 keyboard blocks (.v or .vhd files) that you can use / modify to establish
your design. Explain the functionality of each block (symbol) used and why
you modified it (if you did).
Build your LCD block (you can use previous designs) appropriately. Explain
your design in details.
Add any additional logic (or Verilog) still needed and explain your overall
design.
Assign your pins and load your design on the board. Verify your results.
Save your design on the board.
Pre-demo Tasks
 Use the Altera Quartus II Software to implement and simulate your design.
 Download and test your design on the Altera DE2-115 board.
 Submit the design files on the lab webpage on the demo day.
Demo Tasks
 Hand in a print-out of your report at the beginning of the lab.
 Open all your design files on the Altera Quartus II software. You should
demonstrate successful simulation and download of the design.
 Be prepared to answer all questions about the various steps of the design process.
Naming of Design Files
Group all the files used/generated for this project in one directory called DSLab5 then
zip the directory and submit DSLab5.zip on the course webpage. Mention the names
of both group members when you submit the file.
Due Date


February 29, 2016 for the Monday Section
March 2, 2016 for the Wednesday Section
Reminder:


Cut-and-paste from external resources is not acceptable.
All material listed in the report should be presented in your own words and
failure to do so will result in a ZERO grade on the report.
2
Download