Basic Computing

Why This Matters

As your community grows, the problems you face grow faster. How much grain do you need to store to survive winter if your population is 347 and each person eats 0.5 kg per day? What angle should you cut a gear tooth for a water mill? How much copper wire do you need for a telegraph line that is 8.3 km long? These are not hard questions โ€” but they are tedious, error-prone, and time-consuming to solve by hand. Computing tools โ€” from the humble abacus to relay-based logic circuits โ€” let you solve them faster, more reliably, and delegate the work to trained operators or machines. Every civilization that advanced beyond subsistence agriculture developed computing tools. You will need them for engineering, trade, resource planning, and eventually for controlling the complex electrical and mechanical systems your community will build.

What You Need

For an abacus:

  • A rectangular wooden frame: approximately 30 x 20 cm
  • 11-13 thin rods (bamboo, straight sticks, wire): each about 22 cm long to span the frame
  • 55-77 beads (wooden balls, clay beads, drilled nuts, or any small objects with holes): 5-7 per rod
  • A horizontal divider bar across the middle of the frame

For a slide rule:

  • Three straight strips of wood, bamboo, or stiff cardboard: 30-35 cm long, 3-4 cm wide, 3-5 mm thick
  • A fine-tipped marking instrument (pen, sharp pencil, scribe)
  • A ruler marked in millimeters (or a precise measuring tool)
  • Clear finish (varnish, wax, or shellac) to protect markings

For relay-based logic gates:

  • Electromagnetic relays: scavenged from cars (starter relays, horn relays), appliances, or industrial equipment. Each relay needs a coil and one or more switching contacts. You need 2-6 relays per logic gate.
  • Battery: 12V car battery or equivalent
  • Wire, switches, LEDs or bulbs (for output indication)
  • Mounting board

For a simple adder circuit:

  • 5-10 relays (depending on bit width)
  • Wire, battery, LEDs
  • Patience

For punch cards:

  • Stiff cardboard or heavy paper, cut to uniform size (standard: 18.7 x 8.3 cm, but any consistent size works)
  • A hole punch or awl for making holes
  • A card reader: a board with pins or contacts aligned to the hole positions

The Binary Number System

Every modern computer uses binary โ€” a number system with only two digits: 0 and 1. This is not an arbitrary choice. Binary maps perfectly to electrical circuits: a switch is either OFF (0) or ON (1). A relay is either open (0) or closed (1). A wire either has voltage (1) or does not (0). Two states, two digits.

How Binary Works

In the decimal system (base 10) you are familiar with, each position represents a power of 10:

  Thousands  Hundreds  Tens  Ones
  (10^3)     (10^2)    (10^1) (10^0)
    1           4        0      3    = 1x1000 + 4x100 + 0x10 + 3x1 = 1403

Binary (base 2) works the same way, but each position represents a power of 2:

  128s  64s  32s  16s  8s  4s  2s  1s
  (2^7) (2^6)(2^5)(2^4)(2^3)(2^2)(2^1)(2^0)
   1     0    1    0    1   1   0   1   = 128+32+8+4+1 = 173

Counting in Binary

DecimalBinaryHow to Read It
00000zero
10001one
20010two (the โ€œtwosโ€ column)
30011two plus one
40100four (the โ€œfoursโ€ column)
50101four plus one
60110four plus two
70111four plus two plus one
81000eight
91001eight plus one
101010eight plus two
151111eight plus four plus two plus one
1610000sixteen (next power of 2)
25511111111the largest number storable in 8 bits

Converting Decimal to Binary

Method: Repeated division by 2

To convert decimal 173 to binary:

173 / 2 = 86 remainder 1  (least significant bit)
 86 / 2 = 43 remainder 0
 43 / 2 = 21 remainder 1
 21 / 2 = 10 remainder 1
 10 / 2 =  5 remainder 0
  5 / 2 =  2 remainder 1
  2 / 2 =  1 remainder 0
  1 / 2 =  0 remainder 1  (most significant bit)

