module FSM05
Title '110 recognizer'

Declarations

  Clock		PIN;
  Reset		PIN;
  SerIn		PIN;
  SerOut	PIN istype 'com';
  Q1, Q0	PIN istype 'reg';

Equations
  Q1.CLK = Clock ;
  Q0.CLK = Clock ;
  Q1.AR  = Reset ;
  Q0.AR  = Reset ;  

TRUTH_TABLE ([Q1, Q0, SerIn] :> [Q1, Q0] -> SerOut)
  [0,0,0] :> [0,0] -> 0 ;
  [0,0,1] :> [0,1] -> 0 ;
  [0,1,0] :> [0,0] -> 0 ;
  [0,1,1] :> [1,0] -> 0 ;
  [1,0,0] :> [0,0] -> 1 ;
  [1,0,1] :> [1,0] -> 0 ;
  
end FSM05
