베릴로그 초본데 반가산기랑 전가산기는 만들었는데 4비트 가감산기만들려니까 안되네
module adder4(x,y,sub,s,c);
input [3:0] x,y;
input sub;
output [3:0] s;
output c;
wire [2:0] w;
wire ws1,ws2,ws3,ws4;
assign ws1=sub^y[0];
assign ws2=sub^y[1];
assign ws3=sub^y[2];
assign ws4=sub^y[3];
fulladder M1(x[0],ws[0],sub,s[0],w[0]);
fulladder M2(x[1],ws[1],w[0],s[1],w[1]);
fulladder M3(x[2],ws[2],w[1],s[2],w[2]);
fulladder M4(x[3],ws[3],w[2],s[3],c);
endmodule
이렇게하면 되는거아냐? 문법왤케 어렵냐
댓글 0