心智圖資源庫 組合邏輯電路模組設計
數位邏輯與電腦體系結構,期末複習筆記第三章。數位電路依邏輯功能的不同特點,可以分成兩大類,一類叫做組合邏輯電路(簡稱組合電路),另一類叫做時序邏輯電路。
編輯於2021-05-20 11:17:41This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about bacteria, and its main contents include: overview, morphology, types, structure, reproduction, distribution, application, and expansion. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about plant asexual reproduction, and its main contents include: concept, spore reproduction, vegetative reproduction, tissue culture, and buds. The summary is comprehensive and meticulous, suitable as review materials.
This is a mind map about the reproductive development of animals, and its main contents include: insects, frogs, birds, sexual reproduction, and asexual reproduction. The summary is comprehensive and meticulous, suitable as review materials.
模組設計
語言基礎
運算
零擴充
無符號數:位數少的高位補0和位數多的進行運算
有符號數:位數少的高位補符號位元擴展到和位數多的數運算
縮減運算(一元規約)
包括& | ^和~^
結果只有一位1或0
舉例:y=[4:0]a &a==y[0]&y[1]&y[2]&y[3]&y[4]
移位運算
無符號數
邏輯左移<<
低位補0
邏輯右移>>
高位補0
有符號數
算數左移<<<
低位補0
算術右移>>>
高位補符號位
運算結果為邏輯值1 0
相等運算
==和!=
關係運算
< > >=且<=
表達式中有一個無符號數(eg:4'd5),其他都變成無符號數
邏輯運算
!(單目運算)&&(雙眼)以及‖(雙眼))
條件運算?:
舉例: assign y=s?d0:d1 s輸入為1,結果為d0,否則為d1
位元混合運算(位元拼接運算)
Y={B[0],2C[1],2b′10}常數位寬不能省略
複製運算 {n{A}},將訊號A重複拼接n次
資料類型
變數
logic [7:0] a八位元無符號向量訊號
多態性
單源驅動訊號
output logic a
線網路(多輸入)
tri [7:0] a八位元tri類型向量訊號
多源驅動訊號
output tri a
建模方法
行為建模(透過輸入輸出之間的因果關係直接建模)
assign(持續賦值)
assign #5 out = A&B; //經過5個時間單位延遲後賦值給out,#5用於模擬不可綜合
assign out=A&B;右邊一旦有量變化,左邊立即重新賦值
左側可以是logic也可以是tri;任何輸入變化都會立即影響輸出結果。
always和initial(基於過程區塊)
阻塞賦值 out=a&b 。前面語句未完成,後面無法執行
文法
initial用於仿真。 always建模模擬皆可,類似無限迴圈。
無assign。左邊必須是變數(如logic),不可以線網
begin……end(相當於{})
always_comb begin …… end endmoudle
分支結構
if……else
begin end標誌範圍
case
case endcase標誌範圍
casez
條件判斷可加?,該位元始終為真
循環結構
for
begin end相當於大括號!
repeat
reapeat(指定迴圈次數) 語句塊;
while
forever
(無限迴圈)forever 語句塊
結構化建模(將複雜的電路劃分為多個子模組,再分別建模並組合)
結構化建模
模組實例化
閘級建模
參數化建模(parameter宣告參數,類似巨集定義)
用法
generate語句
generate…endgenerate
測試程式
要素
激勵
待測模組
輸出
訊號
待測模組
回應
結構
訊號定義 模組實例化 添加激勵訊號 顯示輸出結果
範例
激勵訊號
initial過程區塊,線性激勵
always過程區塊,循環激勵
透過文件施加激勵