Well, since you don't want to use a power of two for your multiplication, it's going to be a PITA. I'll show you what would be more ideal after answering your question. I'm not going to provide any code - just technique.
The Hard Way (x 1000)
- Multiply the mantissa of your 0-1 number with the mantissa of 1000 (Multiply by a Constant)
- Add the exponent of your 0-1 number with the exponent of 1000 (Add a constant)
- Normalize the mantissa/exponent to the form 1.XXX*2^Y (variable shift, add)
- Adjust the mantissa/exponent so that the exponent is 10 (Can be combined with previous step) (shift, add)
- Take 10 bits of data to the left of the decimal point as your integer
The Easy Way (x 1024)
- Normalize the mantissa for an exponent of 2^10 (variable shift)
- Take the 10 most-significant-bits as your integer value
re: (fair question but now deleted) in comments : HDL Designer is a professional tool for logic design from Mentor Graphics. It has been around for a while, originally under the Renoir name, it's only been HDL Designer for about six or seven years.
It intends to add higher levels of abstraction over VHDL and Verilog designs. From what I have seen of Verilog, it might be useful there, but if you're using VHDL you can write at a higher level of abstraction without it, and using HDL Designer badly can keep your VHDL code stuck in the dark ages...
However, that said :
a Library, like a VHDL library, is for things (types, components, packages, utilities) that you will re-use in different places, either within a single project or common to multiple projects.
A Project is what you would use to structure a single design, e.g. for a single FPGA, the testbench for it, and possibly the board it is on.
One reasonable use of HDL Designer is to create wrappers for substantial VHDL components (CPU, memory, bus interface, FFT processor etc) and to create structural VHDL designs using them, in the form of HDL Designer block diagrams. That way you effectively have compilable documentation...
Best Answer
How about just casting them: