V
Valentin Tihomirov
Guest
constant BIT_TIME: time := 1/9600 sec;
???
???
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
constant BIT_TIME: time := 1/9600 sec;
???
Bad plan. 1/9600 is evaluated as an integer, yieldingTry this:
constant BIT_TIME: time := (1/9600) * 1 sec;
Good point.How about
constant BIT_TIME: time := 1 sec / 9600;
You have a long memory. I will have to remember notThat comes close to paying you back for catching me
out with a cunning type conversion at your tutorial
in Lyon
"Jim Lewis" <Jim@SynthWorks.com> wrote in message
news:3F957DA4.5090103@SynthWorks.com...
YES! SUCCESS! I caught Jim Lewis out!!!
Try this:
constant BIT_TIME: time := (1/9600) * 1 sec;
Bad plan. 1/9600 is evaluated as an integer, yielding
the value 0.
How about
constant BIT_TIME: time := 1 sec / 9600;
This will work because 1 sec == 10^15 fs, and arithmetic
on physical units is always scaled to the base unit,
which is fs in the case of time.
That comes close to paying you back for catching me
out with a cunning type conversion at your tutorial
in Lyon
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * Perl * Tcl/Tk * Verification * Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, Hampshire, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail: jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.