Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #977
| NNTP-Posting-Date | Sat, 02 Apr 2011 21:58:10 -0500 |
|---|---|
| From | Chris Hinsley <chris.hinsley@gmail.com> |
| Newsgroups | comp.lang.forth |
| Date | Sun, 3 Apr 2011 03:58:10 +0100 |
| Message-ID | <2011040303581035956-chrishinsley@gmailcom> (permalink) |
| References | <2011040219361212758-chrishinsley@gmailcom> <EbGdnVLa4s_15QrQnZ2dnUVZ8mCdnZ2d@brightview.co.uk> <2011040223012056408-chrishinsley@gmailcom> <5dGdnYypo8bZOQrQnZ2dnUVZ8s2dnZ2d@brightview.co.uk> |
| 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-zPbfdrOG8CD8JfKEkHVLU4881ayFwAPwflQEEWqqkKnHTdR+TyyJnR0mrQ9qSfBRn7FkWU8xwAjrgmZ!+Q7rVZggcccJwn41GItOpv1+MVQOefP7hcO+vpFFXvpMmYn0+NwSbgR0RRPNkjF8BgtO/A== |
| 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 | 2602 |
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!news.giganews.com.POSTED!not-for-mail |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.forth:977 |
Show key headers only | View raw
On 2011-04-02 23:33:40 +0100, Jan Coombs said: > On 02/04/11 23:01, Chris Hinsley wrote: >>> o[3] = i[15]|i[14]|i[13]|i[12]|i[11]|i[10]|i[9]|i[8] >>> o[2] = i[15:]|i[14]|i[13]|i[12]|i[7]|i[6]|i[5]|i[4] >>> o[1] = i[15]|i[14]|i[11]|i[10]|i[7]|i[6]|i[3]|i[2] >>> o[0] = i[15]|i[13]|i[11]|i[9]|i[7]|i[5]|i[3]|i[1] >> >> Jan, it took me a while for this to sink in. :) > > Well, I've read your Verilog a few times, without the lights coming on, > so you still got there first. > > And sorry to have short-changed you, it was only half of a slow > priority encoder. > > Jan Coombs module enc5(i, o); input [31:0] i; output [4:0] o; assign o[0] = |i[01:01] | |i[03:03] | |i[05:05] | |i[07:07] | |i[09:09] | |i[11:11] | |i[13:13] | |i[15:15] | |i[17:17] | |i[19:19] | |i[21:21] | |i[23:23] | |i[25:25] | |i[27:27] | |i[29:29] | |i[31:31]; assign o[1] = |i[03:02] | |i[07:06] | |i[11:10] | |i[15:14] | |i[19:18] | |i[23:22] | |i[27:26] | |i[31:30]; assign o[2] = |i[07:04] | |i[15:12] | |i[23:20] | |i[31|28]; assign o[3] = |i[15:08] | |i[31:24]; assign o[4] = |i[31:16]; endmodule This produces a nicely efficient gate version on the FPGA. But I'm still have real problem getting this idea expressed as a macro that will let me generate any width encoder. It's late I'm off to bed and see if any Verilog gurus will give it a go while I'm in the land of nod. :) Chris
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