加法器

module add_4(
input [3:0] X, Y,
output [3:0] sum,
output Cout
);
assign {
Cout, sum} = X+Y;
endmodule
乘法器

module mult_4(
input [3:0] X, Y,
output [7:0] Prod
);
assign Prod =
本文介绍了Verilog基础知识,重点讲解了如何使用Verilog设计加法器、乘法器、比较器、多路器和简单的ALU。通过组合逻辑综合测试,展示了电路结果如何随着指令变化。

module add_4(
input [3:0] X, Y,
output [3:0] sum,
output Cout
);
assign {
Cout, sum} = X+Y;
endmodule

module mult_4(
input [3:0] X, Y,
output [7:0] Prod
);
assign Prod =
4347
413
1885
2940
5084

被折叠的 条评论
为什么被折叠?
&spm=1001.2101.3001.5002&articleId=81006171&d=1&t=3&u=cb423a49a4624b9580b601e4b98ef624)