1 Star 0 Fork 0

打野/Verilog练习代码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
practice_24.6.17.v 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
打野 提交于 2024-06-17 19:57 . 2024-6-17
//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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fight_wild/verilog-code.git
git@gitee.com:fight_wild/verilog-code.git
fight_wild
verilog-code
Verilog练习代码
master

搜索帮助