//------------------------------------------------------------------- //Stoplight inclass problem - skeleton //------------------------------------------------------------------- module stoplight ( input reset_n, //reset async active low input clk, //input clock output northsouth_red, //stoplight output output northsouth_yellow, //stoplight output output northsouth_green, //stoplight output output eastwest_red, //stoplight output output eastwest_yellow, //stoplight output output eastwest_green //stoplight output ); //enumerated values for stoplight_sm enum reg [1:0] {a = 2'b00, ?????????????????????? ?????????????????????? ?????????????????????? stoplightxx = 'x} ??_ps, ??_ns; reg [3:0] timer; //count time for light intervals reg timer_reset; //------------------------------------------------------------------------------- // stoplight_sm //------------------------------------------------------------------------------- always_ff @(????????????????????????????) if (!reset_n) stoplight_ps <=???????? //if reset_n asserted, go to state a else stoplight_ps <=???????? //else, go to next state always_comb begin stoplight_ns = stoplightxx; //default assignments timer_reset = 1'b0; unique case (stoplight_ps) a : if (timer == 10) begin stoplight_ns = b; timer_reset = 1'b1; end else stoplight_ns = a; b : ???????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????? c : ???????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????? d : ???????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????? endcase end//always_comb assign eastwest_red = ((stoplight_ps == a) || (stoplight_ps == b)) ? 1'b1 : 1'b0; assign eastwest_yellow = ??????????????????????????????????????????????????????????? assign eastwest_green = ??????????????????????????????????????????????????????????? assign northsouth_red = ??????????????????????????????????????????????????????????? assign northsouth_yellow = ??????????????????????????????????????????????????????????? assign northsouth_green = ??????????????????????????????????????????????????????????? //------------------------------------------------------------------------------- //timer for stoplight_sm is below //------------------------------------------------------------------------------- always_ff @(????????????????????????????? if (!reset_n) timer ?????????? //if reset_n asserted, clear counter else if (timer_reset) timer ?????????? //reset when told to else timer ?????????? //else increment endmodule