freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[理學(xué)]veriloghdl復(fù)雜數(shù)字系統(tǒng)設(shè)計(jì)-本(參考版)

2025-03-26 00:04本頁(yè)面
  

【正文】 else q=q+1。 always ( posedge clk or negedge rst) if (!rst) q=0。 output [3:0] q。 endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 152 例 76:帶有異步清零端的同步 4位二進(jìn)制加法計(jì)數(shù)器 module ncounter(rst, clk, q )。 bufif0 bf6(out , in [6], !t)。 bufif0 bf4(out , in [4], !t)。 bufif0 bf2(out , in [2], !t)。 bufif0 bf0(out , in [0], !t)。 input a,t。 endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 151 例 2: module tir(a, t, out) 。 wire [7:0] out。 output[7:0] out。 endcase else mout=0。 3?b110:mout=in7。 3?b100:mout=in5。 3?b010:mout=in3。 always (addr or in1 or in2 or in3 or in4 or in5 or in6 or in7 or in8 or ncs) begin if(!ncs) //if (ncs= = 0) 2022/4/14 南通大學(xué)電子信息學(xué)院 149 case(addr) 3?b000:mout=in1。 output [width1:0] mout。 input [2:0] addr 。 輸入 地址 輸出 2022/4/14 南通大學(xué)電子信息學(xué)院 148 module mux_8(addr, in1,in2,in3,in4,in5,in6,in7,in8,mout,ncs) 。xsy=1。xsy=0。 else xey=0。 reg xgy,xsy,xey。 input[width1:0] x , y 。 module pare_n(x,y,xgy,xsy,xey) 。 assign product = x * y 。 input[3:0] x , y 。若需要重復(fù)使用該運(yùn)算器,則需要在控制數(shù)據(jù)流動(dòng)的狀態(tài)機(jī)中為其安排必要的時(shí)序。然后設(shè)計(jì)者還需通過(guò)布局布線工具生成具有布線延遲的電路,再進(jìn)行后仿真,便可知道該加法器的實(shí)際延時(shí)。有的高性能綜合器還可以根據(jù)用戶對(duì)運(yùn)算速度的要求插入流水線結(jié)構(gòu),來(lái)提高運(yùn)算器的性能。設(shè)計(jì)者可以考慮提高電路的速度,也可以考慮節(jié)省電路元件以減少電路占用硅片的面積。借助綜合器,可以根據(jù)以上 Verilog HDL源代碼自動(dòng)將其綜合成典型的加法器電路結(jié)構(gòu)。 assign {c,sum}=x+y。 output[3:0] sum。 endtable endprimitive 2022/4/14 南通大學(xué)電子信息學(xué)院 136 第 10章 編寫和驗(yàn)證純組合邏輯模塊 2022/4/14 南通大學(xué)電子信息學(xué)院 137 加法器 2022/4/14 南通大學(xué)電子信息學(xué)院 138 2022/4/14 南通大學(xué)電子信息學(xué)院 139 2022/4/14 南通大學(xué)電子信息學(xué)院 140 加法器的行為級(jí)描述 module add_4(x,y,sum,c)。 1 1 0 : ? : 1 。 initial begin q=0; end table // d clk clrb : qn : qn+1 ? ? 1 : ? : 0 。 input d, clk, clrb。 …… …… ……。 邏輯值 邏輯值 邏輯值 …… : 邏輯值 。 reg 輸出端口名 。 //置數(shù) end endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 133 仿真: 2022/4/14 南通大學(xué)電子信息學(xué)院 134 *( UDP) 定義 UDP primitive 元件名(輸出端口名,輸入端口名 1,輸入端口名 2……) output 輸出端口名 。//清 0 else if(prn= =0) q=1。 assign qn=!q。 output q,qn。 module dff_7474(d,clk,clrn,prn,q,qn)。//清 0 else q=d。 reg[3:0] q。 input[3:0] d。 endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 131 VerilogHDL的行為級(jí)建模 例 93:行為描述的 4位寄存器 module hardreg(d,clk,clrb,q)。 output[3:0] q。 input clk,clrb。 not 10 iv1(ndata,data), iv2(nclock,clock)。 nand 10 nd1(a,data,clock,clear), nd2(b, data,clock), nd4(d,c,b,clear), nd5(e,c,nclock), nd6(f,d,nclock), nd8(qb,q,f,clear)。 input data, clock, clear。 2022/4/14 南通大學(xué)電子信息學(xué)院 126 `ifdef 宏名 程序段 1 `else 程序段 2 `endif 2022/4/14 南通大學(xué)電子信息學(xué)院 127 第 9章 不同抽象級(jí)別的 Verilog HDL模型 2022/4/14 南通大學(xué)電子信息學(xué)院 128 門級(jí)結(jié)構(gòu)描述 門類型(共 26個(gè)) and nand or nor xor xnor buf not 引用聲明舉例: and 10 and0 ( f, a, b, c, d )。 ?文件包含是可以嵌套的 2022/4/14 南通大學(xué)電子信息學(xué)院 125 3. 時(shí)間尺度 `timescale 作用:說(shuō)明該命令后模塊的仿真時(shí)間單位和時(shí)間精度。 ?引用時(shí)在宏名前加上 “ ` ‖。 ?先定義,后使用。 2022/4/14 南通大學(xué)電子信息學(xué)院 123 說(shuō)明: ?建議宏名用大寫字母。 end $display(―final value =%d‖,value) end endmodule 函數(shù)調(diào)用 2022/4/14 南通大學(xué)電子信息學(xué)院 120 第 7章 調(diào)試用系統(tǒng)任務(wù)和常用編譯預(yù)處理語(yǔ)句 2022/4/14 南通大學(xué)電子信息學(xué)院 121 系統(tǒng)任務(wù) $display和 $write 例如: $display(“Partial result n=%d result=%d”,n,result)。m=9。 initial begin value =1。 end endfunction 函數(shù) 2022/4/14 南通大學(xué)電子信息學(xué)院 119 reg[31:0] value。 i= n。 begin f =1。 input[3:0] n。 2022/4/14 南通大學(xué)電子信息學(xué)院 117 4)函數(shù)的使用規(guī)則 ?函數(shù)中不能包含時(shí)間控制語(yǔ)句 ?函數(shù)不能啟動(dòng)任務(wù) ?函數(shù)至少有一個(gè)輸入?yún)⒘? ?函數(shù)中必須對(duì)與函數(shù)名相同的寄存器賦值 2022/4/14 南通大學(xué)電子信息學(xué)院 118 例 62: 計(jì)算 )1!(2?nnmodule func。 d 。 c amp。 b amp。 f_and=a amp。 定義函數(shù)的語(yǔ)法 function返回值的類型或范圍 函數(shù)名; 端口說(shuō)明語(yǔ)句 變量類型說(shuō)明語(yǔ)句 begin 語(yǔ)句 end end function 缺省時(shí),返回值的類型為 1位 reg型 2022/4/14 南通大學(xué)電子信息學(xué)院 115 2)函數(shù)的返回值 ? 函數(shù)定義語(yǔ)句隱含對(duì)函數(shù)名相同的、函數(shù)內(nèi)部寄存器的聲明 ? 函數(shù)中必須對(duì)與函數(shù)名相同的寄存器賦值 ? 范圍缺省時(shí),返回值為 1位 reg型 3)函數(shù)的調(diào)用 ? 函數(shù)名 (表達(dá)式 ,表達(dá)式 *) ? 調(diào)用時(shí),函數(shù)被當(dāng)作表達(dá)式中的操作數(shù) 2022/4/14 南通大學(xué)電子信息學(xué)院 116 ?函數(shù)調(diào)用舉例: function f_and。 100 clock=1。//等待上升沿 color=off。input [31:0] tics。 end task light。 green=on。 amber=on。 2022/4/14 南通大學(xué)電子信息學(xué)院 113 always begin red=on。 initial amber=off 。 parameter on=1,off=0,red_tics=350, amber_tics=30,green_tics=200。 end endtask endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 112 例 61:交通信號(hào)燈設(shè)計(jì) module traffic_lights。 if(a==c) e=1。f=0。 begin d=0。// input a,b,c 。 always (a or b or c) my_task(a,b,c,d,e,f)。 2022/4/14 南通大學(xué)電子信息學(xué)院 111 例如 :module pare1(a,b,c,d,e,f)。 ?函數(shù)有返回值,任務(wù)沒(méi)有返回值。 ?任務(wù)可以調(diào)用函數(shù),函數(shù)不能調(diào)用任務(wù)。 //置數(shù) end endmodule 2022/4/14 南通大學(xué)電子信息學(xué)院 108 task和 function說(shuō)明語(yǔ)句 任務(wù)和函數(shù)說(shuō)明語(yǔ)句 作用: ?把大的程序分解成比較小的程序; ?不同地方多次使用的相同程序段設(shè)計(jì)成task或 function, 能夠簡(jiǎn)化程序。 always (posedge clk or posedge clrb) begin if(clrb) q=8?b00000000。 output[7:0] q。 input clk,clrb。 always (posedge clk) q=d。 output[7:0] q。 input clk。 else out=b。 reg out。 input a,b,sl。 ?一個(gè)模塊中可以有多個(gè) always 塊。缺少“時(shí)序控制”,將產(chǎn)生死鎖。 ?作用之二:產(chǎn)生激勵(lì)波形,用于測(cè)試文件。 ?每個(gè) initial塊只在仿真開始時(shí)執(zhí)行一次,多個(gè) initial塊是并行的運(yùn)行的。tempreg= tempreg 1) if(tempreg[0]= =1) count=co
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1