Verilog Code For Counter With Testbench PDF
Verilog Code For Counter With Testbench PDF
Verilog Code For Counter With Testbench PDF
FPGA4student
YouTube 564
Image processing on
FPGA using Verilog HDL
This FPGA project is aimed
to show in details how to
process an image using
Verilog from reading an input bitmap
Verilog code for up counter: image (.bmp) in Verilog...
// down counter
always @(posedge clk or posedge reset)
begin
if(reset)
counter_down <= 4'hf;
else
counter_down <= counter_down - 4'd1;
end
assign counter = counter_down;
endmodule
// down counter
always @(posedge clk or posedge reset)
begin
if(reset)
counter_up_down <= 4'h0;
else if(~up_down)
counter_up_down <= counter_up_down + 4'd1;
else
counter_up_down <= counter_up_down - 4'd1;
end
assign counter = counter_up_down;
endmodule
Verilog testbench code for up-down counter:
// FPGA projects using Verilog/ VHDL
// fpga4student.com: FPGA projects, Verilog projects, VHDL projects
// Verilog code for up-down counter with testbench
// Testbench Verilog code for up-down counter
module updowncounter_testbench();
reg clk, reset,up_down;
wire [3:0] counter;
53
SHARES
Facebook Twitter Pinterest
No comments:
Post a Comment