Advertisement
Guest User

Untitled

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