Survivalcraft Electrics

This article describes the electrics within Survivalcraft. The unusual aspects are highlighted to show the advantages of building within this environment.

Complete information on each component may be found on the Survivalcraft wiki. Links to the proper articles are included in each section. See those articles for more details.

=System Features= There are several features of the electrics system that are useful to the design of complicated circuitry.

Hex signals
One of the most powerful factors in SCE is the hex signal. This hex signal may be passed along a single wire but represents a 4-bit data value. Most of the gates will operate on this 4-bit signal, giving a 4-bit output. SC calls this an 'analog signal'. It is often referred to in volts, from 0.0 to 1.7, in the SC system documentation. Any gate that requires a binary only input effectively only looks at the high bit since any 'voltage' of 0.8 or above will trigger it. A few gates take further advantage of the 16-value 'analog' signal. Hereinafter, I will call these 'hex' signals and 'hex' inputs, etc. They are not analog by any means except as a false concept to make it easier (?) for some to understand.

Hybrid Signals
The system also uses partial-hex-type signals. The LED uses a "half-hex" signal where any value below '8' does nothing and '8' to 'F' control the lighting amount. I call it a "half-hex" because it can be thought of as a light value added to the hex '8' (the minimum value that triggers a binary input).

Another hybrid is the Memory Bank's clock input. This usage is unique to the bank. See this article for more information.

Wired-OR
All outputs may be wired together to provide an implicit OR function amongst them. There is no fan-out or fan-in limit or degradation since this is a virtual environment. In many cases this can eliminate the need for an output enable buffer.

Dual Outputs
All the basic gates use only 2 or 3 I/O ports. The blocks in SC allow up to 5 connections so for these gates a second, independent output is provided. This can be very useful if the main one is connected in a wired-OR line. A second output prevents the wired-OR from interfering with another circuit operating on this output.

Implicit Power
In this virtual environment, no concrete power supply is needed. Power to the components is implied and need not be wired. This makes the physical construction significantly simpler. It avoids all the difficulties of power supply distribution.

Fan-in / Fan-out
We do not need to be concerned about any fan-out or fan-in issues in this virtual environment. Loading on output buffers is non-existent.

Wire length/placement
There is no limit on the length of any wires. The virtual environment does not include issues such as wire/load capacitance or signal dampening or settling times.

There is also no possibility of crosstalk between conductors. See below for additional wiring issues.

Timing Delay
Updates to the circuit values are made incrementally, in 'tics'. Each tic represents the passage of a signal through a single gate. So the total propagation time of a signal is simply the count of the gates it passes through. Even the powerful memory bank takes but a single tic to output any new value. When the system is running, the internal clock providing the tics runs at a meagre 100 tics per second. This is nothing great but for a virtual breadboard of this nature, it has to suffice.

=Gates and Chips= Survivalcraft electrics includes many equivalents to real-world components. In addition to the basic gates, there are several extremely useful 'chips' as well. One huge advantage of these chips is that the delay time through them is the same as through any basic gate - a single clock tic.

Follow the included links for more detailed information on these components.

Basic Gates
All the basic gates are included: AND OR NAND NOR XOR NOT. Two types of delay are also available - a fixed delay and an adjustable one. The adjustable delay allows for delays from 0.01 second (1 tic) to 2.56 seconds and will be used exclusively in this design. One tic is the delay time through any gate or 'chip'.

Memory Bank
The memory bank is the most versatile block in SC. It is a 256 cell storage array and each cell holds a single hex (4-bit) data value. It has 5 connections which include separate data inputs and outputs. There are 2 hex address lines for the 8-bit addressing. The last I/O is a multipurpose clock input line.

The clock input accepts a hex signal so it may be driven by either a hex or a binary output. Depending on how (and whether) the clock input is connected, the bank can operate in several modes:

- If the clock is not connected, the bank is an asynchronous read-only block. As such, it may be used as a ROM or a general-purpose PLA (Programmable Logic Array) with 8 inputs and 4 independent outputs. One common use for this mode is as an output enable buffer. - If the clock is driven by a binary only signal, the bank is a synchronous read-only block. In this mode it still may be used as a PLA but the output is always synchronized to the clock input. As such, one common use is as a general purpose latch. - The clock may be driven by a 'hybrid' signal as well. This is not a full hex input as only certain levels are relevant. As before, a signal of 8h or higher will trigger a synchronous read. However a signal above 0h yet below 8h triggers a WRITE. This provides for the 3rd mode - synchronous R/W (or RAM). This makes the bank a "dual-port" device. It will continue to output the last accessed location while writing to other locations.

In any of these modes, the total delay times for any change through the memory bank is still the same as the delay through a single basic gate - a single tic.

This is a representation of the memory in the Memory Bank. The row is selected by the high address input and the column within that row is determined by the low address input.

||0 1 2 3 4 5 6 7 8 9 A B C D E F| 0||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 1||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 2||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 3||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 4||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 5||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 6||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 7||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 8||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| 9||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| A||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| B||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| C||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| D||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| E||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X| F||X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|X|

Memory Bank

S-R Latch
The latch may be operated in either synchronous or async modes. Like the memory bank, it has a clock input and if this input is not connected, it operates as an async S/R latch. If the clock is connected, the output will not update until the clock level goes high.

S-R Latch

A>D and D>A
The A>D and D>A are provided to give conversion between the two signal types - binary and hex ('analog'). They function as a "bit splitter" or "bit combiner". The A>D accepts a hex input, separates the 4 bits in the signal and outputs each bit separately on its own output line. The D>A accepts 4 binary ONLY inputs and combines them into a single hex output signal. It is not the same as using an OR gate since each input line only affects the specific bit of the output. An OR gate (or a wired-OR) will 'OR' each bit of all the inputs.

A>D Converter D>A Converter

Truth Table
This is strictly an asynchronous gate. It takes in 4 binary ONLY inputs and provides a binary ONLY output which depends on the states of the inputs. It includes the dual output feature. There is a method to force it to output a hex value but this feature will not be used in this design.

Truth Table

=Other Components= Numerous other components are available to the designer. Some of these will only be useful during debugging of the system, while others may be used in other sub-systems.

7-Segment Display
These are the same as standard 'real world' numeric displays. They accept a Hex input and display the value of that signal as a hexadecimal from '0' to 'F'

7-Segment Display

LEDs
These do not light an area but are useful as indicators and come in 8 different colors. They accept a binary signal.

LED

4-LED Display
This component accepts hex inputs and is useful as a dot-matrix display. It is comprised of an array of 2 x 2 LEDs and each LED reflects the state of one of the input bits.

4-LEDs

Switches
There are two types of switches available in this environment, a pushbutton and a toggle switch. The pushbutton is a momentary contact switch and when pressed will output an 'F' for approximately 1/2 second. The toggle outputs either a '0' or an 'F' depending on which state it's in. The toggle may be used as a 'power source'.

Pushbutton Switch Toggle Switch

Battery
The battery may be used as a power source for a variable 'voltage' value. It outputs a hex signal that may be manually adjusted from inside the environment.

Battery

Piston
Piston

Custom Blocks
Custom Blocks

-

=Virtual System Negatives= There are two significant limitations on circuits within this environment. Other restrictions are listed as well.

View Distance
This is the maximum distance (in 'blocks') that the game renders the terrain out to. It may be altered in the system settings. The maximum useful distance is determined by the processing power of the device the system is running on.

The system only computes changes to a circuit within this distance limitation. Therefore, any electric circuit must be completely contained within this distance to operate properly. This is often a problem for circuits made for use in the actual game, since the character may move into and out of range of only parts of the circuit thus causing incomplete operation of the circuit.

In this design, the character will be assumed to be permanently placed at an optimal position for circuit operation so partial functioning is avoided. However it does mean that there is a 'physical' limit to the size of the build. This limit will be initially set at a 96 block radius but may be increased if necessary.

View Distance

Complexity Limit
There is a 'bug' or limit to the maximum complexity of any build within this environment. It is due to the massive computing necessary to render the many thousands of graphical elements in such a limited space. It is a local effect, meaning it primarily limits complexity in the vertcal direction. The Electric components seem to contribute more to this limit than 'regular' blocks.

This limit is impossible to predict, so it often requires trial and error to keep the construction below this limit. - Those two limitations are clearly at odds with each other. The complexity limit forces circuits to be spread out more while the view distance limitation enforces a maximum spread.

Physical Layout
Because this is a virtual environment and not a full simulation, the circuitry does need to be physically placed. In this system, there can be only one component in a single 'block' space. The limition this poses is not a major problem since the vertical dimension is freely available. The negatives cited above are affected by the physical build and it is the build itself that must not violate those limits.

Wiring can be potentially a problem since it is also limited by the 1-block, 1-component rule, except when there are only wires in that block. Then more complicated rules take effect. All connections are made automatically by the system and there is little the designer can do about this. Proper attention to layout must be followed to avoid undesireable connections.

Wires may be any of 7 colors, plus neutral. Neutral wires will attempt to connect to any other wire a single block away, provided there is a continuous surface. Colored wires will only connect to same-colored wires and neutral wires. See the wiki article.

Two wires may be laid out to pass throuh the same block space but not connect, if they do not share an edge. This means they must be on opposite sides of that block space. Any such wires however are forced to be the same color and this could cause problems elsewhere. When this is a problem, a single block of the neutral colored wire may be used to change the color of that specific wire.