1 |
6 |
marta |
-- VHDL data flow description generated from `count3x`
|
2 |
|
|
-- date : Thu Aug 2 09:52:58 2001
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
-- Entity Declaration
|
6 |
|
|
|
7 |
|
|
ENTITY count3x IS
|
8 |
|
|
PORT (
|
9 |
|
|
clk : in BIT; -- clk
|
10 |
|
|
rst : in BIT; -- rst
|
11 |
|
|
q : out bit_vector(2 DOWNTO 0) ; -- q
|
12 |
|
|
vdd : in BIT; -- vdd
|
13 |
|
|
vss : in BIT -- vss
|
14 |
|
|
);
|
15 |
|
|
END count3x;
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
-- Architecture Declaration
|
19 |
|
|
|
20 |
|
|
ARCHITECTURE VBE OF count3x IS
|
21 |
|
|
SIGNAL current_state : REG_VECTOR(2 DOWNTO 0) REGISTER; -- current_state
|
22 |
|
|
SIGNAL current_state_s7 : BIT; -- current_state_s7
|
23 |
|
|
SIGNAL next_state_s7 : BIT; -- next_state_s7
|
24 |
|
|
SIGNAL current_state_s6 : BIT; -- current_state_s6
|
25 |
|
|
SIGNAL next_state_s6 : BIT; -- next_state_s6
|
26 |
|
|
SIGNAL current_state_s5 : BIT; -- current_state_s5
|
27 |
|
|
SIGNAL next_state_s5 : BIT; -- next_state_s5
|
28 |
|
|
SIGNAL current_state_s4 : BIT; -- current_state_s4
|
29 |
|
|
SIGNAL next_state_s4 : BIT; -- next_state_s4
|
30 |
|
|
SIGNAL current_state_s3 : BIT; -- current_state_s3
|
31 |
|
|
SIGNAL next_state_s3 : BIT; -- next_state_s3
|
32 |
|
|
SIGNAL current_state_s2 : BIT; -- current_state_s2
|
33 |
|
|
SIGNAL next_state_s2 : BIT; -- next_state_s2
|
34 |
|
|
SIGNAL current_state_s1 : BIT; -- current_state_s1
|
35 |
|
|
SIGNAL next_state_s1 : BIT; -- next_state_s1
|
36 |
|
|
SIGNAL current_state_s0 : BIT; -- current_state_s0
|
37 |
|
|
SIGNAL next_state_s0 : BIT; -- next_state_s0
|
38 |
|
|
SIGNAL next_state : BIT_VECTOR(2 DOWNTO 0); -- next_state
|
39 |
|
|
|
40 |
|
|
BEGIN
|
41 |
|
|
next_state(0) <= (next_state_s0 OR next_state_s1 OR next_state_s2
|
42 |
|
|
OR next_state_s5);
|
43 |
|
|
next_state(1) <= (next_state_s1 OR next_state_s2 OR next_state_s3
|
44 |
|
|
OR next_state_s4);
|
45 |
|
|
next_state(2) <= (next_state_s0 OR next_state_s2 OR next_state_s4
|
46 |
|
|
OR next_state_s6);
|
47 |
|
|
next_state_s0 <= current_state_s7;
|
48 |
|
|
current_state_s0 <= (current_state(2) AND NOT(current_state(1)) AND
|
49 |
|
|
current_state(0));
|
50 |
|
|
next_state_s1 <= current_state_s0;
|
51 |
|
|
current_state_s1 <= (NOT(current_state(2)) AND current_state(1) AND
|
52 |
|
|
current_state(0));
|
53 |
|
|
next_state_s2 <= current_state_s1;
|
54 |
|
|
current_state_s2 <= (current_state(2) AND current_state(1) AND
|
55 |
|
|
current_state(0));
|
56 |
|
|
next_state_s3 <= current_state_s2;
|
57 |
|
|
current_state_s3 <= (NOT(current_state(2)) AND current_state(1) AND
|
58 |
|
|
NOT(current_state(0)));
|
59 |
|
|
next_state_s4 <= current_state_s3;
|
60 |
|
|
current_state_s4 <= (current_state(2) AND current_state(1) AND NOT(
|
61 |
|
|
current_state(0)));
|
62 |
|
|
next_state_s5 <= current_state_s4;
|
63 |
|
|
current_state_s5 <= (NOT(current_state(2)) AND NOT(current_state(1))
|
64 |
|
|
AND current_state(0));
|
65 |
|
|
next_state_s6 <= current_state_s5;
|
66 |
|
|
current_state_s6 <= (current_state(2) AND NOT(current_state(1)) AND
|
67 |
|
|
NOT(current_state(0)));
|
68 |
|
|
next_state_s7 <= current_state_s6;
|
69 |
|
|
current_state_s7 <= (NOT(current_state(2)) AND NOT(current_state(1))
|
70 |
|
|
AND NOT(current_state(0)));
|
71 |
|
|
label0 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
72 |
|
|
BEGIN
|
73 |
|
|
current_state(0) <= GUARDED (next_state(0) OR rst);
|
74 |
|
|
END BLOCK label0;
|
75 |
|
|
label1 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
76 |
|
|
BEGIN
|
77 |
|
|
current_state(1) <= GUARDED (next_state(1) AND NOT(rst));
|
78 |
|
|
END BLOCK label1;
|
79 |
|
|
label2 : BLOCK ((NOT((clk'STABLE)) AND clk) = '1')
|
80 |
|
|
BEGIN
|
81 |
|
|
current_state(2) <= GUARDED (next_state(2) OR rst);
|
82 |
|
|
END BLOCK label2;
|
83 |
|
|
|
84 |
|
|
q(0) <= ((current_state_s1 AND NOT(rst)) OR (
|
85 |
|
|
current_state_s3 AND NOT(rst)) OR (current_state_s5 AND NOT(rst))
|
86 |
|
|
OR (current_state_s7 AND NOT(rst)));
|
87 |
|
|
|
88 |
|
|
q(1) <= ((current_state_s2 AND NOT(rst)) OR (
|
89 |
|
|
current_state_s3 AND NOT(rst)) OR (current_state_s6 AND NOT(rst))
|
90 |
|
|
OR (current_state_s7 AND NOT(rst)));
|
91 |
|
|
|
92 |
|
|
q(2) <= ((current_state_s4 AND NOT(rst)) OR (
|
93 |
|
|
current_state_s5 AND NOT(rst)) OR (current_state_s6 AND NOT(rst))
|
94 |
|
|
OR (current_state_s7 AND NOT(rst)));
|
95 |
|
|
END;
|