AI engineering glossary · Computing foundations

What is two's complement?

Two's complement: The standard way computers store signed integers in binary: a negative number is formed by inverting all bits of its positive value and adding one. It lets the same addition circuit handle both positive and negative numbers.

Level: advancedTopic: Computing foundations

Two's complement: an example

In 8 bits, 5 is 00000101 and -5 is 11111011, and adding them gives zero after dropping the overflow.

Related terms

More Computing foundations terms

Where you learn it

Two's complement is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.