-
Notifications
You must be signed in to change notification settings - Fork 2
/
REG6.vhd
164 lines (145 loc) · 2.8 KB
/
REG6.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
-- REG6
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity REG6 is
port
(
clk : in std_logic;
cl : in std_logic;
i : in std_logic_vector(5 downto 0);
ld : in std_logic;
cin : in std_logic;
inc : in std_logic;
ein : in std_logic;
dec : in std_logic;
ir : in std_logic;
shr : in std_logic;
il : in std_logic;
shl : in std_logic;
cout : out std_logic;
eout : out std_logic;
q : out std_logic_vector(5 downto 0)
);
end entity;
architecture reg6 of REG6 is
signal state : std_logic_vector(5 downto 0) := ('0', '0', '0', '0', '0', '0');
signal coutVector : std_logic_vector(4 downto 0) := ('0', '0', '0', '0', '0');
signal eoutVector : std_logic_vector(4 downto 0) := ('0', '0', '0', '0', '0');
begin
q <= state;
reg10 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(0),
ld => ld,
cin => cin,
inc => inc,
ein => ein,
dec => dec,
ir => state(1),
shr => shr,
il => il,
shl => shl,
--output signals
cout => coutVector(0),
eout => eoutVector(0),
q => state(0)
);
reg11 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(1),
ld => ld,
cin => coutVector(0),
inc => inc,
ein => eoutVector(0),
dec => dec,
ir => state(2),
shr => shr,
il => state(0),
shl => shl,
--output signals
cout => coutVector(1),
eout => eoutVector(1),
q => state(1)
);
reg12 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(2),
ld => ld,
cin => coutVector(1),
inc => inc,
ein => eoutVector(1),
dec => dec,
ir => state(3),
shr => shr,
il => state(1),
shl => shl,
--output signals
cout => coutVector(2),
eout => eoutVector(2),
q => state(2)
);
reg13 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(3),
ld => ld,
cin => coutVector(2),
inc => inc,
ein => eoutVector(2),
dec => dec,
ir => state(4),
shr => shr,
il => state(2),
shl => shl,
--output signals
cout => coutVector(3),
eout => eoutVector(3),
q => state(3)
);
reg14 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(4),
ld => ld,
cin => coutVector(3),
inc => inc,
ein => eoutVector(3),
dec => dec,
ir => state(5),
shr => shr,
il => state(3),
shl => shl,
--output signals
cout => coutVector(4),
eout => eoutVector(4),
q => state(4)
);
reg15 : entity work.reg1 port map(
--input signals
clk => clk,
cl => cl,
i => i(5),
ld => ld,
cin => coutVector(4),
inc => inc,
ein => eoutVector(4),
dec => dec,
ir => ir,
shr => shr,
il => state(4),
shl => shl,
--output signals
cout => cout,
eout => eout,
q => state(5)
);
end reg6;