Read remainders bottom to top: 10101101

Binary Addition

Binary addition follows simple rules:

0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10  (that is: 0, carry 1 to the next column)

Example: 5 + 3 = 8

    0101  (5)
  + 0011  (3)
  ------
    1000  (8)

Step by step (right to left):
  Column 1: 1+1 = 0, carry 1
  Column 2: 0+1+carry 1 = 0, carry 1
  Column 3: 1+0+carry 1 = 0, carry 1
  Column 4: 0+0+carry 1 = 1
  Result: 1000

This is exactly how a digital adder circuit works โ€” and you will build one later in this article.


Method 1: Building an Abacus

The abacus is a mechanical computing device that has been in continuous use for over 4,000 years. A skilled abacus operator can add, subtract, multiply, and divide faster than most people can with pencil and paper โ€” and often faster than someone using a basic calculator.

Construction

Step 1 โ€” Build the frame. Cut four pieces of wood to form a rectangle approximately 30 cm wide and 20 cm tall. Join at the corners with nails, screws, or mortise-and-tenon joints. The frame must be rigid.

Step 2 โ€” Install the divider bar. Mount a horizontal bar (the โ€œbeamโ€) across the frame about one-third of the way down from the top, dividing the frame into an upper deck (smaller) and a lower deck (larger).

Step 3 โ€” Drill or carve holes for rods. Along the top and bottom edges of the frame, make 13 evenly spaced holes (or slots) to hold the rods vertically. Space them about 2 cm apart.

Step 4 โ€” Thread beads onto rods. Each rod passes through the divider bar. The standard configuration (Japanese soroban style):

  • Upper deck: 1 bead per rod (this bead represents a value of 5)
  • Lower deck: 4 beads per rod (each represents a value of 1)

Alternatively, the Chinese suanpan style uses 2 beads above and 5 below โ€” this allows numbers up to 15 per column, which simplifies certain operations but is not necessary.

Step 5 โ€” Insert rods through the frame and divider. Each rod should slide through its holes with beads captured between the frame edges and the divider bar. The beads should slide freely on the rod but not fall off.

Step 6 โ€” Label the columns. The rightmost rod represents ones, the next represents tens, then hundreds, thousands, and so on. Mark these values on the frame for reference.

Using the Abacus

Resetting: Push all upper beads to the top (away from the divider) and all lower beads to the bottom (away from the divider). The abacus now reads zero.

Entering a number: To enter 7 on the ones rod: push the upper bead down to the divider (value = 5) and push 2 lower beads up to the divider (value = 2). Total: 5 + 2 = 7.

Addition example: 365 + 247

  1. Set 365: Hundreds rod: 3 lower beads up. Tens rod: 1 upper bead down + 1 lower bead up (5+1=6). Ones rod: 1 upper bead down (5).

  2. Add 247, starting from the leftmost digit:

    • Hundreds: add 2. Push 2 more lower beads up. Hundreds now shows 5 (but 5 lower beads up is not possible with only 4 โ€” so push all lower beads down, push upper bead down, and push 1 lower bead up. Upper bead (5) + 1 lower bead (1) = 6, but we need 5, so: clear lower deck, upper bead down = 5). The carry and exchange process takes practice.
    • Tens: add 4. Push 4 lower beads up. But we already have 1 upper + 1 lower = 6, plus 4 = 10. Clear the tens rod (all beads away from divider) and add 1 to the hundreds rod.
    • Ones: add 7. We have 5, add 7 = 12. Clear ones rod, set to 2 (2 lower beads up), carry 1 to tens.
  3. Read result: 612.

Tip

Abacus proficiency comes with practice. Expect 2-4 weeks of daily practice (30 minutes/day) to become proficient at addition and subtraction. Multiplication and division take longer to learn but follow systematic procedures. The payoff is a computing tool that never needs batteries, never breaks down (unless you break it physically), and works as fast as your fingers can move.


Method 2: Building a Slide Rule

The slide rule was the primary computing tool for engineers and scientists from the 1600s through the 1970s. It performs multiplication, division, squares, square roots, logarithms, and trigonometric functions. Every bridge, building, ship, and aircraft designed before 1970 was calculated on a slide rule.

How It Works

The slide rule is based on logarithms. The key insight: adding two logarithmic distances is equivalent to multiplying the original numbers. If you place two logarithmic scales side by side and slide one relative to the other, you can read multiplication and division results directly.

You do not need to understand logarithms to use a slide rule โ€” you only need to build the scales correctly and learn the reading procedure.

Building the Scales

Step 1 โ€” Prepare three strips of wood, bamboo, or stiff cardboard: each 30-35 cm long and 3-4 cm wide. Sand smooth. These form the body (two outer strips) and the slide (one inner strip). The slide must fit snugly between the two body strips and move freely left and right.

Step 2 โ€” Mark the C and D scales (the primary multiplication/division scales). These are logarithmic scales where the physical distance from the left end corresponds to the logarithm of the number.

On a 25 cm scale length (leave margins on each end), the positions of key numbers are:

NumberDistance from Left End (cm)Calculation
10.00log(1) = 0
1.54.39log(1.5) x 25
27.53log(2) x 25
2.59.95log(2.5) x 25
311.93log(3) x 25
415.05log(4) x 25
517.47log(5) x 25
619.45log(6) x 25
721.12log(7) x 25
822.58log(8) x 25
923.86log(9) x 25
1025.00log(10) = 1

Step 3 โ€” Mark these positions precisely on both the lower body strip (D scale) and the slide strip (C scale). Use a sharp scribe or fine pen. Add subdivision marks between the major numbers โ€” as many as you can fit legibly.

Step 4 โ€” For additional precision, add intermediate marks. Between 1 and 2, mark every 0.1 (1.1, 1.2, 1.3โ€ฆ). Between 2 and 5, mark every 0.2. Between 5 and 10, mark every 0.5. The spacing between marks decreases as numbers increase โ€” this is the logarithmic compression.

Step 5 โ€” Assemble the slide rule. The two body strips form a channel. The slide strip fits between them and can be moved left and right. If you have clear material (glass, transparent plastic), create a cursor (hairline indicator) that slides along the body to help read precise values.

Using the Slide Rule

Multiplication: 3 x 4

  1. Slide the C scale so that its โ€œ1โ€ aligns with โ€œ3โ€ on the D scale.
  2. Find โ€œ4โ€ on the C scale.
  3. Read the D scale value directly below the C scale โ€œ4โ€.
  4. The answer is 12. (You read 1.2 โ€” the slide rule gives you 1.2, and you determine the decimal place mentally: 3 x 4 is in the range of 10, so it is 12.)

Division: 15 / 3

  1. Align โ€œ3โ€ on the C scale with โ€œ15โ€ (read as 1.5) on the D scale.
  2. Read the D scale value below the โ€œ1โ€ on the C scale.
  3. The answer is 5.

Important: The slide rule does NOT keep track of decimal places. You must estimate the order of magnitude yourself. For 300 x 4, the slide rule gives 1.2, and you know the answer is around 1200 (3 x 4 = 12, scale by 100 = 1200). This is the single biggest source of errors for slide rule beginners.

Tip

Accuracy of a slide rule depends on its length. A 25 cm slide rule reads to about 3 significant digits (0.1% precision). For most engineering purposes, this is more than adequate. If you need more precision, build a longer rule (50 cm gives about 4 digits) or use an abacus for exact integer calculations.


Method 3: Building Relay-Based Logic Gates

Logic gates are the building blocks of all digital computers. Every computer ever built โ€” from room-sized mainframes to smartphones โ€” is made of billions of logic gates performing simple binary operations. You can build working logic gates from electromagnetic relays, which were the basis of the earliest digital computers (1930s-1940s).

How a Relay Works (Review)

A relay is an electrically controlled switch. When current flows through the coil, an electromagnet pulls a metal contact arm, closing (or opening) a switch. When current stops, the contact springs back.

    Control signal --> COIL --> Magnetic field pulls CONTACT
                                    |
                        NO (normally open) --> closes when coil energized
                        NC (normally closed) --> opens when coil energized

Relays have two types of contacts:

  • NO (Normally Open): Switch is open (disconnected) when the relay is off. Closes when energized.
  • NC (Normally Closed): Switch is closed (connected) when the relay is off. Opens when energized.

Many relays have both NO and NC contacts, selectable by which terminal you wire to.

AND Gate

An AND gate outputs 1 (ON) only when BOTH inputs are 1 (ON). If either input is 0, the output is 0.

Truth table:

Input AInput BOutput
000
010
100
111

Construction: Wire two relays in SERIES. The output circuit passes through the NO contact of Relay A and then through the NO contact of Relay B. Only when both relays are energized (both NO contacts closed) does current flow to the output.

+BATTERY --> [Relay A NO contact] --> [Relay B NO contact] --> OUTPUT (LED/bulb)
                                                                    |
                                                                  GROUND

Input A controls Relay A coil
Input B controls Relay B coil

Step 1 โ€” Mount two relays on a board. Connect the NO contact of Relay A in series with the NO contact of Relay B, with the output load (LED + resistor, or bulb) at the end.

Step 2 โ€” Wire Input A (a switch) to control Relay Aโ€™s coil. Wire Input B (another switch) to control Relay Bโ€™s coil.

Step 3 โ€” Test: flip both switches ON โ€” output lights. Turn either switch OFF โ€” output goes dark.

OR Gate

An OR gate outputs 1 if EITHER input (or both) is 1.

Truth table:

Input AInput BOutput
000
011
101
111

Construction: Wire two relays in PARALLEL. The output circuit can pass through either Relay Aโ€™s NO contact OR Relay Bโ€™s NO contact.

+BATTERY --> [Relay A NO contact] --+--> OUTPUT (LED/bulb)
                                    |         |
+BATTERY --> [Relay B NO contact] --+       GROUND

Step 1 โ€” Wire the NO contacts of Relay A and Relay B in parallel โ€” both paths lead to the same output.

Step 2 โ€” Either relay energizing closes a path to the output.

NOT Gate (Inverter)

A NOT gate outputs the opposite of its input. Input 1 gives output 0. Input 0 gives output 1.

Truth table:

InputOutput
01
10

Construction: Use a single relay with an NC (normally closed) contact. When the relay is off (input 0), the NC contact is closed and current flows to the output (output 1). When the relay is energized (input 1), the NC contact opens and current stops (output 0).

+BATTERY --> [Relay NC contact] --> OUTPUT (LED/bulb)
                                         |
                                       GROUND

Input controls Relay coil

Combining Gates: NAND, NOR, XOR

These compound gates are built by combining the basic three:

NAND (NOT-AND): Output is 0 only when both inputs are 1. Build an AND gate, then feed its output through a NOT gate. Alternatively, wire two relay NC contacts in parallel.

NOR (NOT-OR): Output is 1 only when both inputs are 0. Build an OR gate, then feed its output through a NOT gate. Alternatively, wire two relay NC contacts in series.

XOR (Exclusive OR): Output is 1 when inputs are different (one is 0, the other is 1). Output is 0 when both inputs are the same. This requires 2-4 relays depending on the implementation. XOR is essential for building adders.

XOR truth table:

Input AInput BOutput
000
011
101
110

Building a Simple Adder Circuit

An adder performs binary addition โ€” the most fundamental operation in computing. Everything else (subtraction, multiplication, division, comparisons) can be built from adders.

Half Adder

A half adder adds two single-bit binary numbers and produces a sum and a carry.

ABSumCarry
0000
0110
1010
1101

Notice: the Sum column is an XOR operation, and the Carry column is an AND operation.

Construction: Build one XOR gate (for Sum) and one AND gate (for Carry). Feed the same two inputs (A and B) into both gates.

