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

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > VHDL

VHDL comp.lang.vhdl newsgroup / Usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-01-2003, 11:05 AM
Ciar?n Hughes
Guest
 
Posts: n/a
Default std_logic_vector divide

Hi all,

Is there any operator to divide a std_logic_vector, either by another
std_logic_vector or by an integer?

I am using the following code at the moment

temp := CONV_INTEGER(buf2) / q ;
ZRLOut <= CONV_STD_LOGIC_VECTOR(temp,11);

where buf2 and ZRLOut are signals of type std_logic_vector, temp is a
variable of type integer, and q is a signal of type integer.

Thanks
Ciarán Hughes

This works fine in behavioural simulation, but when I run a post
translate simulation, the division seems to be ignored, i.e. ZRLOut is
equal buf2. It is like the division can't be synthesised, and is
ignored (like the after statement).

Thanks,
Ciarán Hughes
Reply With Quote
  #2 (permalink)  
Old 10-01-2003, 03:12 PM
FE
Guest
 
Posts: n/a
Default Re: std_logic_vector divide

Sorry, division operator are not available for synthesis, except for power
of 2 (shift).You must design it. You can check for non restoring algorithm
on the web (I think that it's the easiest algorithm to implement) and you
can found some existing vhdl implemetation too.

regards
fe

"Ciar?n Hughes" <[email protected]> wrote in message
news:[email protected] om...
> Hi all,
>
> Is there any operator to divide a std_logic_vector, either by another
> std_logic_vector or by an integer?
>
> I am using the following code at the moment
>
> temp := CONV_INTEGER(buf2) / q ;
> ZRLOut <= CONV_STD_LOGIC_VECTOR(temp,11);
>
> where buf2 and ZRLOut are signals of type std_logic_vector, temp is a
> variable of type integer, and q is a signal of type integer.
>
> Thanks
> Ciarán Hughes
>
> This works fine in behavioural simulation, but when I run a post
> translate simulation, the division seems to be ignored, i.e. ZRLOut is
> equal buf2. It is like the division can't be synthesised, and is
> ignored (like the after statement).
>
> Thanks,
> Ciarán Hughes



Reply With Quote
  #3 (permalink)  
Old 10-04-2003, 03:34 PM
David Bishop
Guest
 
Posts: n/a
Default Re: std_logic_vector divide


You will find an unsigned divide routine commented out in
the floating point routines.

http://www.eda.org/fphdl/vhdl/fphdl_base_pkg_body.vhd

It is done as a subtraction tree, not very elegant, but it will
synthesize.

Ciar?n Hughes wrote:
>
> Hi all,
>
> Is there any operator to divide a std_logic_vector, either by another
> std_logic_vector or by an integer?
>
> I am using the following code at the moment
>
> temp := CONV_INTEGER(buf2) / q ;
> ZRLOut <= CONV_STD_LOGIC_VECTOR(temp,11);
>
> where buf2 and ZRLOut are signals of type std_logic_vector, temp is a
> variable of type integer, and q is a signal of type integer.
>
> Thanks
> Ciarán Hughes
>
> This works fine in behavioural simulation, but when I run a post
> translate simulation, the division seems to be ignored, i.e. ZRLOut is
> equal buf2. It is like the division can't be synthesised, and is
> ignored (like the after statement).
>
> Thanks,
> Ciarán Hughes


--
NAME: David W. Bishop INTERNET: [email protected]
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
std_logic_vector(0 downto 0) Brad Smallridge FPGA 2 11-12-2004 05:50 PM
std_logic_vector vs unsigned Chuck McManis FPGA 6 05-18-2004 04:07 PM
character to std_logic_vector Pedro Claro VHDL 6 08-04-2003 10:18 AM
Array of std_logic_vector Willem Oosthuizen VHDL 2 07-09-2003 06:47 PM


All times are GMT +1. The time now is 02:10 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