My brother got this at school I cant help him with, I am thankfull for any help/advices

On a street there are 2 traffic lights - one for people and one for cars.

Both traffic lights have a button for switching.

1) Traffic lights can only show "green" and "red"

2) If the cars are green, the pedestrians have red

3) one of the two buttons is pressed, the traffic lights change the state

Draw a circuit.

What I tried (not correct and kinda without any sense I guess):

enter image description here


Our final solution (not sure if correct or not - using 1 button to switch only)

enter image description here

  • 1
    \$\begingroup\$ Do you have to use an adder? I would have thought a latch or flip-flop would be more appropriate. \$\endgroup\$ – brhans Jan 11 '17 at 14:25
  • \$\begingroup\$ @brhans yes we have to, its their topic at the moment. Do you have a hint for me how we can solve this using an adder? Thank you in advance taking ur time \$\endgroup\$ – piguy Jan 11 '17 at 14:26
  • \$\begingroup\$ I read the question as saying: (a) normally, T=Green and P=Red; (b) while one switch (not none, not both) is pressed then T=Red and P=Green. What made you put 'half/full adder' in the title? It looks to me like it needs 2..4 gates, depending on how illustrative one wants to draw it. Do those gates needs to be particular types of gates, is the point of the exercise to understand particular gates? \$\endgroup\$ – TonyM Jan 11 '17 at 14:29
  • \$\begingroup\$ @TonyM I am sorry if I asked my question not very good. What I wanted to say is that both switches have the task to switch the lights (same task) from green to red / red to green (depending to the previous colour). In the beginning cars got green and people red. If one of the buttons gets pressed people get green and cars red (and so on). My brothers teacher asked them to solve this using an adder and I am totally lost \$\endgroup\$ – piguy Jan 11 '17 at 14:33
  • 2
    \$\begingroup\$ After repeatedly stating that you were required to solve this using an adder your final solution doesn't contain an adder. Am I missing something here? \$\endgroup\$ – Andrew Jan 11 '17 at 17:31

Using an adder seems like an odd way to solve the problem but I think the teacher is looking for something along the lines of this:

Use a 1 bit full adder with it's output starting at 0.

Car red and people green = adder output.
Car green and people red = not adder output.

The 3 inputs to the adder (a,b and carry) are the two buttons and the current output of the adder.

So when a button is pressed the adder output increases (or if it's 1 wraps around to 0) and the lights change.

You would need to include a latch or play games with clocks to prevent the system counting as fast as possible while a button is held down.

It all seems a little overly complex but I can't see how else you would do it using an adder. A latch and a couple of logic gates would be a lot easier. I am making the assumption that the buttons are momentary. i.e. press and release the button and the lights change state and remain in the new state.

  • \$\begingroup\$ Thank you for your answer - I am doing this right so far? imgur.com/a/ZHAWV \$\endgroup\$ – piguy Jan 11 '17 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.