Advertisement
XeBuZer0

Untitled

Jan 12th, 2023
2,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.37 KB | Source Code | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. entity displayl is port(
  4. clk: in std_logic;— pulso de reloj
  5. tecla: in std_logic_vector (0 to 8) ; — botón del teclado
  6. C: inout std_logic_vector (3 downto 0);—salida codificador
  7. A: inout std_logic_vector (3 dcwnto 0);— entrada registro
  8. Q: inout std__logic_vector (3 downto 0);— salida registro
  9. D: inout std_logic_vector (3 dcwnto 0);—entrada decodificador
  10. seg: out std_logic_vector (0 to 6)); —salidas decodificador
  11. end displayl;
  12.  
  13. architecture a_displ of displayl is
  14. begin
  15.     C <= "0001" when tecla = "100000000" else
  16.         "0010" when tecla = "010000000" else
  17.         "0011" when tecla = "001000000" else
  18.         "0100" when tecla = "000100000" else
  19.         "0101" when tecla = "000010000" else
  20.         "0110" when tecla = "000001000" else
  21.         "0111" when tecla = "000000100" else
  22.         "1000" when tecla = "000000010" else
  23.         "1001";
  24. A <= C;
  25. process (clk,A,D) begin
  26.     if (clk1 event and clk = '1') then
  27.     Q <= A;
  28.     D <= Q;
  29.     end if;
  30.         case d is
  31.             when "0000" => seg <= "0000001";
  32.             when "0001" => seg <= "1001111";
  33.             when "0010" => seg <= "0010010";
  34.             when "0011" => seg <= "0000110";
  35.             when "0100" => seg <= "1001100";
  36.             when "0101" => seg <= "0100100";
  37.             when "0110" => seg <= "0100000";
  38.             when "0111" => seg <= "0001110";
  39.             when "1000" => seg <= "0000000";
  40.             when others => seg <= "0001100";
  41.         end case;
  42.     end process;
  43. end a_displ;
Tags: VHDL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement