Hardware Reference
In-Depth Information
30
begin
31
case pr_state is
32
when idle =>
33
selA <= '-';
34
selB <= '-';
35
wrA <= '0';
36
wrB <= '0';
37
ALUop <= "00";
38
if dv='1' then
39
nx_state <= load;
40
else
41
nx_state <= idle;
42
end if;
43
when load =>
44
selA <= '1';
45
selB <= '1';
46
wrA <= '1';
47
wrB <= '1';
48
ALUop <= "00";
49
nx_state <= waitt;
50
when waitt =>
51
selA <= '-';
52
selB <= '-';
53
wrA <= '0';
54
wrB <= '0';
55
ALUop <= "10";
56
if sign="01" then
57
nx_state <= writeA;
58
elsif sign="10" then
59
nx_state <= writeB;
60
else
61
nx_state <= idle;
62
end if;
63
when writeA =>
64
selA <= '0';
65
selB <= '-';
66
wrA <= '1';
67
wrB <= '0';
68
ALUop <= "10";
69
nx_state <= waitt;
70
when writeB =>
71
selA <= '-';
72
selB <= '0';
73
wrA <= '0';
74
wrB <= '1';
75
ALUop <= "11";
76
nx_state <= waitt;
77
end case;
78
end process;
79
80 end architecture;
81 -----------------------------------------------------
Simulation results are presented in i gure 6.5. The encoding chosen for the states
was sequential (section 3.7). The states are enumerated from 0 to 4 (there are i ve states)
Search WWH ::




Custom Search