Saturday, 5 December 2015

Comparator with enable (Dataflow)




library IEEE;
use IEEE.STD_LOGIC_1164.ALL;


entity comprtr is
    Port ( a,b : in  STD_LOGIC_VECTOR(2 downto 0);
           enable : in STD_LOGIC;
           e,l,g : out  STD_LOGIC);
end comprtr;


architecture Dataflow of comprtr is

begin
e<='1' when (a=b and enable='1') else '0';
l<='1' when (a<b and enable='1') else '0';
g<='1' when (a>b and enable='1') else '0';
end Dataflow;

No comments:

Post a Comment