Showing results for

- Intel Community
- FPGAs and Programmable Solutions
- Nios® II Embedded Design Suite (EDS)
- Verilog - minimizing logic

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-03-2011
12:56 PM

761 Views

Verilog - minimizing logic

Hi

I'm generating some asymmetric waveforms from a counter, and am able to adjust the counts where it changes output. Hence I'd like to choose numbers that utilize the minimum amount of logic - e.g: Counter8_out = ((Counter1 >= 48) && (Counter1 < 80)) | ((Counter1 >= 128) && (Counter1 < 176)) | ((Counter1 >= 208) && (Counter1 < 256)) | (Counter1 >= 304); Is there any way I can see what effect tweaking the numbers has on the compiled logic, e.g. seeing how much logic is used by that signal, or seeing the canonical equation produced by the synthesis (IIRC there was a way of seeing that from MAX-PLUS-II)? [edit] - other than by compile, print-screen "resource usage summary", tweak, compile, compare "resource usage summary" against previous... [edit] - also seeing that adjusting the counts to use a spread of 2,3,4 input Logic Element usage can work better than trying to always use minimum number of bits.Link Copied

2 Replies

Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-03-2011
01:25 PM

36 Views

This kind of compare logic is minimized if you choose numbers which allow comparision of a limited number of bits.

This can be easily evaluated from the binary representation of you numbers, e.g (Counter1 >= 128) && (Counter1 < 176) is efficient because only 3 upper bits need to be compared in order to evaluate the expression. While (Counter1 >= 135) && (Counter1 < 182) would require far more complex logic.
Altera_Forum

Honored Contributor I

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

10-03-2011
01:33 PM

36 Views

ISTR that somewhere you can see a logic diagram (or similar) after one stage of the syntheses. But the actual logic used can depend on timing (and other) constraints.

I'd guess that you'd be better counting down to zero (or until carry) and reloading the counter with a sequence of values.- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.