fsm state encodings

C

Caterpillar

Dear all,
I want to optimize the state encoding of a FSM. I've typed this
declarations

type STATETYPE is std_logic_vector(1 downto 0); -- state declaration
constant IDLE : STATETYPE := "00";
constant EN_MUX1_DEMUX : STATETYPE := "01";
constant EN_MUX2 : STATETYPE := "11";
constant RST_FF : STATETYPE := "10";
signal CURRENT_STATE : STATETYPE;
signal NEXT_STATE : STATETYPE; -- signals
declaration

then I've used the usually 3-process coding style, with case
statements.
Modelsim gives me this error

near "std_logic_vector": expecting: '(' ACCESS ARRAY FILE RANGE RECORD
PROTECTED

What's wrong?

Thank you

Cat
 
C

charles.elias

Cat,
try subtype STATETYPE ...

std_logic_vector is a type so STATETYPE is a subtype.

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top