If I want to code a signed number into 2's complement I should use a XOR gate like this:
(Consider that A is an 8-bit input)
But if I want to code it in 1's complement how should I implement it in a logic circuit?
circuit analysiscircuit-designlogic-gatesmicrocontroller
Best Answer
Just invert all the bits. That's all 1's complement is.
In fact the circuit you show, assuming you replicated it for each bit, gives you the 1's complement. An XOR gate with an input tied high is basically just an inverter.