- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi all:
One of my books says that we can compile "while" if there is some thing control it (eg:@(posedge Clock)).I don't know whether my book is right. Is there some one have do it .Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
reg MyRegBit;
always @ ( posedge MyClock ) MyRegBit <= MyAssignedValue; this is like a while ( 1 ) { MyRegBit = MyAssignedValue; } if you want dependencies based upon a signal then while ( EnableAssignment ) { MyRegBit = MyAssignedValue; } would be reg MyRegBit; always @ ( posedge MyClock ) if ( EnableAssignment ) MyRegBit <= MyAssignedValue; else MyRegBit <= MyRegBit; or write it like reg MyRegBit; always @ ( posedge MyClock ) MyRegBit <= ( EnableAssignment ) ? MyAssignedValue : MyRegBit;
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