# Designing Shift Registers

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

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

Sep 13, 2010
735
43
I've got a few questions for some shift registers I've got to design.

One of the registers is suppose to repeat the sequence,

1000, 0100, 0010, 0001.

As you can see, it's simply shifting the 1-bit through the 0-bits from left to right.

It doesn't say whether or not the register has to be parallel-load or serial-load so I'm assuming I can simply choose whichever I please.

A shift register like the following would do the job right? For 3 bit's atleast, not 4. I'd have to add another D FF. (See figure attached)

Now what if I wanted to do a different sequence like the following:

1100, 0110, 0011, 1001.

How would I alter my shift register above to obtain this sequence?

Thanks again!

File size:
10.6 KB
Views:
150
2. ### Kermit2 AAC Fanatic!

Feb 5, 2010
3,852
968
You would just have to add a 'carry' bit on the 4th FF and loop that bit back to the input on FF #1.

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

Sep 13, 2010
735
43

How do I add a 'carry' bit?

I'm not entirely sure what that is. The only time I've heard this terminology was when we had a shifter circuit using MUX's and we wanted to remember the value of the bit on the end after it has been shifted.

Can you explain in more detail please?

Feb 5, 2010
3,852
968
5. ### jegues Thread Starter Well-Known Member

Sep 13, 2010
735
43
Okay so your basic "Ring counter" will easily cover sequence number 1, (i.e. 1000, 0100, 0010, 0001) but I'm still a little confused on how to modify this in order to obtain the following sequence:

1100, 0110, 0011, 1001.

The circuits in that figure always have only one 1, I need two 1's.

How can I incorporate another 1-bit into my ring counter?

6. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Man, how many assignments do you have per day anyway? And they are all different somehow! In which college do you go?

The ring circuit is good to go. As for the input, as you said, you can choose between serial or parallel. Remember the shift register with Left/Right Shift you did previously? It was an example for parallel loading. You could use that schematic too.

If you load paralelly, just load the 4 bits you want to rotate in the first clock, and rotate them in the next pulses.

If you load serially, you must specify a "first" FF on which the input will be loaded. For the four first pulses, you must load the 4 bits you want to rotate. From the fifth pulse and on just close the loop and let the numbers rotate endlessly.

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

Sep 13, 2010
735
43
Okay I've got some questions about if I choose to load serially. For the most part your explanation is clear and makes perfect sense but you skip over a bunch of "little" practical details that have to been answered.

You say that I have to load the first 4 bits I want in the first four clock pulses and close the loop from the fifth pulse on.

How do I do that? I have to design this circuit in quartus and implement on a breadboard and I just don't know how I could do such a thing.

What's missing?

8. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Do you have to go serial? Paralel load will make your life much more easy.

For a serial load, you can use a 2-to-1 MUX to select the input in the first FF. Either it will come from the last FF or from the data input.

A manual clock will make your life easier. Just have the MUX (controled by a switch) allow the input data in the first FF. The data will be created by antoher switch. Hit the clock four times, each time changing the input data as desired. After you are done, have the MUX allow the loop data and from then on, just hit the clock button.

Draw a schematic before implementing it. There are some issues I want to discuss about the manual clock.

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

Sep 13, 2010
735
43
It says we are allowed to use the 4-bit Bi-directional Universal Shift Register IC 74194.

With this shift register we have the ability to use a parallel load, as well as shifting towards the right.

So really all we should have to do is setup it up that it loads the correct combination of bits, and after having done some, contiously shift to the right.

Scenario 1:

-Continously shift right

Scenario 2:

-Continously shift right

So in quartus I'll have this IC, and I will have 4 inputs running into it. These inputs will be mapped to switches I have on my breadboard.

This way I can load any combination I want, I just have to set the switches accordingly.

The part I'm confused about is how do I get it to loop the shift right function AFTER loading my bits?

10. ### Kermit2 AAC Fanatic!

Feb 5, 2010
3,852
968
Go back and read more in the pdf file I linked to, up above.

It has sections on how to control shift direction and how to change between data input and ' loop' connection

11. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
After so many assignments you should start to think how you can combine the things you have learnt.

How about a 2-to-1 MUX, that is controlled by the Load signal that controls the register too?

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

Sep 13, 2010
735
43
But I don't need to know how to control shift direction right? Because the IC will be doing it for me.

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

Sep 13, 2010
735
43
Here's what I came up. (see figure attached)

Okay so the any combination of 4 digit bits can be loaded into the register using the 4 switches associated with s0,s1,s2,s3.

If load = 0, then the register will contiously shift the bits s0,s1,s2,s3 right.

If load = 1, the register will contiously clear itself, allowing me to change s0,s1,s2,s3 to the appropriate bits. After having done so, I can switch load from 1 to 0 and have it contiously shift it to the right again.

How's that?

File size:
93.9 KB
Views:
85
14. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
On the pin diagram of the IC notice that clear has a dot on its input. That means that it is activated when it is fed LOW. Thus the IC will clear when you give it 0 and plan to shift the data.

You cannot clear the IC and Load it at the same time. Clear doesn't last for a moment and then lets you load data. For as long Clear is LOW, the outputs of the IC will be all 0.

You don't have to use clear. Load command replaces any data with the ones you input.

Will you use manual or automatic clock?

Post a full diagram of the ciruit. Or your attempt at it if you can't nail it.

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

Sep 13, 2010
735
43
It doesn't specify but my guess is that it'd be automatic. I dont know what I should add on my diagram.

You've told me I don't need to use clear, I just have to load the correct inputs and shift them to the right.

So I would just connect shift right to another switch, set my inputs accordingly, and flip the switch connected to shift right once my inputs have been loaded.

Then at every pulse of the clock it will shift my inputs right, completeing the sequence.

If I need the sequence 1100, 0110, 0011, 1001.

Then I'll simply load the desired values of S0,S1,S2,S3 and have it continue to shift right.

Last edited: Oct 25, 2010
16. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
Yes, but, read the datasheet first.
Notice that when shifting, the values that will enter from the one part of the register won't be the ones on the other end of the sequence. Instead, there are specific input pins that give their data as new input in the register. Pins 2 (Shift right serial input) and 7 (Shift left serial input) do this job.

You have to manually close a loop from the last output bit to the correct Shift serial input.

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

Sep 13, 2010
735
43
After all the work I've done on shift registers recently, I can honestly that I'm still pretty lost.

I'd love to give designing it another shot, but I'm still in the dark as to what to do at the moment.

I'm going to give the data sheet another look and try and understand what you're telling me.

Any other tips/hints/suggestions you have for me, please feel free the post.

18. ### Georacer Moderator

Nov 25, 2009
5,151
1,266
All I am saying is that you should notice the fact that this IC does not circulate that data while shifting; it just dumps them out of it. You must connect the output that contains the bit to be dumped next with the Serial In pin, in order to have the data circulate.