-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPRI_ENC_TB.vhd
53 lines (35 loc) · 907 Bytes
/
PRI_ENC_TB.vhd
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
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY PRI_ENC_TB IS
END PRI_ENC_TB;
ARCHITECTURE behavior OF PRI_ENC_TB IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT PRI_ENC
PORT(
X: in std_logic_vector(23 downto 0);
Y: out std_logic_vector(7 downto 0)
);
END COMPONENT;
--Inputs
signal X : std_logic_vector(23 downto 0);
--Outputs
signal Y : std_logic_vector(7 downto 0);
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: PRI_ENC PORT MAP (
X => X,
Y => Y
);
process
begin
X <= "010101010101010101010101";
-- output should be 00000001
wait for 100 ns;
X <= "000111010110111000010010";
-- output should be 00000011
wait for 40 ns;
X <= "000000000000000000101011";
-- output should be 00010010
wait for 40 ns;
end process;
END;