Member-only story

Using Ten’s Complement to Represent Negative Numbers

A look at how mechanical computation devices deal with negative numbers

Erik Engheim
7 min readNov 17, 2022
Odhner Arithmometer - Pinwheel calculator invented in Russia in 1873
Odhner Arithmometer — Pinwheel calculator invented in Russia in 1873

Binary digital computers represent negative numbers using something called two’s complement. The reason is simple: Memory cells can store zeros and ones, but not a negative sign. But instead of explaining two’s complement, I am going to explain ten’s complement to you in this story. Why? Because it helps you understand how computers work with negative numbers without having to learn the binary number system.

In fact, the first computers were not working with binary numbers but decimal numbers. The most famous example is Charles Babbage’s Difference Engine. It was built like an enormous clock. Calculations were done mechanically using gears.

Difference Engine No. 1 calculating engine. A prototype of the full Difference Engine.
Difference Engine №1 calculating engine. A prototype of the full Difference Engine.

Strictly speaking, the Difference Engine was not a general purpose computer, but the Analytical Engine which Charles Babbage would later design on paper was. Both are however examples of mechanical computing devices. These computers did not evolve out of a complete vacuum, but were natural evolutions of earlier digital mechanical calculators such as the Arithmometer.

--

--

Erik Engheim
Erik Engheim

Written by Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Responses (1)