Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > SRL and ROL

Reply
Thread Tools

SRL and ROL

 
 
Chris Connelly
Guest
Posts: n/a
 
      08-03-2004
Please excuse the probable simplicity of this question.

I'm trying to use ROL and SRL logical operators and I can't seem to
find the correct syntax.

I have a bit_vector(31 downto 0) called 'tx' , now all I want to do is
rotate the vector to the left and pick of bit(0).
As I said I've tried a few arrangements ie. tx ROL 1 and ROL tx but
nothing seems to work.

Can someone let me know what the syntax is to do this simple task.

TIA

Chris
 
Reply With Quote
 
 
 
 
Egbert Molenkamp
Guest
Posts: n/a
 
      08-03-2004
entity test is
port (A : in bit_vector(31 downto 0);
p : in integer;
B : out bit_vector(31 downto 0));
end test;

architecture behavior of test is

begin
B <= A Rol p;
end behavior;

Egbert Molenkamp

"Chris Connelly" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Please excuse the probable simplicity of this question.
>
> I'm trying to use ROL and SRL logical operators and I can't seem to
> find the correct syntax.
>
> I have a bit_vector(31 downto 0) called 'tx' , now all I want to do is
> rotate the vector to the left and pick of bit(0).
> As I said I've tried a few arrangements ie. tx ROL 1 and ROL tx but
> nothing seems to work.
>
> Can someone let me know what the syntax is to do this simple task.
>
> TIA
>
> Chris



 
Reply With Quote
 
 
 
 
Ralf Hildebrandt
Guest
Posts: n/a
 
      08-03-2004
Chris Connelly wrote:


> I'm trying to use ROL and SRL logical operators and I can't seem to
> find the correct syntax.
>
> I have a bit_vector(31 downto 0) called 'tx' , now all I want to do is
> rotate the vector to the left and pick of bit(0).
> As I said I've tried a few arrangements ie. tx ROL 1 and ROL tx but
> nothing seems to work.


tx_rolled(31 downto 0) <= tx(0) & tx (31 downto 1);

works indipendent from used libraries, but is fixed as can bee seen.


Ralf
 
Reply With Quote
 
Mike Treseler
Guest
Posts: n/a
 
      08-03-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (Chris Connelly) wrote in message news:<(E-Mail Removed). com>...
> Please excuse the probable simplicity of this question.
>
> I'm trying to use ROL and SRL logical operators and I can't seem to
> find the correct syntax.
>
> I have a bit_vector(31 downto 0) called 'tx' , now all I want to do is
> rotate the vector to the left and pick of bit(0).
> As I said I've tried a few arrangements ie. tx ROL 1 and ROL tx but
> nothing seems to work.


Consider using rotate_left from the
ieee.numeric_std library as shown below.

-- Mike Treseler

-----------------------------------------------

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity rotate is
-- Mike Treseler Tue Aug 3 09:52:10 2004

generic (len : positive := 32);

port (clk : in std_ulogic;
rst : in std_ulogic;
rot : in std_ulogic; -- rotate or init
tx : out std_ulogic);

end entity rotate;

architecture synth of rotate is

begin -- architecture sim
sh : process (clk, rst) is
variable tx_v : unsigned(len-1 downto 0);
begin -- process sh
if rst = '1' then
tx_v := (others => '0');
tx <= tx_v(0);
elsif rising_edge(clk) then
if rot = '1' then
tx_v := rotate_left(tx_v, 1); -- rotate data
tx <= tx_v(0); -- pick off bit 0
else
tx_v := x"13701248"; -- init data
end if;
end if;
end process sh;

end architecture synth;
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if and and vs if and,and titi VHDL 4 03-11-2007 05:23 AM
Nikon full frame sensor SRL massimo Digital Photography 63 10-14-2005 02:59 AM
nikon full frame sensor SRL Darrell Digital Photography 11 02-17-2005 12:38 AM



Advertisments