點陣實驗報告

2021-04-19 21:13:45 字數 5187 閱讀 7732

大連理工大學軟體學院

《fpga設計與應用實驗》實驗報告

姓名: 王鑫明學號: 201292223 班級: 軟1212

姓名: 席翀宇學號: 201292383 班級: 軟1212

組號實驗箱編號

實驗時間:2023年5月20日實驗室: 嵌入式實驗室實驗台: seed教學實驗平台_

指導教師: 王潔成績

實驗2:led點陣實驗

1、實驗目的和要求

熟悉ise8.2開發環境,掌握工程的生成方法;

熟悉seed-xdtk_v4實驗環境;

了解hdl語言在fpga中的使用;

了解定時器的hdl實現。

實驗內容:

定時時鐘設計;

led點陣點亮。

二、實驗原理和內容

實驗內容:

定時時鐘設計;

led點陣點亮。

三、主要儀器裝置及軟體程式設計環境

主要儀器裝置:

seed-xdtk_v4實驗環境

軟體程式設計環境:

ise8.2開發環境

modelsim**工具

四、實驗步驟與程式設計

實驗步驟:

建立工程

新增hdl資源檔案

編寫**

`timescale 1ns / 1ps

// company:

// engineer:

// // create date: 09:43:00 04/18/2008

// design name:

// module name: dot

// project name:

// target devices:

// tool versions:

// description:

//// dependencies:

//// revision:

// revision 0.01 - file created

// additional comments:

//module dot(clk_in, nrst, cpld_e,dot_data , dot_con ,ad_ncs , da_ncs ,usb_ncs,lcd_ncs );

input clk_in;

input nrst;

output [1:0] cpld_e;

output [15:0] dot_data;

output [15:0]dot_con;

output usb_ncs;

output ad_ncs;

output da_ncs;

output lcd_ncs;

reg clk_out = 1'b1;

reg [15:0]dot_con =16'h0000;

reg [15:0]dot_data =16'h0000;

reg [13:0] div_counter = 14'h000;

reg [3:0] cnt= 4'h0;

reg [13:0] cnt1=14'h000;

reg [2:0] cnt2=3'h0;

parameter div_factor = 14'h1f98;

//cpld功能切換

assign cpld_e = 2'b11;

//其他晶元功能禁止

assign usb_ncs = 1'b1;

assign ad_ncs = 1'b1;

assign da_ncs = 1'b1;

assign lcd_ncs = 1'b1;

//時鐘分頻

always@(posedge clk_in)

begin

if(!nrst)

begin

clk_out <= 1'b1;

div_counter <= 10'h000;

endelse

begin

if(div_counter <= div_factor )

begin

div_counter <= div_counter + 1;

endelse

begin

div_counter <= 12'h000;

clk_out <= !clk_out;

end end

end//點亮點陣

always@(posedge clk_out)

begin

cnt = cnt+1;

cnt1 = cnt1+1;

if(cnt1 == 14'hf)

begin

cnt2 = cnt2+1;

endif(cnt2 == 3'h0)

begin

if(cnt == 4'h0)

begin

dot_con <= 16'h8000;

dot_data <= 16'h0000;

endelse if(cnt == 4'h1)

begin

dot_con <= 16'h4000;

dot_data <= 16'hfffe;

endelse if(cnt == 4'h2)

begin

dot_con <= 16'h2000;

dot_data <= 16'h0104;

endelse if(cnt == 4'h3)

begin

dot_con <= 16'h1000;

dot_data <= 16'h0100;

endelse if(cnt == 4'h4)

begin

dot_con <= 16'h0800;

dot_data <= 16'h0100;

endelse if(cnt == 4'h5)

begin

dot_con <= 16'h0400;

dot_data <= 16'h0100;

endelse if(cnt == 4'h6)

begin

dot_con <= 16'h0200;

dot_data <= 16'h0100;

endelse if(cnt == 4'h7)

begin

dot_con <= 16'h0100;

dot_data <= 16'h0100;

endelse if(cnt == 4'h8)

begin

dot_con <= 16'h0080;

dot_data <= 16'h7ffc;

endelse if(cnt == 4'h9)

begin

dot_con <= 16'h0040;

dot_data <= 16'h0108;

endelse if(cnt == 4'ha)

begin

dot_con <= 16'h0020;

dot_data <= 16'h0100;

endelse if(cnt == 4'hb)

begin

dot_con <= 16'h0010;

dot_data <= 16'h0100;

endelse if(cnt == 4'hc)

begin

dot_con <= 16'h0008;

dot_data <= 16'h0100;

endelse if(cnt == 4'hd)

begin

dot_con <= 16'h0004;

dot_data <= 16'h0100;

endelse if(cnt == 4'he)

begin

dot_con <= 16'h0002;

dot_data <= 16'h7ffc;

endelse if(cnt == 4'hf)

begin

dot_con <= 16'h0001;

dot_data <= 16'h0008;

end end

if(cnt2 == 3'h1)

begin

if(cnt == 4'h0)

begin

dot_con <= 16'h8000;

dot_data <= 16'h2040;

endelse if(cnt == 4'h1)

begin

dot_con <= 16'h4000;

dot_data <= 16'h2040;

endelse if(cnt == 4'h2)

begin

dot_con <= 16'h2000;

dot_data <= 16'h2040;

endelse if(cnt == 4'h3)

begin

dot_con <= 16'h1000;

dot_data <= 16'h2040;

endelse if(cnt == 4'h4)

begin

dot_con <= 16'h0800;

dot_data <= 16'h27fc;

endelse if(cnt == 4'h5)

begin

dot_con <= 16'h0400;

dot_data <= 16'he040;

endelse if(cnt == 4'h6)

begin

dot_con <= 16'h0200;

dot_data <= 16'h2040;

endelse if(cnt == 4'h7)

begin

dot_con <= 16'h0100;

dot_data <= 16'h15f4;

endelse if(cnt == 4'h8)

begin

dot_con <= 16'h0080;

dot_data <= 16'h0a4e;

endelse if(cnt == 4'h9)

begin

dot_con <= 16'h0040;

dot_data <= 16'h2110;

endelse if(cnt == 4'ha)

begin

dot_con <= 16'h0020;

dot_data <= 16'h60a0;

實驗報告電路實驗報告要求

三一文庫 報告范文 實驗報告 電路實驗報告要求 同學您好 電路實驗課已經結束,請按題目要求認真完成實驗報告,並要仔細檢查一遍,以免退回,具體要求如下 一 繪製電路圖要工整 選取合適比例,元件引數標註要準確 完整。二 計算題要有計算步驟 解題過程,要代具體資料進行計算,不能只寫得數。三 實驗中測試得到...

實驗四點陣

一 實驗目的 1 通過實驗,熟悉並掌握試驗系統原理與使用方法。2 掌握點陣的原理,和使用方法。二 實驗內容 1 實現點陣顯示字。2 了解點陣的使用原理和引腳接法。3 掌握使用keil環境程式設計。4 掌握 keil編譯好的程式到51微控制器中。三 實驗步驟 1 掌握51微控制器與外設點陣的引腳接法和...

實驗報告 高中化學實驗報告

1 1 稱取4gnaoh,5.85gnacl 2 用量筒量取適量蒸餾水 3 置於燒杯中攪拌溶解冷卻 4 用玻璃棒將液體引流到1l的容量瓶中 5 再用蒸餾水洗燒杯,再引流到容量瓶中 6 用膠頭滴管定容 7 蓋上容量瓶蓋子,上下搖晃,混合均勻即可2 1 驗漏 2 用標準液和待測液潤洗滴定管 3 取高錳酸...