I am designing a 4-bit comparator using only basic logic gates (and, or, nand, xor, etc.) In its current form, the comparator takes two 4-bit unsigned binary numbers (A and B) and compares each bit value from most to least significant and determines an output: A > B, A < B, or A = B. Pretty simple.
However, I am trying to add a control bit to signify whether the input is unsigned binary or two's complement. The default state, 0, should signify that the input is in unsigned binary, while 1 signifies that the input numbers are in two's complement.
I'm having difficult understanding how or where in the circuit to implement the control bit. I understand that one method is to implement an adder, but I'm not sure if it would have to exist outside of the circuitry I have already designed, and the control bit would switch between two circuits that exist almost independently of each other. I'm sure there has to be a more elegant, integrated solution. If you could just point me in the right direction, I would greatly appreciate it!