" ABEL CODE for a sequence detector 1011, with binary encoding,
" implemented as a Moore Machine
"
" File: C:\MYDOCU~1\CLASSW~1\XILINX~1\SEQDETMR\SeqMoore.abl
" created: 05/14/00 19:56:45
" from: 'C:\MYDOCU~1\CLASSW~1\XILINX~1\SEQDETMR\SeqMoore.asf'
" by: fsm2hdl - version: 2.0.1.53
"
module seqmoore
Title 'seqmoore'

Declarations
"clocks
CLK PIN;

"input ports
RST PIN;
X PIN;

"output ports
Z PIN;

"******** BINARY ENCODED state machine: Sreg0 ******

Sreg0_0 NODE istype 'reg';

xilinx property 'save Sreg0_0';

    Sreg0_1 NODE istype 'reg';

xilinx property 'save Sreg0_1';

    Sreg0_2 NODE istype 'reg';

xilinx property 'save Sreg0_2';

    Sreg0 = [Sreg0_2, Sreg0_1, Sreg0_0];

S0 = ^b000;
S1 = ^b001;
S2 = ^b010;
S3 = ^b011;
S4 = ^b100;
"diagram ACTIONS

"************* state machine: Sreg0 *************

Equations

" clock signals definitions
Sreg0.clk = CLK;
Sreg0_0.clr = RST;
Sreg0_1.clr = RST;
Sreg0_2.clr = RST;

State_diagram Sreg0

State S0:

Z=^b0;
IF (!X#RST) THEN
S0
ELSE IF (X&!RST) THEN
S1;
State S1:
Z=^b0;
IF (X&!RST) THEN
S1
ELSE IF (!X&!RST) THEN
S2;
State S2:
Z=^b0;
IF (!X&!RST) THEN
S0
ELSE IF (X&!RST) THEN
S3;
State S3:
Z=^b0;
IF (!X&!RST) THEN
S2
ELSE IF (X&!RST) THEN
S4;
State S4:
Z=^b1;
IF (X&!RST) THEN
S1
ELSE IF (!X&!RST) THEN
S2;
" end of state machine - Sreg0

end seqmoore