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.

My first verilog module.. is messed up.. :(

Status
Not open for further replies.

ipunished

Junior Member level 3
Joined
Mar 15, 2011
Messages
31
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
United Kingdom
Activity points
1,504
Hello,

Im new to verilog and am learning it myself.. What im trying to do is to create a simple system, a part of it is an irq timer module... its supposed to generate a pulse determined by a parameter and each pulse should last for 4 clock cycles.

here is what i worte (its my first verilog module)

Code:
module timer(
    input clock,
    input reset,
    output reg[15:0] irq
    );

always@(posedge clock or posedge reset)
begin
		if(reset || (irq==16'h8000))
				irq<=0;
		else
		irq<=irq+1;
		
end
				
endmodule

Note: i have no idea how to implement parameter here, i know that its implemented using the leyword parameter in the module header but i dont know how it can be used here for our purpose.

Note: clock is supposed to be 32768 Hz, am i supposed to mention thsi someplace in my code?

Thank you for looking
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top