0.前言
为了熟悉整个数字IC设计流程,以知识点+实验的方式记录。
四位全加器的写法有很多种,按照FPGA的设计方法,可以直接调用一个四位的加法器;但数字IC基于标准cell的设计,为了速度与面积的trade off,以及后端布线方便,本实验采用模块调用的写法。
1.设计代码
module adder_4bits(
input [3:0] num1,
input [3:0] num2,
output cout,
output [3:0] sum
);
wire cout_0;
wire cout_1;
wire cout_2;
adder_1bit adder0 (
.num1 ( num1[0] ),
.num2 ( num2[0] ),
.cin ( 1'b0 ),
.cout ( co