AHDL

Implementing State Machines with Asynchronous Outputs



AHDL supports the implementation of state machines with asynchronous outputs. The outputs of these types of state machines can change whenever the inputs change, regardless of clock transitions.

The mealy.tdf file shown below implements a four-state Mealy state machine with asynchronous outputs.

SUBDESIGN mealy
(
   clk   : INPUT;
   reset : INPUT;
   y     : INPUT;
   z     : OUTPUT;
)
VARIABLE
   ss: MACHINE WITH STATES (s0, s1, s2, s3);
BEGIN
   ss.clk = clk;
   ss.reset = reset;

   TABLE
   %  current  current     current  next  %
   %  state    input       output   state %
      ss,      y       =>  z,       ss;

      s0,      0       =>  0,       s0;
      s0,      1       =>  1,       s1;
      s1,      0       =>  1,       s1;
      s1,      1       =>  0,       s2;
      s2,      0       =>  0,       s2;
      s2,      1       =>  1,       s3;
      s3,      0       =>  0,       s3;
      s3,      1       =>  1,       s0;
   END TABLE;
END;


Back to Top

- PLDWorld -

 

Created by chm2web html help conversion utility.