shifter: shift last two values

Status
Not open for further replies.

fanwel

Full Member level 3
Joined
May 26, 2011
Messages
178
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,878
Hi all,

I want to have a shifter to shift the last two values of my input into the left (MSB) as the output.
For example, input: f=( 2,1,0,9,3) then the output will be y=(9,3,2,1,0).
It is possible I write this operation in VHDL?
Hope for your advise. Thank You
 

Yes, Im sure its possible. But your question isnt very clear. You ask to shift two values, but then you talk about shifting the MSB?
then the function of the output you show is a right shift, not a left shift.

So is it a bitwise shift, or a value you shift? do the outputs make up different parts of a larger number?

Please make what you want to do more clear.
 

Hi TrickyDicky,

Sorry on that question, I'm wrong. Actually I want to shift the last two values of the input into the front (from right to left).
I try to write VHDL code using shifter but I dont know how to shift the values. Can you helps me.
Thanks for reply
 

are these input serially into a parrallel buffer, or are they input in parrallel and you simply want to move them around their input array?
 

Hi TrickyDicky,

Yes, the inputs are in parallel and I want to move them around their input array.
Thanks for reply
 

then they dont need to be shifted. you just assign them to their specific new entries

type some_array_t is array(0 to 4) of integer;

output <= input(2 to 4) & input(0 to 1);

So now, lets assume input was (0,1,2,3,4);
output is now (2,3,4,0,1);
 

Hi TrickyDicky,

Thanks for the idea. I will write the code and let you know if I get problems.
Many thanks
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…