You often need to pass "reals" back and forth between modules. For
example, an A/D would have a Vin input that is supposed to represent
the analog voltage, say, between -2.500 and 2.500V. Unfortuneatly,
Verilog doesn't allow reals to be ports. The common trick is to then
define wires and ports that are 64-bit buses (e.g. input [63:0] vin).
There are Verilog functions $bitstoreal and $realtobits that will
convert back and forth (this is from memory..). This way, you can
glue together mixed signal systems. This is usually when someone will
chime in with something about the Analog extentions to Verilog...
I have examples of this sort of thing, if that's what you are
interested in.
tom coonan
Scientific Atlanta
>Can anyone here tell me how to specified a floating point number in
>verilog?
>Such as for a 32bit number A=6.0247e-23 ====> A=32'd ???
>
>Thanks in advance.
>
>
On a practical level, any simulator is going to use the floating point
representation of the machine that it runs on. Anything else would take
extra work for the person writing the simulator and for the simulator
executing the floating point operations. Most computers use IEEE floating
point these days.
U will need to declare A has Real data type and then assign value
appropriately.
For Ex: real A;
initial begin
A = 6e-23; //scientific
notation; U maynot be able to declare it as 6.0247e-23
A = 6.0247; //Legal declaration
end
Get the idea !!!! -SUBBU