The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 8:31am
Pages: 1
Send Topic Print
how to perform multiple assignments on case statement (Read 4090 times)
Ari
Junior Member
**
Offline



Posts: 17
Israel
how to perform multiple assignments on case statement
Dec 15th, 2009, 11:52am
 
Hi,

I wish to perform several assignment to variable on each case of my case statement.  i.e.:
       @(timer(tstart, period)) begin
           case(rnd )
           ( 0 ) : a=0;
                    b=1;
                    c=3;
           ( 1 ) : a=3;
                    b=1;
                    c=2;
          endcase


However, compiler reject such syntax (or alike), and I don't see any example for for multiple assignments, or and specification for this in the 2.3 LRM

Does anyone know if syntax supports multiple assignments?

Thanks in advance,

Ari
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: how to perform multiple assignments on case statement
Reply #1 - Dec 15th, 2009, 11:57am
 
make them a single statement by surrounding them with begin/end.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
Ari
Junior Member
**
Offline



Posts: 17
Israel
Re: how to perform multiple assignments on case statement
Reply #2 - Dec 16th, 2009, 1:46pm
 
Ken,

Thanks. I missed the possibility  :)


Ari
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.