I'm not quite convinced it's not possible yet. There is an easy way to get all but the msb of B of the odd term taken care of (so 2A + 2B + B%4). But I'm not seeing any way to get that last bit in there.Is "Not Possible" a valid answer? Given that the ALU can only be used once, that would be my answer. Because the function as defined has three operations. 2A can be calculated without using the ALU. But 3B needs to use the ALU. Leaving no way (since the ALU can only be used once) to add the two terms.
by Luke James
by Robert Keim
by Cabe Atwell