Hardware Reference
In-Depth Information
statements for nx_state . For example, observe in lines 20-36, relative to state A, that
the output values are now conditional. Compare these lines against lines 36-46 in the
template of section 6.3.
Please review the following comments, which can easily be adapted from the Moore
case to the Mealy case:
—On the Moore template for category 1, in section 6.3, especially comment 10.
—On the enum_encoding and fsm_encoding attributes, also in section 6.3.
—On possible code variations, in section 6.4.
1 -------------------------------------------------------------
2 library ieee;
3 use ieee.std_logic_1164.all;
4 -------------------------------------------------------------
5 entity circuit is
6 (same as for category 1 Moore, section 6.3)
7 end entity;
8 -------------------------------------------------------------
9 architecture mealy_fsm of circuit IS
10 (same as for category 1 Moore, Section 6.3)
11 begin
12
13
--FSM state register:
14
(same as for category 1 Moore, section 6.3)
15
16
--FSM combinational logic:
17
process (all) --list proc. inputs if “all” not supported
18
begin
19
case pr_state is
20
when A =>
21
if <condition> then
22
output1 <= <value>;
23
output2 <= <value>;
24
...
25
nx_state <= B;
26
elsif <condition> then
27
output1 <= <value>;
28
output2 <= <value>;
29
...
30
nx_state <= ...;
31
else
32
output1 <= <value>;
33
output2 <= <value>;
34
...
35
nx_state <= A;
36
end if;
37
when B =>
38
if <condition> then
39
output1 <= <value>;
40
output2 <= <value>;
41
...
42
nx_state <= C;
43
elsif <condition> then
Search WWH ::




Custom Search