FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2004, 01:26 AM
kwaj
Guest
 
Posts: n/a
Default VHDL:Dividing a real number by two??

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




Reply With Quote
  #2 (permalink)  
Old 02-10-2004, 02:03 AM
Bevan Weiss
Guest
 
Posts: n/a
Default Re: VHDL:Dividing a real number by two??

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" <[email protected]> wrote in message
news:[email protected]
> 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
>
>
>
>



Reply With Quote
  #3 (permalink)  
Old 02-10-2004, 02:18 AM
Allan Herriman
Guest
 
Posts: n/a
Default Re: VHDL:Dividing a real number by two??

On Tue, 10 Feb 2004 15:03:11 +1300, "Bevan Weiss"
<[email protected]> wrote:

>"kwaj" <[email protected]> wrote in message
>news:[email protected]
>> 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.
Reply With Quote
  #4 (permalink)  
Old 02-10-2004, 08:55 AM
Uwe Bonnes
Guest
 
Posts: n/a
Default Re: VHDL:Dividing a real number by two??

Allan Herriman <[email protected]> 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 [email protected]

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Reply With Quote
  #5 (permalink)  
Old 02-10-2004, 09:04 AM
Allan Herriman
Guest
 
Posts: n/a
Default Re: VHDL:Dividing a real number by two??

On Tue, 10 Feb 2004 08:55:53 +0000 (UTC), Uwe Bonnes
<[email protected]> wrote:

>Allan Herriman <[email protected]> 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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cascaded dividers for dividing down clocks anand Verilog 1 08-16-2006 09:21 PM
Evaluating difference between real number and fixed point approx. [email protected] Verilog 7 07-10-2006 08:06 PM
bin to bcd for same number weizbox Verilog 5 10-12-2004 03:02 PM


All times are GMT +1. The time now is 09:03 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved