The Lost Feed

📜History Tales

Uncovering Common Lisp's Sixteen Hidden Logic Gate Names

Common Lisp holds a secret few programmers know: it names all sixteen binary logic gates. Discover this forgotten piece of computing history and why it matters.

10 views·5 min read·Jul 15, 2026
Common Lisp names all sixteen binary logic gates

Imagine a programming language that knows the name of every single possible way two pieces of information can combine. It sounds like something out of a sci-fi movie, but it's a real feature hidden within an old, powerful language called Common Lisp. Most people, even many programmers, have no idea this secret exists.

This isn't just a quirky detail. It's a peek into a time when computer languages were designed with incredible depth and foresight. Common Lisp, a language from the 1980s, actually has specific names for all sixteen possible binary logic gates.

The Fundamental Building

Blocks of Logic

Before we get into Lisp's unique naming system, let's quickly explain what binary logic gates are. Think of them as tiny decision-makers inside a computer. They take one or more inputs, which are usually either "true" (1) or "false" (0), and produce a single output, also "true" or "false".

These simple gates are the bedrock of all digital electronics and computing. Every calculation, every piece of data processing, every image on your screen ultimately breaks down into countless operations performed by these basic logic functions. They are the alphabet of the digital world.

Why Sixteen?

Understanding the Possibilities

The number sixteen isn't random. It comes from the mathematical possibilities when you have two inputs. Let's say we have two inputs, A and B. Each can be either 0 or

  1. This gives us four possible combinations:
  • A=0, B=0

  • A=0, B=1

  • A=1, B=0

  • A=1, B=1

For each of these four input combinations, a logic gate can produce either a 0 or a 1 as an output. Since there are four input possibilities and two choices for each output, you get 2 multiplied by itself four times (222*2), which equals sixteen unique output patterns. Each of these patterns represents a distinct binary logic gate.

The Official Source: Common

Lisp the Language

Where does this surprising fact come from? It's not a rumor or a forgotten piece of code. The authoritative document for Common Lisp, often called CLTL for "Common Lisp the Language," clearly spells this out. This book, written by Guy L. Steele Jr., is the bible for Lisp programmers.

It lays out the full specification of the language, detailing everything from basic data types to complex functions. Within its pages, in a section about bit-wise logical operations, you find the complete list of these sixteen functions, each with its own official name. It's a detail that many might skim over, but it holds a lot of meaning.

"There are sixteen possible functions of two logical arguments. Common Lisp provides names for all of them."

This quote from CLTL confirms that the language designers thought about every single permutation. They didn't just include the common ones. They included *all

  • of them.

Beyond AND and OR: Naming Every Logic Function

Most people know logic gates like AND, OR, and XOR. These are fundamental. But what about the others? Common Lisp gives them names too. Here are some examples of the named functions:

  • LOGAND: This is the familiar AND gate. Both inputs must be true for the output to be true.

  • LOGOR: The OR gate. If either input is true, the output is true.

  • LOGXOR: The XOR gate. The output is true if inputs are different.

  • LOGNAND: Not AND. The output is true unless both inputs are true.

  • LOGNOR: Not OR. The output is true only if both inputs are false.

  • LOGEQV: This is the XNOR gate. The output is true if inputs are the same.

  • LOGNOT: This is a single-input NOT gate, which flips the input (0 becomes 1, 1 becomes 0).

But Lisp goes further. It names functions that might seem less intuitive at first glance. For example, there's LOGIORC1 (meaning A OR NOT B) and LOGANDC2 (meaning A AND NOT B). These might sound strange, but they represent specific logical relationships that are perfectly valid and sometimes useful.

Why Such Completeness?

A Glimpse into Lisp's Design Philosophy

Why did the creators of Common Lisp bother to name all sixteen? It speaks to a core principle of the language: completeness and power. Lisp was designed to be a highly flexible and expressive language, especially for artificial intelligence and symbolic computing. Having every logical operation explicitly named and available gives programmers maximum control.

It shows a deep understanding of the underlying hardware and the mathematical foundations of computing. Instead of forcing programmers to build these specific logic functions from more basic ones, Lisp provides them directly. This makes code clearer and potentially more efficient for certain tasks. It's about providing the full toolkit.

The "Lost"

Knowledge of These Gates

Despite being officially documented, the knowledge of all sixteen named logic gates isn't common. Many modern programmers, even those using Lisp, might only use the more popular ones like AND, OR, and XOR. Why is this?

One reason is that you can build any of the other gates using combinations of just a few basic ones (like NAND or NOR). So, for many practical purposes, explicitly naming all sixteen wasn't strictly necessary for everyday coding. Also, as computing evolved, the focus shifted to higher-level abstractions, moving further away from direct bit manipulation. The sheer depth of older languages can sometimes lead to fascinating features being overlooked.

The Enduring

Legacy of Thoughtful Design

The fact that Common Lisp names all sixteen binary logic gates is more than just a trivia point. It's a reminder of the incredible thought and thoroughness that went into designing early, powerful programming languages. It shows a commitment to providing a complete set of tools, even if some of those tools are used less often.

This attention to detail is a hallmark of good engineering. It ensures that the language is robust and adaptable, capable of handling a vast array of problems. It also encourages us to look deeper into the tools we use, as there might be hidden gems and powerful features waiting to be rediscovered.

So, the next time you think about the simple 0s and 1s that make up our digital world, remember Common Lisp. It quietly holds the key to every single way those two little numbers can interact. It's a testament to the enduring depth of computing history, and a call to appreciate the intricate designs that still power our world today.

How does this make you feel?

Comments

0/2000

Loading comments...