1 |
6 |
marta |
-- VHDL data flow description generated from `count4x`
|
2 |
|
|
-- date : Thu Aug 2 08:55:34 2001
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
-- Entity Declaration
|
6 |
|
|
|
7 |
|
|
ENTITY count4x IS
|
8 |
|
|
PORT (
|
9 |
|
|
clk : in BIT; -- clk
|
10 |
|
|
rst : in BIT; -- rst
|
11 |
|
|
q : out bit_vector(3 DOWNTO 0) ; -- q
|
12 |
|
|
vdd : in BIT; -- vdd
|
13 |
|
|
vss : in BIT -- vss
|
14 |
|
|
);
|
15 |
|
|
END count4x;
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
-- Architecture Declaration
|
19 |
|
|
|
20 |
|
|
ARCHITECTURE VBE OF count4x IS
|
21 |
|
|
SIGNAL current_state : REG_VECTOR(3 DOWNTO 0) REGISTER; -- current_state
|
22 |
|
|
SIGNAL current_state_s15 : BIT; -- current_state_s15
|
23 |
|
|
SIGNAL next_state_s15 : BIT; -- next_state_s15
|
24 |
|
|
SIGNAL current_state_s14 : BIT; -- current_state_s14
|
25 |
|
|
SIGNAL next_state_s14 : BIT; -- next_state_s14
|
26 |
|
|
SIGNAL current_state_s13 : BIT; -- current_state_s13
|
27 |
|
|
SIGNAL next_state_s13 : BIT; -- next_state_s13
|
28 |
|
|
SIGNAL current_state_s12 : BIT; -- current_state_s12
|
29 |
|
|
SIGNAL next_state_s12 : BIT; -- next_state_s12
|
30 |
|
|
SIGNAL current_state_s11 : BIT; -- current_state_s11
|
31 |
|
|
SIGNAL next_state_s11 : BIT; -- next_state_s11
|
32 |
|
|
SIGNAL current_state_s10 : BIT; -- current_state_s10
|
33 |
|
|
SIGNAL next_state_s10 : BIT; -- next_state_s10
|
34 |
|
|
SIGNAL current_state_s9 : BIT; -- current_state_s9
|
35 |
|
|
SIGNAL next_state_s9 : BIT; -- next_state_s9
|
36 |
|
|
SIGNAL current_state_s8 : BIT; -- current_state_s8
|
37 |
|
|
SIGNAL next_state_s8 : BIT; -- next_state_s8
|
38 |
|
|
SIGNAL current_state_s7 : BIT; -- current_state_s7
|
39 |
|
|
SIGNAL next_state_s7 : BIT; -- next_state_s7
|
40 |
|
|
SIGNAL current_state_s6 : BIT; -- current_state_s6
|
41 |
|
|
SIGNAL next_state_s6 : BIT; -- next_state_s6
|
42 |
|
|
SIGNAL current_state_s5 : BIT; -- current_state_s5
|
43 |
|
|
SIGNAL next_state_s5 : BIT; -- next_state_s5
|
44 |
|
|
SIGNAL current_state_s4 : BIT; -- current_state_s4
|
45 |
|
|
SIGNAL next_state_s4 : BIT; -- next_state_s4
|
46 |
|
|
SIGNAL current_state_s3 : BIT; -- current_state_s3
|
47 |
|
|
SIGNAL next_state_s3 : BIT; -- next_state_s3
|
48 |
|
|
SIGNAL current_state_s2 : BIT; -- current_state_s2
|
49 |
|
|
SIGNAL next_state_s2 : BIT; -- next_state_s2
|
50 |
|
|
SIGNAL current_state_s1 : BIT; -- current_state_s1
|
51 |
|
|
SIGNAL next_state_s1 : BIT; -- next_state_s1
|
52 |
|
|
SIGNAL current_state_s0 : BIT; -- current_state_s0
|
53 |
|
|
SIGNAL next_state_s0 : BIT; -- next_state_s0
|
54 |
|
|
SIGNAL next_state : BIT_VECTOR(3 DOWNTO 0); -- next_state
|
55 |
|
|
|
56 |
|
|
BEGIN
|
57 |
|
|
next_state(0) <= (next_state_s0 OR next_state_s1 OR next_state_s3
|
58 |
|
|
OR next_state_s4 OR next_state_s6 OR next_state_s8
|
59 |
|
|
OR next_state_s12 OR next_state_s14);
|
60 |
|
|
next_state(1) <= (next_state_s0 OR next_state_s1 OR next_state_s2
|
61 |
|
|
OR next_state_s4 OR next_state_s5 OR next_state_s9
|
62 |
|
|
OR next_state_s12 OR next_state_s13);
|
63 |
|
|
next_state(2) <= (next_state_s0 OR next_state_s1 OR next_state_s2
|
64 |
|
|
OR next_state_s3 OR next_state_s5 OR next_state_s8
|
65 |
|
|
OR next_state_s10 OR next_state_s11);
|
66 |
|
|
next_state(3) <= (next_state_s1 OR next_state_s2 OR next_state_s4
|
67 |
|
|
OR next_state_s6 OR next_state_s7 OR next_state_s8
|
68 |
|
|
OR next_state_s9 OR next_state_s10);
|
69 |
|
|
next_state_s0 <= current_state_s15;
|
70 |
|
|
current_state_s0 <= (NOT(current_state(3)) AND current_state(2) AND
|
71 |
|
|
current_state(1) AND current_state(0));
|
72 |
|
|
next_state_s1 <= current_state_s0;
|
73 |
|
|
current_state_s1 <= (current_state(3) AND current_state(2) AND
|
74 |
|
|
current_state(1) AND current_state(0));
|
75 |
|
|
next_state_s2 <= current_state_s1;
|
76 |
|
|
current_state_s2 <= (current_state(3) AND current_state(2) AND
|
77 |
|
|
current_state(1) AND NOT(current_state(0)));
|
78 |
|
|
next_state_s3 <= current_state_s2;
|
79 |
|
|
current_state_s3 <= (NOT(current_state(3)) AND current_state(2) AND
|
80 |
|
|
NOT(current_state(1)) AND current_state(0));
|
81 |
|
|
next_state_s4 <= current_state_s3;
|
82 |
|
|
current_state_s4 <= (current_state(3) AND NOT(current_state(2)) AND
|
83 |
|
|
current_state(1) AND current_state(0));
|
84 |
|
|
next_state_s5 <= current_state_s4;
|
85 |
|
|
current_state_s5 <= (NOT(current_state(3)) AND current_state(2) AND
|
86 |
|
|
current_state(1) AND NOT(current_state(0)));
|
87 |
|
|
next_state_s6 <= current_state_s5;
|
88 |
|
|
current_state_s6 <= (current_state(3) AND NOT(current_state(2)) AND
|
89 |
|
|
NOT(current_state(1)) AND current_state(0));
|
90 |
|
|
next_state_s7 <= current_state_s6;
|
91 |
|
|
current_state_s7 <= (current_state(3) AND NOT(current_state(2)) AND
|
92 |
|
|
NOT(current_state(1)) AND NOT(current_state(0)));
|
93 |
|
|
next_state_s8 <= current_state_s7;
|
94 |
|
|
current_state_s8 <= (current_state(3) AND current_state(2) AND NOT(
|
95 |
|
|
current_state(1)) AND current_state(0));
|
96 |
|
|
next_state_s9 <= current_state_s8;
|
97 |
|
|
current_state_s9 <= (current_state(3) AND NOT(current_state(2)) AND
|
98 |
|
|
current_state(1) AND NOT(current_state(0)));
|
99 |
|
|
next_state_s10 <= current_state_s9;
|
100 |
|
|
current_state_s10 <= (current_state(3) AND current_state(2) AND NOT(
|
101 |
|
|
current_state(1)) AND NOT(current_state(0)));
|
102 |
|
|
next_state_s11 <= current_state_s10;
|
103 |
|
|
current_state_s11 <= (NOT(current_state(3)) AND current_state(2) AND
|
104 |
|
|
NOT(current_state(1)) AND NOT(current_state(0)));
|
105 |
|
|
next_state_s12 <= current_state_s11;
|
106 |
|
|
current_state_s12 <= (NOT(current_state(3)) AND NOT(current_state(2))
|
107 |
|
|
AND current_state(1) AND current_state(0));
|
108 |
|
|
next_state_s13 <= current_state_s12;
|
109 |
|
|
current_state_s13 <= (NOT(current_state(3)) AND NOT(current_state(2))
|
110 |
|
|
AND current_state(1) AND NOT(current_state(0)));
|
111 |
|
|
next_state_s14 <= current_state_s13;
|
112 |
|
|
current_state_s14 <= (NOT(current_state(3)) AND NOT(current_state(2))
|
113 |
|
|
AND NOT(current_state(1)) AND current_state(0));
|
114 |
|
|
next_state_s15 <= current_state_s14;
|
115 |
|
|
current_state_s15 <= (NOT(current_state(3)) AND NOT(current_state(2))
|
116 |
|
|
AND NOT(current_state(1)) AND NOT(current_state(0)));
|
117 |
|
|
label0 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
118 |
|
|
BEGIN
|
119 |
|
|
current_state(0) <= GUARDED (next_state(0) OR rst);
|
120 |
|
|
END BLOCK label0;
|
121 |
|
|
label1 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
122 |
|
|
BEGIN
|
123 |
|
|
current_state(1) <= GUARDED (next_state(1) OR rst);
|
124 |
|
|
END BLOCK label1;
|
125 |
|
|
label2 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
126 |
|
|
BEGIN
|
127 |
|
|
current_state(2) <= GUARDED (next_state(2) OR rst);
|
128 |
|
|
END BLOCK label2;
|
129 |
|
|
label3 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
130 |
|
|
BEGIN
|
131 |
|
|
current_state(3) <= GUARDED (next_state(3) AND NOT(rst));
|
132 |
|
|
END BLOCK label3;
|
133 |
|
|
|
134 |
|
|
q(0) <= ((current_state_s1 AND NOT(rst)) OR (
|
135 |
|
|
current_state_s3 AND NOT(rst)) OR (current_state_s5 AND NOT(rst))
|
136 |
|
|
OR (current_state_s7 AND NOT(rst)) OR (
|
137 |
|
|
current_state_s9 AND NOT(rst)) OR (current_state_s11 AND NOT(rst)
|
138 |
|
|
) OR (current_state_s13 AND NOT(rst)) OR (
|
139 |
|
|
current_state_s15 AND NOT(rst)));
|
140 |
|
|
|
141 |
|
|
q(1) <= ((current_state_s2 AND NOT(rst)) OR (
|
142 |
|
|
current_state_s3 AND NOT(rst)) OR (current_state_s6 AND NOT(rst))
|
143 |
|
|
OR (current_state_s7 AND NOT(rst)) OR (
|
144 |
|
|
current_state_s10 AND NOT(rst)) OR (current_state_s11 AND NOT(rst)
|
145 |
|
|
) OR (current_state_s14 AND NOT(rst)) OR (
|
146 |
|
|
current_state_s15 AND NOT(rst)));
|
147 |
|
|
|
148 |
|
|
q(2) <= ((current_state_s4 AND NOT(rst)) OR (
|
149 |
|
|
current_state_s5 AND NOT(rst)) OR (current_state_s6 AND NOT(rst))
|
150 |
|
|
OR (current_state_s7 AND NOT(rst)) OR (
|
151 |
|
|
current_state_s12 AND NOT(rst)) OR (current_state_s13 AND NOT(rst)
|
152 |
|
|
) OR (current_state_s14 AND NOT(rst)) OR (
|
153 |
|
|
current_state_s15 AND NOT(rst)));
|
154 |
|
|
|
155 |
|
|
q(3) <= ((current_state_s8 AND NOT(rst)) OR (
|
156 |
|
|
current_state_s9 AND NOT(rst)) OR (current_state_s10 AND NOT(rst)
|
157 |
|
|
) OR (current_state_s11 AND NOT(rst)) OR (
|
158 |
|
|
current_state_s12 AND NOT(rst)) OR (current_state_s13 AND NOT(rst)
|
159 |
|
|
) OR (current_state_s14 AND NOT(rst)) OR (
|
160 |
|
|
current_state_s15 AND NOT(rst)));
|
161 |
|
|
END;
|