-
Notifications
You must be signed in to change notification settings - Fork 0
/
LogicalStep_Lab4_top.vhd.bak
86 lines (70 loc) · 2.82 KB
/
LogicalStep_Lab4_top.vhd.bak
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY LogicalStep_Lab4_top IS
PORT
(
clkin_50 : in std_logic; -- The 50 MHz FPGA Clockinput
rst_n : in std_logic; -- The RESET input (ACTIVE LOW)
pb_n : in std_logic_vector(3 downto 0); -- The push-button inputs (ACTIVE LOW)
sw : in std_logic_vector(7 downto 0); -- The switch inputs
leds : out std_logic_vector(7 downto 0); -- for displaying the the lab4 project details
-------------------------------------------------------------
-- you can add temporary output ports here if you need to debug your design
-- or to add internal signals for your simulations
-------------------------------------------------------------
seg7_data : out std_logic_vector(6 downto 0); -- 7-bit outputs to a 7-segment
seg7_char1 : out std_logic; -- seg7 digi selectors
seg7_char2 : out std_logic -- seg7 digi selectors
);
END LogicalStep_Lab4_top;
ARCHITECTURE SimpleCircuit OF LogicalStep_Lab4_top IS
component segment7_mux port (
clk : in std_logic := '0';
DIN2 : in std_logic_vector(6 downto 0); --bits 6 to 0 represent segments G,F,E,D,C,B,A
DIN1 : in std_logic_vector(6 downto 0); --bits 6 to 0 represent segments G,F,E,D,C,B,A
DOUT : out std_logic_vector(6 downto 0);
DIG2 : out std_logic;
DIG1 : out std_logic
);
end component;
component clock_generator port (
sim_mode : in boolean;
reset : in std_logic;
clkin : in std_logic;
sm_clken : out std_logic;
blink : out std_logic
);
end component;
component pb_inverters port (
pb_n : in std_logic_vector(3 downto 0);
pb : out std_logic_vector(3 downto 0)
);
end component;
-- component synchronizer port(
-- clk : in std_logic;
-- reset : in std_logic;
-- din : in std_logic;
-- dout : out std_logic
-- );
-- end component;
--
-- component holding_register port (
-- clk : in std_logic;
-- reset : in std_logic;
-- register_clr : in std_logic;
-- din : in std_logic;
-- dout : out std_logic
-- );
-- end component;
--
----------------------------------------------------------------------------------------------------
CONSTANT sim_mode : boolean := FALSE; -- set to FALSE for LogicalStep board downloads
-- set to TRUE for SIMULATIONS
SIGNAL sm_clken, blink_sig : std_logic;
SIGNAL pb : std_logic_vector(3 downto 0); -- pb(3) is used as an active-high reset for all registers
BEGIN
----------------------------------------------------------------------------------------------------
INST1: pb_inverters port map (pb_n, pb);
INST2: clock_generator port map (sim_mode, pb(3), clkin_50, sm_clken, blink_sig);
END SimpleCircuit;