Skip to content

Commit

Permalink
Fixed a problem in the code whereby it doesn't wait for KEY0 to be pr…
Browse files Browse the repository at this point in the history
…essed
  • Loading branch information
ayeohmy committed Oct 5, 2014
1 parent 93c71bf commit 28b3a8a
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions module SevenSegmentDisplay.sv
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ module SevenSegmentControl

endmodule: SevenSegmentControl


/* This module checks if there is something wrong with the inputs.
* If there is, returns something wrong with 1. Vice versa.
* It only does this if scoreThis has been pressed
*/

module IsSomethingWrong
(input logic [4:0] X,
Expand All @@ -71,14 +74,16 @@ module IsSomethingWrong
output logic wrong);

always_comb begin
if((X>0) && (X<11) && (Y>0) && (Y<11))
somethingWrong = 1;
else if(bigLeft == 2'b11)
somethingWrong = 1;
else if((big==1) && (bigLeft==2'b00))
somethingWrong = 1;
else
somethingWrong = 0;
if(scoreThis) begin
if((X>0) && (X<11) && (Y>0) && (Y<11))
somethingWrong = 1;
else if(bigLeft == 2'b11)
somethingWrong = 1;
else if((big==1) && (bigLeft==2'b00))
somethingWrong = 1;
else
somethingWrong = 0;
end
end

endmodule: IsSomethingWrong
Expand All @@ -103,10 +108,10 @@ module HandleHit
end

end
endmodule: HandleHit




endmodule: HandleHit

/* This module checks if there is somethingWrong
* If there is, turn on all the LEDs in HEX6 and HEX7 using the module made in
Expand Down Expand Up @@ -138,6 +143,9 @@ module HandleWrong

endmodule: HandleWrong




/* This module takes in any inputs by the user, desides how to interpret them, and calls the right command
* in return.
*
Expand Down

0 comments on commit 28b3a8a

Please sign in to comment.