# 2 flip flops connected together.

#### Brigen

Joined Jun 20, 2023
8
I am trying to arrange these relays in a manner so that it follows the following sequence upon pressing and releasing the momentary push button.
When the push button is pressed first, relay 1 comes on and when it is released, relay 2 comes on.
When the push button is pressed again, relay 1 and 2 comes off and relay 3 comes on. When it is released, relay 2 come on.
When the push button is pressed again, relay 2 comes off and relay 1 turns on and then when it is released, relay 1 turns off. At this point all the relays are off.
I am stuck on how to proceed from the second push onwards.
Any help would be appreciated.

#### Attachments

• 154.4 KB Views: 9

#### LowQCab

Joined Nov 6, 2012
3,581
What is this Switching arrangement supposed to accomplish ?
What is it's purpose ?
.
.
.

#### Brigen

Joined Jun 20, 2023
8
It’s just to demonstrate how a shift register could work. It’s an assignment

#### AnalogKid

Joined Aug 1, 2013
10,786
A shift register does not normally transfer information on both edges of the clock (button-press and button-release). Also. there are some aspects of your description that sound more like a counter than a shift register. Also, the most basic version of a shift register circuit has an unchanging input to the first stage that is propagated one stage down the register with each clock.

I suggest that you make a truth table for the outputs, with one row for each edge of the clock. For example, three button presses would be six rows in the table.

Is this school work?

ak

Last edited:

#### crutschow

Joined Mar 14, 2008
33,355
Yes, please post a truth table with the exact sequence of events you want.
What you want is not a normal shift-register.
What type of flip-flops are you using?

#### Brigen

Joined Jun 20, 2023
8
this is the truth table that the circuit shills operate on.

#### Attachments

• 159.7 KB Views: 3

#### BobTPH

Joined Jun 5, 2013
8,104
The brute force method would be to start with a circuit that that produces a clock pulse on button down and another on button up. This could be tricky due to bounce and varying timing.

Then you run these clock pulses into a 3-bit counter since you have seven states.

Then use logic gates to derive the relay states from the outputs, and to reset after count 6.

#### crutschow

Joined Mar 14, 2008
33,355
As noted, how do you expect to get that many states (I count 6) from 2 flip-flops, which have 4 unique states maximum.

If you use a mechanical switch, then you need a debounce circuit so you will get only 1 pulse per change of the PB state.

That debounced signal can then go to a XOR gate with an RC delay to one input, to give a pulse on both the press and release of the PB.

That pulse signal can then clock the toggle flip-flops configured as a counter.

#### BobTPH

Joined Jun 5, 2013
8,104
states (I count 6)
Oh, right, the last line in his table is the same as the first.