verilog code for sawtooth waveform

Status
Not open for further replies.

param426

Newbie level 3
Joined
Jul 14, 2011
Messages
4
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,306
Hi,


Can any one suggest verilog code for sawtooth wave form.?


thanks for spending time for read my question.
 

The question isn't clear. Verilog can't describe analog waveforms, it can at best generate a numerical variable that represents a waveform and may be output by a DAC.

A sawtooth waveform would be simply represented by a counter that's continuously incremented with overflow.
 

Hi,

thanks for reply my question...




here iam attaching the Block diagram..
i want to generate a sawtooth wave form with 100kHz in 50MHz FPGA board to compare with the MPPT out..

MPPT output is a sinusoidal wave ....


plz FIA..
 

In this case, I keep my suggestion how to generate a sawtooth waveform. To modify scaling and period, you may want to change the 1 increment of a simple counter to a specific number. Obviously, it will count at 50 MHz.
 

RAMP WAVE GENERATION
Code
`timescale 1ns / 1ps
module Ramp(Ramp,En,Clk,Rst);
output reg [7:0] Ramp;
input En,Clk,Rst;
always@(posedge Clk or posedge Rst)
begin
if (Rst)
Ramp<=0;
else begin
if (En)
begin
Ramp <= Ramp+1′b1;
end
end
end
endmodule

This is ramp wave code, could you please modify this to sawtooth wave form?
 
Reactions: rrucha

    rrucha

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…