menghitung jumlah pulsa yang masuk dan dinyatakan dengan bilangan biner
upcounter 2 bit
module duabitcounter(
out,
enable,
clk,
reset
);
input enable,clk,reset;
output [1:0] out;
reg [1:0] out;
always @ (posedge clk)
if (reset) begin
out <= 2'b0;
end
else
begin
out <= out + 1;
end
endmodule
OUTPUT
Sign up here with your email
ConversionConversion EmoticonEmoticon