📄 xor.vl
字号:
module not1(x,a);
input a;
output x;
supply1 pwr;
supply0 grd;
pmos p(x,pwr,a);
nmos n(x,grd,a);
endmodule
module xor1 (a, b, w);
input a, b;
output w;
supply1 vdd;
supply0 gnd;
wire w1,w2,w3,w4,an,bn;
not1 n0(an,a);
not1 n1(bn,b);
nmos(w, w3, a);
nmos(w, w4, an);
nmos(w3, gnd, b);
nmos(w4, gnd, bn);
pmos(w1, vdd, a);
pmos(w2, vdd, an);
pmos(w, w1, bn);
pmos(w, w2, b);
endmodule
module testxor();
reg A, B;
wire out;
xor1 n1(A, B, out);
initial begin
A=4'b0 ; B=4'b0 ;
#1000 A=4'b0 ; B=4'b1 ;
#1000 A=4'b1 ; B=4'b0 ;
#1000 A=4'b1 ; B=4'b1 ;
end
initial begin
$monitor("A=%b B=%b out=%b ",A,B,out);
end
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -