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

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top