cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
2,907 Views
Registered: ‎01-17-2012

no loop for ranged type in simulation ?

Hi,

is there a way i get a loop instead of 'out of index'

 

signal test : integer range 0 to 3:=0;

test <= test + 1 ; --0 1 2 3 0 1 2.....

 

thx

0 Kudos
1 Reply
Highlighted
Historian
Historian
2,905 Views
Registered: ‎02-25-2008

Re: no loop for ranged type in simulation ?


@nikmeilleur wrote:

Hi,

is there a way i get a loop instead of 'out of index'

 

signal test : integer range 0 to 3:=0;

test <= test + 1 ; --0 1 2 3 0 1 2.....

 

thx


test <= (test + 1) mod 4;

 

You're welcome.

----------------------------Yes, I do this for a living.
0 Kudos