Bit length constraining integers & reals

K

Kwaj

I am trying to analyse the effects of finite word quantisations on the
performance of my VHDL implementation.

A couple of questions

1. what sort of bit length is being employed for real values and integer
values as default? For example

VARIABLE Result: real;

would 'Result' be 16-bit unsigned, 32-bit unsigned or 64-bit unsigned??


2. How would one limit the bit length for the above variable, Result, to
let's say an 8-bit representation??

cheers

- Kingsley
 
D

David Bishop

Kwaj said:
I am trying to analyse the effects of finite word quantisations on the
performance of my VHDL implementation.

A couple of questions

1. what sort of bit length is being employed for real values and integer
values as default? For example

VARIABLE Result: real;

would 'Result' be 16-bit unsigned, 32-bit unsigned or 64-bit unsigned??

64 bit floating point. That is the default for the real data type.
Floating point is very different from unsigned.
2. How would one limit the bit length for the above variable, Result, to
let's say an 8-bit representation??

variable result : integer range 0 to 255;
should do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top