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

正文內(nèi)容

北航電子電路設(shè)計(jì)訓(xùn)練數(shù)字部分實(shí)驗(yàn)報(bào)告(編輯修改稿)

2024-08-30 01:54 本頁面
 

【文章內(nèi)容簡(jiǎn)介】 reg clk。 initial begin clk=0。 forever 50 clk=~clk。 end initial begin a=439。h3。 $display()。 100 a=439。h7。 $display()。 100 a=439。hf。 $display()。 100 a=439。ha。 $display()。 100 a=439。h2。 $display()。 100 $display()。 $stop。 end non_blocking non_blocking(clk,a,b2,c2)。 blocking blocking(clk,a,b1,c1)。 blocking1 blocking1(clk,a,b3,c3)。 blocking2 blocking2(clk,a,b4,c4)。endmodule 仿真實(shí)驗(yàn)關(guān)鍵結(jié)果及其解釋圖 8 練習(xí)四仿真結(jié)果 仿真圖中a對(duì)應(yīng)輸入,bb1=c1,可以看出在時(shí)序邏輯中使用阻塞賦值有可能會(huì)導(dǎo)致輸出邏輯結(jié)果不正確。而在blocking1中,改變了兩者的賦值順序。,在無優(yōu)化的仿真中,邏輯輸出也有錯(cuò)誤。 實(shí)驗(yàn)任務(wù)2——在Verilog HDL中使用函數(shù) 實(shí)驗(yàn)要求利用一個(gè)函數(shù)調(diào)用的實(shí)例,采用同步時(shí)鐘觸發(fā)運(yùn)算的執(zhí)行,每個(gè)clk時(shí)鐘周期前都會(huì)執(zhí)行一次運(yùn)算,并在測(cè)試模塊中,通過調(diào)用系統(tǒng)任務(wù)$display及在時(shí)鐘下降沿顯示每次計(jì)算的結(jié)果。 模塊的核心邏輯設(shè)計(jì)//module tryfunct(clk,n,result,reset)。 output[31:0] result。 input[3:0] n。 input reset,clk。 reg[31:0] result。 always @(posedge clk) begin if(!resetmodule tryfunct(clk,n,result,reset)。 output[31:0] result。 input[3:0] n。 input reset,clk。 reg[31:0] result。 always @(posedge clk) begin if(!reset) result=0。 else begin result=n*factorial(n)/((n*2)+1)。 end end function [31:0] factorial。 input [3:0] operand。 reg [3:0] index。 begin factorial=operand?1:0。 for(index=2。index=operand。index=index+1) factorial=index*factorial。 end endfunctionendmodule ) result=0。 else begin result=n*factorial(n)/((n*2)+1)。 end end function [31:0] factorial。 input [3:0] operand。 reg [3:0] index。 begin factorial=operand?1:0。 for(index=2。index=operand。index=index+1) factorial=index*factorial。 end endfunctionendmodule//module controlfunc(clk,n,result,reset,a)。output[7:0] result。input[3:0] n。input[1:0] a。input reset,clk。reg[7:0] result。always @(posedge clk or a) begin if(!reset) result=0。 else begin case(a) 239。b00: result=1。 239。b01: result=factorial(n)。 239。b10: result=pf(n)。 239。b11: result=lf(n)。 endcase end end function [7:0] factorial。 input [3:0] operand。 reg [3:0] index。 begin factorial=(operand6amp。 amp。operand=0)?1:0。 for(index=2。index=operand。index=index+1) factorial=index*factorial。 endendfunction function [7:0]pf。 input [3:0] operand。 reg [3:0] index。 begin pf=operand*operand。 endendfunction function [7:0]lf。 input [3:0] operand。 reg [3:0] index。 begin lf=operand*operand*operand。 endendfunctionendmodule 測(cè)試程序的核心邏輯設(shè)計(jì)//`include./`timescale 1ns/100ps`define clk_cycle 50module tryfuctTop。 reg[3:0] n,i。 reg reset,clk。 wire[31:0] result。 initial begin clk=0。 n=0。 reset=1。 100 reset=0。 100 reset=1。 for(i=0。i=15。i=i+1) begin 200 n=i。 end 100 $stop。 end always `clk_cycle clk=~clk。 tryfunct m(.clk(clk),.n(n),.result(result),.reset(reset))。 endmodule //`include./`timescale 1us/1ns`define clk_cycle 50module test。reg[3:0] n。reg[1:0] a。reg reset,clk。wire[7:0] result。parameter t=16。initial begin clk=0。 n=0。 reset=1。 a=239。b0。 10 reset=0。 50 reset=1。 repeat(t) begin 200 a={$random}%3。 200 n={$random}%15。 end 100 $stop。 end always `clk_cycle clk=~clk。 controlfunc m(.clk(clk),.n(n),.result(result),.reset(reset),.a(a))。endmodule北京航空航天大學(xué) 電子電路設(shè)計(jì)訓(xùn)練(數(shù)字EDA部分)實(shí)驗(yàn)報(bào)告 仿真實(shí)驗(yàn)關(guān)鍵結(jié)果及其解釋//練習(xí)六仿真結(jié)果圖 9 練習(xí)六仿真結(jié)果 仿真結(jié)果利用十進(jìn)制表示,模塊調(diào)用函數(shù)來完成輸入值n的階乘,之后輸出n*n!/(n*2+1)的整數(shù)部分,機(jī)result值。//實(shí)驗(yàn)六練習(xí)題圖 10 練習(xí)六練習(xí)題仿真結(jié)果 圖中定義a為控制變量,a=1,表示求階乘,a=2表示求平方,a=3表示求立方,其他輸出結(jié)果為0。利用隨機(jī)數(shù)產(chǎn)生輸入值n,當(dāng)n為負(fù)值時(shí),輸出為0。
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1