[Verilog]Verilog中提供的逻辑门和开关模型的定義及用法總結

       摘要:Verilog中已有一些建立好的逻辑门和开关的模型。在所涉及的模块中,可通过实例引用这些门与开关模型,从而对模块进行结构化的描述。

一、逻辑门

and (output,input,...)  

nand (output,input,...)

or (output,input,...)

nor (output,input,...)

xor (output,input,...)

xnor (output,input,...)

二、缓冲器和非门

buf (output,...,input)

not (output,...,input)

三、三态门

bufif0 (output,input,enable)

bufif1 (output,input,enable)

notif0 (output,input,enable)

notif1 (output,input,enable)

四、MOS开关

nmos (output,input,enable)

pmos (output,input,enable)

rnmos (output,input,enable)

rpmos (output,input,enable)

五、CMOS开关

cmos (output,input,Nenable,Penable)

rcmos (output,input,Nenable,Penable)

六、双向开关

tran (inout,inout2)

rtran (inout,inout2)

七、双向可控开关

tranif0 (inout1,inout2,control)

tranif1 (inout1,inout2,control)

rtranif0 (inout1,inout2,control)

rtranif1 (inout1,inout2,control)

八、上拉源和下拉源

pullup (output)

pulldown (output)

九、以下为上述门电路的真值表,其中逻辑值L和H代表部分未知值。L表示0或者Z,H表示1或者Z;

       1、與門(and)真值表

與門(and)真值表
and  0   1   x   z 
 0   0  0  0  0
 1  0  1   x  x
 x  0  x  x  x
 z  0  x  x  x

       2、與非門(nand)真值表

與非門(nand)真值表
nand  0   1   x   z 
 0   1  1  1  1
 1  1  0   x  x
 x  1  x  x  x
 z  1  x  x  x

       3、或門(or)真值表

或門(or)真值表
or  0   1   x   z 
 0   0  1  x  x
 1  1  1   1  1
 x  x  1  x  x
 z  x  1  x  x

       4、或非門(nor)真值表

或非門(nor)真值表
nor  0   1   x   z 
 0   1  0  x  x
 1  0  0   0  0
 x  x  0  x  x
 z  x  0  x  x

     5、同或門(xnor)真值表

同或門(xnor)真值表
xnor  0   1   x   z 
 0   1  0  x  x
 1  0  1   x  x
 x  x  x  x  x
 z  x  x  x  x

      6、異或門(xor)真值表

異或門(xor)真值表
xor  0   1   x   z 
 0   0  1  x  x
 1  1  0   x  x
 x  x  x  x  x
 z  x  x  x  x

       7、緩衝器(buf)和非門(not)真值表

緩衝器(buf)和非門(not)真值表
buf   not
Input Output   Input Output
0 0   0 1
1 1   1 0
x x   x x
z x   z x

     

发布了140 篇原创文章 · 获赞 81 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/gsjthxy/article/details/103781160