module fourBA(a,b,c,s,c_out); input [3:0]a,b; input c; output [3:0]s; output c_out; wire c1,c2,c3; assign s[0]=c^a[0]^b[0]; assign c1= (c && a[0]) || (c && b[0]) || (b[0] && a[0]); assign s[1]=c1^a[1]^b[1]; assign c2= (c1 && a[1]) || (c1 && b[1]) || (b[1] && a[1]); assign s[2]=c2^a[2]^b[2]; assign c3= (c2 && a[2]) || (c2 && b[2]) || (b[2] && a[2]); assign s[3]=c3^a[3]^b[3]; assign c_out= (c3 && a[3]) || (c3 && b[3]) || (b[3] && a[3]); endmodule