Input A ---+---> XOR gate ----> SUM output
           |
Input B ---+---> AND gate ----> CARRY output
           |
           +---> (both gates receive both inputs)

This requires approximately 4-6 relays.

Full Adder

A full adder adds two bits PLUS a carry input from the previous column โ€” just like carrying in decimal addition. You need full adders to add multi-bit numbers.

ABCarry InSumCarry Out
00000
00110
01010
01101
10010
10101
11001
11111

Construction: A full adder is built from two half adders and an OR gate:

  1. First half adder: inputs A and B โ†’ produces intermediate Sum1 and Carry1
  2. Second half adder: inputs Sum1 and Carry In โ†’ produces final Sum and Carry2
  3. OR gate: inputs Carry1 and Carry2 โ†’ produces final Carry Out

This requires approximately 10-14 relays per full adder.

Building a 4-Bit Adder

Chain four full adders together: the Carry Out of each adder feeds into the Carry In of the next. This creates a 4-bit adder that can add two binary numbers from 0000 (0) to 1111 (15), producing results from 0 to 30.

Bit 0:  A0 + B0 + 0 (no carry in) --> Sum0, Carry0
Bit 1:  A1 + B1 + Carry0           --> Sum1, Carry1
Bit 2:  A2 + B2 + Carry1           --> Sum2, Carry2
Bit 3:  A3 + B3 + Carry2           --> Sum3, Carry3 (overflow)

Total relays needed: Approximately 40-56 for a 4-bit adder. This is a substantial project but entirely achievable with scavenged automotive relays.

Input: 8 switches (4 for number A, 4 for number B), each either up (1) or down (0).

Output: 5 LEDs or bulbs (4 sum bits + 1 carry/overflow bit).

To use: Set the input switches to represent your two binary numbers. The output LEDs display the binary result. Convert back to decimal to read.


Punch Cards for Data Storage

Punch cards store information as patterns of holes in stiff paper or cardboard. Each position on the card has two states: hole (1) or no hole (0) โ€” binary, again. Punch cards were used for data storage and program input from the 1890s (Hollerith census cards) through the 1970s.

Making Punch Cards

Step 1 โ€” Cut cards to a uniform size. Standard IBM punch cards were 18.7 x 8.3 cm, but any consistent size works. Stiff cardboard or heavy paper is essential โ€” flimsy paper tears.

Step 2 โ€” Create a template. Lay out a grid of positions on the card. A practical layout:

  • 40 columns across the card (each column represents one character or data field)
  • 12 rows down (each row represents one bit or code value)
  • Mark the grid positions with dots or light lines

Step 3 โ€” Define your encoding. Each column of holes represents a character using a code (like Morse code but for paper). A simple encoding: each column has 8 rows representing an 8-bit binary number (0-255), which can encode any ASCII character.

Step 4 โ€” Punch data. For each character or value, punch holes in the appropriate positions using an awl, nail, or dedicated hole punch. A hole = 1, no hole = 0.

Reading Punch Cards

Manual reading: Hold the card up to light. Holes are visible; unpunched positions are opaque. Read by eye, decoding each column.

Mechanical reading: Build a card reader:

Step 5 โ€” Make a base plate with metal pins (nails or wire) protruding upward at every grid position. Each pin is wired as an electrical contact.

Step 6 โ€” Above the pins, mount a metal plate (or individual contact pads) as the opposing contact.

Step 7 โ€” Slide a punch card between the pins and the plate. Where there is a hole, the pin pushes through and touches the upper plate, completing a circuit (1). Where there is no hole, the card blocks the pin (0).

Step 8 โ€” Wire each contact to an indicator (LED, bulb, or relay) to display the data, or feed it into your relay logic circuits for processing.

Practical Uses

  • Population records: One card per person, with punched fields for age, skills, health status
  • Inventory management: One card per item type, with quantity and location encoded
  • Recipe/formula storage: Encode measurements and ingredients as numeric values
  • Program storage: Encode sequences of operations for a relay computer (advanced)

