Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

slicing /inverting vectors?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've got a bus 16 bits long and it looks like that "1111 0000 1010 0011" I would lith to take the output like that i "0011
1010 0000 1111" (as you look at it)

from the left to the rigth

the inout is 16 and the output is 4 bits long
i have done the example below but is not working.:
frame_out_s <= tx_dat_s (3 downto 0 ) ;
tx_dat_s(15 downto 4) <= tx_dat_s (11 downto 0);



please help me...
regards
alex
 
hi!
in u r code u r not storing the present value in the intermediate variable so u will loose some bits before reversing the bus.

so first store u r bus bits in some temporary variable say
temp(15 down to 0) <= tx_dat_s(15 downto 4)
then
from the temp varible reverse the bits to tx_dat_s(15 downto 4)

tx_dat_s(15 downto 4) <= temp(11 downto 0);

give a try and let me know whether it works or not
Bye
Praveen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top