Microsoft AGB-00001 Spécifications Page 122

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 144
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 121
VHDL for the ABEL-HDL Designer
C-10 VHDL Reference Manual
library ieee;
use ieee.std_logic_1164.all;
entity machine is
port (clk,reset: in std_logic;
state_inputs: in std_logic_vector (0 to 1);
state_outputs: out std_logic_vector (0 to 1));
end machine;
architecture behavior of machine is
type states is (st0, st1, st2, st3);
signal present_state, next_state: states;
begin
register: process (clk)
begin
if reset = '1' then
present_state <= st0; -- async reset to st0
elsif rising_edge(clk) then
present_state <= next_state; -- transition on clock
end if;
end process;
transitions: process(present_state, state_inputs)
begin
case current_state is -- describe transitions
when st0 => -- and comb. outputs
state_outputs <= "00";
if state_inputs = "11" then
next_state <= st0; -- hold
else
next_state <= st1; -- next state
end if;
when st1 =>
state_outputs <= "01";
if state_inputs = "11" then
next_state <= st1; -- hold
else
next_state <= st2; -- next state
end if;
when st2 =>
state_outputs <= "10";
if state_inputs = "11" then
next_state <= st2; -- hold
else
next_state <= st3; -- next state
end if;
when st3 =>
state_outputs <= "11";
if state_inputs = "11" then
next_state <= st3; -- hold
else
next_state <= st0; -- next state
end if;
end case;
end process;
end behavior;
A variety of state machines designs are provided with your VHDL
Synthesizer software. The craps, prep3 and prep4 designs included
in the tutorials chapter of the VHDL Entry manaul are examples of
alternative ways to describe state machine designs in VHDL.
Vue de la page 121
1 2 ... 117 118 119 120 121 122 123 124 125 126 127 ... 143 144

Commentaires sur ces manuels

Pas de commentaire