library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity cpr is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0):="0000";
b : in STD_LOGIC_VECTOR (3 downto 0):="0000";
e : out STD_LOGIC;
l : out STD_LOGIC;
g : out STD_LOGIC);
end cpr;
architecture Behavioral of cpr is
begin
process(a,b)
begin
for i in 3 downto 0 loop
if a(i)=b(i) then e<='1';l<='0';g<='0';
else
if a(i)='0' and b(i)='1' then e<='0';l<='1';g<='0';
else e<='0';l<='0';g<='1';
end if;
exit;
end if;
end loop;
end process;
end Behavioral;
No comments:
Post a Comment