Published on

Minecraft 8 Bit Adder

Authors
  • avatar
    Name
    Joseph Fortman
    Twitter

Background

Overview
Night Overview
Side by Side
Vanilla

Earlier this month I decided to make another 8-bit adder in Minecraft. I had been working on Nand2Tetris, so the ideas were fresh in my mind already.

At the start of COVID, I built my first redstone 8-bit adder. I also prototyped seven-segment displays with redstone to display the output, but I gave up when I considered the space and wiring logistics. I have updated the bottom of this post with some images I stumbled on.

Theory

To build a 1 bit Full Adder, the general procedure is to use two Half Adders, with an OR between them.

A Half Adder is composed of an XOR to calculate the sum bit, and an AND to calculate the carry bit.

Why does this work? Think about the problem carefully. The carry bit should be set only if input A is set AND input B is set. The sum bit should set if A is set or B is set, but not if both are set. This function is called an Exclusive Or: XOR for short.

Input & Output

Usage

Input

Flip switches to express two numbers in binary. 8 bits supports positive numbers from 0 to 255. Alternatively negative numbers can be used with Two's Complement, from -128 to 127.

The RFTools circuit appears to have 0 calculation delay. In a vanilla redstone circuit the calculation can take a second due to logic gates requiring a number of ticks to operate.

Note that the output has 9 bits. Normally this overflow bit would be discarded.

Input & Output

118 + 69 = 187

Construction

Vanilla Redstone

I made some improvements to my previous vanilla full adder design. This time a ~30% smaller Xor gate was used. Also, the And gates were lowered by one block which reduces the total chip width to 8 blocks.

Vanilla

Vanilla 1 bit adder

Notes - Vanilla

20L x 8W x 3H

RFTools

I did not explore very deeply for redstone enhancements, but the modpack I was using had RFTools available. There are likely other mods to make what this easier, but that will have to wait for the next build.

The Redstone Transmitter & Receiver works in a straightforward way. Only one transmitter per channel, but multiple receivers is allowed. The downside is that there is a limited number of channels available. 4 transmitters were used per circuit, 2 for the input, 1 for the carry bit, and 1 internal wire labeled T1.

RFTools also supplies a Logic Gate block which accepts up to 3 inputs and has 1 output. When clicked to configure, the user is presented with a raw truth table to manipulate. This was used to construct Xor, And, and Or gates to ultimately build the chips.

This build can be made smaller by adding more receivers. I opted to split the redstone signal from the inputs because it was more straightforward to me. In future builds I might optimize this further.

Compact

8 bit addition with 9 bit result

Notes - Compact

7L x 5W x 2H

Bonus - First Iteration Pictures

These structures were made purely with vanilla redstone components.

I found these pictures going through old messages. I did not find the original galleries these came from, though I recall taking a handful of pictures to document my work. I believe those images were lost during a drive failure, but I still hope to find them somewhere.

Compact

Extensive staircases for redstone wires

Notes - Compact

Detailed instructions on how to operate the machine

7 Segment Display

My original goal was to build 3 of these to display output from the 8-bit adder. I gave up on that after this prototype: it would not be possible to put three close together. Maybe some drastic measures could make it work, but I wasn't into trying.

With redstone transmitters from RFTools, implementation might be able to scale. I will have to come back to this next time.