salahmuftah
Newbie level 1

Hi all,
I have a vector A(31 downto 0)
how to do in VHDL in order to obtain A(0 downto 31)
Thank's
I have a vector A(31 downto 0)
how to do in VHDL in order to obtain A(0 downto 31)
Thank's
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
process
begin
for index 0 to 31
loop
ROLLED_A ( 31 - index ) <= A ( index ) ;
end loop ;
end process ;
Hi all,
I have a vector A(31 downto 0)
how to do in VHDL in order to obtain A(0 downto 31)
Thank's
Just to clarify, you can use a for loop like shaiko suggests to reverse the value in the A(31 downto 0) vector, but you can't reverse the vector to A(0 to 31). The vector would have to be declared as A(0 to 31).You can write a for loop:
Code:process begin for index 0 to 31 loop ROLLED_A ( 31 - index ) <= A ( index ) ; end loop ; end process ;
Instead you can use the ROR or ROL operators.
You can write a for loop:
Code:process begin for index 0 to 31 loop ROLLED_A ( 31 - index ) <= A ( index ) ; end loop ; end process ;
Instead you can use the ROR or ROL operators.
Code VHDL - [expand] 1 2 3 4 5 6 signal a : std_logic_vector(31 downto 0); signal b : std_logic_vector(0 to 31); ... b <= a;
Questions...Its even simpler than that
signal a : unsigned ( 31 downto 0 ) ;
signal b : unsigned ( 0 to 31 ) ;
signal x : unsigned ( 31 downto 0 ) ;
signal y : unsigned ( 0 to 31 ) ;
x <= a + b ;
y <= a + b ;
1. Will the numeric value of x and y be the same?
No. Bit a(0) will be added to b(31).2. Will bit a(0) be added to bit b(0) ?
You can write a for loop:
Code:process begin for index 0 to 31 loop ROLLED_A ( 31 - index ) <= A ( index ) ; end loop ; end process ;
Instead you can use the ROR or ROL operators.
ROLLED_A(0) <= A(31);
...
ROLLED_A(31) <= A(0);
if you use "for" loop like in your code and then implement its in FPGA, what will happen?
what difference when I use the follow code in stead of yours?