Re: gEDA-user: OT Verilog syntax question

2010-08-03 Thread John Griessen
On 08/03/2010 12:16 PM, Patrick Doyle wrote: wire [9:0] tmp = $rtoi(whatever); Regardless, I'm getting the impression that there is no simple way to cast an integer expression to a bit vector. I wonder why I thought there was... probably was just wishful thinking. verilog originated to descr

Re: gEDA-user: OT Verilog syntax question

2010-08-03 Thread Patrick Doyle
On Tue, Aug 3, 2010 at 12:59 PM, Stephen Williams wrote: > > I'm a little surprised that Icarus Verilog doesn't already pay > attention to the "4" in your "%4b". In any case, this should do > the trick for you: > >   integer result; >     ... $display("%b", result[3:0]); ... > Oh, of course B

Re: gEDA-user: OT Verilog syntax question

2010-08-03 Thread Stephen Williams
I'm a little surprised that Icarus Verilog doesn't already pay attention to the "4" in your "%4b". In any case, this should do the trick for you: integer result; ... $display("%b", result[3:0]); ... or failing that, you can try: wire [3:0] tmp = result; ... $display("%b", tmp); Pa

Re: gEDA-user: OT Verilog syntax question

2010-08-03 Thread Patrick Doyle
On Tue, Aug 3, 2010 at 12:33 PM, Larry Doolittle wrote: > On Tue, Aug 03, 2010 at 09:12:00AM -0400, Patrick Doyle wrote: >> I have some verilog test code in which I would like to display an >> integer value, which is known to be between 0 and 15, as a binary >> vector, i.e. >> >> integer result; >

Re: gEDA-user: OT Verilog syntax question

2010-08-03 Thread Larry Doolittle
On Tue, Aug 03, 2010 at 09:12:00AM -0400, Patrick Doyle wrote: > I have some verilog test code in which I would like to display an > integer value, which is known to be between 0 and 15, as a binary > vector, i.e. > > integer result; > $display("%4b", result); > > of course I get a 64 bit vector

gEDA-user: OT Verilog syntax question

2010-08-03 Thread Patrick Doyle
Sorry to pester you folks with this, but I'm not sure whom else to ask. I have some verilog test code in which I would like to display an integer value, which is known to be between 0 and 15, as a binary vector, i.e. integer result; $display("%4b", result); of course I get a 64 bit vector displa