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.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top