基於verilog的分頻器設計(半整數分頻,小數分頻:下)

來源:互聯網
上載者:User

標籤:

半整數分頻器:計數器是通過上升沿觸發,故在計數為N-1時對計數觸發進行翻轉,時鐘的下降沿變為上升沿,因此計數值為0,所以每產生n+0.5分頻時鐘的周期,觸發時鐘都要翻轉一次。,採用異或門和2分頻模組設計脈衝扣除電路,脈衝扣除是輸入頻率和2分頻輸出相異或的結果。

module fenpin(clk,rst_n,clk_out);input clk;input rst_n;output clk_out;reg clk_out2;wire clk_out1;reg [1:0] cnt;reg FB_CLK;always@(posedge clk_out2,negedge rst_n)begin if (!rst_n)FB_CLK<=0;elseFB_CLK<=~FB_CLK;endalways@(posedge clk_out1,negedge rst_n)begin if (!rst_n)begincnt<=0;clk_out2<=0;endelse if (cnt==2)begincnt<=0;clk_out2<=1;endelsebegincnt<=cnt+1‘b1;clk_out2<=0;endendxor xor1(clk_out1,clk,FB_CLK);wire CLK_OUT_R;assign CLK_OUT_R=(cnt==1) ? 1‘b0:1‘b1;assign clk_out=clk_out2 | CLK_OUT_R;endmodule

基於verilog的分頻器設計(半整數分頻,小數分頻:下)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.