I was asked to design a digital system that receives two inputs: X and X+2, and must output X+1, without using any adders or subtractors. (We weren't told what is the number of bits for X and X+2)
I came across the circuit shown below (see attached diagram). It uses a multiplexer and some simple logic feedback to achieve the required output.
However, I have a question about how this works: The MUX has a single select input (X[0]), but both data inputs are multi-bit signals (X and X+2). How can a MUX with one select bit handle multi-bit inputs like that? Isn’t it supposed to only choose between 0 and 1?
I’m wondering if the idea here is actually that the system uses n parallel 2:1 multiplexers, one per bit — and that would explain how the multi-bit selection works? Since the output is also an n-bit value, maybe that’s the intended interpretation?
But here's a concern: If we assume X = 11111110 or X = 11111111 (i.e., near the upper bound of n bits), then X+2 would overflow and require n+1 bits. So wouldn’t we actually need n+1 multiplexers and produce an n+1-bit output? That is, X+2 and X+1 could be wider than n bits. How is this handled in such a design?
Any clarification would be appreciated!