semesu
Newbie level 4
dac verilog code
Hi,
I have a project on pwm in verilog programming language. "pwm and one bit dac". The aim of this project is to convert the dıgıtal data to analog. Ihave found codes.
I am usıng xilinx spartan 3E kit
module PWM(clk, PWM_in, PWM_out);
input clk;
input [7:0] PWM_in;
output PWM_out;
reg [8:0] PWM_accumulator;
always @(posedge clk) PWM_accumulator <= PWM_accumulator[7:0] + PWM_in;
assign PWM_out = PWM_accumulator[8];
endmodule
but,in the codes a pwm accumulator is mentıoned and there ıs a command it is"PWM_accumulator <= PWM_accumulator[7:0] + PWM_in;" I don't understand why this command is written in the program and what is the functıon of the pwm accumulator?
my second questıon is what does the samplıng frequency mean?there are some explanatıons on the ınternet but I don't understand them.
ıf there is anyone to help me,I will be glad.
thanks
regards
Hi,
I have a project on pwm in verilog programming language. "pwm and one bit dac". The aim of this project is to convert the dıgıtal data to analog. Ihave found codes.
I am usıng xilinx spartan 3E kit
module PWM(clk, PWM_in, PWM_out);
input clk;
input [7:0] PWM_in;
output PWM_out;
reg [8:0] PWM_accumulator;
always @(posedge clk) PWM_accumulator <= PWM_accumulator[7:0] + PWM_in;
assign PWM_out = PWM_accumulator[8];
endmodule
but,in the codes a pwm accumulator is mentıoned and there ıs a command it is"PWM_accumulator <= PWM_accumulator[7:0] + PWM_in;" I don't understand why this command is written in the program and what is the functıon of the pwm accumulator?
my second questıon is what does the samplıng frequency mean?there are some explanatıons on the ınternet but I don't understand them.
ıf there is anyone to help me,I will be glad.
thanks
regards