Advertisement
Tyler_Elric

testfulladder

Sep 20th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.62 KB | None | 0 0
  1.  
  2. LIBRARY ieee;
  3. USE ieee.std_logic_1164.ALL;
  4.  
  5. ENTITY testfulladder IS
  6. END testfulladder;
  7.  
  8. ARCHITECTURE behavior OF testfulladder IS
  9.  
  10.     -- Component Declaration for the Unit Under Test (UUT)
  11.  
  12.     COMPONENT fulladder
  13.     PORT(
  14.          a : IN  std_logic;
  15.          b : IN  std_logic;
  16.          cin : IN  std_logic;
  17.          cout : OUT  std_logic;
  18.          s : OUT  std_logic
  19.         );
  20.     END COMPONENT;
  21.    
  22.  
  23.    --Inputs
  24.    signal a : std_logic := '0';
  25.    signal b : std_logic := '0';
  26.    signal cin : std_logic := '0';
  27.  
  28.     --Outputs
  29.    signal cout : std_logic;
  30.    signal s : std_logic;
  31.    -- No clocks detected in port list. Replace <clock> below with
  32.    -- appropriate port name
  33.  
  34. BEGIN
  35.  
  36.     -- Instantiate the Unit Under Test (UUT)
  37.    uut: fulladder PORT MAP (
  38.           a => a,
  39.           b => b,
  40.           cin => cin,
  41.           cout => cout,
  42.           s => s
  43.         );
  44.  
  45.  
  46.    -- Stimulus process
  47.    stim_proc: process
  48.    begin       
  49.       -- hold reset state for 100 ns.
  50.       wait for 100 ns;
  51.  
  52.       cin <= '0';
  53.         a <= '0';
  54.         b <= '0';
  55.        
  56.         wait for 100 ns;
  57.  
  58.       cin <= '0';
  59.         a <= '0';
  60.         b <= '1';
  61.        
  62.         wait for 100 ns;
  63.  
  64.       cin <= '0';
  65.         a <= '1';
  66.         b <= '0';
  67.        
  68.         wait for 100 ns;
  69.  
  70.       cin <= '0';
  71.         a <= '1';
  72.         b <= '1';
  73.        
  74.         wait for 100 ns;
  75.  
  76.       cin <= '1';
  77.         a <= '0';
  78.         b <= '0';
  79.        
  80.         wait for 100 ns;
  81.  
  82.       cin <= '1';
  83.         a <= '0';
  84.         b <= '1';
  85.        
  86.         wait for 100 ns;
  87.  
  88.       cin <= '1';
  89.         a <= '1';
  90.         b <= '0';
  91.        
  92.         wait for 100 ns;
  93.  
  94.       cin <= '1';
  95.         a <= '1';
  96.         b <= '1';
  97.        
  98.         wait for 100 ns;
  99.  
  100.       wait;
  101.    end process;
  102.  
  103. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement