- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I come on this pice of code:
SIGNAL clockticks200k: INTEGER RANGE 0 TO max200k; What dose Range stand for?Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I come on this pice of code: SIGNAL clockticks200k: INTEGER RANGE 0 TO max200k; What dose Range stand for? --- Quote End --- The word range is used here to constrain the signal clockticks200k to the range 0<=clockticks200k<=max200k. If the value that clockticks200k ever evaluates to something outside of this range, a simulator will assert an error telling you so. If the signal were declared: SIGNAL clockticks200k: INTEGER; no such checks would be performed. Range constraining is a good practice if you know the bounds of the values. It provides a free assertion for you in your VHDL code without having to actually code an assertion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You're welcome.
I should have also mentioned that a range constraint also guides the synthesis tool. The synthesis tool should only use as much resources as are necessary to represent the outer bounds of the integer range of the declared signal.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page