ROR / ROL 
Author Message
 ROR / ROL

Good Morning,

     w/ ROR & ROL I need to use them to roll STD_VECTORS (after converting
them to BIT_VECTORS) by another STD_VECTOR.  I know you're supposed to use
an integer w/ these values, but can you use STD_VECTORS?

     Example:

     din:    std_logic_vector(31 downto 0);
     dout: std_logic_vector(31 downto 0);
     n:       std_logic_vector(31 downto 0);

     din <= To_VECTOR(din);
     dout <= din ROR n;

     Do I need to convert N to a bitvector?

     Thank you very much.

     John



Sun, 09 May 2004 18:48:11 GMT  
 ROR / ROL
How about:-

dout <= din ROR CONV_INTEGER(n);

CONV_INTEGER is in one of the ieee packages, can't remember which.


Quote:
> Good Morning,

>      w/ ROR & ROL I need to use them to roll STD_VECTORS (after converting
> them to BIT_VECTORS) by another STD_VECTOR.  I know you're supposed to use
> an integer w/ these values, but can you use STD_VECTORS?

>      Example:

>      din:    std_logic_vector(31 downto 0);
>      dout: std_logic_vector(31 downto 0);
>      n:       std_logic_vector(31 downto 0);

>      din <= To_VECTOR(din);
>      dout <= din ROR n;

>      Do I need to convert N to a bitvector?

>      Thank you very much.

>      John



Mon, 10 May 2004 03:00:36 GMT  
 ROR / ROL

Quote:

> Good Morning,

>      w/ ROR & ROL I need to use them to roll STD_VECTORS (after converting
> them to BIT_VECTORS) by another STD_VECTOR.  I know you're supposed to use
> an integer w/ these values, but can you use STD_VECTORS?

>      Example:

>      din:    std_logic_vector(31 downto 0);
>      dout: std_logic_vector(31 downto 0);
>      n:       std_logic_vector(31 downto 0);

>      din <= To_VECTOR(din);
>      dout <= din ROR n;

>      Do I need to convert N to a bitvector?

For some reason, I think that the amount to rotate by has to be static
(known at compile time).

Someone please check this...

-a



Mon, 10 May 2004 05:08:16 GMT  
 ROR / ROL
n has to be integer. at least in numeric_std.

from the FAQ:
 rol
     uns
     int
     uns
     rotates left 1st par by 2nd par bit positions if 2nd par >=0, otherwise
rotates right

      ror
     uns
     int
     uns
     rotates right 1st par by 2nd par bit positions if 2nd par >=0,
otherwise rotates left

      rol
     sgn
     int
     sgn
     rotates left 1st par by 2nd par bit positions if 2nd par >=0, otherwise
rotates right

      ror
     sgn
     int
     sgn
     rotates right 1st par by 2nd par bit positions if 2nd par >=0,
otherwise rotates left

--
Benjamin Todd
European Organisation for Nuclear Research
SL SPS/LHC -- Control -- Timing Division
CERN, Geneva, Switzerland,  CH-1211
Building 864 Room 1 - A24


Quote:
> Good Morning,

>      w/ ROR & ROL I need to use them to roll STD_VECTORS (after converting
> them to BIT_VECTORS) by another STD_VECTOR.  I know you're supposed to use
> an integer w/ these values, but can you use STD_VECTORS?

>      Example:

>      din:    std_logic_vector(31 downto 0);
>      dout: std_logic_vector(31 downto 0);
>      n:       std_logic_vector(31 downto 0);

>      din <= To_VECTOR(din);
>      dout <= din ROR n;

>      Do I need to convert N to a bitvector?

>      Thank you very much.

>      John



Mon, 10 May 2004 16:32:05 GMT  
 ROR / ROL
it is in the arith I think
Quote:

>How about:-

>dout <= din ROR CONV_INTEGER(n);

>CONV_INTEGER is in one of the ieee packages, can't remember which.



>> Good Morning,

>>      w/ ROR & ROL I need to use them to roll STD_VECTORS (after converting
>> them to BIT_VECTORS) by another STD_VECTOR.  I know you're supposed to use
>> an integer w/ these values, but can you use STD_VECTORS?

>>      Example:

>>      din:    std_logic_vector(31 downto 0);
>>      dout: std_logic_vector(31 downto 0);
>>      n:       std_logic_vector(31 downto 0);

>>      din <= To_VECTOR(din);
>>      dout <= din ROR n;

>>      Do I need to convert N to a bitvector?

>>      Thank you very much.

>>      John



Tue, 11 May 2004 12:35:17 GMT  
 ROR / ROL
I used rol without numeric_bit

On Thu, 22 Nov 2001 09:32:05 +0100, "Benjamin Todd"

Quote:

>n has to be integer. at least in numeric_std.

>from the FAQ:
> rol
>     uns
>     int
>     uns
>     rotates left 1st par by 2nd par bit positions if 2nd par >=0, otherwise
>rotates right

>      ror
>     uns
>     int
>     uns
>     rotates right 1st par by 2nd par bit positions if 2nd par >=0,
>otherwise rotates left

>      rol
>     sgn
>     int
>     sgn
>     rotates left 1st par by 2nd par bit positions if 2nd par >=0, otherwise
>rotates right

>      ror
>     sgn
>     int
>     sgn
>     rotates right 1st par by 2nd par bit positions if 2nd par >=0,
>otherwise rotates left



Tue, 11 May 2004 12:36:02 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. sll, srl, sla, sra , rol, ror operations

2. More newb questions (ROL,ROR etc.)

3. ROR and ROL instruction

4. 32-bits registers (Re: ROR and ROL instruction)

5. Using the ROR shift operator and getting errors

6. ror 32 bit

7. how do i ROR EAX?

8. ROL operatior

9. Efficient ROL on the K6-2

10. Release of the ROL system version 2.1

11. Release of the ROL System Version 2.0

12. Release of the ROL System Version 2.0

 

 
Powered by phpBB® Forum Software