📄 lac_adder16.v
字号:
module LAC_adder16(a,b,cin,s,p_out,g_out);
input[15:0] a,b;
input cin;
output[15:0] s;
output p_out,g_out;
wire[3:0] p,g;
wire[2:0] c;
LAC_adder4(a[3:0],b[3:0],cin,s[3:0],p[0],g[0]);
assign c[0]=g[0]||(p[0]&&cin);
LAC_adder4(a[7:4],b[7:4],c[0],s[7:4],p[1],g[1]);
assign c[1]=g[1]||(p[1]&&g[0])||(p[1]&&p[0]&&cin);
LAC_adder4(a[11:8],b[11:8],c[1],s[11:8],p[2],g[2]);
assign c[2]=g[2]||(p[2]&&g[1])||(p[2]&&p[1]&&g[0])||(p[2]&&p[1]&&p[0]&&cin);
LAC_adder4(a[15:12],b[15:12],c[2],s[15:12],p[3],g[3]);
assign p_out=p[3]&&p[2]&&p[1]&&p[0];
assign g_out=g[3]||(p[3]&&g[2])||(p[3]&&p[2]&&g[1])||(p[3]&&p[2]&&p[1]&&g[0]);
endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -