Advertisement
lasthunter657

Top_Module

Apr 11th, 2022
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.numeric_std.ALL;
  4. USE ieee.std_logic_unsigned.ALL;
  5. USE ieee.std_logic_arith.ALL;
  6. USE work.ITCE364Project_lab3.ALL;
  7.  
  8. ENTITY lab3 IS
  9. PORT (
  10. conin : IN std_logic;
  11. inbus : IN std_logic_vector(length - 1 DOWNTO 0) := (OTHERS => '0');
  12. ir : IN integer RANGE 0 TO length := 0;
  13. condition : OUT std_logic);
  14. END ENTITY;
  15.  
  16. ARCHITECTURE rtl OF lab3 IS
  17.  
  18. SIGNAL Decoder_out : std_logic_vector(length - 1 DOWNTO 0) := ((OTHERS => '0'));
  19. SIGNAL g : std_logic_vector(g_length - 1 DOWNTO 0) := ((OTHERS => '0'));
  20. SIGNAL brn : std_logic := '0';
  21.  
  22. BEGIN
  23.  
  24. Decoder : PROCESS (ir, Decoder_out)
  25. BEGIN
  26. Decoder_out <= rom(ir);
  27. END PROCESS;
  28.  
  29.  
  30. g(0) <= Decoder_out(1);
  31. g(1) <= Decoder_out(2) AND NOT (inbus(0) OR inbus(1) OR inbus(2) OR inbus(3) OR inbus(4) OR inbus(5) OR inbus(6) OR inbus(7));
  32. g(2) <= Decoder_out(3) AND (inbus(0) OR inbus(1) OR inbus(2) OR inbus(3) OR inbus(4) OR inbus(5) OR inbus(6) OR inbus(7));
  33. g(3) <= Decoder_out(4) AND NOT (inbus(7));
  34. g(4) <= Decoder_out(5) AND (inbus(7));
  35. brn <= g(0) OR g(1) OR g(2) OR g(3) OR g(4);
  36.  
  37.  
  38. Con : PROCESS (conin)
  39. BEGIN
  40. IF rising_edge(conin) THEN
  41. condition <= brn;
  42. END IF;
  43. END PROCESS;
  44. END ARCHITECTURE;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement