Redstone circuits/Advanced circuits

Here are some examples of the possibilities that redstone gates create.

Advanced Redstone circuitry may be seen as comparable to the "WireMod" addon popular within Garry's Mod and to  digital electronics in real life.

Binary to Decimal
A series of gates that convert a 3bit binary input from inputs into a decimal output from 0-7. Useful in many ways as they are compact 5x5x3 at the largest.

These can be linked in a series from one input source but it is recommended to place an inverter before each  input into the circuit to keep them isolated from interacting with the  other circuits since some drive a combination of High and Low current.

Need clarification but some of these may also work as Tri State buffers or  as close as possible with redstone depending on your setup.

Computation
Using logic gates, we can arrange them to make binary calculations, like in a  computer. When using the gates below, mind the inputs and outputs. You may be wondering why there are so many inverted signals being used  instead of the regular signal. The adders below use XNOR gates rather than XOR gates because they are more compact. As a result, IMPLIES gates must be used instead of an AND gate, which also happen to be more  compact. Therefore for the most compact adder, inverse signals must be used. These adders are too complex to be easily deciphered with 2 layers per square, so each single layer has been drawn separately to ease the  building process.

Half Adder


Gates: XNOR, IMPLIES

Torches: 12

Redstone: 7

Blocks: 19

Size: 5X4X4

This adder will take 2 bits and add them together. The resulting bit will be the output of S (sum). If both bits are 1, there will be a carry over, and C will become 1 (~C will become 0). This half adder can be modified to create a non inverted C output, but this configuration is used so  that it can be implemented as the start of a chain of full adders.

Full Adder (1 Bit Adder)
AS A FOREWARNING THIS DESIGN IS WRONG! It uses an OR instead of an AND to combine the two half adders.



Gates: XNOR (2), IMPLIES, NOT, OR, AND

Torches: 16

Redstone: 32

Blocks: 48

Size: 6X12X5 Ceiling to floor, including I/O spaces.

This adder will take 2 bits and a carried over bit (actually ~C, rather than  C, a value held in the redstone in the bottom left corner on layer 1)  and add them all together, producing a sum (S) bit and a carry (actually  ~C rather than C).

4 Bit Adder


'''Note! The least significant digit ("ones" digit) is on the left of the diagram so that the progression from half adder to the full adders can  be seen more clearly. Reverse the diagram if you want a conventional left to right input.'''

Gates: XNOR (7), IMPLIES (4), NOT (4), OR (3), AND (3)

Torches: 56

Redstone: 108

Blocks: 164

Size: 23X12X5

This adder will take 2, 4 bit numbers (A and B) and add them together,  producing a sum (S) bit for each bit added and a carry (C) for the whole  sum. The sum bits are in the same order as the input bits, which on the diagram means that the leftmost S output is the least significant digit  of the answer. This is just an example of a string of adders; adders can be strung in this way to add bigger numbers as well.

Related pages

 * Redstone
 * Redstone (wire)
 * Redstone (ore)
 * Redstone (dust)
 * Redstone Torch
 * Redstone_circuits
 * Mechanisms
 * Traps