Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17043 Discussions

vhdl code for state machine

Altera_Forum
Honored Contributor II
1,398 Views

Hai, 

 

Can anyone justify what the different between two line codes below: 

 

1) case cycle is 

when 0l1l7 =>cp<=SXT(bm,11)+b3; 

end case 

 

2) if cycle=2 or cycle=3 then 

cm<=SXT(b2,11)-b3; 

end if 

 

I'm curious the function of "l". Is it it mean by "AND" function? Thanks in advance
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
535 Views

| in this context is just to combine several cases in one line and avoid repeating some code.when 0|1|7 =>cp<=SXT(bm,11)+b3;is equivalent towhen 0 => cp<=SXT(bm,11)+b3; when 1 => cp<=SXT(bm,11)+b3; when 7 => cp<=SXT(bm,11)+b3;

0 Kudos
Altera_Forum
Honored Contributor II
535 Views

IIRC, | can only be used in case statements or in with..select statements. It is not an "or" operator.

0 Kudos
Altera_Forum
Honored Contributor II
535 Views

Hai Daixiwen and Tricky, 

 

Thanks for your explanations. I understand now, very appreciates. :)
0 Kudos
Reply