Hi all, I am developing a little program for a state machine in WinCupl.
The program should be a counter, which if the E input is low, in output I have binary peer numbers from 0000 to 1110, and if E is high odd numbers from 0001 to 1111 are in output.
I started write this code
But WinCupl report this error:
[0032ca] invalid next state: 'h'2
I know that off course it is a stupid error, but how can I fix it? Where I am wrong there?
Thank you for your help.
The program should be a counter, which if the E input is low, in output I have binary peer numbers from 0000 to 1110, and if E is high odd numbers from 0001 to 1111 are in output.
I started write this code
Rich (BB code):
Name EX3;
Designer Simo;
Device g22v10;
/** Inputs **/
PIN 1 = clock;
PIN 2 = E;
/** Outputs **/
PIN 23 = Q0;
PIN 22 = Q1;
PIN 21 = Q2;
PIN 20 = Q3;
FIELD state = [Q3..0];
$define S0 'b'0000
$define S1 'b'0001
$define S2 'b'0010
$define S3 'b'0011
$define S4 'b'0100
$define S5 'b'0101
$define S6 'b'0110
$define S7 'b'0111
$define S8 'b'1000
$define S9 'b'1001
$define S10 'b'1010
$define S11 'b'1011
$define S12 'b'1100
$define S13 'b'1101
$define S14 'b'1110
$define S15 'b'1111
SEQUENCE state {
PRESENT S0
IF !E NEXT S2;
}
[0032ca] invalid next state: 'h'2
I know that off course it is a stupid error, but how can I fix it? Where I am wrong there?
Thank you for your help.
Last edited: