BCD
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity BCD_CI is
Port ( i0 : in STD_LOGIC;
i1 : in STD_LOGIC;
i2 : in STD_LOGIC;
i3 : in STD_LOGIC;
a : out STD_LOGIC;
b : out STD_LOGIC;
c : out STD_LOGIC;
d : out STD_LOGIC;
e : out STD_LOGIC;
f : out STD_LOGIC;
g : out STD_LOGIC);
end BCD_CI;
architecture Behavioral of BCD_CI is
component COMPUERTAAND is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
S : out STD_LOGIC);
end component;
component COMPUERTANOT is
Port ( A : in STD_LOGIC;
B : out STD_LOGIC);
end component;
component COMPUERTASAND_3IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
S : out STD_LOGIC);
end component;
component COMPUERTASOR_2IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASOR_3IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASOR_4 is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
D : in STD_LOGIC;
F : out STD_LOGIC);
end component;
component COMPUERTASXNOR is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASXOR is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
signal ip0, ip1, ip2, a1, b1, d1, d2, d3, d4, e1, e2, f1, f2, f3, g1, g2: std_logic;
begin
U0: COMPUERTANOT port map(i0, ip0);
U1: COMPUERTANOT port map(i1, ip1);
U2: COMPUERTANOT port map(i2, ip2);
U3: COMPUERTASXNOR port map(i2, i0, a1);
U4: COMPUERTASOR_3IN port map(i3, i1, a1, a);
U5: COMPUERTASXNOR port map(i1, i0,b1);
U6: COMPUERTASOR_2IN port map(ip2, b1, b);
U7: COMPUERTASOR_3IN port map(i2, ip1, i0, c);
U8: COMPUERTAAND port map(i1,ip0, d1);
U9: COMPUERTAAND port map(ip2, ip0,d2);
U10: COMPUERTAAND port map(ip2, i1,d3);
U11: COMPUERTASAND_3IN port map(i2, ip1, i0,d4);
U12: COMPUERTASOR_4 port map(d1, d2, d3, d4, d);
U13: COMPUERTAAND port map(i1, ip0, e1);
U14: COMPUERTAAND port map(ip2, ip0, e2);
U15: COMPUERTASOR_2IN port map(e1, e2,e);
U16: COMPUERTAAND port map(i2, ip1, f1);
U17: COMPUERTAAND port map(i2,ip0, f2);
U18: COMPUERTAAND port map(ip1, ip0, f3);
U19: COMPUERTASOR_4 port map(i3, f1, f2, f3, f);
U20: COMPUERTAAND port map(i1, ip0, g2);
U21: COMPUERTASOR_3IN port map(i3, g2, g1, g);
U22: COMPUERTASXOR port map(i2, i1, g1);
end Behavioral;
use IEEE.STD_LOGIC_1164.ALL;
entity BCD_CI is
Port ( i0 : in STD_LOGIC;
i1 : in STD_LOGIC;
i2 : in STD_LOGIC;
i3 : in STD_LOGIC;
a : out STD_LOGIC;
b : out STD_LOGIC;
c : out STD_LOGIC;
d : out STD_LOGIC;
e : out STD_LOGIC;
f : out STD_LOGIC;
g : out STD_LOGIC);
end BCD_CI;
architecture Behavioral of BCD_CI is
component COMPUERTAAND is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
S : out STD_LOGIC);
end component;
component COMPUERTANOT is
Port ( A : in STD_LOGIC;
B : out STD_LOGIC);
end component;
component COMPUERTASAND_3IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
S : out STD_LOGIC);
end component;
component COMPUERTASOR_2IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASOR_3IN is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASOR_4 is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C : in STD_LOGIC;
D : in STD_LOGIC;
F : out STD_LOGIC);
end component;
component COMPUERTASXNOR is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
component COMPUERTASXOR is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
Q : out STD_LOGIC);
end component;
signal ip0, ip1, ip2, a1, b1, d1, d2, d3, d4, e1, e2, f1, f2, f3, g1, g2: std_logic;
begin
U0: COMPUERTANOT port map(i0, ip0);
U1: COMPUERTANOT port map(i1, ip1);
U2: COMPUERTANOT port map(i2, ip2);
U3: COMPUERTASXNOR port map(i2, i0, a1);
U4: COMPUERTASOR_3IN port map(i3, i1, a1, a);
U5: COMPUERTASXNOR port map(i1, i0,b1);
U6: COMPUERTASOR_2IN port map(ip2, b1, b);
U7: COMPUERTASOR_3IN port map(i2, ip1, i0, c);
U8: COMPUERTAAND port map(i1,ip0, d1);
U9: COMPUERTAAND port map(ip2, ip0,d2);
U10: COMPUERTAAND port map(ip2, i1,d3);
U11: COMPUERTASAND_3IN port map(i2, ip1, i0,d4);
U12: COMPUERTASOR_4 port map(d1, d2, d3, d4, d);
U13: COMPUERTAAND port map(i1, ip0, e1);
U14: COMPUERTAAND port map(ip2, ip0, e2);
U15: COMPUERTASOR_2IN port map(e1, e2,e);
U16: COMPUERTAAND port map(i2, ip1, f1);
U17: COMPUERTAAND port map(i2,ip0, f2);
U18: COMPUERTAAND port map(ip1, ip0, f3);
U19: COMPUERTASOR_4 port map(i3, f1, f2, f3, f);
U20: COMPUERTAAND port map(i1, ip0, g2);
U21: COMPUERTASOR_3IN port map(i3, g2, g1, g);
U22: COMPUERTASXOR port map(i2, i1, g1);
end Behavioral;
Comentarios
Publicar un comentario