Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help needed with state machines.

Status
Not open for further replies.

s3034585

Full Member level 4
Joined
May 24, 2004
Messages
226
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Activity points
2,087
Hi guys
I am trying to implement state machines in my code to perform writting and reading to various memories... I am not sure whether the state machine which i have written is a right way to implement state machines. Thus can you guys comment on this and let me know if there is any thing wrong in it.

Basicy i get a set of data from a block which i slpit into 3 diff segments and store into 3 diff rams. after that i have one state machine to read from these rams in a particular sequence.
--- state machine...

process(clk,reset)
If()--- asyn reset...
----reset all
state <= idle;
elsif(risign)--- on the risng edge..
--- all the default values...
case state is

when idle...
-- logic to jump to next state....
state <= new value..

when write1...
----- here i wait for a counter to finish and till then write in one ram...
--------------------once the coutner is over i make a assignment for state<= new value...
-- similarly others states are done...

end caes..
--end of state machine...

like this i have done the state machine...
wht i want to know is that i make the assignment for output signals and also the sate with the new values... rather than having one more variable as nextstate and then assigning this on the clk edge to state...

Can any one tell me is this a correct way to do.. because i want to control the ouput signals and state synchronusly...

Thanks a lot...
tama
 

plz post ur full fsm code.....i m not able to understand this one properly.....
 

you should do like that....
1. you need to define the state for Ram through define.....
2.use one process statement for (clk,reset)
ihere you take consideration of async.& in else statement
stae = nextstate;
3.use another process statement (state) only
as case staement you are approaching....
the 3 ram memory will be different state.
Thanks

Added after 14 seconds:

anmolvlsi13 said:
you should do like that....
1. you need to define the state for Ram through define.....
2.use one process statement for (clk,reset)
ihere you take consideration of async.& in else statement
stae = nextstate;
3.use another process statement (state) only
as case staement you are approaching....
the 3 ram memory will be different state.
Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top