九九热最新网址,777奇米四色米奇影院在线播放,国产精品18久久久久久久久久,中文有码视频,亚洲一区在线免费观看,国产91精品在线,婷婷丁香六月天

歡迎來到裝配圖網(wǎng)! | 幫助中心 裝配圖網(wǎng)zhuangpeitu.com!
裝配圖網(wǎng)
ImageVerifierCode 換一換
首頁 裝配圖網(wǎng) > 資源分類 > DOCX文檔下載  

華中科技大學Verilog語言實驗報告.docx

  • 資源ID:116537878       資源大?。?span id="24d9guoke414" class="font-tahoma">1.11MB        全文頁數(shù):34頁
  • 資源格式: DOCX        下載積分:12積分
快捷下載 游客一鍵下載
會員登錄下載
微信登錄下載
三方登錄下載: 微信開放平臺登錄 支付寶登錄   QQ登錄   微博登錄  
二維碼
微信掃一掃登錄
下載資源需要12積分
郵箱/手機:
溫馨提示:
用戶名和密碼都是您填寫的郵箱或者手機號,方便查詢和重復下載(系統(tǒng)自動生成)
支付方式: 支付寶    微信支付   
驗證碼:   換一換

 
賬號:
密碼:
驗證碼:   換一換
  忘記密碼?
    
友情提示
2、PDF文件下載后,可能會被瀏覽器默認打開,此種情況可以點擊瀏覽器菜單,保存網(wǎng)頁到桌面,就可以正常下載了。
3、本站不支持迅雷下載,請使用電腦自帶的IE瀏覽器,或者360瀏覽器、谷歌瀏覽器下載即可。
4、本站資源下載后的文檔和圖紙-無水印,預覽文檔經(jīng)過壓縮,下載后原文更清晰。
5、試題試卷類文檔,如果標題沒有明確說明有答案則都視為沒有答案,請知曉。

華中科技大學Verilog語言實驗報告.docx

