Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > implementation of traffic light...

Reply
Thread Tools

implementation of traffic light...

 
 
danddad61@gmail.com
Guest
Posts: n/a
 
      05-24-2013
hi all,
i'm new in the area of vhdl.
and i need to do a traffic light that turn the red light for 10 second.
the yellow light to 4 second and the green light for 2 seconds.
it's maybe sound simple program in vhdl.
but who can help me and say how to program it.
and what is the machine statement for this.
thank's all...
 
Reply With Quote
 
 
 
 
Thomas Stanka
Guest
Posts: n/a
 
      05-24-2013
On 24 Mai, 13:39, (E-Mail Removed) wrote:
> and i need to do a traffic light that turn the red light for 10 second.
> the yellow light to 4 second and the green light for 2 seconds.


Tell your teacher that no one needs such a ridicoluos bad traffic
light. He missed a yellow phase between green and red, together with
only 2 sec green this will lead to horrible traffic jams.

> it's maybe sound simple program in vhdl.
> but who can help me and say how to program it.


architecture programm of trafficjam is
type traffic_light_t is (red, green, yellow);
begin
program: process
variable traffic_light is traffic_light_type;
begin
traffic_light := red;
wait for 10 sec;
traffic_light=yellow;
wait for 4 sec;
traffic_light = green;
wait for 2 sec;
end process;

> and what is the machine statement for this.
> thank's all...


You sure you will manage to do the following steps to your master of
copy&paste yourself?

best regards

Thomas
 
Reply With Quote
 
 
 
 
danddad61@gmail.com
Guest
Posts: n/a
 
      05-24-2013
Hi Thomas,
first of all thank's for the fast reply.
i don't know also why he want such a traffic light.
about your program...
i don't need to initialize an entity at all?
something like:
entity lights is
port (CLK: in STD_LOGIC;
GO_GREEN: in STD_LOGIC;
GO_RED: in STD_LOGIC;
GO_YELLOW: in STD_LOGIC;
LIGHT_GREEN: out STD_LOGIC;
LIGHT_RED: out STD_LOGIC;
LIGHT_YELLOW: out STD_LOGIC);
end;
and what the circle that the traffic light need to do?
when the green light finish he need to go back to be red and so on...
how he do that in your code? and how i do it in real?
and what about a clk, i don't need to use one for geting a real seconds?

thank's
dan
 
Reply With Quote
 
John Speth
Guest
Posts: n/a
 
      05-24-2013
On 5/24/2013 7:34 AM, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hi Thomas,
> first of all thank's for the fast reply.
> i don't know also why he want such a traffic light.
> about your program...
> i don't need to initialize an entity at all?
> something like:
> entity lights is
> port (CLK: in STD_LOGIC;
> GO_GREEN: in STD_LOGIC;
> GO_RED: in STD_LOGIC;
> GO_YELLOW: in STD_LOGIC;
> LIGHT_GREEN: out STD_LOGIC;
> LIGHT_RED: out STD_LOGIC;
> LIGHT_YELLOW: out STD_LOGIC);
> end;
> and what the circle that the traffic light need to do?
> when the green light finish he need to go back to be red and so on...
> how he do that in your code? and how i do it in real?
> and what about a clk, i don't need to use one for geting a real seconds?


This is the part where you get to do the work now. Mr Stanka threw you
a very generous bone. He probably already has his EE degree. It's time
for you to earn yours.

I recommend you experiment and iterate using a test bench simulator.
That's where you'll find your answers.

JJS


 
Reply With Quote
 
Thomas Stanka
Guest
Posts: n/a
 
      05-26-2013
On 24 Mai, 16:34, (E-Mail Removed) wrote:
> Hi Thomas,
> first of all thank's for the fast reply.
> i don't know also why he want such a traffic light.
> about your program...
> i don't need to initialize an entity at all?


You always need an entity. Don't expect me to write basics down for
you. The code from me is not even syntactically correct.

You asked for a program, and I gave you one. It will do what is needed
include looping infinite, but you cannot expect this to be simple
converted into real hardware.

To get real hardware you would need first to learn the difference
between a program (software) and a circuit (hardware). If you don't
know these differences, and understand why there is a reason to have
both possibilities in VHDL you will have a hard time till you have
your first own circuit running.

If you think about a circuit, you need to think about hardware
representations for time, lightbulbs, and so one. But why would this
circuit traffic light have some inputs called "go_green"?
This is a question to be answered by the guy who invents the system.
If you like me to invent your system, you should be able to pay me.
Else it will be your task.

> and what about a clk, i don't need to use one for geting a real seconds?


Yes you will need a source that allows you to tell, when a second has
passed. This can be a (precise) clock for your design, or an cyclic
pulse that is not used as clock in your design, but represents a clock
on system level.

bye Thomas


 
Reply With Quote
 
rickman
Guest
Posts: n/a
 
      05-27-2013
On 5/24/2013 10:34 AM, (E-Mail Removed) wrote:
> Hi Thomas,
> first of all thank's for the fast reply.
> i don't know also why he want such a traffic light.
> about your program...
> i don't need to initialize an entity at all?
> something like:
> entity lights is
> port (CLK: in STD_LOGIC;
> GO_GREEN: in STD_LOGIC;
> GO_RED: in STD_LOGIC;
> GO_YELLOW: in STD_LOGIC;
> LIGHT_GREEN: out STD_LOGIC;
> LIGHT_RED: out STD_LOGIC;
> LIGHT_YELLOW: out STD_LOGIC);
> end;
> and what the circle that the traffic light need to do?
> when the green light finish he need to go back to be red and so on...
> how he do that in your code? and how i do it in real?
> and what about a clk, i don't need to use one for geting a real seconds?
>
> thank's
> dan


I don't know what grade you will get, but I think your professor should
get an F for how poorly he has prepared you for this assignment. If you
don't understand VHDL well enough to know what is happening in the
program Thomas gave you and what the problems are with using it, there
is no chance you will complete this assignment.

What book are you using? Where are you in the book. What has been
covered in class so far?

Here is a hint... "wait for xxx sec;" is not synthesizable in hardware.
So you need to think of another way of controlling the timing. If you
weren't using an HDL, but were designing this using schematics, how
would you control the timing?

--

Rick
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing Question - How to send default internet traffic to PIX and VPN traffic from router out internet Evolution Cisco 1 02-27-2007 10:00 PM
FTP outward traffic causing "Unidentified IP traffic" error on ISA 2004 server connected to a PIX quentinhudson@hotmail.com Cisco 0 05-31-2006 11:43 AM
How does typical ISP traffic shaping/bandwidth limiting work ? Do ISP's allow bursty traffic per second ? Skybuck Flying Cisco 0 01-19-2006 08:50 PM
traffic-shaping limit ftp traffic Hypno999 Cisco 5 10-08-2005 07:25 AM
Traffic Log-Legitimate Traffic or Data Mining??? Jeff Computer Security 11 08-10-2004 01:08 AM



Advertisments