fpga_asic_designer
Junior Member level 3
I am looking at a silicon proved design of DDS;
1. Basically use phase accumulater to generate the DTO values, carry_r/carry_f flag,
2. then pass through a module (the one i am cracking my head out but still have no idea how it works) to obtain pointer address for rising and falling.
3. Then the addresses along with address valid would be passed to a rom like logic, choosing appropriate edges from analog for start of rising and start of falling indicater
4. put the start of rising and falling indicaters into an S-R latch, to genertate correct DDS freqency.
All these are simply for open loop.
For #2 module, I understood each line and wrote my own codes out. But I still cannot see the big picture what these repetitive calculations are for. Can any one help me out? I am pasting part of my codes here.
Note: f_o_clk = f_i_clk * SF/(2**16)
Note: dto_width = 16 in this case.
//1st subtraction
wire [dto_width-4:0] sum1 = DTO_div4[dto_width-4:0] - SF_div8[dto_width-4:0];
wire sum1_sign = DTO_div4[dto_width-3] ^ (DTO_div4[dto_width-4:0] >= SF_div8[dto_width-4:0]);
reg [dto_width-4:0] sum1_load;
always @ (posedge irst or posedge iclk)
begin
if (irst) sum1_load <= 'h0;
else if (sum1_sign) sum1_load <= sum1;
else sum1_load <= DTO_div4[dto_width-4:0];
end
//2nd subtraction
wire [dto_width-5:0] sum2 = sum1_load[dto_width-5:0] - SF_div16[dto_width-5:0];
wire sum2_sign = sum1_load[dto_width-4] ^ (sum1_load[dto_width-5:0] >= SF_div16[dto_width-5:0]);
reg [dto_width-5:0] sum2_load;
always @ (posedge irst or posedge iclk)
begin
if (irst) sum2_load <= 'h0;
else if (sum2_sign) sum2_load <= sum2;
else sum2_load <= sum1_load[dto_width-5:0];
end
Thanks a lot!
1. Basically use phase accumulater to generate the DTO values, carry_r/carry_f flag,
2. then pass through a module (the one i am cracking my head out but still have no idea how it works) to obtain pointer address for rising and falling.
3. Then the addresses along with address valid would be passed to a rom like logic, choosing appropriate edges from analog for start of rising and start of falling indicater
4. put the start of rising and falling indicaters into an S-R latch, to genertate correct DDS freqency.
All these are simply for open loop.
For #2 module, I understood each line and wrote my own codes out. But I still cannot see the big picture what these repetitive calculations are for. Can any one help me out? I am pasting part of my codes here.
Note: f_o_clk = f_i_clk * SF/(2**16)
Note: dto_width = 16 in this case.
//1st subtraction
wire [dto_width-4:0] sum1 = DTO_div4[dto_width-4:0] - SF_div8[dto_width-4:0];
wire sum1_sign = DTO_div4[dto_width-3] ^ (DTO_div4[dto_width-4:0] >= SF_div8[dto_width-4:0]);
reg [dto_width-4:0] sum1_load;
always @ (posedge irst or posedge iclk)
begin
if (irst) sum1_load <= 'h0;
else if (sum1_sign) sum1_load <= sum1;
else sum1_load <= DTO_div4[dto_width-4:0];
end
//2nd subtraction
wire [dto_width-5:0] sum2 = sum1_load[dto_width-5:0] - SF_div16[dto_width-5:0];
wire sum2_sign = sum1_load[dto_width-4] ^ (sum1_load[dto_width-5:0] >= SF_div16[dto_width-5:0]);
reg [dto_width-5:0] sum2_load;
always @ (posedge irst or posedge iclk)
begin
if (irst) sum2_load <= 'h0;
else if (sum2_sign) sum2_load <= sum2;
else sum2_load <= sum1_load[dto_width-5:0];
end
Thanks a lot!