1.1BIT全加器的代码
- module Receiver(
- A,B,CI,SUM,CY);
- input A,B;
- input CI;
- output wire SUM;
- output wire CY;
- assign {CY,SUM} = A + B + CI;
- endmodule
复制代码
2.2BIT全加器的代码:
- module Receiver(
- A,B,CI,SUM,CY);
- input [1:0]A,B;
- input CI;
- output wire [1:0]SUM;
- output wire CY;
- assign {CY,SUM} = A + B + CI;
- endmodule
复制代码
|