Skip to content

Commit

Permalink
Update counter.sv
Browse files Browse the repository at this point in the history
  • Loading branch information
ruwayd99 authored Jan 18, 2024
1 parent e0f382c commit 330dedb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions counter.sv
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ begin
overflow <= 0;
end
else begin
//set overflow to 1 if counter is 15 and set counter back to 0 again
if (counter == 4'b1111) begin
counter <= 0;
counter <= counter + 1;
//set overflow to 1 if counter is 15n
if (counter == 4'b1111)
overflow <= 1;
end
//increment counter by 1 if counter is not 15 and overflow is 0
else begin
counter <= counter + 1;
//overflow is 0
else
overflow <= 0;
end
end
end

Expand Down

0 comments on commit 330dedb

Please sign in to comment.