------------------------------------------------------------------------------- -- -- EE 552 Project: Driver's Ed -- -- led.vhd -- -- Description: Top Level Architecture to instantiate a keypad decoder state machine -- and output the detected key to an LED and an output port that -- will be connected to the VGA display entity. The other LED -- will have a value of 0 -- -- Author: Raymond Sung -- -- Compiled and Simulated with No Known Errors -- ------------------------------------------------------------------------------- LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; USE ieee.std_logic_unsigned.all; library work; use work.keytest_pkg.all; ENTITY keytest IS PORT( clk : IN STD_LOGIC; resetn : IN STD_LOGIC; row : IN STD_LOGIC_VECTOR(3 downto 0); col : OUT STD_LOGIC_VECTOR(3 downto 0); keyvalid : OUT STD_LOGIC; led_output : OUT STD_LOGIC_VECTOR(6 downto 0); unused_led : OUT STD_LOGIC_VECTOR(6 downto 0); keyvalue_output : OUT STD_LOGIC_VECTOR(3 downto 0) ); END keytest; architecture structural of keytest is signal internal_keyvalue: std_logic_vector(3 downto 0); signal zero: std_logic_vector(3 downto 0); begin zero <= "0000"; keyvalue_output <= internal_keyvalue; -- instantiate the keypad scanning state machin keydecode_part: component keydecode PORT MAP ( clk => clk, resetn => resetn, row => row, col => col, keyvalue_registered => internal_keyvalue, keyvalid => keyvalid ); -- instantiate the hexadecimal to seven segment decoder led_part: component led port map ( input => internal_keyvalue, led_output => led_output ); -- instantiate the hexadecimal to seven segment decoder which is unsed -- and driven to "0000" unused_led_part: component led port map ( input => zero, led_output => unused_led ); end;