-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextend_tb.vhd
More file actions
executable file
·60 lines (39 loc) · 1.27 KB
/
extend_tb.vhd
File metadata and controls
executable file
·60 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--------------------------------------------------------------------------------
--sign extend test bench
--------------------------------------------------------------------------------
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--USE ieee.numeric_std.ALL;
ENTITY extend_tb IS
END extend_tb;
ARCHITECTURE behavior OF extend_tb IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT sign_extend
PORT(
AD : IN std_logic_vector(5 downto 0);
se_bits : OUT std_logic_vector(15 downto 0)
);
END COMPONENT;
--Inputs
signal AD : std_logic_vector(5 downto 0) := (others => '0');
--Outputs
signal se_bits : std_logic_vector(15 downto 0);
-- No clocks detected in port list. Replace <clock> below with
-- appropriate port name
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: sign_extend PORT MAP (
AD => AD,
se_bits => se_bits
);
-- Stimulus process
stim_proc: process
begin
AD<="101001";
wait for 100 ns;
AD<="011111";
wait;
end process;
END;