2016Verilog 語言 實驗報告專 業(yè):計算機科學與技術(shù)班 級:CS1409學 號:U201414813姓 名:唐禮威電 話:15827505005郵 件:完成日期:2016.6.13華 中 科 技 大 學 課 程 實 驗 報 告目 錄1數(shù)據(jù)通路實驗11.1實驗目的11.2實驗內(nèi)容及要求11.3實驗方案21.4實驗步驟21.5故障及分析21.6仿真與結(jié)果31.7心得與體會42FSM實驗52.1實驗目的52.2實驗內(nèi)容及要求52.3實驗方案62.4實驗步驟62.5故障及分析72.6仿真與結(jié)果72.7心得與體會83意見和建議94附錄1011 數(shù)據(jù)通路實驗1.1 實驗目的綜合應用掌握的簡單組合電路和時序電路的設(shè)計方法,完成一個簡單的數(shù)據(jù)通路的設(shè)計。1.2 實驗內(nèi)容及要求1. 根據(jù)下圖給出的數(shù)據(jù)通路(圖中R0、R1和ACC是寄存器,+是加法器,其它則是多路選擇器),完成相應的Verilog程序設(shè)計,圖中數(shù)據(jù)線的寬度為8位,要求可以擴充至16位或者是32位;2. 根據(jù)下圖給出的數(shù)據(jù)通路(圖中SUM和NEXT是寄存器,Memory是存儲器,+是加法器,=0是比較器,其它則是多路選擇器),完成相應的Verilog程序設(shè)計,圖中數(shù)據(jù)線的寬度為8位,要求可以擴充至16位或者是32位。實驗要求:程序必須自己編寫,滿足數(shù)據(jù)通路設(shè)計要求,綜合結(jié)果正確。1.3 實驗方案根據(jù)要求,先把選擇器、加法器、寄存器、比較器和存儲器分模塊編寫,在主模塊中根據(jù)數(shù)據(jù)通路調(diào)用即可。題目中要求數(shù)據(jù)線寬度為8位,并且可以擴充至16位或32位,所以在前面定義WIDTH,利用parameter的參數(shù)傳遞功能來實現(xiàn)。1.4 實驗步驟1.分模塊編寫代碼(見附錄)2.運行綜合Run Synthesis3.綜合成功后檢查RTL Analysis中的電路圖Schematic1.5 故障及分析剛開始跑出來很多線是斷的,后來發(fā)現(xiàn)是引腳對應部分的代碼沒有寫完整。后來加法器和ACC的參數(shù)順序?qū)戝e,導致接線與題給的不一致,發(fā)現(xiàn)問題后及時改正了。1.6 仿真與結(jié)果Schematic圖形如下:第一個數(shù)據(jù)通路:第二個數(shù)據(jù)通路:由以上兩圖可得,成功完成了要求的數(shù)據(jù)通路的設(shè)計,滿足了各基本器件的輸入輸出鏈接要求;改變數(shù)據(jù)線寬度后再檢查電路圖,發(fā)現(xiàn)數(shù)據(jù)線做出相應改變,完成該實驗。1.7 心得與體會對數(shù)據(jù)通路的設(shè)計有了更好的理解,明白了數(shù)據(jù)通路的基本器件構(gòu)成,熟悉了這些器件的功能和端口,掌握了Verilog完成基本運算器件的設(shè)計,完成了數(shù)據(jù)通路的設(shè)計。 2 FSM實驗2.1 實驗目的掌握用Verilog語言進行FSM設(shè)計、實現(xiàn)和仿真的方法。2.2 實驗內(nèi)容及要求5.1_1、用FSM實現(xiàn)一個mealy型序列檢測器,對一位的串行輸入序列中的“1”的數(shù)量進行檢測。如果“1”的總數(shù)可以被3整除,輸出“1”,否則輸出“0”。5.1_2、用FSM實現(xiàn)一個moore型序列檢測器,對兩位的串行輸入序列進行檢測。輸入01,00時,輸出0,輸入11,00時,輸出1,輸入10,00時,輸出反向。5.1_3、用FSM實現(xiàn)一個計數(shù)器(采用存儲器),對一位的輸入進行計數(shù)。計數(shù)序列為:000,001,011,101,111,010。5.2、用FSM實現(xiàn)一個序列識別器,該FSM的狀態(tài)轉(zhuǎn)移圖如下所示,它能夠?qū)σ晃坏拇休斎胄蛄兄械摹?”的數(shù)量進行檢測。如果FSM發(fā)現(xiàn)輸入“1”的總數(shù)可以被3整除時,輸出“1”;否則,輸出“0”。同時針對“01011011101”輸入序列,寫出相應的仿真程序并進行真波測試。2.3 實驗方案先根據(jù)要求畫出狀態(tài)圖,根據(jù)狀態(tài)圖編寫程序,根據(jù)程序編寫仿真程序,最后得出結(jié)果和結(jié)論。2.4 實驗步驟5.1_1狀態(tài)圖:S1S0 in=1/1 in=1/0 in=0/0 in=1/0 in=1/0S4S3 in=0/0 in=1/1 in=0/05.1_2狀態(tài)圖:S0 in=00 in=01 in=10 in=11S2S1S3S6S5S4 in=00 in=00 in=00 out=0 out翻轉(zhuǎn) out=15.1_3狀態(tài)圖:1.根據(jù)以上狀態(tài)圖編寫源程序(見附錄)2.運行綜合Run Synthesis3.綜合正確后編寫仿真程序4.仿真,得到仿真波形,驗證結(jié)果2.5 故障及分析無故障2.6 仿真與結(jié)果5.1_1:如圖,1的個數(shù)是3的倍數(shù)時輸出1與預期一致5.1_2:如圖,輸入01后再輸入00,輸出0;輸入11后再輸入00,輸出1;輸入10后再輸入00,輸出翻轉(zhuǎn):與預期一致5.1_3:如圖,輸出序列為000,001,011,101,111,010(重復)與預期一致5.2:如圖,1的個數(shù)是3的倍數(shù)時輸出1與預期一致2.7 心得與體會這次實驗通過FSM設(shè)計明白了設(shè)計的過程和步驟,首先要知道分為哪些狀態(tài),設(shè)計的是何種電路,如何選擇用mealy還是moore型電路,狀態(tài)轉(zhuǎn)移要如何實現(xiàn)。知道了mealy型和moore型電路的區(qū)別:當要求輸出對輸入快速響應并希望電路簡單時選擇mealy型,當要求時序輸出穩(wěn)定,能接受輸出序列晚一個周期,即選擇moore型電路不增加電路復雜性時,選擇moore型電路。3 意見和建議建議老師上課還是用中文PPT比較好,另外作業(yè)練習也用中文給出來,題目要求也盡量具體些,這樣會減少我們學習的成本,更加有效的學習這門課。4 附錄源程序:4.1(第一個數(shù)據(jù)通路)/主模塊module text4(S0,S1,S2,S3,Clk,reset,load,outR0,outR1,outACC,outS0,outS1,outS2,outS3,outA); parameter WIDTH=8; /位寬8位 input S0,S1,S2,S3,Clk,reset,load; output WIDTH-1:0 outR0,outR1,outACC,outS0,outS1,outS2,outS3,outA; register #(8) R0(inR0,Clk,reset,load,outR0); register #(8) R1(inR1,Clk,reset,load,outR1); register #(8) ACC(inACC,Clk,reset,load,outACC); mux #(8) S0(S0,inS00,inS01,outS0); mux #(8) S1(S1,inS10,inS11,outS1); mux #(8) S2(S2,inS20,inS21,outS2); mux #(8) S3(S3,inS30,inS31,outS3); add #(8) W1(inA0,inA1,outA); assign inS00=outS3; assign inS10=outS3; assign inS01=outR0; assign inS20=outR0; assign inS11=outR1; assign inS21=outR1; assign inA0=outACC; assign inS31=outACC; assign inACC=outA; assign inA1=outS2; assign inS30=outS2; assign inR1=outS1; assign inR0=outS0;endmodule/加法器模塊module add(A,B,C); parameter WIDTH=8; input WIDTH-1:0 A, B; output WIDTH-1:0 C; wire WIDTH:0 DATA; assign DATA=A+B; assign C=DATA7:0;endmodule/寄存器模塊module register(D,Clk,reset,load,Q); parameter WIDTH=8; input WIDTH-1:0 D; input Clk,reset,load; output reg WIDTH-1:0 Q;always (posedge Clk)if (reset)beginQ = 8b0;end else if (load)beginQ b) out=1; else out=0; endendmodule/存儲器模塊module ROM(ROM_data, ROM_addr);parameter data_WIDTH=8;parameter addr_WIDTH=8;output addr_WIDTH-1:0 ROM_data;input addr_WIDTH-1:0 ROM_addr;reg addr_WIDTH-1:0 ROM data_WIDTH-1:0; / defining 4x2 ROMassign ROM_data = ROMROM_addr; / reading ROM content at the address ROM_addrinitial $readmemb (ROM_data.txt, ROM, 0, 3); / load ROM content from ROM_data.txt fileendmodule/寄存器模塊module register(D,Clk,reset,load,Q); parameter WIDTH=8; input WIDTH-1:0 D; input Clk,reset,load; output reg WIDTH-1:0 Q;always (posedge Clk)if (reset)beginQ = 8b0;end else if (load)beginQ = D;endendmodule/加法器模塊module add(A,B,C); parameter WIDTH=8; input WIDTH-1:0 A, B; output WIDTH-1:0 C; wire WIDTH:0 DATA; assign DATA=A+B; assign C=DATA7:0;endmodule/二路選擇器模塊module mux(s,x,y,m); parameter WIDTH=8; input WIDTH-1:0 x,y; input s; output WIDTH-1:0 m;assign m =(s?y:x);endmodule5.1_1module lab5_1_1(input clk, input reset, input ain, output reg yout, output reg 3:0 count); reg 1:0 state, nextstate; parameter S0=0, S1=1, S2=2, S3=3; always (posedge clk) / always block to update state if (reset) begin state = S0; count = 0; end else state = nextstate; always (state or ain) / always block to compute output begin yout = 0; case(state) S0: if(!ain) yout = 1; S1: yout = 0; S2: yout = 0; S3: if(ain) yout = 1; endcase end always (posedge clk) / always block to compute output begin if(ain) count = count + 1; end always (state or ain) / always block to compute nextstate begin case(state) S0: if(ain) nextstate = S1; else nextstate = S0; S1: if(ain) nextstate = S2; else nextstate = S1; S2: if(ain) nextstate = S3; else nextstate = S2; S3: if(ain) nextstate = S1; else nextstate = S3; endcase end endmodule仿真程序:module lab5_1_1_tb(); reg clk,reset,ain; wire yout; wire 3:0 count; integer i; parameter TIME = 400; parameter DELAY = 5; lab5_1_1 DUT (.clk(clk), .ain(ain), .count(count), .reset(reset), .yout(yout); initial begin #TIME $finish; end initial begin clk = 0; for(i = 0; i (TIME/DELAY); i = i + 1) #DELAY clk = clk; end initial begin reset = 1; #(4*DELAY) reset = 0; #(34*DELAY) reset = 1; #(2*DELAY) reset = 0; end initial begin ain = 0; #(8*DELAY) ain = ain; #(4*DELAY) ain = ain; #(12*DELAY) ain = ain; #(8*DELAY) ain = ain; #(4*DELAY) ain = ain; #(6*DELAY) ain = ain; #(6*DELAY) ain = ain; endendmodule5.1_2module lab5_1_2(input clk, input reset, input 1:0 x, output reg yout, output reg 2:0 nextstate); reg 2:0 state; parameter S0=0, S11=1, S21=2, S31=3, S12=4, S22=5, S32=6; always (posedge clk) / always block to update state if (reset) begin state = S0; nextstate = S0; yout = 0; end else state = nextstate; always (state) / always block to compute output begin case(state) S0: yout = yout; S12: yout = 0; S22: yout = 1; S32: yout = yout; endcase end always (state or x) / always block to compute nextstate begin case(state) S0: if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S11: if(x = 0) nextstate = S12; else if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S12: if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S21: if(x = 0) nextstate = S22; else if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S22: if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S31: if(x = 0) nextstate = S32; else if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; S32: if(x = 1) nextstate = S11; else if(x = 3) nextstate = S21; else if(x = 2) nextstate = S31; endcase endendmodule仿真程序:module lab5_1_2_tb(); reg clk,reset; reg 1:0 x; wire 2:0 nextstate; wire yout; integer i; parameter TIME = 200; parameter DELAY = 5; lab5_1_2 DUT (.clk(clk), .x(x), .reset(reset), .yout(yout), .nextstate(nextstate); initial begin #TIME $finish; end initial begin clk = 0; for(i = 0; i (TIME/DELAY); i = i + 1) #DELAY clk = clk; end initial begin reset = 1; #(4*DELAY) reset = 0; end initial begin x = 0; #(8*DELAY) x = 3; #(2*DELAY) x = 2; #(2*DELAY) x = 0; #(4*DELAY) x = 2; #(2*DELAY) x = 0; #(2*DELAY) x = 3; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 2; #(2*DELAY) x = 3; #(2*DELAY) x = 0; #(6*DELAY) x = 2; #(6*DELAY) x = 0; endendmodule5.1_3module lab5_1_3(input clk, input reset, input x, output reg 2:0 yout, output reg 2:0 nextstate); reg 2:0 state; parameter S0=0, S1=1, S2=2, S3=3, S4=4, S5=5; always (posedge clk) / always block to update state if (reset) begin state = S0; nextstate = S0; end else state = nextstate; always (state or x) / always block to compute output begin case(state) S0: yout = 0; S1: yout = 1; S2: yout = 3; S3: yout = 5; S4: yout = 7; S5: yout = 2; endcase end always (x or state) / always block to compute nextstate begin case(state) S0: if(x) nextstate = S1; else nextstate = S0; S1: if(x) nextstate = S2; else nextstate = S1; S2: if(x) nextstate = S3; else nextstate = S2; S3: if(x) nextstate = S4; else nextstate = S3; S4: if(x) nextstate = S5; else nextstate = S4; S5: if(x) nextstate = S0; else nextstate = S5; endcase endendmodule仿真程序:module lab5_1_3_tb(); reg clk,reset; reg x; wire 2:0 nextstate; wire 2:0 yout; integer i; parameter TIME = 400; parameter DELAY = 5; lab5_1_3 DUT (.clk(clk), .x(x), .reset(reset), .yout(yout), .nextstate(nextstate); initial begin #TIME $finish; end initial begin clk = 0; for(i = 0; i (TIME/DELAY); i = i + 1) #DELAY clk = clk; end initial begin reset = 1; #(4*DELAY) reset = 0; end initial begin x = 0; #(8*DELAY) x = 1; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; #(2*DELAY) x = 1; #(2*DELAY) x = 0; endendmodule5.2module lab5_2_1(input clk, input reset, input ain, output reg yout, output reg 3:0 count); reg 1:0 state, nextstate; parameter S0=0, S1=1, S2=2, S3=3; always (posedge clk) / always block to update state if (reset) begin state = S0; count = 0; end else begin state = nextstate; if(ain) count = count + 1; end always (state) / always block to compute output begin yout = 0; case(state) S0: yout = 0; S1: yout = 0; S2: yout = 0; S3: yout = 1; endcase end always (posedge clk) / always block to compute output begin end always (state or ain) / always block to compute nextstate begin case(state) S0: if(ain) nextstate = S1; else nextstate = S0; S1: if(ain) nextstate = S2; else nextstate = S1; S2: if(ain) nextstate = S3; else nextstate = S2; S3: if(ain) nextstate = S1; else nextstate = S3; endcase end endmodule仿真程序:module lab5_2_1_tb(); reg clk,reset,ain; wire yout; wire 3:0 count; integer i; parameter TIME = 400; parameter DELAY = 5; lab5_2_1 DUT (.clk(clk), .ain(ain), .count(count), .reset(reset), .yout(yout); initial begin #TIME $finish; end initial begin clk = 0; for(i = 0; i (TIME/DELAY); i = i + 1) #DELAY clk = clk; end initial begin reset = 1; #(4*DELAY) reset = 0; #(34*DELAY) reset = 1; #(2*DELAY) reset = 0; end initial begin ain = 0; #(8*DELAY) ain = ain; #(4*DELAY) ain = ain; #(12*DELAY) ain = ain; #(8*DELAY) ain = ain; #(4*DELAY) ain = ain; #(6*DELAY) ain = ain; #(6*DELAY) ain = ain; endendmodul指導教師評定意見一、原創(chuàng)性聲明 本人鄭重聲明本報告內(nèi)容,是由作者本人獨立完成的。有關(guān)觀點、方法、數(shù)據(jù)和文獻等的引用已在文中指出。除文中已注明引用的內(nèi)容外,本報告不包含任何其他個人或集體已經(jīng)公開發(fā)表的作品成果,不存在剽竊、抄襲行為。 特此聲明!作者簽字: 二、對實驗的學術(shù)評語 三、對實驗的評分評分項目(分值)報告撰寫(30分)實驗過程(70分)最終評定(100分)得分 指導教師簽字: 年 月 日

注意事項

本文(華中科技大學Verilog語言實驗報告.docx)為本站會員(good****022)主動上傳,裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對上載內(nèi)容本身不做任何修改或編輯。 若此文所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng)(點擊聯(lián)系客服),我們立即給予刪除!

溫馨提示:如果因為網(wǎng)速或其他原因下載失敗請重新下載,重復下載不扣分。




關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!