# creating a circuit using half/full adder

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):

EDIT:

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

• Do you have to use an adder? I would have thought a latch or flip-flop would be more appropriate. – brhans Jan 11 '17 at 14:25
• @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 – piguy Jan 11 '17 at 14:26
• 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? – TonyM Jan 11 '17 at 14:29
• @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 – piguy Jan 11 '17 at 14:33
• 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? – 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.

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