程序目的是血型配对指示器,匹配符合要求T灯亮不符合要求F灯亮
en
tity ddd is
Port ( a : in STD_LOGIC_VECTOR (3 downto 0);
b : in STD_LOGIC_VECTOR (3 downto 0);
c : out STD_LOGIC_VECTOR (1 downto 0));
end ddd;
architecture Behavioral of ddd is
begin
process
begin
if (a="1000")then
if b="1000" or b="0010"then
c<="10";
else
c<="01";
end if;
elsif(a="0100")then
if b="0100" or b="0010"then
c<="10";
else
c<="01";
end if;
elsif(a="0010")then
if b="0010" then
c<="10";
else
c<="01";
end if;
elsif(a="0001")then
c<="10";
else
c<="11";-- false condition
end if;
end process;
end Behavioral;
一周热门 更多>