Page 1 of 1

Exercise This design exercise is the creation of a controller for a traffic intersection. The controller is responsible

Posted: Fri May 20, 2022 11:25 pm
by answerhappygod
Exercise This Design Exercise Is The Creation Of A Controller For A Traffic Intersection The Controller Is Responsible 1
Exercise This Design Exercise Is The Creation Of A Controller For A Traffic Intersection The Controller Is Responsible 1 (166.98 KiB) Viewed 18 times
----------------------------------------------------------------------------------

-- Traffic.vhd
--
-- Traffic light system to control an intersection
--
-- Accepts inputs from two car sensors and two pedestrian call
buttons
-- Controls two sets of lights consisting of Red, Amber and Green
traffic lights and
-- a pedestrian walk light.
----------------------------------------------------------------------------------

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Traffic is
Port ( Reset : in
STD_LOGIC;
Clock
: in STD_LOGIC;

-- for debug
debugLED : out
std_logic;
LEDs
: out std_logic_vector(2 downto 0);
-- Car and pedestrian
buttons
CarEW
: in STD_LOGIC; -- Car on EW road
CarNS
: in STD_LOGIC; -- Car on NS road
PedEW
: in STD_LOGIC; -- Pedestrian moving EW (crossing NS
road)
PedNS
: in STD_LOGIC; -- Pedestrian moving NS (crossing EW
road)

-- Light control
LightsEW : out
STD_LOGIC_VECTOR (1 downto 0); -- controls EW lights
LightsNS : out
STD_LOGIC_VECTOR (1 downto 0) -- controls NS lights

);
end Traffic;
architecture Behavioral of Traffic is
-- Encoding for lights
constant RED : std_logic_vector(1 downto 0) := "00";
constant AMBER : std_logic_vector(1 downto 0) := "01";
constant GREEN : std_logic_vector(1 downto 0) := "10";
constant WALK : std_logic_vector(1 downto 0) := "11";
begin
-- Show reset status on FPGA LED
debugLed <= Reset;

-- Threee LEDs for debug
LEDs <= "000";

-- Luck North-south traffic
LightsEW <= RED;
LightsNS <= WALK;
end;
Can anyone solve this in VHDL please? Really urgent
Exercise This design exercise is the creation of a controller for a traffic intersection. The controller is responsible for controlling the traffic and walk lights for the intersection. The operation of the intersection is described by the following: For each of the following three scenarios, initially assume that the East-West traffic has had a green traffic light for a long time. o if a North-South Car is detected then the traffic lights will cycle to Green in that direction. The Walk light will not be on unless a pedestrian is detected before the lights have finished cycling to Green. If a North-South Pedestrian is detected then the lights will cycle in a similar fashion but the appropriate Walk light will be displayed for a short interval before cycling to Green for traffic only. If an East-West Pedestrian is detected then the appropriate walk light will be displayed for a short interval before returning to East-West having a green light for traffic only. Once the lights have changed to Green in a particular direction they: o Will remain green for a minimum time before another change is possible. o Will remain green unless an input situation requires the lights to cycle i.e. the lights do not cycle between directions without cars and/or pedestrians being present. If a pedestrian wishing to cross with the traffic is present and a car and/or pedestrian is present on the cross road then the lights will cycle before the 1st mentioned pedestrian is shown a walk light." The intersection is symmetrical – neither road has precedence. The description given above may be applied to the other direction with obvious substitutions being used. EEE20001 Digital Electronics Design Project Ped Car Traffic light 1 Some points to note: The pedestrian buttons will not be held. They are only pressed briefly as would be the case for real pedestrian call buttons. The car buttons may be assumed to be held since they represent car detectors in the road and would be active as long as the car was present. Cars that appear and then disappear before the lights change may be ignored! Car Ped Pedestrian walk light