std_logic_vector divide

C

Ciar?n Hughes

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
 
F

FE

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
 

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,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top