Advertisement
hbinderup94

code_lock_tester

May 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.73 KB | None | 0 0
  1. ------ code_lock_tester ------
  2. library ieee;
  3. use ieee.std_logic_1164.all;
  4.  
  5. entity code_lock_tester is
  6. port(
  7.     CLOCK_50        : in std_logic;
  8.     KEY             : in std_logic_vector(1 downto 0);
  9.     SW              : in std_logic_vector(3 downto 0);
  10.     LEDG0, LEDR0    : out std_logic;
  11.     HEX0            : out std_logic_vector(6 downto 0));
  12. end code_lock_tester;
  13.  
  14.  
  15. architecture structural of code_lock_tester is
  16.     signal hex : std_logic_vector(3 downto 0);
  17. begin
  18.  
  19. I1: entity work.code_lock
  20.      port map(
  21.      clk        => CLOCK_50,
  22.      reset      => KEY(1),
  23.      code       => SW,
  24.      enter      => KEY(0),
  25.      lock       => LEDG0,
  26.      err        => LEDR0,
  27.      err_hex    => hex);
  28.      
  29. I2: entity work.bin2hex -- HEX display til antal errors
  30.      port map(
  31.      bin        => hex,
  32.      seg        => HEX0);
  33.      
  34. end structural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement