Professional Documents
Culture Documents
Componentes o
subcircuitos
VHDL - Xilinx ISE Software
Danilo A. Garca-Hansen
Subcircuitos o componentes
Subcircuito = Componente
entity FULLADD is
Port ( cin, A, B : in STD_LOGIC;
s, cout : out STD_LOGIC);
end FULLADD;
architecture logica of FULLADD is
begin
s<=A xor B xor cin;
cout<= ( A and B) or (cin and A) or (cin and B);
end logica;
BEGIN
ETAPA0: FULLADD
ETAPA1: FULLADD
ETAPA2: FULLADD
ETAPA3: FULLADD
end ESTRUCTURA;
LOC
LOC
LOC
LOC
=
=
=
=
"J14";
"J15";
"K15";
"K14";
entity CIRCUITO is
Port ( CLK_PPAL : in STD_LOGIC;
PORT_IN : in STD_LOGIC_VECTOR (3 downto 0);
S0 : in STD_LOGIC;
S1 : in STD_LOGIC;
PORT_OUT : out STD_LOGIC_VECTOR (3 downto 0));
end CIRCUITO;
architecture ARQ_CTO of CIRCUITO is
SIGNAL DIVISOR: STD_LOGIC_VECTOR(23 DOWNTO 0);
SIGNAL
SIG1, SIG2, SIG3: STD_LOGIC_VECTOR(3 DOWNTO 0);
COMPONENT CONT_4BITS
Port ( CLK: in STD_LOGIC;
Q : INOUT STD_LOGIC_VECTOR (3 downto 0));
end COMPONENT;
--contina
end ARQ_CONTADOR;
entity MUX4CH is
Port ( A : in STD_LOGIC_VECTOR (3 downto 0);
B : in STD_LOGIC_VECTOR (3 downto 0);
S : in STD_LOGIC;
Y : OUT STD_LOGIC_VECTOR (3 downto 0));
end MUX4CH;
architecture ARQ_MUX of MUX4CH is
begin
process (S,A,B)
begin
case S is
when '0' => Y <= A;
when others => Y <= B;
end case;
end process;
end ARQ_MUX;