Question

Please use system verilog:

03. Using FSM technique, write an HDL code for a traffic light controller with 3-bit active-high outputs (Red, Amber, and Gre

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

--VHDL Code

library ieee;
use ieee.std_logic_1164.all;

entity controller is
port ( trigger : in std_logic;
north : out std_logic_vector(2 down to 0);
east : out std_logic_vector(2 down to 0);
south : out std_logic_vector(2 down to 0);
west : out std_logic_vector(2 down to 0)
);
end controller;

architecture arch of controller is

type state is (S0, S1, S2, S3);
signal present_state, next_state : state;

begin

process (present_state)

begin

case present_state is

when S0=> north <= "100"; east <= "001"; south <= "100"; west <= "001"; next_state <= S1;
when S1=> north <= "100"; east <= "010"; south <= "100"; west <= "010"; next_state <= S2;
when S2=> north <= "001"; east <= "100"; south <= "001"; west <= "100"; next_state <= S3;
when S3=> north <= "010"; east <= "100"; south <= "010"; west <= "100"; next_state <= S0;
when others => null;
end case;

end process;

process (trigger)

begin

if rising_edge (trigger) then
present_state <= next_state;
end if;

end process;

end arch;

--Simulated on MultiSim

- - x o Wave File Edit View Wave Default Add Format Tools Bookmarics Window Help 3+ * Search: + 100 10010101100 001 + + contrPlease give me thumbs up,if you like the answer .
Please let me know if you don't understand any step before giving Down rating directly :). Happy to help

Add a comment
Know the answer?
Add Answer to:
Please use system verilog: 03. Using FSM technique, write an HDL code for a traffic light...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 4: Develop a state machine diagram for a traffic light controller that works as follows: A...

    4: Develop a state machine diagram for a traffic light controller that works as follows: A timing signal T is the input to the controller. T defines the yellow light interval, as well as the changes of the red and green lights. The outputs tothe signals are defined by the following:GN Green Light, North/South SignalYN Yellow Light, North/South Signal RN Red Light, North/South SignalGE Green Light, East/West SignalYE Yellow Light, East/West SignalRE Red Light, East/West SignalWhile T 0 the green...

  • Design a finite state machine for a traffic light at the intersection of north-south traffic and...

    Design a finite state machine for a traffic light at the intersection of north-south traffic and east-west traffic. The light can be red, green or yellow. Assume a 30 second clock. Assume that the light will change only if a car is coming in the other direction. If cars are in both north-south and east-west, the light will change from one direction to the other.                                                         What are the machine states? What are the inputs? What are the outputs? Draw state...

  • Design a finite state machine for a traffic light at the intersection of north-south traffic and...

    Design a finite state machine for a traffic light at the intersection of north-south traffic and east-west traffic. The light can be red, green or yellow. Assume a 30 second clock. Assume that the light will change only if a car is coming in the other direction. If cars are in both north-south and east-west, the light will change from one direction to the other. What are the machine states? What are the inputs? What are the outputs? Draw state...

  • 3- Traffic Light Controller The diagram of figure 4 implified traffic light controll ents an intersection...

    3- Traffic Light Controller The diagram of figure 4 implified traffic light controll ents an intersection of a main road (North-South) and a side road (East-West). The er cycles the light (Red, Yellow, and Green) every one minutes for the side road and every three minutes. for the mairn Assuming t ming that a Llso, the controller ensures that the Red (N-S) and Red (EW) lasts for three l minute clock source is available, then NSREO NSYELLOW NSGREEN NSRED NSYELLOW...

  • COSC/ELEN 2448: Introduction to Digital System Design LAB 12 partment is seeking a new system of...

    COSC/ELEN 2448: Introduction to Digital System Design LAB 12 partment is seeking a new system of traffic lights to be implemented at a busy pedestrian-friendly. A group of students came up intersection with the following design. on campus that is intended to be Traffic G1 Light controller- Sensor) RST ts to operate, namely the Red and Green lights in the North-South direction ), along with the Red and Green lights in the East-West direction (R2 and G2). A sensor P...

  • Designing a Traffic Light Controller [50 pts] [Your originality, thinking method and execution would be graded]...

    Designing a Traffic Light Controller [50 pts] [Your originality, thinking method and execution would be graded] In Gotham city, traffic lights have three outputs as Red (R), Yellow (Y) or Green (G). Let's assume you're given a microchip with clock input 0.2 Hz. As you know.cars can travel when the light is Green and should not pass the traffic light when the light is Yellow or Red. We are asked to design the traffic light controller in the busiest road...

  • Word Problem) Two two-way streets meet at an intersection controlled by a four-way traffic light. In...

    Word Problem) Two two-way streets meet at an intersection controlled by a four-way traffic light. In the east and west directions, the lights cycle from green to yellow to red. The south-facing lights do the same thing, except that they are red when the east-west lights are green or yellow, and vice versa. However, the north-facing lights are augmented with a green left turn arrow. They cycle red-green arrow-yellow arrow-green-yellow-red. Consider the following additional problem specifications: When the green or...

  • If anyone could give me some guidance for these questions. I know i'm chancing my arm but its worth a shot.... Thanks in advance i.Write a private instance method cycleState() which takes no ar...

    If anyone could give me some guidance for these questions. I know i'm chancing my arm but its worth a shot.... Thanks in advance i.Write a private instance method cycleState() which takes no argument and returns no value. This method cycles the value of state, from 1 to 2, from 2 to 3, from 3 to 4 and from 4 back to 1 again. (Note that the value of 0 for state is not part of this cycle). ii.Write a...

  • If anyone could give me some guidance for these questions. I know i'm chancing my arm...

    If anyone could give me some guidance for these questions. I know i'm chancing my arm but its worth a shot.... Thanks in advance i.Write a private instance method cycleState() which takes no argument and returns no value. This method cycles the value of state, from 1 to 2, from 2 to 3, from 3 to 4 and from 4 back to 1 again. (Note that the value of 0 for state is not part of this cycle). ii.Write a...

  • Please help with my car traffic simulator! Code that I already have below, I do not know how to...

    Please help with my car traffic simulator! Code that I already have below, I do not know how to start it off! public class IntersectionSimulation { private final static int EAST_WEST_GREEN_TIME = 30 ; private final static int[] NORTH_SOUTH_GREEN_TIMES = { 20, 24, 30, 42 } ; private final static int[] CAR_INTERSECTION_RATES = { 3, 5, 10 } ; private final static int[] CAR_QUEUEING_RATES = { 5, 10, 30 } ; private final static int[] EXPERIMENT_DURATIONS = { 3*60, 5*60,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT