Binary division

G

genlock

Guest
I am trying to divide a 24 bit binary value by 2,4,8...for which I have
used the following syntax:

sample / "000000000000000000000010"

It keeps showing an error as follows :

/ can not have such operands in this context

Any suggestions welcome.

Thanks
 
I tried sample / 2 but it keeps showing the same error.....sample is a
24 bit vector.

The point is that I have to divide this bit vector value by 1.122 in
which case , I cannot use a shift right operation.

What kind of type conversions are u referring to?

I tried converting the 24 bit binary to an integer but I need to divide
this integer by the value 1.122.

It shows the same error for using the operator '/'

Any suggestions

Thankyou
 
Bert,
Thankyou very much for this technique.

I want the synthesizer to work and it is working when using the '/'
operator with powers of 2.

What library do I need to add in order to use the function: to_integer?
I need to convert the resultant integer back to a bit vector.

I am using the functions conv_integer and conv_std_logic_vector. I have
added the library
ieee.std_logic_signed.vhd for these functions.

Can you explain where I would need an accumulator and shift register...
I am using Xilinx ISE and coding in VHDL....I dont understnad the RTL
part you are talking about...

I am going to try this solution and see how it works....

Thankyou
 

Welcome to EDABoard.com

Sponsor

Back
Top