Add Lab work No2

This commit is contained in:
Imants Pulkstenis
2020-03-25 00:08:31 +02:00
parent 27e63599f4
commit f19b7c8ca1
11 changed files with 878 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
/////////////////////////////
// Author - Imants Pulkstenis
// Date - 24.03.2020
// Project name - Lab work No2 - Counter
// Module name - counter module
//
// Detailed module description:
//
// This module counts form 0000 to ffff
// in hex
//
//
// Revision:
// A - initial design
// B -
//
//
/////////////////////////////
module counter (
input clk,
input reset,
output [15:0] counter);
always@(posedge clk) begin
if (reset == 'b1) begin
r_counter <= 'b0;
end
else begin
r_counter <= r_counter + 1;
end
end
reg [15:0] r_counter = 'b0;
assign counter = r_counter;
endmodule