BusNOT

Inputs

PinTypeDescription
Abus8Input bus (8 bits)

Outputs

PinTypeDescription
Qbus8~A (bitwise NOT) = 255 − A

How It Works

BusNOT is the simplest bus node: it has one input, and it flips each of the eight bits to its opposite. Zero becomes one, one becomes zero. Think of a photograph and its negative: where it was light it is now dark, and vice versa. A byte example: 00001111 (15) turns into 11110000 (240) — all eight positions flip at the same time.

Because of the bitwise flip the result is called the one's complement: in each pair "bit of A and bit of Q" there is exactly one 1, so A + Q = 11111111, that is Q = 255 − A. Check: 15 + 240 = 255. This symmetry is not just decoration — it is a working tool. The node instantly answers the question "how much is missing up to the maximum".

A subtlety: in two's complement, minus is written not as a plain inversion but as inversion plus one: −x = NOT(x) + 1. On its own, NOT(x) equals −x − 1, not −x. Another consequence of the symmetry: a double inversion returns the original number — NOT(NOT(A)) = A, like a negative made from a negative.

8-bit Examples

A (bin)A (dec)Q (bin)Q (dec)
000011111511110000240
00000000011111111255
101010101700101010185
11111111255000000000

Usage

In the ALU (level 13), BusNOT works in tandem with the adder and turns addition into subtraction. The circuit A − B is built as A + NOT(B) + 1: invert the subtrahend, add one through the adder's carry-in — and you get the exact difference without a dedicated subtraction unit. This is how the processor executes the SUB command almost for free, reusing the adder it already has.

In the Harvard architecture (level 16), inversion is needed for negative numbers: to get −5, the processor inverts 00000101, gets 11111010, adds one — and the register holds 11111011, which is −5 in two's complement. BusNOT also helps with masks: invert a mask, and in one move the operation "keep these bits" becomes "wipe these bits" — AND with the inverted mask clears exactly the positions it used to protect.

Build it yourself →

Related components

Related articles

Frequently Asked Questions

What does bitwise NOT do?

It inverts every bit of the bus: 0 becomes 1 and vice versa. This is the 255-complement of a number.

How do I get minus one on the bus?

Invert zero: NOT(00000000) = 11111111. In two's complement, 11111111 is exactly −1 — a ready-made value for decrementing a counter.

Why is NOT(A) equal to 255 − A?

Each input/output bit pair contains exactly one 1, so A and NOT(A) together always make 11111111 = 255. For example, 00001111 (15) + 11110000 (240) = 255.