AIM: Write a program in verilog to implement counters
LEARNING OBJECTIVE:-To make the students familiar with concept of counters i.e. UP DOWN Counter using verilog HDL
1. Open a new project from the drop down menu by clicking in FILE given on the
top left of the screen.
2. Create a new project and name it.
3. Click on next to enter the device properties.
4. Select the appropriate properties according to the hardware to be used.
5. Click on the next button to enter the new source.
6. Here select the Verilog MODULE and give the file name.
7. Click on next button and enter the entity name.
8. Select the define module.
9. Select the ports as input and output and name them.
10. Click on next and then to on finish.
11. Write the code for the project under the library entity.
12. Save the program.
13. Select the behavioral simulation option from the three modeling options.
14. Now select the syntax check.
15. If the syntax check comes out to be correct, then precede further, otherwise check
16. Now select simulation option and select the test bench option.
17. Initialize the clock and other properties from the window that appears on the
18. Give the clock pulse to one of the inputs and save the program.
19. Click on simulate to get the output.
Verilog code for updown counter
module up_down_counter (out,up_down,clk,reset);
output [7:0] out;
input up_down, clk, reset;
reg [7:0] out;
always @(posedge clk)
if (reset) begin // active high reset
out <= 8'b0 ;
end else if (up_down) begin
out <= out + 1;
end else begin
out <= out - 1;
Watch Related Videos
4 bit ALU Design in verilog using Xilinx Simulator
ALU Design in Verilog with Text Bench
AND Gate Logic Design in Xilinx Simulator
Counter Design in Verilog with Text Bench Complete Tutorial
Design All Logic Gates in Xilinx
Full Adder Design in Xilinx ISE Simulator
Half Adder Design in Xilinx ISE Simulator
How to create text bench in Xilinx ISE Simulator
JK Flip Flop design in Verilog with Text Bench
D Flip Flop Design in Verilog Using Xilinx ISE
FPGA XOR Gate Design in Verilog using Xilinx ISE Simulator Part
FPGA XOR Gate Design in Verilog using Xilinx ISE Simulator Part 2 of 2