# Having trouble constructing this sequential circuit

I am to construct a sequential digital logic Moore circuit for the back lights of a car based on the following information:

We have input: x2, x1, x0, I decided to make x0 simulate the right turn signal, x1 the left turn signal and x2 the brake pedal.

We have ouput: z5, z4, z3 z2, z1, z0

The output is supposed to be connected to 2 groups of LEDS, I decided to make z5,z4,z3 the left group and z2,z1,z0 the right group.

So this is how it's supposed to work:

If x0 = 1 and x2 and x1 = 0 then the z2,z1,z0 should sequentially light up starting with the inner LED first (z2)

If x1 = 1 and x0 and x2 = 0 then z5,z4,z3 should sequentially light up starting with the inner LED first (z3)

if x2 = 1 and x0 and x1 = 0 then the back lights will light up constantly

If either turn signal is high (x1 or x0) and the brakes (x2) is high too then the turn signal should light up sequentially as before but the other 3 LEDS should light up constantly.

I made a picture describing the situation here:

Now I have been trying to figure this one out for a while now but I end up getting a machine with at least 16 states which I feel is way too much. Is there something I'm missing?

• Please show us your state tables and state diagrams. We don't hand out homework solutions here; you have to ask a specific question. Commented Feb 8, 2021 at 19:49
• What happens with all three inputs are "1"? Or when the brake is not on but both left and right are on (x2=0, x1=x0=1?) Nice problem, by the way. Oh, and you also need to define what happens if the inputs transition in the middle of sequential transitions while either a left or right turn signal is active but where the lighting sequence isn't finished. Does it complete? Or immediately abort?
– jonk
Commented Feb 8, 2021 at 20:47
• Can you use finite state machine reduction methods or a Karnaut Map to reduce the number of registers? This reminds me of my Dad's 67 Cougar XR7 with these light sequences Commented Feb 8, 2021 at 20:47
• Cougar youtu.be/OJ9E7xLSBC8?t=65 The LED's add more drama like a Police Light from lack of risetime. Now make the LEDs turn off slowly but turn on fast Commented Feb 8, 2021 at 20:53
• Lss, you just need four states and some combinatorial logic. That's it.
– jonk
Commented Feb 9, 2021 at 7:43

In a Moore machine each state is associated with a certain output or in your case a certain 6 outputs.

Look at what combinations of the 6 outputs are repeated. Where the outputs are the same in your photo, that combination of outputs can be represented by the same state in a Moore machine.

For example outputs of 000000 occur 3 times but can be represented by the same state. Outputs of 111111 also occurs 3 times and can also be represented by a single state. 000111 occurs twice but can be represented by a single state and 111000 also occurs twice but can be represented by a single state.

I count that reduces total number of states to 12.

In a Moore machine the inputs written on the transition arrows then dictate which is the next state that the sequence transitions to from the present state.

• You're right, i counted double the everything full states. But then I have 12 states. Silly problem but tricky Commented Feb 8, 2021 at 20:09

Well, let see, you have:

State 0: Rest   ... ...
State 1: Brake  *** ***
State 2, 3, 4 Turn right
... *..
... **.
... ***
State 5, 6, 7 Turn left
..* ...
.** ...
*** ...
State 8, 9, 1 Brake right
*** *..
*** **.
*** ***
State 10, 11, 1 Brake left
..* ***
.** ***
*** ***


That's 12 states, maybe you tried to model the cases where, for example you are in the right turn and it restarts the cycle. It's not really necessary since from the rest state you proceed correctly. For example instead of, say

    State  Leds     Turn
0      ... ...  H -> 1
1      ... *..  H -> 2
2      ... **.  H -> 3
3      ... ***  H -> 4
4      ... ...  H -> 1


You simply need

    State  Leds     Turn
0      ... ...  H -> 1
1      ... *..  H -> 2
2      ... **.  H -> 3
3      ... ***  H -> 4
0      ... ...  H -> 1


since at rest the turn input is still active.

For a real-world state machine 14 states are, well, really few. Having to build that with JK flops would be however a royal pain

• Actually 13 states but I don't know who voted without comments Commented Feb 8, 2021 at 20:43
• I can't find what the 13 state is!:P what I missed? Commented Feb 8, 2021 at 20:51
• you counted *** all ON *** twice your 13th state Commented Feb 8, 2021 at 21:04