Advertisement
Guest User

Untitled

a guest
Jan 6th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.18 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity Quiz is
  5.     Port ( rst : in  STD_LOGIC;
  6.            clk : in  STD_LOGIC;
  7.            Pulsante1 : in  STD_LOGIC;
  8.            Pulsante2 : in  STD_LOGIC;
  9.            Display : out  STD_LOGIC_VECTOR (0 to 6);
  10.               stato : out STD_LOGIC_VECTOR (0 to 2);
  11.               cont : out STD_LOGIC_VECTOR (0 to 3));
  12. end Quiz;
  13.  
  14. architecture Behavioral of Quiz is
  15.  
  16. component GestionePulsanti is
  17.     Port ( rst : in  STD_LOGIC;
  18.            clk : in  STD_LOGIC;
  19.            P1 : in  STD_LOGIC;
  20.            P2 : in  STD_LOGIC;
  21.            seg_out : out  STD_LOGIC_VECTOR (0 to 3);
  22.               state_debug : out STD_LOGIC_VECTOR (0 to 2);
  23.               count_debug : out STD_LOGIC_VECTOR (0 to 3));
  24. end component;
  25.  
  26. component Display7Segmenti is
  27.     Port ( num : in  STD_LOGIC_VECTOR (0 to 3);
  28.            segments : out  STD_LOGIC_VECTOR (0 to 6));
  29. end component;
  30.  
  31. signal seg_in: STD_LOGIC_VECTOR (0 to 3);
  32. -- utilizzo seg_in come segnale di output di "GestionePulsanti"
  33. -- che va in input a "Display7Segmenti"
  34.  
  35. begin
  36.  
  37. seq: GestionePulsanti port map (rst, clk, Pulsante1, Pulsante2, seg_in, stato, cont);
  38. seg: Display7Segmenti port map (seg_in, display);
  39.  
  40. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement