Test Fixture Program :-
module tf_up_counter;
// Inputs
reg clk;
reg reset;
// Outputs
wire [7:0] out;
// Instantiate the Unit Under Test (UUT)
up_counter uut (
.out(out),
.clk(clk),
.reset(reset)
);
initial begin
clk=1'b1;
forever #5 clk=~clk;
end
initial begin
reset = 1;#10;
reset = 0;#30;
end
endmodule
--------------------------------------------------------------------------------------------------------------------------
Program for Up Counter ( VERILOG ) :-
module up_counter (
out , // Output of the counter
clk , // clock input
reset // reset input
);
//----------Output Ports--------------
output [7:0] out;
//------------Input Ports--------------
input clk, reset;
//------------Internal Variables--------
reg [7:0] out;
//-------------Code Starts Here-------
always @(posedge clk)
if (reset) begin // active high reset
out <= 7'b0 ;
end else begin
out <= out + 1;
end
endmodule
Great stuff , thanks for sharing , very informative and presented well , keep updating morered hat linux training institute in chennai|best red hat training center in chennai|red hat certified training partners in chennai|red hat linux training center in chennai|red hat linux training centre in chennai|red hat training in chennai
ReplyDelete