在Verilog里面, 定义了如下几种gate/swich:
逻辑门
type | 特征 | 说明 |
---|
and | N个输入, 一个输出 | 输出多个输入的and操作结果 |
nand | N个输入, 一个输出 | 输出多个输入的and操作取反的结果 |
or | N个输入, 一个输出 | 输出多个输入的or操作结果 |
nor | N个输入, 一个输出 | 输出多个输入的or操作取反的结果 |
xor | N个输入, 一个输出 | 输出多个输入的xor操作结果 |
xnor | N个输入, 一个输出 | 输出多个输入的xor操作取反的结果 |
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210530133933444.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JhaWppd2Vp,size_16,color_FFFFFF,t_70)
缓冲门/非门
type | 特征 | 说明 | example |
---|
buf | 一个输入, N个输出 | 最后一个参数是输入 | buf b1_2out(OUT1,OUT2,IN); |
not | 一个输入, N个输出 | 最后一个参数是输入 | not (OUT1,IN); |
![在这里插入图片描述](https://img-blog.csdnimg.cn/2021053013583660.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JhaWppd2Vp,size_16,color_FFFFFF,t_70)
三态门(带控制端的缓冲器/非门)
type | 特征 | example |
---|
bufif0 | 第一个参数是输出, 第二个是输入, 第三个参数是控制 | bufif0 bf1 (outw, inw, controlw); |
bufif1 | 第一个参数是输出, 第二个是输入, 第三个参数是控制 | bufif1 bf2 (outw, inw, controlw); |
notif0 | 第一个参数是输出, 第二个是输入, 第三个参数是控制 | notif0 not1 (outw, inw, controlw); |
notif1 | 第一个参数是输出, 第二个是输入, 第三个参数是控制 | bufif1 not1 (outw, inw, controlw); |
![在这里插入图片描述](https://img-blog.csdnimg.cn/20210530141109197.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2JhaWppd2Vp,size_16,color_FFFFFF,t_70)
双向开关
type | 特征 | example |
---|
tran | 参数是输入输出双向的 | tran tr (inout1, inout2, …); |
tranif0 | 参数是输入输出双向的, 带有传输控制参数 | tranif0 tr0 (inout1, inout2, control); |
tranif1 | 参数是输入输出双向的, 带有传输控制参数 | tranif1 tr1 (inout1, inout2, control); |
rtran | 参数是输入输出双向的 | rtran rtr (inout1, inout2, …); |
rtranif0 | 参数是输入输出双向的, 带有传输控制参数 | rtranif0 rtr0 (inout1, inout2, control); |
rtranif1 | 参数是输入输出双向的, 带有传输控制参数 | rtranif1 rtr1 (inout1, inout2, control); |
MOS 开关