Download Print this page

UBC ELEX 3330 Instructions

Keypad decoder

Advertisement

Quick Links

Introduction
In this lab you will design a decoder for a 3x3 switch-
matrix numeric keypad. Your decoder will show the
binary value of the key being pressed on the FPGA
board's LEDs:
DE0-Nano
FPGA
board
4x4
switch
matrix
Requirements
All LEDs should be off if no key is being pressed.
When a key is pressed the binary value of the key
should be displayed on LED(3) through LED(0).
You need only decode the keys between 1 and 9 and
you may assume that only one key at a time will be
pressed.
Decoder Operation
e keypad contains 16 switches arranged in a 4x4
grid. We will only use the 3x3 portion consisting of
the digits 1 through 9. Each switch is connected to
one row and one column. Pressing a switch makes a
connection between the corresponding row and col-
umn conductors:
lab5.tex
ELEX 3330 : Programmable Logic Devices
2016 Winter Term
Keypad Decoder
8
LEDs
col
4
4
row
e three lemost column conductors, keypad
pins 4 through 2, are connected to FPGA inputs that
are configured with pull-up resistors so they will read
high (1) unless pulled low.
1
A simple
decoder can be designed as a state ma-
chine that cycles through three states. In each state
a different row is set low (0). Pressing a switch will
drive one of the column inputs low. If any of the
columns is low then the state machine stays in the
current state. Otherwise it goes to the next state.
a
011
a: col="111"
We can design combinational logic to obtain the
binary value of the key being pressed from the current
row and column values.
Keypad-FPGA Interface
A ribbon cable cable connects the 8 pins of the keypad
ribbon cable to 8 general purpose I/O (GPIO) pins on
the DE0-Nano FPGA board.
1
A more complete design would have to debounce the
switches and register key presses.
1
a
101
110
a
2016-05-04 23:33

Advertisement

loading
Need help?

Need help?

Do you have a question about the ELEX 3330 and is the answer not in the manual?

Questions and answers

Summary of Contents for UBC ELEX 3330

  • Page 1 ELEX 3330 : Programmable Logic Devices 2016 Winter Term Keypad Decoder Introduction In this lab you will design a decoder for a 3x3 switch- matrix numeric keypad. Your decoder will show the binary value of the key being pressed on the FPGA board’s LEDs:...
  • Page 2 e lab5.qsf settings file assigns the names row(3 downto 1) and col(3 downto 1) to the 6 upper le row/column pins and configures col(3 downto 1) with internal pull-up resistors. Connector Details e connections to the ribbon cable can be con- Connect the keypad to the blue ribbon cable connec- fusing.
  • Page 3 Also add the following instruction before compil- Connector Pinouts ing your code: e following diagrams show the connector pinouts: • select Project > Add/Remove Files in Project... and add the file clock.vhd to your project. keypad Test your design and demonstrate it to the instruc- cable connector pins tor to get credit for completing the lab.
  • Page 4 • under Signal Configuration: Clock: click on ... to use the node finder to list the signals that can be monitored. Click on the “Show more search op- tions” button beside List if necessary and select SignalTapII:pre-synthesis as the filter option. Add your clock signal as the clock.