[HELP] Circuit simulator help - Semaphore

ThunderbInazuma

Well-Known Member
OP
Member
Joined
Aug 31, 2015
Messages
507
Trophies
0
Location
Under Your Bed
XP
2,091
Country
Portugal
Hi guys.

I'm in the middle of a school project that I need to create, with a simulator called Logisim. What I need to do is to create a semaphore for cars + pedestrians that work as 4 states:

  • State A - Cars Green; Pedestrians Red
  • State B - Cars Yellow; Pedestrians Red
  • State C - Cars Red; Pedestrians Green
  • State D - Cars Red; Pedestrians Red
The circuit goes on as A->B->C->D with the clock. However, when it is on state A, it stops there waiting for a pedestrian input (click on button) and, on C, it is supposed to use a counter before it changing state.

I've been trying to get the equations for the Flip Flops to resolve the problem during 2h, but I can't seem to reach anywhere. I know that we need only 2 FF to make 4 states ( 00,01,10,11) but I can't seem to get the changes on the Leds (that simulate the Semaphore). Can anyone help me to reach something?

Thanks in advance.
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,348
Country
United Kingdom
I fear I have spent too long considering micro controllers as even a 2c thing would probably handle this just fine. We shall do it in basic principles though.

Slightly expensive method.
You say you have 4 states but to me it seems like adding another binary digit (which may well be unused in most states) you could add another level of functionality and with it.

To start with three bits per state. Have the highest bit indicate a timer in running/active. Pressing the button can then trigger this timer state and after finishing state D it then resets the button/timer bit and allows the process to happen all over again. You may have to do something about the button so you can't press it in the middle of state C and have it mess something up.

You say it happens on a timer but specifically mention C after that. Is the timer there special? If it needs to run for longer why not do ABCCD (or ABCCCD...), or do you mean it also has to display a counter while it is running in that state? Is the counter a standalone circuit you can just fire with a transistor or something?

Going back to states then I would next look at the outputs.
You have three for cars and two for pedestrians, not all combinations can happen which make some kind of multiplexer an option but let us not go there. The big question is do you combine the outputs into one logical pool or treat them as separate? Separate works for me for this. Also are you using colour changing LEDs and if so what method do they change by? In the real world I might have some kind of lockout on the lights so if a fault occurs I can never have both be green. While anticipating things are you going to be asked to expand this (now you have a cross junction or something) as some effort now might help you later? I don't know if you will for your projects but it is a pretty classic move to teach people to design for future expansion.

100 (the rest/cars green state)
000
001
010
011
back to
100

if
100 PED red
000 PED red
001 PED red
010 PED green
011 PED red

Sadly can't key of a single bit for this one, at least if your clock counts in binary and you reset after D (reset after C and it could be done).

Can use two gates though

Do an XOR of the lower two bits. Take the output of that and NAND it with the lower bit.

if
100 CAR green
000 CAR green
001 CAR yellow
010 CAR red
011 CAR red


NOR lower two bits green
simple transistor or whatever off lower bit for yellow.
OR lower two bits for red.

That would leave yellow on as well as red at some points, and not in the same way it exists in some countries. Maybe run the middle bit through a NOT gate and then feed that and the lower bit into an AND gate. Alternatively the middle bit will be high when the red is on and no other time so that could be used from a simple transistor.

The timer can be switched off with an AND of the lower two bits.
 

ThunderbInazuma

Well-Known Member
OP
Member
Joined
Aug 31, 2015
Messages
507
Trophies
0
Location
Under Your Bed
XP
2,091
Country
Portugal
Hi! Thanks for your answer. I didn't remember that way of maintaining C there (repating it). I achieved to make the circuit like this.
upload_2017-11-22_20-48-35.png
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    BigOnYa @ BigOnYa: Ok good chatting, I'm off to the bar, to shoot some pool, nighty night. +1