-
Notifications
You must be signed in to change notification settings - Fork 6
/
TestBCDConverter.vhd
53 lines (40 loc) · 1.13 KB
/
TestBCDConverter.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
-- Alessandro Montanari 880606-Y555
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY TestBCDConverter IS
END TestBCDConverter;
ARCHITECTURE behavior OF TestBCDConverter IS
-- Component Declaration for the Unit Under Test (UUT)
COMPONENT bcd_converter
PORT(
input : IN std_logic_vector(8 downto 0);
hundreds : OUT std_logic_vector(3 downto 0);
tens : OUT std_logic_vector(3 downto 0);
unit : OUT std_logic_vector(3 downto 0)
);
END COMPONENT;
--Inputs
signal input : std_logic_vector(8 downto 0) := (others => '0');
--Outputs
signal hundreds : std_logic_vector(3 downto 0);
signal tens : std_logic_vector(3 downto 0);
signal unit : std_logic_vector(3 downto 0);
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: bcd_converter PORT MAP (
input => input,
hundreds => hundreds,
tens => tens,
unit => unit
);
-- Stimulus process
stim_proc: process
begin
input <= "010111001";
wait for 200us;
input <= "111010110";
wait for 200us;
input <= "101001001";
wait;
end process;
END;