Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are two teams: Home ( H ) , and Away ( A ) . Reset switch can be used to start the game. The
There are two teams: Home H and Away A Reset switch can be used to start the game. The current score for each team will be shown on two display segments starting with Each team will be given seconds in order to try scoring points. A countdown will appear on display segment starting from reaching to The two teams cant play simultaneously. H plays first then A gets the turn then H again. When it is team H turn, LEDR will be on and LEDR will be off. On the other hand, when it is team A turn, LEDR will be on and LEDRR will be off. In each attempt, the team may score or points. The attempt score will be inserted by turning on one of the score switches for that team. For example, team H inserted score can be or by turning on sw sw sw or sw respectively. In the same way, team A points can be inserted during it attempt through switches sw sw sw or sw Each attempts scored points will be added to the teams total score. Team H score will be shown using displays and while team A score will be shown using displays and If the countdown ends before inserting a score, the turn will simply move to the other team. Please note that turning on a score switch for a team outside its attempt time wont be counted and its score will not be changed. In this project you can consider that the maximum score any team can reach is During the game, LEDG will be if team H is winning while LEDG will be on if team A is winning. If the result is a tie, both LEDS go off. We assume that the user may switch on one score switch only during each attempt. You may need to use the clock from experiment in order to calculate the required delays. Example: The user turns on the reset switch and both teams start with score with both LEDG and LEDG are off. The first attempt is given to team H and the countdown display will count from to while LEDR is on During the countdown sw will be turned on and two points will be added to the team H score to be Moreover, LEDG will be on as team H is winning. Next, the turn goes to team A and hence the countdown display starts counting again from to with LEDR goes off and LEDR goes on A sw is turned on before the countdown ends. As a result, three points will be added to team A score to become LEGR will be on and LEDG will be off as team A is winning. The attempt is now returns to team H However, the countdown reaches while no score switch is turned on As a result, the score will not change and the attempt goes back to team A Modify the code based on this explanationmodule segdriverABCDabcdefg;input ABCD;output abcdefg;assign a~B&~C&DB&~C&~D;assign bB&~C&DB&C&~D;assign c~B&C&~D;assign d~B&~C&DB&~C&~DB&C&D;assign eDB&~C;assign f~B&D~B&CC&D;assign g~A&~B&~C;endmodulemodule counter input clock, output reg: counterout;always @ posedge clockbegincounterout # counterout ;endendmodule module dffDReset,clkQQnot;input DclkReset;output QQnot;reg QQnot;always @ posedge Reset, posedge clkbeginif ResetbeginQ ;Qnot ; endelsebeginQ D;Qnot ~D;endendendmodulemodule dmuxtooosin;output oo;input sin;Invgate outin;Invgate ws;Andgateoutinin;Andgateowin;Andgateosin;endmodulemodule dumuxtodsssoooooooo;input dsss;output oooooooo;dmuxtooosin; dmuxtowwsd; dmuxtowwsw; dmuxtowwsw;dmuxtooosw; dmuxtooosw;dmuxtooosw;dmuxtooosw;endmodulemodule Andgateoutinin;input inin;output out;assign # outin∈endmodulemodule Andgateoutininin;input ininin;output out;assign # outin&in∈endmodulemodule Nandgateoutininin;input ininin;output out;assign # out~in&in∈endmodulemodule Andgateoutinininin;input inininin;output out;assign # outin&in&in∈endmodulemodule Invgate outin;input in;output out;assign # out~in;endmodulemodule Orgateoutininin;input ininin;output out;assign # outininin;endmodulemodule Orgateoutinininin;input inininin;output out;assign # outinininin;endmodulemodule Orgateoutinin;input inin;output out;assign # outinin;endmodulemodule Nandgate outinin;input inin;output out;assign # out~in∈endmodulemodule Xnorgate outinin;input inin;output out;assign # out~inin;endmodulemodule Xorgateoutininin;input ininin;output out;assign # outininin;endmodulemodule Norgate outinin;input inin;output out;assign # out~inin;endmodulemodule Norgateoutininin;input ininin;output out;assign # out~ininin;endmodulemodule Xorgate outinin;input inin;output out;assign # outinin;endmodulemodule muxtoI I S out;input I I S;output out;Invgate outin;Invgate wS;Andgateoutinin;AndgatewSI;AndgatewwI;Orgateoutinin;Orgateoutww;endmodulemodule muxtoinininSSout;input inininSS;output out;muxtoI I S out;muxtoin in S out;muxtoout in S out;endmodule module muxtoinininSSout;input inininSS;output out;muxtoI I S out;muxtoin in S out;muxtoout in S out;endmodule module muxtoininininininin in SSS out;input ininininininin in SSS;output out;muxtoI I S out;muxtoinin S out; muxtoin in S out; muxtoin in S out;muxtoout out S out; muxtoout out S out; endmodulemodule prayertrackerResetclkFDAMELGLGLGLGLGLRLRLRLRLRabcdef
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started