Skip the navigation

Binary basics

Binary logic, binary math, binary circuits -- they're the foundations of computer hardware and software, but why?

By Gary Anthes
March 26, 2007 12:00 PM ET

Computerworld - “But let your communication be, Yea, yea; nay, nay: for whatsoever is more than these cometh of evil.Matthew 5:37

There is nothing in computer science as basic as the binary number system. In fact, the word binary is often used to refer to something that’s too simple, as in, “He’s a binary thinker,” meaning he can’t see shades of gray. (Or the digits 2 through 9.)

All of the software and all of the data in conventional (digital) computers, from PDAs to supercomputers, are built up from strings of zeroes and ones. If you knew where to look, that picture you took with your digital camera, the recent presentation to your board and all the complex logic in your company’s supply chain system would appear as endless streams of binary digits (bits), like this: 01100100100010110101101010...

The Way You Count Counts
Decimal Binary Octal Hexadecimal
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
16 10000 20 10

It’s hard to believe today, but in the 1940s, the earliest computer technicians actually worked at the bit level. If a computer made a mistake and the technician determined it wasn’t from a burned-out vacuum tube, he might have replaced a 0 with a 1 somewhere and tried again.

In day-to-day life, most humans use the decimal, or base-10, system. But if humans had eight fingers, no doubt our numbering system would be a base-8 system, with numerals from 0 through 7. And if we had 16 fingers, we might use a base-16 system. In fact, IBM invented just such a system in the early 1960s, using the “numerals” 0 through 9 and A through F. “Hexadecimal” became the base notation for the IBM System/360 mainframes. Why? A programmer could remember and work with a 16-bit instruction much more easily when it was represented by four hex characters, such as 58F0 (a “load” instruction), than if it were 0101 1000 1111 0000.

Way before that, in 1949, Grace Hopper programmed the Binac (Binary Automatic Computer) at the Eckert-Mauchly Computer Corp. using octal code. She taught herself base-8 math, and she once admitted she couldn’t balance her checkbook because she tended to lapse into octal subtraction.

Still, at their lowest levels, the Binac and System/360s stored and operated on binary numbers, just as today’s computers do, with the octal and hex numbers that were entered by programmers converted to binary.

Binary Logic
AND gate
AND Gate

Here, two binary (off/on) switches are connected in series. If both are closed, the bulb lights and the AND condition is satisfied; it's "true." If either or both switches are open, the bulb won't light and the AND condition is not met; it's false.
OR gate
OR Gate

Here, two binary switches are connected in parallel. If either one or both are closed, the bulb lights and the OR condition is satisfied; it's "true." If both switches are open, the bulb won't light and the OR condition is not met; it's "false."


Our Commenting Policies
Consumerization of IT: Be in the know
consumer tech

Our new weekly Consumerization of IT newsletter covers a wide range of trends including BYOD, smartphones, tablets, MDM, cloud, social and what it all means for IT. Subscribe now and stay up to date!