Problem with CPLD code

Status
Not open for further replies.

pavan.emb

Newbie level 5
Joined
Oct 21, 2009
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Bengaluru
Activity points
1,364
Hi all,

I am doing a small program with CPLD in xilinx.(I am new to the verilog code).

Here is my program....

module f_count
(
(* LOC="P1" *) output Buzzer_out,
(* LOC="P44" *) input in_clock,
(* LOC="P43" *) input GCLK,
(* LOC="P42" *) output Output_Signal,
(* LOC="P3 P5 P6 P8 P12 P13 P14 P16 P27 P28 P29 P30 P31 P32 P33 P34" *) output [15:0]f_measurment
);
reg [15:0]count;

assign count = f_measurment;

always @(negedge in_clock)
begin


if(count[15:0] > 16)
begin
Buzzer_out = 1;
Output_Signal = 0;
end
else
begin
count <= count + 16'd1;
Buzzer_out = 0;
Output_Signal = 1;
end
end
endmodule




****

when I am synthesising this code, I am getting the error as follows........
Expecting the 'endmodule' but found 'if'.

what could be the mistake in the code...........

Thanks all.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…