module alu_4b (iS,iP,iQ,iF,oF,oY); input[1:0] iS; input[3:0] iP,iQ,iF; output[3:0] oF,oY; wire[3:0] oY; wire iC, iB, oC,oB; wire[3:0] tA0, tA1; wire[3:0] tL0, tL1; add_4b a_add (iC,iP,iQ,oC,tA0); sub_4b a_sub (iB,iP,iQ,oB,tA1); and_4b l_and (iP,iQ,tL0); or_4b l_or (iP,iQ,tL1); // separate flag bits for borrow and carry assign oF = { 2'b00 , oB, oC }; // should get from same bit position assign iB = iF[1]; assign iC = iF[0]; dmux41 sel0 (iS,tA0,tA1,tL0,tL1,oY); endmodule