Question

In: Electrical Engineering

Design a sequential traffic light controller for the intersection of street A and street B. Each...

Design a sequential traffic light controller for the intersection of street A and street B. Each street has traffic sensors which detect the presence of vehicles approaching or stopped at intersection.

Sa=1 means a vehicle is approaching on street A.

Sb=1 means a vehicle is approaching on street B.

There are 3 outputs of each streets RedA, YellowA and GreenA, RedB, YellowB, and GreenB.

Condition: “StreetA” is a main street and has a green light for at least 50s, after 50s if there is a car approaches on “StreetB”, the light changed to yellow then red and “StreetB” has green light for 50s.

At the end of 50s, the light change back unless there is a car on “StreetB” and none on “StreetA”

Present the code and develop a waveform using the Quartus Prime 19.1 Lite edition.

Solutions

Expert Solution

library ieee;

use ieee.std_logic_1164.all;

entity traffic_light is port (clk, sa, sb: in bit; ra, rb, ga, gb, ya, yb: inout bit);

end traffic_light;

architecture behave of traffic_light is signal state, nextstate: integer range 0 to 12;

type light is (r, y, g);

signal lighta, lightb: light;

begin

process(state, sa, sb)

begin

ra<='0'; rb<='0';ga<='0'; gb<='0'; ya<='0'; yb <= '0';

case state is

when 0 to 4 => ga <='1';rb <= '1'; '; nextstate <= state+1;

when 5=>ga<='1';rb<='1';if sb='1' then nextstate<=6;end if;

when 6 => ya <= '1'; rb <= '1'; nextstate <= 7;

when 7 to 10 => ra <= '1'; gb <= '1'; nextstate<=state+1;

when 11 => ra <= '1'; gb <= '1';

if (sa='1' or sb='0') then nextstate <=12; end if;

when 12 => ra <= '1'; yb <= '1'; nextstate <= 0;

end case;

end process;

process(clk)

begin

if clk = '1' then state <= nextstate; end if;

end process;

lighta <= r when ra='1' else y when ya='1' else g when ga='1';

lightb <= r when rb='1' else y when yb='1' else g when gb='1';

end behave;


Related Solutions

A traffic light at a certain intersection is green 50% of the time,yellow 10% of the...
A traffic light at a certain intersection is green 50% of the time,yellow 10% of the time, and red 40% of the time. A car approaches this intersection once each day. We would like to know about the number of days that pass up to and including the first time the car encounters a red light. Assume that each day represents an independent trial. a) Define the random variable of interest, it support, and parameter values. b) What is the...
-Explain step by step the operation of sequential logic circuit for traffic light ? digital system......
-Explain step by step the operation of sequential logic circuit for traffic light ? digital system... -Analyse the sequential logic circuit operation by using timing diagrams (with sketch for the diagrams) and present the optimization process of the sequential logic circuit. - Propose an enhancement for your design by using different sequential logic circuit. Please explain step by step with cleat hand writing.. Thanks.
Verilog code for Traffic light controller. Need a block diagram, Verilog codes used with testbench, and...
Verilog code for Traffic light controller. Need a block diagram, Verilog codes used with testbench, and the waveforms screen-prints.
Design an embedded system using MSP430 to control a traffic light system. It is included a...
Design an embedded system using MSP430 to control a traffic light system. It is included a complete design description of a traffic light system to help you in your design. Show the hardware schematics and the software needed to complete your design.
For design, the daily car, pickup truck, and light van traffic is 20,000; and the daily...
For design, the daily car, pickup truck, and light van traffic is 20,000; and the daily truck traffic consists of 200 passes of single-unit trucks with single and tandem axles, and 410 passes of tractor semi-trailer trucks with single, tandem, and triple axles. The axle weights are :cars, pickups, light vans = two 2000-lb single axles;single-unit trucks = 10,000-lb steering, single axle= 22,000-lb drive, tandem axle and: tractor semi-trailer trucks = 12,000-lb steering, single axle,= 18,000-lb drive, tandem axle,= 50,000-lb...
Design a Traffic Light that upon reset, turns Red for 10 seconds, then Green for 10...
Design a Traffic Light that upon reset, turns Red for 10 seconds, then Green for 10 seconds, then Yellow for 5 seconds. Assume a CLK period of 5 seconds. Draw the State Transition Diagram, State Transition Table and Output Table, find the Boolean Equations for Next State and Output and draw the logic circuit.
DOT wants to install a traffic signal at a dangerous intersection on US-51. The traffic signal...
DOT wants to install a traffic signal at a dangerous intersection on US-51. The traffic signal will cost $450,000. Based on historical data, it will eliminate, on average, one fatal accident every 10 years, but will cause 5 additional minor accidents every year. The standard cost assigned to fatal accidents is $12,300,000 and the cost assigned to minor accidents is $160,000 each. At an interest rate of 4% per year, does the B/C ratio justify the cost of the signal?...
Design an automatic traffic light control signal for a road square using 1MHz internal oscillator of...
Design an automatic traffic light control signal for a road square using 1MHz internal oscillator of PIC16F887. Each traffic light must consist of three (Red, Yellow, Green) lights. Use proteus for implementation. Your code must use four light signals installed on each road connecting to square. in word program form.(text and diagram )
Design a sequential circuit with 2 JK flip-flops A and B, and 2 inputs, E...
Design a sequential circuit with 2 JK flip-flops A and B, and 2 inputs, E and x. the design must adhere to the following requirements: If E = 0, the circuit remains in the same state regardless of the value of x.  When E = 1 and x = 1, the circuit goes through the state transitions from 00 to 01 to 10 to 11 back to 00 and repeats. When E = 1 and x = 0, the circuit goes through the...
5. A driver encounters two traffic lights on the way to work each morning. Each light...
5. A driver encounters two traffic lights on the way to work each morning. Each light is either red, yellow, or green. The probabilities of the various combinations of colors is given in the following table: Second Light First Light R Y G R 0.31 0.02 0.18 Y 0.02 0.03 0.03 G 0.14 0.04 0.23 a) What is the probability that the first light is red? b) What is the probability that the second light is green? c) Find the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT