Electronic – Is it possible to design a 2:1 multiplexer using only inverters, XOR gates, half adders and full adders? If so how

digital-logic

One of my final exam questions in digital design was to design a circuit that converts an 8-bit Sign/Magnitude number to Two's Complement number using only inverters, XOR gates, half adders and full adders. The simplest approach to this problem, I thought, was to use a multiplexer. However, I couldn't design one using the allowed components. Is it even possible to make a MUX out of these components or does this problem require a different approach?

Edit:

If I could make a multiplexer, my solution would be to multiplex the input number and a version of it that is inverted and added 1 using the sign bit as select.

Best Answer

X-Y problem why would you be thinking of a multiplexer given those components the examiners were giving you a clue. Expressing the problem in words.... If sign bit is set(negative) invert the value and add 1. If sign bit is not set don't invert the value and add 0. That should be easy with those components.

This is an xor on each value bit as an inverter which is switched by the sign bit. Then a half adder which adds the sign bit to the result of that.

If a multiplexer is deemed to be absolutely necessary you need an and function followed by an or function. The carry out of a half adder is an and, you can convert this to an or by inverting the inputs and outputs of the and. So you can make one mux bit with three half adders and three inverters.