VHDL:Dividing a real number by two??

K

kwaj

Guest
I would have assumed that given a real variable, LAPP, to divide it by two
would simply be;

LAPP / 2

But I get as an error, "no feasible entries for /". How would one divide
through a real number??

- Kingsley
 
I think that you're mistaking VHDL as some form of programming language.
VHDL is a hardware description language, and as such it has no real
knowledge of a divide. The only thing that a divide would be used for would
be as an expression to form a constant.

If you're trying to divide some non-constant value by two, then you have to
ask yourself where this non-constant value is coming from, what kind of
operation would need to be performed on it to divide it by two, and where
you want the result to end up. Then you must design the logic to go between
the input and the output of the divide operation (or alternatively use some
prebuilt libray which already has such a design).

I think that you should read an introductory book on VHDL, it should help
you understand where you're going wrong with your approach.

"kwaj" <k.otengNOSPAM@student.unsw.edu.auNOSPAM> wrote in message
news:c09bq7$r6t$1@tomahawk.unsw.edu.au...
I would have assumed that given a real variable, LAPP, to divide it by two
would simply be;

LAPP / 2

But I get as an error, "no feasible entries for /". How would one divide
through a real number??

- Kingsley
 
On Tue, 10 Feb 2004 15:03:11 +1300, "Bevan Weiss"
<kaizen__@NOSPAMhotmail.com> wrote:

"kwaj" <k.otengNOSPAM@student.unsw.edu.auNOSPAM> wrote in message
news:c09bq7$r6t$1@tomahawk.unsw.edu.au...
I would have assumed that given a real variable, LAPP, to divide it by two
would simply be;

LAPP / 2

But I get as an error, "no feasible entries for /". How would one divide
through a real number??

- Kingsley
try

LAPP / 2.0

'2.0' is a real, and '2' is an integer (and the compiler hasn't been
told to divide a real by an integer).

This is unlikely to be synthesisable (depending on context) as Bevan
suggested.

Regards,
Allan.
 
On Tue, 10 Feb 2004 08:55:53 +0000 (UTC), Uwe Bonnes
<bon@elektron.ikp.physik.tu-darmstadt.de> wrote:

Allan Herriman <allan.herriman.hates.spam@ctam.com.au.invalid> wrote:

: try

: LAPP / 2.0

: '2.0' is a real, and '2' is an integer (and the compiler hasn't been
: told to divide a real by an integer).

What about substracting -1 from the exponent?
That doesn't work in general (for IEEE floating point). There are
special cases to consider. Besides, we don't know yet whether the OP
requires synthesisable code.

Regards,
Allan.
 
Allan Herriman <allan.herriman.hates.spam@ctam.com.au.invalid> wrote:

: try

: LAPP / 2.0

: '2.0' is a real, and '2' is an integer (and the compiler hasn't been
: told to divide a real by an integer).

What about substracting -1 from the exponent?
--
Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
 

Welcome to EDABoard.com

Sponsor

Back
Top