luishenriique

comp_magnitude

Apr 24th, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.42 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.all;
  3.  
  4. ENTITY Comp_Magnitude_4bits IS
  5. PORT (
  6.     A : in std_logic_vector (3 DOWNTO 0);
  7.     B : in std_logic_vector (3 DOWNTO 0);
  8.     AGB, AEB, ALB : out bit;
  9. );
  10. END Comp_Magnitude_4bits;
  11.  
  12. ARCHITECTURE arc OF Comp_Magnitude_4bits is
  13.     SIGNAL S : std_logic_vector (2 DOWNTO 0);
  14. begin
  15.     AGB <= "1" when A > B else "0";
  16.     AEB <= "1" when A = B else "0";
  17.     ALB <= "1" when A < B else "0";
  18. end arc;
Advertisement
Add Comment
Please, Sign In to add comment