Common Mistakes

MistakeWhy Itโ€™s DangerousWhat to Do Instead
Trying to build a computer before understanding binaryWiring errors, wrong results, wasted time and materialsMaster binary arithmetic on paper first. Practice conversions until they are automatic.
Using non-magnetic contacts in relaysRelay contacts must be electrically conductive, not magnetic. The coil core must be magnetic.Use iron/steel for the coil core, copper/brass for the contact surfaces
Ignoring relay coil current drawEach relay draws current. A 4-bit adder with 50 relays may draw 5-10 amps โ€” a significant battery drainCalculate total power draw before building. Use relays with the lowest coil current available.
Slide rule: forgetting to track decimal placesGetting an answer of 1.2 instead of 12 or 120 or 0.12Always estimate the answer magnitude first (3 x 4 is โ€œabout 12โ€), then read the slide rule for precision
Abacus: moving beads sloppilyWrong calculations, lost accuracyPractice the finger techniques: thumb pushes up, index finger pushes down. Clean, deliberate movements.
Punch cards: inconsistent hole positioningReader cannot interpret the card โ€” holes misaligned with contactsUse a template for every card. Punch precisely on grid positions.
Wiring logic gates without testing each one firstOne wrong gate produces wrong results for the entire circuit; debugging is extremely difficultBuild and test each gate independently before connecting them. Verify truth tables with switches and LEDs.
Using relays with different voltage requirementsSome relays energize, others do not, or some burn out from overvoltageSort scavenged relays by coil voltage. Use only relays rated for the same voltage in a given circuit.
Not labeling wires and relay positionsImpossible to troubleshoot when something goes wrongLabel every wire, number every relay, and draw a schematic before building
Building too many bits before proving the concept8-bit adder requires ~100 relays โ€” if your fundamental design is flawed, you waste enormous effortStart with a 1-bit half adder. Prove it works. Then 1-bit full adder. Then 2-bit. Scale up only after each stage works.

Whatโ€™s Next

With basic computing tools, your community can:

  • Semiconductors โ€” move from relay-based to solid-state computing (transistors, integrated circuits)
  • Perform engineering calculations for bridges, buildings, and machines
  • Manage population and resource data systematically
  • Lay the groundwork for programmable automation and control systems

Quick Reference Card

Basic Computing -- At a Glance

Binary Basics:

  • Only two digits: 0 and 1
  • Each position is a power of 2: โ€ฆ128, 64, 32, 16, 8, 4, 2, 1
  • Convert decimal to binary: divide by 2 repeatedly, read remainders bottom-up

Three Computing Tools:

ToolOperationsPrecisionPower Needed
Abacus+, -, x, / (integers)ExactNone
Slide rulex, /, sqrt, log, trig3 significant digitsNone
Relay logicBinary arithmetic, logicExact (binary)Battery

Logic Gate Summary:

GateFunctionRelays Needed
ANDOutput 1 only if BOTH inputs are 12 (NO contacts in series)
OROutput 1 if EITHER input is 12 (NO contacts in parallel)
NOTOutput is opposite of input1 (NC contact)
XOROutput 1 if inputs are DIFFERENT2-4

Half Adder: XOR (sum) + AND (carry) = 4-6 relays

Full Adder: 2 half adders + 1 OR gate = 10-14 relays

4-Bit Adder: 4 full adders chained = 40-56 relays. Adds numbers 0-15.

Abacus: Upper bead = 5, lower beads = 1 each. Right column = ones, next = tens, etc.

Slide Rule: Logarithmic scales. Align C scale โ€œ1โ€ with your first number on D. Read product under second number on C. YOU track the decimal point.

Punch Cards: Uniform stiff cards, consistent grid, holes = 1, no holes = 0. Use a template for every card.

Build Order: Abacus first (immediate utility, no electricity). Slide rule second (engineering calculations). Relay logic third (foundation for automation).