# Checking Truth table and K-Maps for a two-way traffic light

#### ramwen0

Joined Jan 24, 2024
4
Hi everyone, I've been assigned to work on a two-way traffic light system, for cars and pedestrians.
I have made a state and truth table, along with some K-Maps I've attempted but are most probably wrong, which are available in the attached file.
Based on that, I'm stuck on how to do the K-Maps, I've tried but the expressions I get don't translate to the output I'd want them to, sometimes two lights light up in the same system, sometimes none, or it just doesn't change lights at all (I've tried making this a few times already). So I'd like some help on that, so that I could implement the circuit
Thank you!!

#### Attachments

• 65.3 KB Views: 11

#### dl324

Joined Mar 30, 2015
16,922
Welcome to AAC!
It would be helpful if you posted the complete text for the problem so we can try to understand what you've given us.

#### ramwen0

Joined Jan 24, 2024
4
Welcome to AAC!
It would be helpful if you posted the complete text for the problem so we can try to understand what you've given us.
the guidelines I have for the circuitry are:
● Under normal conditions, the traffic lights for vehicles are green, and the traffic lights for pedestrians
it's red;
● If the speeding sensor is activated by a vehicle, the vehicle's traffic lights should change to yellow, stay yellow for 2 clock pulses, and then change to red;
● The pedestrian traffic light must turn green on the 2nd pulse of the clock after the vehicle traffic light turn red;
● After the pedestrian traffic light changes to green, it must remain green for 8 pulses of the clock, then change to yellow, remain yellow for 2 clock pulses and finally, change to red;
● The vehicle traffic lights must change to green on the 2nd pulse of the clock after the traffic lights. pedestrians turn red;
● If the pedestrian crossing button is activated, the vehicle traffic lights must change to yellow, stay yellow for 2 clock pulses, change to red;
The system must also include a 7-segment display that shows pedestrians how many cycles of the clock remains until the traffic light changes from green to yellow.

Hope this helps!

Last edited:

#### dl324

Joined Mar 30, 2015
16,922
What kind of intersection is it? 4-way?

Is that the description from the teacher or a translation? It isn't presented in a format that's easy to comprehend; at least for me...

#### ramwen0

Joined Jan 24, 2024
4
What kind of intersection is it? 4-way?

Is that the description from the teacher or a translation? It isn't presented in a format that's easy to comprehend; at least for me...

It's a one-way with a pedestrian crossing.

#### dl324

Joined Mar 30, 2015
16,922
It's a one-way with a pedestrian crossing.
Was a diagram included with the problem?
Under normal conditions, the traffic lights for vehicles are green, and the traffic lights for pedestrians
it's red;
Pedestrians usually have walk or don't walk signs, not red/green/yellow.
If the speeding sensor is activated by a vehicle, the vehicle's traffic lights should change to yellow, stay yellow for 2 clock pulses, and then change to red;
A speeding vehicle causes the light to turn yellow for vehicles behind it?

#### ramwen0

Joined Jan 24, 2024
4
Was a diagram included with the problem?
Not at all, I was tasked to make one, and I did, I can also add the ASM model I have for it if you'd like me to.

Pedestrians usually have walk or don't walk signs, not red/green/yellow.
In this case it's specified they have red/yellow/green, although it is indeed odd.

A speeding vehicle causes the light to turn yellow for vehicles behind it?
Yes indeed, according to the problem specifications.

#### dl324

Joined Mar 30, 2015
16,922
I was tasked to make one, and I did, I can also add the ASM model I have for it if you'd like me to.

I can't understand the information you posted.

I count 6 variables (assuming 1 way traffic because nothing in the requirements made me think 2 way). Can you solve kmaps with that many variables?

Last edited:

#### tonyStewart

Joined May 8, 2012
131
It's a different country, maybe different Traffic lights.

I recall Scottish Engineers from Cumbernauld shaking their heads at our lights in Winterpeg with flashing Red arrows and flashing green and yellow means drive like crazy.

A 2-state counter needs 1 D-FF with Q! to D.
An 10 stage counter needs 3 bits or a Johnson Counter
17 states can be the sum of all counters as long as you consider the master clock and outputs with latency to avoid a race condition.
If the Pedestrian async input occurs during Car Speed Detect(CSD) =1 the state input must wait at 2 clk cycles. But if CSD=0 when Request Walk (RW) =1 I guess that means it is undefined how soon the vehicle lights can change to Yellow(2 or 0?)+2 then Red(+2) then (+2) =Walk Green with 8 seconds on the counter. If there is no car near (?) this is not a normal situation, to initiate Yellow immediately, but implied.

The rest is combination logic unless you define the master clock sync'd to the start of an async input event. (Here they make you wait several minutes.)

Last edited: