The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 17th, 2024, 6:35am
Pages: 1
Send Topic Print
What does -: mean? (Read 1401 times)
Mike_k
New Member
*
Offline



Posts: 1

What does -: mean?
Oct 30th, 2009, 5:17pm
 
For example: bus_name[32-:8]
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: What does -: mean?
Reply #1 - Nov 2nd, 2009, 5:45am
 
I thought it was a typo, but I do see that syntax in 1800-2005.

I think it was intended to allow you to grab a fixed-size slice of an array:
Quote:
The size of the part-select or slice must be constant, but the position can be variable. The syntax of Verilog is used.
int i = bitvec[j +: k]; // k must be constant.


So, in your case, I think [32-:8] is the slice starting at 32 and going down to get 8 bits, and thus would be the same as [32:25].  However, you could also have bus_name[x-:8] and sometimes x=32 and other times x=24, etc.
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   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.