module PWM_Gen(
input clk, // Clock input
input [7:0]DUTY_CYCLE, // Input Duty Cycle
output PWM_OUT // Output PWM
);
reg [7:0]counter_out; // 8-bit counter
always @(posedge clk)
begin
if (DUTY_CYCLE > counter_out)
PWM_OUT = 1;
else
PWM_OUT = 0;
end
counter counter_inst (
.clk(clk),
.counter_out(counter_out)
)
endmodule
error is -
Error (10170): Verilog HDL syntax error at PWM_Gen.v(51) near text: "endmodule"; expecting ";".