Uploaded September 2011 | Updated November 2026, 7 hours ago
If you're working with numbers in minecraft you probably will need a two's complement at some point (e.g. to subtract). You could invert your number and add 1 to get its negative representation, or you can build something like this. It uses vertical xor-gates to invert parts of the number.
Think of it in this way:
You start at your LSB (least significant bit, the "1"-bit) and move to the MSB. From the LSB to the first "one" (active input) you just copy the values to the output (including the "one"). The rest of the number gets inverted. The result is the two's complement of your input.
If you're working with numbers in minecraft you probably will need a two's complement at some point (e.g. to subtract). You could invert your number and add 1 to get its negative representation, or you can build something like this. It uses vertical xor-gates to invert parts of the number.
Think of it in this way:
You start at your LSB (least significant bit, the "1"-bit) and move to the MSB. From the LSB to the first "one" (active input) you just copy the values to the output (including the "one"). The rest of the number gets inverted. The result is the two's complement of your input.










