Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. -- Lab1 for FPGA course
  2. library ieee;
  3. use ieee.std_logic_1164.all;
  4.  
  5. entity lab1 is
  6. -- btns are inputs of the circuit
  7. -- leds are outputs of the circuit
  8. port (
  9. btn : in std_logic_vector(3 downto 0);
  10. led : out std_logic_vector(3 downto 0)
  11. );
  12. end lab1;
  13.  
  14. architecture rtl of lab1 is
  15. -- intermediate signals
  16. signal l0, l1 : std_logic := '0';
  17. begin
  18.  
  19. -- concurrent assignments
  20. -- order does not matter
  21. led(0) <= not btn(0);
  22. l0 <= btn(1) and (not btn(2));
  23. led(1) <= l0;
  24. l1 <= btn(2) and btn(3);
  25. led(2) <= l1;
  26. led(3) <= l0 or l1;
  27.  
  28. end rtl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement