4) Counter
4) Counter
AIM:
To design, Simulate and Implement Up Down Counter using XILINX ISE Software
and FPGA Board.
TOOLS REQUIRED:
1. Personal Computer
2. XILINX Software
3. FPGA Spartan-3E Starter Board(XC3S250E TQ144)
input clk,rst,mode;
output [3:0]q;
counterdddk a2(clk,rst,mode,q);
endmodule
\\Counter
module counterdddk(clk,rst,mode,q);
input clk,rst,mode;
output reg[3:0]q;
always@(posedge clk)
begin
if(rst)
q=4'b0000;
else if(mode==1'b0)
q=q+1;
else
Reg.No:61072112113
q=q-1;
end
endmodule
\\Updown counter
module updowncounter(clk,rst,mode,q);
input clk,rst,mode;
output [3:0]q;
clk_divdddk a1(clk,slow_clk);
counterdddk a2(clk,rst,mode,q);
endmodule
\\Clock division
module clk_div(
input clk,
reg [26:0] c;
initial c = 27'b0;
begin
c = c + 1;
slow_clk = c[25];
end
endmodule
Reg.No:61072112113
\\Counter
module counterdddk(clk,rst,mode,q);
input clk,rst,mode;
output reg[3:0]q;
always@(posedge clk)
begin
if(rst)
q=4'b0000;
else if(mode==1'b0)
q=q+1;
else
q=q-1;
end
endmodule
PIN ASSIGNMENTS:
Reg.No:61072112113
RTL SCHEMATIC(UP DOWN COUNTER):
Reg.No:61072112113
SYNTHESIS SUMMARY:
Device utilization summary:
---------------------------
IO Utilization:
Number of IOs: 7
---------------------------
---------------------------
Reg.No:61072112113
No Partitions were found in this design.
---------------------------
=========================================================================
Timing Report
Clock Information:
------------------
-----------------------------------+------------------------+-------+
-----------------------------------+------------------------+-------+
clk | BUFGP |4 |
-----------------------------------+------------------------+-------+
----------------------------------------
Timing Summary:
---------------
Speed Grade: -3
Reg.No:61072112113
Minimum period: 1.059ns (Maximum Frequency: 943.842MHz)
Timing Details:
---------------
=========================================================================
-------------------------------------------------------------------------
Gate Net
---------------------------------------- ------------
Reg.No:61072112113
----------------------------------------
=========================================================================
-------------------------------------------------------------------------
Gate Net
---------------------------------------- ------------
----------------------------------------
=========================================================================
-------------------------------------------------------------------------
Reg.No:61072112113
Offset: 0.659ns (Levels of Logic = 1)
Gate Net
---------------------------------------- ------------
----------------------------------------
=========================================================================
--------------------------
---------------+---------+---------+---------+---------+
---------------+---------+---------+---------+---------+
clk | 1.059| | | |
---------------+---------+---------+---------+---------+
Reg.No:61072112113
=========================================================================
-->
Reg.No:61072112113
SIMULATION OUTPUT:
RESULT:
Thus UpDown Counter is designed and Simulation is done using XILINX ISE
Software and Implementation is done using FPGA Spartan-3E Starter Board.
Reg.No:61072112113
Reg.No:61072112113