Boolean function for binary shift with a variable amount

Viewed 43

How can I construct a Boolean function for a binary shift operation by a variable amount?

I looked that there are possibilities using and and or operators Binary Shifters using Logic Gates. But my problem is I need to do a shift operation by a variable amount and not hardcoding this variable to 1.

1 Answers

For each A input, add an AND gate for each possible value of the shift. The inputs to these gates will be its A and a new D selector value for the value of the shift. There will be (8 possible shift values) X (8 bits) = 64 of these AND gates.

The Boolean functions for each of these new D selectors can be determined by using truth tables and Karnaugh maps. These gates can then be reduced/re-used. This will be a large circuit!

You could look for a chip that provides this function--the documentation for it might show the circuit diagram.

Related