Hardware Reference
In-Depth Information
21
signal outp, outp_reg: std_logic_vector(...);
22
23 begin
24
25
--Timer:
26
(same as for category 2 Moore, section 9.2)
27
28
--Auxiliary register:
29
process (clk, rst)
30
begin
31
if (rst='1') then
32
outp_reg <= <initial value>;
33
elsif rising_edge(clk) then
34
outp_reg <= outp;
35
end if;
36
end process;
37
38
--FSM state register:
39
(same as for category 2 Moore, section 9.2)
40
41
--FSM combinational logic:
42
process (all) --list proc. inputs if ″all″ not supported
43
begin
44
case pr_state is
45
when A =>
46
outp <= outp_reg;
47
tmax <= T1-1;
48
if <condition> then
49
nx_state <= B;
50
elsif <condition> then
51
nx_state <= ...;
52
else
53
nx_state <= A;
54
end if;
55
when B =>
56
outp <= outp_reg + 1;
57
tmax <= T2-1;
58
if <condition> then
59
nx_state <= C;
60
elsif <condition> then
61
nx_state <= ...;
62
else
63
nx_state <= B;
64
end if;
65
when C =>
66
...
67
end case;
68
end process;
69
70
--Optional output register:
71
(same as for category 1 Moore, section 6.3)
72
73
output <= outp;
74
75 end architecture;
76 -------------------------------------------------------------
Search WWH ::




Custom Search