正弦波方波三角波.docxVIP

  • 6
  • 0
  • 约1.12万字
  • 约 14页
  • 2022-09-18 发布于山西
  • 举报
module dac( input clk, output reg din, output reg sclk, output reg sync ); reg[15:0] data; reg[7:0] N; reg[10:0] cntdiv; reg[4:0]j; initial begin sclk=0; N=0; cntdiv=11b0; din=0; data=0; j=0; end always @(posedge clk) begin sclk = ~sclk; end always @(posedge clk) begin cntdiv = cntdiv + 1b1; if (cntdiv==1960) begin if (N255) begin N = N+1b1; end else begin N=0; end cntdiv=0; end end always @(posedge sclk) begin sync=0; din=data[15]; data[15:1]=data[14:0]; data[0

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档