1 |
6 |
marta |
-- VHDL data flow description generated from `count5`
|
2 |
|
|
-- date : Thu Aug 2 08:47:45 2001
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
-- Entity Declaration
|
6 |
|
|
|
7 |
|
|
ENTITY count5 IS
|
8 |
|
|
PORT (
|
9 |
|
|
clk : in BIT; -- clk
|
10 |
|
|
rst : in BIT; -- rst
|
11 |
|
|
q : out bit_vector(4 DOWNTO 0) ; -- q
|
12 |
|
|
vdd : in BIT; -- vdd
|
13 |
|
|
vss : in BIT -- vss
|
14 |
|
|
);
|
15 |
|
|
END count5;
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
-- Architecture Declaration
|
19 |
|
|
|
20 |
|
|
ARCHITECTURE behaviour_data_flow OF count5 IS
|
21 |
|
|
SIGNAL current_state : REG_VECTOR(4 DOWNTO 0) REGISTER; -- current_state
|
22 |
|
|
SIGNAL aux51 : BIT; -- aux51
|
23 |
|
|
SIGNAL aux48 : BIT; -- aux48
|
24 |
|
|
SIGNAL aux46 : BIT; -- aux46
|
25 |
|
|
SIGNAL aux45 : BIT; -- aux45
|
26 |
|
|
|
27 |
|
|
BEGIN
|
28 |
|
|
aux45 <= (current_state (2) and current_state (1));
|
29 |
|
|
aux46 <= (not (current_state (1)) or current_state (2));
|
30 |
|
|
aux48 <= not ((not (current_state (3)) and not (current_state (2))));
|
31 |
|
|
aux51 <= (not (current_state (2)) and current_state (3));
|
32 |
|
|
label0 : BLOCK ((clk and not (clk'STABLE)) = '1')
|
33 |
|
|
BEGIN
|
34 |
|
|
current_state (0) <= GUARDED (rst or (not (current_state (0)) and current_state (3) and not
|
35 |
|
|
(current_state (1)) and current_state (2)) or (current_state
|
36 |
|
|
(4) and current_state (1) and aux48) or (not (current_state
|
37 |
|
|
(4)) and not (current_state (1)) and not ((current_state (3)
|
38 |
|
|
xor current_state (2)))) or (current_state (0) and (not (current_state
|
39 |
|
|
(3)) or not (current_state (2))) and (current_state (4) or aux45)));
|
40 |
|
|
END BLOCK label0;
|
41 |
|
|
label1 : BLOCK ((clk and not (clk'STABLE)) = '1')
|
42 |
|
|
BEGIN
|
43 |
|
|
current_state (1) <= GUARDED (rst or (current_state (0) and ((not (current_state (1)) and
|
44 |
|
|
aux48) or (current_state (4) and not ((not (current_state (3))
|
45 |
|
|
or not (current_state (2))))))) or (not (current_state (0))
|
46 |
|
|
and (current_state (4) or not ((current_state (3) or current_state
|
47 |
|
|
(1))) or aux51) and (not (current_state (4)) or not ((not (current_state
|
48 |
|
|
(1)) and (not (current_state (2)) or current_state (3)))))));
|
49 |
|
|
END BLOCK label1;
|
50 |
|
|
label2 : BLOCK ((clk and not (clk'STABLE)) = '1')
|
51 |
|
|
BEGIN
|
52 |
|
|
current_state (2) <= GUARDED (rst or (current_state (4) and not (current_state (3)) and not
|
53 |
|
|
(current_state (1)) and current_state (2)) or (not (current_state
|
54 |
|
|
(4)) and not ((current_state (1) xor aux48))) or (current_state
|
55 |
|
|
(0) and (not ((not (current_state (2)) or current_state (3)))
|
56 |
|
|
or (current_state (3) and not ((not (current_state (1)) and
|
57 |
|
|
current_state (2)))))));
|
58 |
|
|
END BLOCK label2;
|
59 |
|
|
label3 : BLOCK ((clk and not (clk'STABLE)) = '1')
|
60 |
|
|
BEGIN
|
61 |
|
|
current_state (3) <= GUARDED (rst or (current_state (0) and (not ((not (current_state (3))
|
62 |
|
|
or (not (current_state (2)) and not (current_state (1))))) or
|
63 |
|
|
not ((current_state (4) or aux45)))) or (not (current_state
|
64 |
|
|
(0)) and ((not (current_state (4)) and not (current_state (1))
|
65 |
|
|
and not (aux51)) or (current_state (4) and current_state (3)
|
66 |
|
|
and aux46))));
|
67 |
|
|
END BLOCK label3;
|
68 |
|
|
label4 : BLOCK ((clk and not (clk'STABLE)) = '1')
|
69 |
|
|
BEGIN
|
70 |
|
|
current_state (4) <= GUARDED (rst or ((not (aux46) or (not (current_state (3)) and not (current_state
|
71 |
|
|
(1)) and current_state (2)) or not ((not (current_state (4))
|
72 |
|
|
and (current_state (0) or (not (current_state (3)) and current_state
|
73 |
|
|
(1)))))) and (not (current_state (4)) or (not (current_state
|
74 |
|
|
(0)) and aux45) or (current_state (0) and (aux51 or (not (current_state
|
75 |
|
|
(3)) and current_state (1)))))));
|
76 |
|
|
END BLOCK label4;
|
77 |
|
|
|
78 |
|
|
q (0) <= (not (rst) and ((not (current_state (3)) and not (current_state
|
79 |
|
|
(1)) and current_state (2)) or (not (current_state (2)) and
|
80 |
|
|
current_state (0) and (current_state (3) or current_state (1)))
|
81 |
|
|
or (not (current_state (4)) and (not (current_state (2)) or
|
82 |
|
|
(current_state (3) and current_state (1) and current_state (0))))));
|
83 |
|
|
|
84 |
|
|
q (1) <= (not (rst) and (not (current_state (0)) or current_state (4)
|
85 |
|
|
or not (current_state (3)) or (not (current_state (2)) and not
|
86 |
|
|
(current_state (1)))) and ((not (current_state (1)) and (not
|
87 |
|
|
(current_state (2)) or current_state (3))) or (not (current_state
|
88 |
|
|
(4)) and (current_state (3) xor current_state (2)))));
|
89 |
|
|
|
90 |
|
|
q (2) <= (not (rst) and (not (current_state (0)) or current_state (4)
|
91 |
|
|
or aux46) and (not (current_state (3)) or (not (current_state
|
92 |
|
|
(0)) and not (current_state (4)) and aux45)));
|
93 |
|
|
|
94 |
|
|
q (3) <= ((not (rst) and current_state (4) and current_state (0) and current_state
|
95 |
|
|
(3) and (current_state (2) xor current_state (1))) or (not (rst)
|
96 |
|
|
and (not (current_state (0)) or not (aux48)) and (not (current_state
|
97 |
|
|
(2)) or current_state (0) or (current_state (4) and current_state
|
98 |
|
|
(1)))));
|
99 |
|
|
|
100 |
|
|
q (4) <= ((not (rst) and not (current_state (0)) and current_state (4)
|
101 |
|
|
and not (aux45)) or (not (rst) and not ((not (current_state
|
102 |
|
|
(0)) or current_state (4))) and ((not (current_state (1)) and
|
103 |
|
|
current_state (3)) or not (aux46))) or (not (current_state (4))
|
104 |
|
|
and not (rst) and not (current_state (0)) and not ((current_state
|
105 |
|
|
(3) and (current_state (2) xor current_state (1))))));
|
106 |
|
|
END;
|