Facebook
From Sweltering Monkey, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 227
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity comp4 is
  5. port(a,b: in std_logic_vector(3 downto 0);
  6. ut_a, ut_b, ut_c, ut_d, ut_e, ut_f, ut_g:out std_logic);
  7. end comp4;
  8.  
  9. architecture behaviour of comp4 is
  10. begin
  11.  
  12. comp:process(a,b)
  13. begin
  14.   if a=b then
  15.   ut_a <= '1';
  16.   ut_b <= '1';
  17.   ut_c <= '1';
  18.   ut_d <= '0';
  19.   ut_e <= '1';
  20.   ut_f <= '1';
  21.   ut_g <= '0';
  22.  
  23.   elsif a<b then
  24.  
  25.   ut_a <= '1';
  26.   ut_b <= '1';
  27.   ut_c <= '1';
  28.   ut_d <= '0';
  29.   ut_e <= '0';
  30.   ut_f <= '1';
  31.   ut_g <= '0';
  32.  
  33.    else
  34.   ut_a <= '1';
  35.   ut_b <= '1';
  36.   ut_c <= '0';
  37.   ut_d <= '0';
  38.   ut_e <= '1';
  39.   ut_f <= '1';
  40.   ut_g <= '0';
  41.  
  42.   end if;
  43.   end process comp;
  44.   end behaviour;