|
|
|
|
|
|
|
|
|
|
|
|
8-Bit Simple Up Counter
|
|
|
|
|
|
1 //-----------------------------------------------------
2 // Design Name : up_counter
3 // File Name : up_counter.sv
4 // Function : Up counter
5 // Coder : Deepak
6 //-----------------------------------------------------
7 module up_counter (
8 output reg [7:0] out , // Output of the counter
9 input wire enable , // enable for counter
10 input wire clk , // clock Input
11 input wire reset // reset Input
12 );
13 //-------------Code Starts Here-------
14 always_ff @(posedge clk)
15 if (reset) begin
16 out <= 8'b0 ;
17 end else if (enable) begin
18 out ++;
19 end
20
21 endmodule
You could download file sv_examples here
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Copyright © 1998-2014 |
Deepak Kumar Tala - All rights reserved |
Do you have any Comment? mail me at:deepak@asic-world.com
|
|