Electrical – 1’s complement of a number using logic gates

circuit analysiscircuit-designlogic-gatesmicrocontroller

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)

enter image description here

But if I want to code it in 1's complement how should I implement it in a logic circuit?

enter image description here

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.