# Shifter Circuit using Multiplexers.

Discussion in 'Homework Help' started by jegues, Oct 20, 2010.

1. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
45
See figure for problem statement, as well as my attempt.

I tried to come up with this truth table on my own from figure 2 but I couldn't do it.

I couldn't see what "k" is or how to use it. So when I read this truth table of course I don't know what "h" is either, and how to use it.

The only childish sort of logical reasoning I could come up with for this is truth table is that when Left = 0, and Right = 1, the circuit will shift the input vector W one bit to the right.

So my output should be,

W0W3W2W1

Why does k contain W0? The only way I can remember what to write is if I ask myself, "When I shift my circuit either left or right what bit (In this case, W0) "falls" into the next column? We can see that the W0 bit will fall into the "k" column.

Likewise for the case Left = 1 and Right = 0.

Can someone explain this stuff to me. I've tried the question numerous times even after seeing the solution but I can never work my way to the same solution without referencing it.

Thanks again.

File size:
109.8 KB
Views:
158
File size:
45.1 KB
Views:
132
2. ### Georacer Moderator

Nov 25, 2009
5,177
1,285
Where did you find that truth table? Is it supposed to describe the circuit figured or the circuit you are requested to make?

3. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
45
The circuit we are requested to make, it's from the solutions.

4. ### Georacer Moderator

Nov 25, 2009
5,177
1,285
Let's get our facts right.
You need to make a shift circuit, not a shift register. That means that the output won't be fed back to the input, as you don't have to hold it. Just read your feed, and slide it on demand.
Shift circuits usually have a "carry" in and a "carry" out bit, that retains the information that was kicked out. I guess this is what h and k are supposed to represent; the left and right carry. However there is a conflict in the schematic posted. K has a dedicated MUX just for itself, which means that we need to hold the information when it's out of the MUX's. But this is unnecessary since this bit is fed back on the first bit of the quadruplet anyway.

Since all the above shows that the exercise is a little vague, I will specify some working conditions and give the solution according to them. We want our circuit to:

• Take a 4 bit input
• Be able to shift (not rotate) those 4 bits to the left or to the right by demand
• Not keep the information that leaves the edges
See how the schematic uses the 2-to-1 MUX in order to drive one time the input above and the other the input next to it? That works fine for a single direction. For bidirectional slide we will need each MUX to get 3 inputs, which leads us to use 4-to-1 MUXs.
Lay 4 of them in a row and connect them appropriately. One input of each MUX will be hanging, but we don't care about it. Don't forget to connect the Selection Signals on the MUXs. They will be 2 bits and common for all the MUXs.

Post a schematic following the above instructions, so we can discuss over it.

5. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
45
Here's my circuit. I'm not going to lie I peaked at the solutions a little bit, but other than that I just based it off the truth table I derived.

EDIT: I'm missing the wires connected to 00. Of course these would simply be, W0, W1, W2, W3 connected to the multiplexer below it, causing no shift.

• ###### SHIFTERA2.JPG
File size:
182.2 KB
Views:
122
Last edited: Oct 21, 2010
6. ### Georacer Moderator

Nov 25, 2009
5,177
1,285
I see the circuit ended up being a rotational shifter after all. I still don't understand what purpose the outputs h and k serve for this particular assignment. Maybe an illuminated professor could give us the answer? Is it a part of a greater plan?

7. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
45
My professor for digital logic is useless. You've probably noticed this by all the questions I end up posting on this forum.

Maybe they didn't state the question properly?

8. ### Georacer Moderator

Nov 25, 2009
5,177
1,285
If the question is taken straight out of the textbook, the professor can't take all the blame (only half of it). Sometimes a question can contain elements of theory that have a connection to more advanced matters without telling you. The plan is to introduce you to some advanced aspects of the lesson little by little, and when these topics will be brought up you will already have an idea of what they are taliking about.

Just don't let a poor professor ruin your opinion of the lesson itself. It would be very unfair for the subject.

9. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
45
Well I'm still at loss as to why we have "carry out" and "carry in" bits for this shifter.

It doesn't seem like they would do anything for the question we've been asked. Without them the circuit will still shift just fine.

Is there a reason I should keep them?

10. ### Georacer Moderator

Nov 25, 2009
5,177
1,285
I would leave them out. The exercise doesn't ask for them explicitly. As for your professor, I don't think he 'll give much attention to a single textbook question.

Judging from the volume of your posts, it's one of the many.