Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.24 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4.  
  5. entity tb_alu is    
  6. end tb_alu;
  7.        
  8. architecture tb_Behavioral of tb_alu is
  9. component alu
  10.  
  11. port (
  12.         argA : in std_logic_vector(7 downto 0);
  13.         argB : in std_logic_vector(7 downto 0);
  14.         sel : in std_logic_vector (3 downto 0);        
  15.         result : out std_logic_vector(7 downto 0);
  16.         F : out std_logic_vector(3 downto 0)    
  17.         );
  18.    
  19. end component;
  20.    
  21.     signal targA, targB, tresult: std_logic_vector(7 downto 0);
  22.     signal tsel, tF: std_logic_vector (3 downto 0);
  23.     signal tclk, treset: std_logic;
  24.     signal toutput: std_logic_vector (11 downto 0);
  25. begin
  26.  
  27. U1: alu port map(targA, targB, tresult, tsel, tF);
  28.  
  29.  
  30.  
  31.  
  32. /*
  33. targA <= "01010101";
  34. targB <= "10101010";
  35.  
  36. tsel <= "0000", "0001" after 10 ps, "0010" after 20 ps, "0011" after 30 ps,
  37.  "0100" after 40 ps, "0101" after 50 ps, "0110" after 60 ps, "0111" after 70 ps,
  38.  "1000" after 80 ps; "1001" after 90 ps, "1010" after 100 ps, "1011" after 110 ps,
  39.  "1100" after 120 ps, "1101" after 130 ps, "1110" after 140 ps, "1111" after 150 ps;
  40. */
  41.  
  42.  process
  43.  begin
  44.     tclk<= '0';
  45.     wait for 5 ps;
  46.     tclk <= not tclk;
  47.     wait for 5 ps;
  48.  end process;
  49.  
  50.  
  51.  
  52. end tb_Behavioral
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement