Advertisement
Guest User

Untitled

a guest
May 24th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4.  
  5. entity circuito_combinado is
  6. port( EN : IN STD_LOGIC_VECTOR (0 TO 9);
  7. ENA: IN STD_LOGIC;
  8. DAT_B: IN STD_LOGIC_VECTOR(3 DOWNTO 0);
  9. EQU,HIG,LES: OUT STD_LOGIC
  10. );
  11.  
  12.  
  13.  
  14. end circuito_combinado;
  15.  
  16.  
  17.  
  18. architecture Circuito of circuito_combinado is
  19.  
  20. COMPONENT comparador_4_bits
  21. Port ( Dato_A : in STD_LOGIC_VECTOR(3 DOWNTO 0);
  22. Dato_B : in STD_LOGIC_VECTOR(3 DOWNTO 0);
  23. EQ,LE,HI : out STD_LOGIC -- EQ=IGUAL,LE=MENOR,HI=MAYOR;
  24. );
  25. end COMPONENT;
  26.  
  27.  
  28. COMPONENT cod_prioritario
  29. Port ( E: IN STD_LOGIC_VECTOR (9 DOWNTO 0);
  30. S: OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
  31. ENABLE: IN STD_LOGIC
  32. );
  33.  
  34. end COMPONENT ;
  35.  
  36.  
  37. SIGNAL SALIDA:STD_LOGIC_VECTOR(3 DOWNTO 0); --Señal de interconexion entre el codificador y el comparador.
  38.  
  39. begin
  40.  
  41. CODIFICADOR:cod_prioritario PORT MAP (E=>EN,
  42. ENABLE=>ENA,
  43. S=>SALIDA);
  44.  
  45. COMPARADOR:comparador_4_bits PORT MAP (Dato_A => SALIDA,
  46. Dato_B => DAT_B,
  47. EQ =>EQU,
  48. HI=>HIG,
  49. LE=>LES);
  50.  
  51.  
  52.  
  53.  
  54.  
  55. end Circuito;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement