Traffic Light circuit

Thread Starter

shahnawazpathan7

Joined Jan 14, 2019
19
Dear Fellows,

I am designing a Traffic Light circuit with following requirements-

Input 1 corresponds to Green Light only.
Input 2 corresponds to red light only.
If both in inputs active- No output
Both inputs inactive- Green Light On.

Inputs are being applied from two different sources hence they are required to correspond to respective light only. I have tried with truth tables for none of the logic is working for me. I have another idea of direction based detection but still didnt find anything.

your ideas are welcome.

Regards,
Shan
 

Picbuster

Joined Dec 2, 2013
1,047
use switch statement

switch ( input_1 + 2 * input_2)
{
case 0: / / zero green
break;
case 1: // 1 on 2 off green
break;
case 2: // 1 off two on red
break;
case 3: // one on two on green
break;
}

Use a pic 10fxxx of 12fxxx

Picbuster
 

Thread Starter

shahnawazpathan7

Joined Jan 14, 2019
19
use switch statement

switch ( input_1 + 2 * input_2)
{
case 0: / / zero green
break;
case 1: // 1 on 2 off green
break;
case 2: // 1 off two on red
break;
case 3: // one on two on green
break;
}

Use a pic 10fxxx of 12fxxx

Picbuster

Hi Pic,
Thanks for your reply.
I am looking for something hardware related solution, not software.
regards,
Shan
 

WBahn

Joined Mar 31, 2012
30,060
Since this is clearly some type of assignment, you need to show your best attempt at a solution or what, specifically, you have done to try to start down that path. We can then help guide you along the way. We are not supposed to just give you the solution -- that would rob you of most of the learning opportunity that the assignment is intended to provide.

Since you say that you tried truth tables and logic based on it, how about presenting your truth table and the logic you tried to use based on it?
 

Thread Starter

shahnawazpathan7

Joined Jan 14, 2019
19
Since this is clearly some type of assignment, you need to show your best attempt at a solution or what, specifically, you have done to try to start down that path. We can then help guide you along the way. We are not supposed to just give you the solution -- that would rob you of most of the learning opportunity that the assignment is intended to provide.

Since you say that you tried truth tables and logic based on it, how about presenting your truth table and the logic you tried to use based on it?

HI,
According to my application condition 0-0 comes twice where in first it should give output but in second it should not. So I traced out direction based detection.

Thanks.
 

danadak

Joined Mar 10, 2018
4,057
Do you have to do a HW design from scratch ? Is task focused on HW only
or HW and SW, any mix you want. Is this first State Machine design you have
tackled ?

Regards, Dana.
 

djsfantasi

Joined Apr 11, 2010
9,163
HI,
According to my application condition 0-0 comes twice where in first it should give output but in second it should not. So I traced out direction based detection.

Thanks.
Yes, but...

Where are your truth tables? From your description, I don’t see where 0-0 occurs twice with different outputs?

Please post your work.
 

danadak

Joined Mar 10, 2018
4,057
There are HW designs out there, single chip, one in specific very well known
by universities, but that does nothing for you in terms of basic learning. State
machines core of digital design. Like Ohms law is to analog State Machine
is to digital.

I find most important step, as a visual learner, is to write down a list of events/values/
states, that has to occur, then start codifying into state table. Even though you will
initially miss stuff it becomes fairly obvious when you get the starting list down.

Pontificating.......


Regards, Dana.
 
Last edited:

WBahn

Joined Mar 31, 2012
30,060
HI,
According to my application condition 0-0 comes twice where in first it should give output but in second it should not. So I traced out direction based detection.

Thanks.
As best I can tell, your "application condition 0-0" is when, per your stated requirements, "Both inputs inactive- Green Light On."

We are not going to go round and round with you trying to get you to show your work for very long -- you want free assistance from strangers on the internet, then SHOW YOUR WORK!
 
Top