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.

doubts regarding Finite state machine coding

Status
Not open for further replies.

M.Shobana

Member level 1
Joined
Sep 13, 2011
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,505
hi.......
process(ps_state,x)
begin
case state is
when s1=>
if(x(1)==0) then
nextstate<=s2;
q1<="001";
else
nextstate<=sin;
q1<={q0,"000"};
end if;
case state is
when s2=>
if(x(2)==0) then
nextstate<=s3;
q2<="010";
else
nextstate<=sin;
q2<={q1,"000"};
end if;
end case;
end process;
z<=q1 & q2;
in this program we may have the size of q as either 3 0r 6 bits. z is an output bit;q1 and q2 are the intermediate outputs we have to show the intermediate result also.like q1 and q2 i have to detect up to q15 and finally we have to concatenate all the 15 values of q1,q2,.......q15 in z;size of the z will be vary based on the size of the q then how we can initialize the size of q and z?

if anybody knows solution for the above problem means please reply me quickly
 

there are multiple errors in your code.

q2 <= {q1, "000"}; is not valid VHDL.
state is missing from the sensitivity list.
== has no meaning in VHDL.

I first suggest you read through a VHDL tutorial.

secondly, the size of Z will never vary, it will always be fixed, as will the size of Q.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top