1 / 5

右旋開發板示範

右旋開發板示範. 主程式. module rotate_right( input clk, input reset, output [7:0] led ); reg [7:0] q; wire clkm; reg [31:0] divider; // 除頻電路 // 向右旋轉 1 bit------------------------------------------------ always@( posedge clkm , negedge reset ) begin if ( !reset )

libby
Download Presentation

右旋開發板示範

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 右旋開發板示範

  2. 主程式 module rotate_right( input clk, input reset, output [7:0] led ); reg [7:0] q; wire clkm; reg [31:0] divider; //除頻電路 //向右旋轉1 bit------------------------------------------------ always@( posedge clkm, negedge reset ) begin if ( !reset ) q <= 8'b1000_0000; else q <= { q[0], q[7:1] }; end assign led = q; endmodule

  3. 除頻電路 //除頻電路------------------------------------------------------ always@(posedge clk or negedge reset ) begin if ( ! reset ) divider <= 32'h0000_0000 ; else divider <= divider + 1; end assign clkm = divider[25]; // 40M/2^25=0.8388 sec

  4. 步驟 • 建新專案(指定元件編號) • 編輯原始程式 • 語法檢查 • 行為模擬 • 指定接腳 • 實作(implement) • 產生燒錄檔(.bit ) • 下載(燒錄)、執行

  5. 開發板元件接腳編號

More Related