代码拉取完成,页面将自动刷新
//2024-6-17 姜青羊
//4位与非门
`timescale 1ns/10ps
module nand_gate_4bits (
A,
B,
Y
);
input[3:0] A,B;
output[3:0] Y;
assign Y=~(A&B);
endmodule
//-----testbench-----
module tb_nand_gate_4bits ();
reg[3:0] a,b;
wire[3:0] y;
nand_gate_4bits u_nand_gate_4bits (
.A(a),
.B(b),
.Y(y)
);
initial begin
a<=4'h0; b<=4'h0;
#10 a<=4'h0; b<=4'h1;
#10 a<=4'h0; b<=4'h2;
#10 a<=4'h0; b<=4'h3;
#10 a<=4'h0; b<=4'h4;
#10 a<=4'h0; b<=4'h5;
#10 a<=4'h0; b<=4'h6;
#10 a<=4'h0; b<=4'h7;
#10 a<=4'h0; b<=4'h8;
#10 a<=4'h0; b<=4'h9;
#10 a<=4'h0; b<=4'hA;
#10 a<=4'h0; b<=4'hB;
#10 a<=4'h0; b<=4'hC;
#10 a<=4'h0; b<=4'hD;
#10 a<=4'h0; b<=4'hE;
#10 a<=4'h0; b<=4'hF;
$stop;
end
endmodule
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。