Conversion: double IEEE 754 => decimal ASCII-String

O

olliH

Guest
Hi,

my problem is that i have to print some results that are given as a
double (64bit IEEE 754) on a LCD.

The problem is the conversion of the double into an ASCII-String


For example:

Double value: 3FF28B4395810625 ==> conversion ==> LCD-output: "1.159"


It would make me very happy if someone can help me.
 
On Thu, 22 Jan 2009 05:13:21 -0800 (PST), olliH wrote:

my problem is that i have to print some results that are given as a
double (64bit IEEE 754) on a LCD.

The problem is the conversion of the double into an ASCII-String
For example:

Double value: 3FF28B4395810625 ==> conversion ==> LCD-output: "1.159"
Any practical solution to this will be software-based. Of course,
the "software" might be running on a tiny CPU in your FPGA or
other hardware design (PicoBlaze??).

Where do the "double" values come from? Surely the same
processor that creates these values could be programmed
to format them as human-readable strings.

If this is a student project, you may find it's best to make
yourself a programmable digit-by-digit BCD arithmetic engine,
and use that to do the various conversion steps. Clearly,
speed is unlikely to be a problem; for a human-readable
display it will be OK if the conversion takes thousands of
clock cycles.

Finally, do you know anything in advance about the range of
possible numeric values? Or do you need the full "double"
precision range of 1.0e-300 to 1.0e+300 (or thereabouts)?
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
jonathan.bromley@MYCOMPANY.com
http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
Hi,

thanks a lot for your answer.
The double values are the result of some calculations with the
Floatingpoint Operator 4.0 from Xilinx.
I will display only 7 digits. So I have to multiply the double result
I want to display with 10^7 and convert it into an Integer. This
should be no problem with the Floating Point Operator from Xilinx.

For the conversion I found an easy way, described on the webpage
below:

http://www.doulos.com/knowhow/vhdl_designers_guide/models/binary_bcd/
 

Welcome to EDABoard.com

Sponsor

Back
Top