Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Verilog A for Divide by n counter ..

Status
Not open for further replies.

ec10404

Newbie level 3
Joined
Jun 6, 2007
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
counter veriloga code

hi friends can u give me verilog A code for divide by n counter for giver clock and duty cycle.
 

veriloga counter

This is the code for mod 9 counter


module counter(Q , clock, clear,op);
output op;
output [3:0] Q;
input clock, clear;
reg [3:0] Q;

always @( posedge clock or negedge clear)
begin
if (!clear)
Q = 4'd0;
else if(Q==4'd9)
Q = 4'd0;

else
Q = (Q + 1) ;
end
assign op = (Q==4'd9) ? 1:0;
endmodule
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top