How to implement a Left Shifter using Right Shifter?

1.9k views Asked by At

I have implemented a Right Shifter(32 bits) using 5 stages of multiplexers (Shift1/2/4/8/16). my question is how can I extend my implementation to implement the Left Shifter with minimum additional hardware ?

1

There are 1 answers

0
Morten Zilmer On

Shift left can be done using shift right by reversing the argument vector, shift right, and then reverse the result, thus:

shift_left(arg, n) = reverse(shift_right(reverse(arg), n))

Function for reverse of std_logic_vector can be found in reverse_any_vector.