Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #964
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail |
|---|---|
| NNTP-Posting-Date | Sat, 02 Apr 2011 15:36:23 -0500 |
| From | Chris Hinsley <chris.hinsley@gmail.com> |
| Newsgroups | comp.lang.forth |
| Date | Sat, 2 Apr 2011 21:36:23 +0100 |
| Message-ID | <2011040221362339753-chrishinsley@gmailcom> (permalink) |
| References | <2011040219361212758-chrishinsley@gmailcom> <EbGdnVLa4s_15QrQnZ2dnUVZ8mCdnZ2d@brightview.co.uk> <2011040220310050490-chrishinsley@gmailcom> <2011040220435062162-chrishinsley@gmailcom> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Subject | Re: Verilog macro issue |
| User-Agent | Unison/2.1.4 |
| Lines | 40 |
| X-Usenet-Provider | http://www.giganews.com |
| X-Trace | sv3-DLXcRKUjOddVyVomQi+0aGKQHyguWOySxVcQrwc63m/zCPZ3hhfMFrYyyQjdw917cL43FG3yqtdkVT+!QwY6VXZb4reiNn3MYGwv/p78C91Zj0pey711AjiPyLGXfk/jsQQKw1EkoW8oVkiUJOaCzw== |
| X-Complaints-To | abuse@giganews.com |
| X-DMCA-Notifications | http://www.giganews.com/info/dmca.html |
| X-Abuse-and-DMCA-Info | Please be sure to forward a copy of ALL headers |
| X-Abuse-and-DMCA-Info | Otherwise we will be unable to process your complaint properly |
| X-Postfilter | 1.3.40 |
| X-Original-Bytes | 2264 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.forth:964 |
Show key headers only | View raw
On 2011-04-02 20:43:50 +0100, Chris Hinsley said: >> >> I didn't think it was a priority encoder ! Are you sure ? I thought >> this was a priority encoder ? > > Just checked on the Simulator, and it's definately _not_ a priority > encoder. It's an encoder with 0 as the output in any error case. ! > > So back to my original question. How to write the encoder generating macro. :) > > Chris This works as a macro to define priority encoders, but still not the same as the original encoder done with a case. `define PRI_ENCODER(NAME, BITS) \ module NAME(i, o); \ input [((2 ** BITS) - 1):0] i; \ output [(BITS - 1):0] o; \ reg [(BITS - 1):0] o; \ integer n; \ always @(i) \ begin : THE_LOOP \ o = BITS'b0; \ for (n = 0; n < (2 ** BITS); n = n + 1) \ begin \ if (i[n]) \ begin \ o = n; \ disable THE_LOOP; \ end \ end \ end \ endmodule `PRI_ENCODER(pri_enc3, 3) `PRI_ENCODER(pri_enc4, 4) `PRI_ENCODER(pri_enc5, 5)
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 19:36 +0100
Re: Verilog macro issue Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-04-02 20:26 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 20:31 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 20:43 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 21:36 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 22:12 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-02 23:01 +0100
Re: Verilog macro issue Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-04-02 23:33 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-03 03:58 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-03 12:27 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-03 13:20 +0100
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-07 23:26 +0100
Re: Verilog macro issue Jan Coombs <jan_2011-02@murray-microft.co.uk> - 2011-04-10 23:20 +0100
Re: Verilog macro issue rickman <gnuarm@gmail.com> - 2011-04-11 10:36 -0700
Re: Verilog macro issue Chris Hinsley <chris.hinsley@gmail.com> - 2011-04-11 20:16 +0100
csiph-web