Ponta
Newbie level 2
- Joined
- Jan 7, 2015
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 15
Hello, can somebody please translate this verilog code to VHDL?
Thanks
Thanks
Code:
module PWM(clock, switches, pwm
);
parameter sd=195;
input clock;
input [7:0] switches;
output pwm;
reg pwm;
reg [15:0] counter = 0;
always @ (posedge clock)
begin
counter = counter+1;
if(counter<=switches*sd) pwm = 1;
else pwm = 0;
if(counter>= 50_000) counter = 0;
end
endmodule