shift/rotate operator for std_logic_vector

M

Marteno Rodia

I mean operators like ror, rol, sla, sra, srl, sll.
Are they overloaded for std_logic_vector type in any 'standard' package?

I use Altera Quartus 6.1, and I recieive a message:
"Error (10327): VHDL error at vector_selector.vhd(191): can't determine
definition of operator ""srl"" -- found 0 possible definitions".

MR
 
M

Mike Treseler

Marteno said:
I mean operators like ror, rol, sla, sra, srl, sll.
Are they overloaded for std_logic_vector type in any 'standard' package?

Let's have a look at the source:
http://www.eda.org/rassp/vhdl/models/standards/numeric_std.vhd

The shifts work differently for
signed vs unsigned. Thats also why sla and sra are
not defined. The vector type covers it.

But it's not hard to cast out the
numeric interpretation when the math is done:

my_slv <= std_logic_vector(my_uns_vec srl 1);
I use Altera Quartus 6.1, and I recieive a message:
"Error (10327): VHDL error at vector_selector.vhd(191): can't determine
definition of operator ""srl"" -- found 0 possible definitions".

That the right answer. There is no srl defined for std_logic_vector.

-- Mike Treseler
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top