top of page

Search this site

18 results found with an empty search

  • adder_demo | Vintage Relay Computers

    Interactive 1-bit Full Adder Abstract: A brief description of how a full adder works followed by an interactive demo Addition is the fundamental arithmetic operation in digital computers. Just like elementary school decimal addition—where adding 9 + 3 produces a sum of 2 and a carry-out of 1 —computers add digits column by column, passing carries to the next position. While humans calculate in base-10, computers operate in binary (0 and 1). Check out the Binary Number Explorer for some interactive fun. The standard building block for multi-bit addition is the 1-bit Full Adder. It takes three 1-bit inputs: A and B (the bits to add) Carry_in (the Carry_out bit received from the previous column) The adder processes these inputs to produce two outputs: Sum (the result bit for the current column) Carry_out (the carry bit passed to the next column as Carry_in) Expressed as an equation: A + B + Carry_in = 2 x Carry_out + Sum The classic adder truth table below shows all possible input and output values. With 3 inputs there are 8 possible sets of outputs. The "Dec" column is the decimal equivalent of the 2 binary outputs. See for example the last row where all the inputs add to decimal 3. The adder below is the classic 1-bit form made of AND, OR and Exclusive OR gates. Learn more about these gates here . This basic block can be replicated and chained to create any length of adder (8, 16, 32, 64,...bits). The R30 relay computer uses a 2-relay, 1-bit adder, six times to create a 6-bit adder. The two-relay adder is described elsewhere on this site and is equivalent to the diagram below in logic operation. Importantly, there are many variations of this circuit so don't get confused if you see something called a "Full Binary Adder" and the design looks different. All methods are equivalent logically with 3 inputs and 2 outputs. To see the adder in operation, experiment with the demo below. Try different inputs and see the resultant outputs.

  • R30 Computer | Vintage Relay Computers

    WIP -- much more to add... Technical Specifications Architectural Core 32-bit electromechanical logic architecture A comprehensive breakdown of the R30's architecture and design philosophy. Switching Logic All binary math is done using telephone relays from the 1940's Power & Voltage Operating voltage: 48V DC. Designed for stable, low-noise power supply integration. Physical Dimensions TBD Design Philosophy The R30 is built to be a masterclass in hybrid electromechanical engineering, emphasizing precision and educational value over speed or "all relay" correctness.

  • Bricks and Mortar | Vintage Relay Computers

    The Building Blocks Abstract: At the foundation of all digital computation lies the active, three-port binary switch—a primitive device capable of opening or closing a circuit under electrical control. While architectural paradigms like Harvard and von Neumann define higher-level processor organization, computation itself is impossible without this foundational switching mechanism. This article outlines a five-layer implementation stack to show how relays, vacuum tubes, and solid-state transistors each fulfill this role to construct primitive gates, combinational logic, arithmetic units, and instruction decoders. Regardless of the underlying physical substrate, the fundamental on/off switch serves as the essential bedrock enabling all digital processing. In the early days of computing, two foundational models emerged: Aiken’s Harvard architecture (1944) and von Neumann’s architecture (1945). Over time, engineers refined and extended both ideas, and the machines we use today blend elements of each. Modern CPUs expose a unified memory model like von Neumann envisioned, yet internally they borrow Harvard’s separation of instruction and data pathways to boost speed and parallelism. The result is a hybrid design that traces its lineage directly back to those two original approaches. There are ample resources explaining basic computer organization, so it won’t be covered here. The focus here is the implementation stack . What is this? Figure 1 shows a hierarchy of five implementation layers. Each layer provides the primitives needed to construct the next. In this case the “top” is the most fundamental element that all lower layers depend on. The coverage is more about the building blocks (or nuts and bolts) and less about the architect's floorplans. Decoupling the two allows an architectural model to endure across vastly different hardware designs, with software only entering the hierarchy at layer 5. Fig 1, A computer implementation stack Although this site focuses on relay-based computing, the following discussion examines three logic-switch technologies fundamental to computer operation: relays, vacuum tubes, and transistors. Each independently played an important role in the history of computing. Understanding these 3 switching devices in relation to each other provides a wider perspective than just how relays were used. The Figure 1 model is deliberately kept simple. Let’s examine each layer. The Stack Layer 1: The Switch Nothing computes or decides without the active (powered) on/off binary switch. This is not a hand operated switch. Rather it’s a 3-port device with a control port(s) that opens and closes a switch(s). Figure 2 shows the concept diagram of this type of switch. For this example, the circuit performs an inverter action, a HIGH In closes the switch and produces a LOW out (0V). When the input is LOW (0V) the switch opens and the Output is HIGH (+V). The control port is typically low current, and this causes switching action of a higher current/voltage if needed. There are many ways to wire switches and Fig 2 is just one example. The Rload resistor limits the current when the switch is on and other variations may not have this resistor. Note too that some switches are normally off (NO) as in Fig 2 and some are normally closed (NC). An NC switch is also modeled by Fig 2 but with the switch being on before the control signal is input. Fig. 2. Conceptual electrically controlled switch Figure 3 shows the Relay, Vacuum tube, and Transistor. Each can be modeled as a binary switch by the Figure 2 concept diagram. These three are the most important electrically controlled switching devices ever invented. Importantly, all three in this figure were manufactured by Western Electric with the designs by Bell Laboratories (both AT&T). Importantly for logic design, the relay can have many contact arrangements -- NO, NC, SPDT/Form-C and more. This gives the relay a super logic power that the tube and transistor don't possess (NO/NC only). There are more exotic experimental switches, but our focus is on the three well established types in Fig 3. See Appendix A . Fig 3, Three primary switching devices from Western Electric U650 Relay (1920s-50s), 300B Tube (1938), 2N67 Transistor (1953) For about 13 years, beginning in 1941, relays were used in computers . During the vacuum-tube era—including the ABC, ENIAC, Colossus, and Ferranti computers—every computer used some relays for slower operations. It was not until 1954, with the introduction of the Bell Labs TRADIC transistor computer, that relays disappeared from computer designs. Layer 2: Primitive Gates If you are unfamiliar with logic gates it will help to review this explainer first (with an interactive explorer). The most fundamental elements are the 6 logic gate types at layer 2 in Fig 1. The NAND and NOR gates are Negated AND & Negated OR, respectively. Inversion (also called negation) turns 0 to 1 and 1 to 0. All digital operations can be performed using only these primitives or clever logically equivalent circuits. Each of these gates are implemented using switches. Figure 4 shows three example gates with supply (+V ) voltage values of +12V, +350V, and +6V, respectively. Why are they so different? The supply voltages are selected based on the individual circuit design needs. Important for us, regardless of the actual voltage, a logic HIGH output is +V and a logic LOW output is at ground potential, zero volts. Fig 4, relay, tube and transistor logic circuit examples For the relay AND gate, if A and B are HIGH their respective relays engage and the output is HIGH (+12V in this case), else LOW. Without describing how resistors, tubes or transistors work (see Appendix A), the following gives a high-level explanation for how, for example, NOR and OR logic gates operate. For the tube based NOR, when A and B are LOW (A = 0, B = 0), neither tube conducts electricity. Because no current flows through the pull-up resistor the output voltage stays at +350V, which represents a HIGH (1) state. If A or B = 1 then the output is LOW (0V) because one or both tubes are conducting. For the transistor OR circuit, if either input is HIGH (respective transistor conducts) the output is HIGH (~6V). There are many variations of these circuits for each gate type. Importantly, using only a voltage source, switches, wires and passive resistors all logic gate types can be built. Some modern designs use semiconductor diodes to assist. The AND gate and OR gate can be built using only diodes and resistors (DRL gates) and a switch is not strictly needed. This design approach has limits due to signal loss but it was used in some early designs. The IBM 608 (1957), an all-transistorized computer, used diode-resistor logic for AND/OR gating, with transistors only for inversion and level restoration. In contrast, the Colossus Mark 1 (England) [3] used about 1,500 vacuum tubes and no relays. Layer 3: Combinational Logic Circuits With gates available as building blocks, we can construct complex logic circuits. Figure 5 is an example of a “multiplexer” (Mux: k-in, 1-out), a commonly used module for digital designers. There are 4 data inputs and 2 selector inputs. The idea is for the 2 selector values to route one of the 4 inputs to the single output, Y. This is a chooser circuit and found often in computer design. See the Truth Table to see all four routing combinations. For example, S1 S0 = 1 1 routes only I3 to the output. Notice it uses 3 primitive gates – AND, OR and the Inverter. No matter how complex, all digital circuits can be made from the primitive gates. There are clever circuit shortcuts for some designs but in the end, all circuits use the primitives in one way or another. It’s easy to imagine this circuit being packaged with 4+2 inputs, 1 output and 2 pins for power. There are 500+ different transistor-based modules available today. Search for the 74LS153 Mux module as an example. These are like Lego blocks for DIY computer builders. There are relay and tube equivalent Mux implementations, but they are not described here. Fig 5, Building a multiplexer using gate primitives Another important element is bit memory. Fig 6 shows a latching relay circuit. In a computer, memory is needed for both program and raw data storage. In the figure, there is a push button to engage the relay (it stays on once its contact closes) and a reset button to disengage it. There may be other contacts if needed. Using a relay to store bits is expensive! 1,000 bits need 1,000 relays. So, engineers looked for more efficient ways to store bits. The first relay-based calculator from Bell Labs used 100-point crossbar switches to store ten decimal digits per switch. See examples here on a companion site dedicated to relay-based telephone systems. Also, some early relay (mostly) computers use short term “1-bit capacitor memory”, some used special mechanically latched relays, and some modern versions use semiconductor memory (often NAND based). Fig 6, Relay latch circuit for 1 bit Layer 4: Hardware Based Math One of the most powerful logic modules is the 1-bit full adder. Experiment with an interactive single 1-bit adder here . Cascading cells enables composite adders of any length in hardware (4, 8, 16, 32 bits,…). See Fig 7 for a hardware 4-bit adder example. A and B each are 4 input bits, S (Sum) are the 4 output bits. Note that the Carry_out bit of each adder is connected to the Carry_in bit of the next adder in the chain. The final Carry_out bit may be forwarded to another adder chain to increase the effective adder bit length beyond 4 bits. Search for the transistorized 74LS83 4-bit adder module to learn more. The R30 cascades six, 1-bit, relay-based full adders, resulting in a 6-bit adder. Each 1-bit adder needs only two relays. The adder is described elsewhere TBD on this site. Th R30's six-bit adder is cascaded (in 6 passes), via the microcontroller, to make a full 36-bit adder and used for all math operations. Fig 7, Hardware 4-bit integer adder made of four small 1-bit adders What about hardware multipliers and dividers? These are also made of one or more n-bit adders but with additional control logic to implement the methods that we all learned in primary school. Here is the systematic method for unsigned integer multiplication: Bit Check: Look at the multiplier one bit at a time, from right to left. Add if 1, skip if 0 : If the bit is a 1, add the multiplicand into a running total (the accumulator). If it is a 0, add nothing. Shift : Slide the multiplicand one bit left, set the new LSB with a zero, and move to the next bit. Repeat : A simple controller repeats this cycle until every bit is checked and the final total is ready With an effort to manage the multiplier and multiplicand exponents (adding exponents is equivalent to multiplying), this method can be extended to signed floating point numbers. The R30 uses the methods above to multiply and the non-restoring method to divide. The R30 supports 32b floating point math with a dynamic range of (+-) 1.4×E-38 to 3.4E+38 based on its 36-bit adder discussed above. Its math accuracy conforms to IEEE 754 Standard for Floating-Point Arithmetic . See the explainer on relay adders here TBD. Many vendors make Floating Point Math accelerators. These are digital chips that can “bolt on” to CPU hardware chips to improve calculation speeds (not expanded on here). Note too that there are many methods available to speed up hardware calcs (i.e. Booth’s algorithm for multiply) but these are beyond our coverage although the R30 uses Booth. Layer 5: The Execution Layer Layers 1 through 4 provide the nuts and bolts —switches, gates, decoders, adders, registers, storage and more. But none of these components can decide what to do on their own. Layer 5 provides the conductor: the control unit, instruction decoding logic, and sequencing hardware (all based on logic gates) that orchestrate data movement across the machine. Of course, these four layers appear as “black boxes” to Layer 5 execution. So, it’s possible to design a hybrid computer using combos of the switches in Fig 2. For example, the IBM SSEC (Selective Sequence Electronic Calculator, 1948) is one of the largest switch hybrids ever built. It combined 12,500 vacuum tubes (for the arithmetic unit and high-speed control) with 21,400 electromechanical relays used for intermediate memory registers and sequence control [1]. There are no known hybrids that use all three switch types. Another example is the famous ABC “first vacuum tube” computer (1939-42). It was more a calculator than a computer. Nonetheless it used tubes for all math and relays for program execution. See Endnote A. Fig 8, R30 program and output listings for solving a quadratic equation Execution centers on the classic instruction cycle: Fetch, Decode, and Execute. A program counter (PC) holds the address of the next command, pointing to a location in memory (whether film, paper tape, electromagnetic store, or modern semiconductor memory). During the fetch phase, this instruction is loaded into an Instruction Register. Next, decoding logic inspects the bit pattern (the opcode). Rather than running math directly, the decoder is essentially a traffic director: it asserts specific control lines that open multiplexers, enable register output onto shared buses, and tell the Layer 4 math units whether to add, invert, or shift. For the famous Zuse Z3 relay computer, about 25% of all the relays (plus some electromechanical stepping switches) were used for program execution. See Endnote B. Layer 5 also manages the boundary between the internal machine state and the outside world via Input/Output (I/O). Using a microcontroller to manage all user I/O (WiFi connected tablet interface for the R30) is very practical and saves many relays. See Figure 8 for a R30 program listing and outputs for computing the two roots of the quadratic equation x*x + 5x + 6 = 0. Appendix A Tubes and Transistors The Vacuum Tube There are many excellent web resources on the operations of the vacuum tube and the transistor. This Appendix gives a tip-of -the-iceberg view of these important devices, especially functioning as binary switches. In 1904, John Ambrose Fleming (British) patented the first vacuum tube diode, called the Fleming Valve . He realized that the Edison effect — one‑way electron flow inside a heated vacuum bulb — could be used as a radio-wave detector (passes one signal polarity, blocks the other). Edison himself had not recognized any practical use for it. Fleming’s diode became the first practical electronic component, enabling reliable detection of wireless signals and effectively starting the electronics industry. In the figure below, if the "plate" element on the right side of the tube is positive in charge, it attracts the electrons from the heated filament. If the plate has a negative voltage the plate repels electrons. A vacuum provides a collision‑free path, allowing electrons to reach the plate more effectively. Fleming's invention is not a full on/off switch but very close to it. The Fleming Valve Vacuum Tube Lee de Forest’s invention — the Audion (1906) — was directly built on Fleming’s valve. De Forest began experimenting with the Edison effect and Fleming’s diode, trying to improve radio detection. He added a third electrode, the grid, creating the first triode (3 element) tube. The Audion became the foundation of radio broadcasting, long‑distance telephony, and eventually early computers. Adding a grid (the control element in Figure 2 above) to the tube allowed it to function as an on/off binary switch or linear amplifier depending on how the tube was wired into the circuit. The grid (see image below) controls the flow of electrons from the cathode to the plate, allowing amplification, switching, and modulation. Without the grid, a tube is just a diode -- a Fleming Valve. By applying varying voltages to the grid element the electron flow is modulated as needed from binary on/off to varying in a linear fashion and causing amplification of audio and radio signals. Finally a new on/off electrical switch that is much faster than a relay! The Lee de Forest Triode Vacuum Tube Source: hamradioschool.com AT&T (through Western Electric and what later became Bell Labs) bought the rights to De Forest’s Audion, and this purchase is what allowed them to industrialize and radically improve the triode. AT&T saw the potential for long‑distance telephone amplifiers and negotiated rights to use and develop the Audion. Over time the triode was used as a binary switch but this was not AT&T's original use case. The first telephone call from New York to San Francisco in 1915 used three vacuum‑tube repeaters along the 3,400 mile (copper wire length) route. Surprisingly, before the tube AT&T used mechanical amplifiers (repeaters) for weak telephone signals. Hundreds of model 6C8G "dual triode" (RCA or Sylvania likely) tubes were used in the original ABC tube computer (1942). The Transistor The transistor was invented (there were two versions) in late 1947-8 at Bell Telephone Laboratories by John Bardeen, Walter Brattain, and William Shockley. Their breakthroughs created the first solid-state device capable of amplifying and switching electrical signals. Several names were proposed and one was semiconductor triode [2], a nod to the triode tube. In the end, "transfer resistor" or transistor was chosen. One way to understand a transistor is to picture a water faucet and its valve. Instead of water, electricity flows through it. Turning the handle is equivalent to applying a tiny trickle of electricity to the B (base) terminal causing electricity to flow between the C and E terminals. There is a similarity between the tube and transistor, each have 3 terminals and one controls the flow of current between the other two. Tube: cathode → grid → plate Transistor: emitter → base → collector Both use a small input signal at the control terminal (grid/base) to modulate a larger current between the other two terminals. One type of transistor (NPN) is made of layers of the element Silicon with tiny amounts of Phosphorus and Boron. Applying a small forward voltage to the base lowers the internal energy barrier at the base-emitter junction, allowing electrons to flow between the collector and the emitter. The figure below shows a working circuit to supply current to a load (lamp, other) and this is controlled by a low current control switch. The resistor limits the base current to a small value. When the control switch is closed the transistor "turns on" and current flows into the load (as in the figure below). When the control switch is off (open), the transistor "turns off" and there is no load current. Importantly the load current can be ~100x more than the control base current so the transistor is an amplifier in a similar way to how tubes amplify [Endnote C]. Relays can't be wired to linearly amplify a signal whereas a tube and transistor can. Vitally, all three devices can operate as binary switches. Faucet and Transistor relationship illustration Transistor circuit and its equivalence with the control switch =closed Transistors are far smaller, more rugged, and draw significantly less power than vacuum tubes because they operate without fragile glass envelopes or power-hungry heater filaments. They also turn on instantly, generate minimal heat, and last decades without the inevitable burnout and degradation that plagued vacuum tubes. Hence, transistors dominate our digital world co-existing with some specialty vacuum tubes for audio and relays for power switching. How many transistors were produced in 2025? There is no official count. However, extending the reasoning of industry analyst Jim Handy [4], an order-of-magnitude estimate is about 10E23 (about a trillion trillion) transistors, with almost all a part of integrated circuits. For example, a single Nvidia Blackwell B200 die has ~104 billion transistors implementing about .7 million adders of various lengths. We've come a long way since the George Stibitz 2-relay adder in 1937. A relay is not just a slow transistor It is tempting to see the relay as a primitive, sluggish ancestor of the transistor. Not so. A transistor's control signal always shares a terminal with the path it switches, whereas a relay's coil is electrically isolated from its contacts. So, tens of milliamps can command large or small voltages with no common ground. One coil can drive many independent contacts at once, each with both normally-open and normally-closed positions, a job that would need a small network of transistors and isolators to reproduce. A closed contact behaves like a "lossless wire." Contacts can be wired directly into logic, with series for AND, parallel for OR, and self-holding circuits for memory, while the coil's built-in hysteresis and the relay's defined state on power loss make it valuable in safety circuits. Sure, relays are slower, they wear out, and they need coil power. But they offer isolation, many contacts from one input, polarity-free switching and ruggedness, which a transistor cannot provide on its own. References 1. Bashe, C. J., Johnson, L. R., Palmer, J. H., & Pugh, E. W. (1986). IBM's Early Computers . MIT Press. 2. Gertner, Jon, The Idea Factory, Bell Labs and the Great Age of American Innovation, 2012, page 98 3. Randell, Brian (ed.). The Origins of Digital Computers: Selected Papers . Springer, 1973. Contains Flowers’ original post‑war paper describing Colossus. 4. Computer History Museum --https://tinyurl.com/ycfermse Endnotes Endnote A: The control system of the ABC did not use vacuum tubes for decoding because it was not a stored-program or tape-programmed computer. It ran a fixed algorithm (Gaussian elimination to solve simultaneous linear equations) governed by approximately 30 telephone relays. The vacuum tubes outside the adders served as amplifiers for the capacitor memory drums (about 30 tubes). The arithmetic logic functions were fully electronic, implemented with vacuum tubes. Based on materials in: Alice R. Burks and Arthur W. Burks: The First Electronic Computer: The Atanasoff Story (University of Michigan Press, 1988). Endnote B : Dr. Raúl Rojas reverse-engineered the relay logic schematics of the Z3 computer by Konrad Zuse. He wrote the paper: "Konrad Zuse’s Legacy: The Architecture of the Z1 and Z3 " (IEEE Annals of the History of Computing, Vol. 19, No. 2, 1997). In Section 3 ("The Control Unit"), Rojas notes: The opcodes read from the 8-track punched film were parsed by a decoding tree of relays requiring minimal hardware (fewer than 40 relays for instruction decoding). The execution sequencers (handling iterative shifts for multiplication and square roots) used rotary stepping switches and interlock chains, leaving data storage and addition related operations to consume over 75% of the machine's physical relay inventory. Endnote C: Tubes and transistors amplify in the sense that the control signal input (grid or base terminal) controls a much larger current. For a transistor, this is done in a linear fashion such that Current_out = K*Control_current, where K is the amplifying factor. A tube is a voltage‑controlled current source, different from how a transistor works. The Current_out= Function(grid voltage). The input-output transfer curve is not linear and beyond the scope here. Importantly, they can also operate in an on/off mode acting as a switching element. With a relay the relationship is different. The control current engages the electromagnetic coil to operate one or more switch contacts. The switch current is independent of the coil current and can be as high or low as needed based on the contacts ability to handle the current.

  • Computer Timeline | Vintage Relay Computers

    The image below (partial) is from "The First Computers -- History and Architecture " by Raul Rojas and Ulf Hashagen, page 10, chart by Michael Williams, 2000. All of the computers in this timeline are relay-based except for the Howard Aiken Mark 3 that was a hybrid relay-tube design. Also the Zuse Z1 was mechanical. The Z2 prototype had a relay-based adder. Early Major (mostly) Relay Computing Events (dates are approximate) Click here to see a higher resolution version of the timeline Relay Computer Timelines Below is a timeline of computer evolution based on switch type. It's instructive to see how relays evolved to transistors over a 17 year period. Table created by Al Kovalick. It is interesting that Fujitsu would build their FACOM 100 relay-only computer in 1954 when tubes were a solid option. Fujitsu was a telephone company with deep relay experience. A team of young engineers led by Toshio Ikeda started developing a “computing machine”. They made relays by the tens of thousands, so it was a natural decision. It had approximately 4,500 relays and took 0.35 seconds for addition and subtraction, 1.8 seconds for multiplication and 5.0 seconds for division with 8-digit (decimal) precision. Click here to see a higher resolution version of the timeline

  • Minimalistic | Vintage Relay Computers

    The Minimalist Calculator Abstract: You might expect a machine that multiplies, divides and takes square roots to need special circuits for each job. It doesn't. This article describes the Minimalistic Calculator, which does all of its math with just two parts, one that adds and one that inverts, plus memory and a controller that runs the steps in order. Subtraction, multiplication, division and even square roots all turn out to be simple patterns of addition and subtraction. Extra hardware makes math faster, but it is never needed to make math possible. Want to compute PI to 1,000 places? This can be done too using the minimalistic approach. Let's see why this is true. All arithmetic can be performed with just four elements: an adder, an inverter, a data sequencer and storage registers. The adder does the addition, and the inverter produces negative numbers (2’s complement) so that subtraction is possible. The adder’s carry-out directs the sequencer’s next step. This is true for computers and calculators since they share the same math subsystem. This may seem counter intuitive so let's dig deeper. See Figure 1. Fig 1, Doing arithmetic with minimal hardware (Kovalick) Marvin Minsky [Minsky] showed that multiplication, division, square roots and floating-point math are just sequences of additions and subtractions directed by the carry, and they need no further arithmetic hardware. Additional hardware adds speed, not capability. The R30 was constructed based on this premise and therefore only has a hardware adder, hardware inverter and a microcontroller for sequencing and for data storage. At one time I thought that a calculator also required right/left bit shifters, muxes, zero detectors, bit masks and more. I was wrong. Sure, these may speed up some operations, but an adder and an inverter are sufficient to do all math ops. Reference : Minsky, M. L., Computation: Finite and Infinite Machines. Prentice-Hall,1967 All you need is adding To understand how only 4 components can execute all calculator math, let’s briefly review the common binary operations for long division. Fig 2, Long division steps to divide two numbers So, step 1 is a left shift , step 2 is add or subtract, step 3 is set a bit (store) and step 4 is a right shift . It turns out that for multiply (the inverse of divide), there is a left shift required during the multiply process. We all learned "restoring division" in primary school but "non restoring" is easier to execute in hardware. Let’s see how to do the shifts using only an adder. • A shift left is done by a d ding a number to itself (A + A), this doubles it. 00110 becomes 01100 . • A shift right can be done using a method we will call shifting right by shifting left. Shifting bits right by shifting bits left A right bit shift of a 32-bit number can be implemented without a hardware-based right shift register by performing 31 successive modular doublings using an adder. Each doubling corresponds to a one-bit cyclic left rotation . 31 such rotations therefore produce a one-bit right rotation. Although very inefficient, the method allows a right-shift operation to be synthesized using an integer adder rather than additional shift hardware. Here is an example of dividing 4 by 2 (Fig 3). In this case A=4 to start. Each addition of A + A gives a left shift as seen in steps 1, 2 and 3. At step 2 the Carry-out = 1 and is fed to the Carry-in (circular rotation). So, at step 3 the result is 2 = 4/2 and this is the same as one right shift of A in a standard shift register. Fig 3, Shifting right by shifting left Trading speed for simplicity These methods trade longer execution time for less hardware. I was surprised to find an “adder solution” for every bit-manipulation operation I examined (including AND, OR, XOR, and NOT). Also, these principles allowed the R30 design to be lightweight, portable, and still be a legitimate relay-based calculator/computer of Class 3 . Some readers may object to this approach based on calculation speed and say, "For the speed increase, the extra hardware is well worth it." In fact, most CPU architectures use very advanced techniques for speeding up math calculations. Unfortunately, the R30 can't afford these due to the extra size and weight especially when using 1940's era relays. The page on the Arithmetic Logic Unit reviews speed up methods that would be very useful for a relay-based machine if size and weight were not a driving factor.

bottom of page