This simple design was first brought to my attention in Blakeslee (1)
as a simple way of implementing algorithmic state machines. Traditional
state machine design involves a rigid state description, input
contingencies , output state to next input state mapping, followed by
assignment of discrete states to JK flip flops and then logic
minimization with Karnough maps or other such tools that in my opinion
serves only to obfuscate the problem and deny practical implementation.
Any change whatsoever in the requirements in the machine neccesarily
require its complete redesign and rebuilding. The traditional method
admits no possibility of "programming" to cope with design changes. In
practice, the traditional state machine permits no simple debugging,
sequence single stepping to verify design compliance. The final logic
map does not have an intuitive mapping between the logic and the
function that the machine has been designed to perform.
The key elements in the design are 4 bit binary resettable counters
with clock enable and preset enable inputs, binary to unary decoders
(eg 74154 4 to 16 decoder) , 8 to 1 multiplexer (eg 74151), 4 bit
priority encoder (eg 74148) and simple SSI glue logic.
Applications.
This design technique is applicable only to seventies era logic when
MSI gates became available and situations where the raw speed
adavantage of hard wired logic or the simplicity of the problem does
not require the complexity or expense of developing a microprocessor
based solution.
In this day one would be remiss not to use an AVR or PIC for even the
most trivial applications unless speed is important. The simple
74xxx series logic can run at at least 20Mhz, newer ACT or older S
variant logic may toggle up to nearly 100 Mhz. The design
implemented in ECL can easily run at 200Mhz without special design
effort.
The design presented and implented in typical 74 series logic will have
a maximum of 16 states. In the practical applications presented (
Static and Dynamic RAM chip testers ) the machine will have millions of
states.
The most usefull and critical application of the the zero bit computer
is in the generation of precision and deterministic timing
sequences for such things as dynamic ram signal sequencing, CCD array
timing, microprocessor bus control or even control of simple automata.
The natural language problem description should be able to be stated in terms of these constructs.
1. wait until condition, or advance state until condition, or advance state unconditionally
2. branch to state X on external contingency, branch to state X if
state equals Y (being an internal contingency), unconditional branch.
3. for each state, there exists a discrete unary output signal, used or
unused, whose meaning is arbitrary and defines the usefull output of
the machine.
These statements map directly to a logic map consisting of nothing more
than a counter, decoder, and two multiplexors and a priority encoder
(only if more than one branch destination is required).
There is no logic minimization, there is nothing to minimise in this MSI implementation. ( still worth doing in an FPGA)
This simple design cannot do arithmetic or branch on value comparisons
and cannot operate on DATA, hence the origin of the zero bit computer
idea. It is not a micro processor, however some conceputally simple
extentions could turn it into an arbitarilly powerfull RISC processor.
An 4 bit MSI counter generally has a clock input, clock enable input, a
preset state input control, preset inputs and binary state outputs.
Some may have a count direction control but that is not a usefull
function in this case. The preset enable control signal should be
synchronous.
A priority encoder take unary signals and outputs a binary word. A
multiplexer takes a binary address value and selects one of many input
unary signals and passes it through. A decoder takes a binary value and
generates a unary signal that represents the binary value. The state of
the machine is defined by the weighted binary value of a small number
of D type flip flops, which in our case are embedded in the binary
counter chips which with their internal glue logic compel them to
"count" in binary. Counting in this sense is just a unique but
arbitrary mapping of one state to its next state however as human
designers we allready understand the "counting sequence"
0,1,2,3.....14,15,0 so there is at least one less mystery to deal with.
The "clock" signal may be any free running clock , the clock serves
merely as a source of discrete time steps that define the smallest
atomic state transistion time and more importantly provide positive
edge transistions that D flip flops require in order to change state.
Now is the time to connect some of these logic gates together.
The preset enable of the counter is connected to the ouput of a
multiplexer. The address line inputs of the multiplexer are connected
to the counter outputs. The data inputs to the multiplexer
are connected to logical zero or one or an external input fromthe
outside world. When the preset input of the counter is active the
binary value present on the counter data input lines becomes (and this
is the important bit) BECOMES THE NEW STATE. This setup can now
perform conditional and unconditional branching determined only by THE
INPUTS OF THE MULTIPLEXOR. Nops or "just advance to the next state" are
wired as logical zeros, unconditional branches are wired as logical
ones and conditional branches are wired to the outside world.
Allready this little machine can react to external stimulie in a meaningful way.
Each state of the machine must have assigned to it a "meaning" in the
higher language sense. The state is represented by the weighted binary
value of the counter. The counter outputs now also feed a binary to
unary decoder. Now exists a discrete signal to which we attach
meanings, even if a particular state is not used, redundant or
"meaningless" we still assign a meaning of "not used" to it.
These unary outputs also represent the "usefull" output signals that
might be driving bus control signals, LSI control signals,
relays, lights, whatever. It is possible to connect one of these unary
outputs to the preset enable multiplexor input to implement a "when you
have reached the end of the program branch to the beginning "
construct...or also to catch and manage unimplemented states ( which
all good digital designers take care of ... dont they ?)
To implement the wait on condition function or the advance state
control another multiplexer output connects to the clock enable
signal of the counter. The address lines to the multiplexor and
counter ouput are connected. It is now possible to assign a wait
states based on the state of the counters. Logical ones
will advance the state, logical zero will halt the machine (this is not
so useless...we may wish to halt on some alarm condition ) or an
external signal. The state machine can now be programmed to wait UNTIL
some external condition is satisfied.
Now we can add more advanced features. The data presented to the preset
inputs of the counter represents a program address location in the
sense of the way we understand what programming means.
Typically it would be hard wired to all logical zero as most micro
programms will branch unconditionally back to zero. We might however
branch back to 0001 and leave state 0000 to perform power on
initiallization of other systems. We could feed the preset inputs
through another multiplexor to implement a conditional branch on
external condition. If there are many external signals on which we wish
to conditinally branch , feed them all through a priority encoder
which will generate a binary weighted word mapped to any one of its
unary input signals. (Think of a priority encoder as a kind of PROM
whoose contents is selected by unary coded address lines!)
There are some logical extentions to this simple scheme to make it more
complicated. Sixtenn states may not seem much and isnt enough for all
but the most simple control and sequencing requirements. Multiple
counters can be cascaded but even with a state counter of 8 bits, this
gives 256 states. Decoding all these states is unreasonable with
discrete logic, only the actual uniquely required states would be
decoded, an application might be TV sync generation where we require 16
bit time resolution. More complex control would be implemented in a
ROM. The counter outputs address a ROM some of whose outputs are
connected to the "branch enable" and "clock enable" and by now the ROM
contents look suprisingly similar to assembly language.
This system is still not processing data, in this model processing data
means makeing conditional branches based on the outcome of arithmetic
operations. Now a "data" path needs to be defined. This can as
arbitarily complex or simple as required. Sources and sinks of data
must be defined. A source of data could be external binary words,
binary words from some ROM output lines, binary words from RAM,
binary words from a general purpose register and so on. Then logical or
arithmetic operations need to be defined. There exists chips allready
prewired to perform arbitrary operations on two binary words that are
selected by some address lines (for example the 74181 ALU slice ) In
our case those selection lines are driven by some of our ROM output
signals. Other ROM or RAMoutput signals could be a source of this data
too. The ALU has two input streams, one output operation
result stream and CONDITION CODES that typically indicated whether
arithmetic operations were meaningfull, overflow, underflow , zero ,
arithmetic carry flag, shift carry. These condition codes may be
directly connected to the branch enable multiplexor. Now programmatic
control based on arithmetic/logic operations becomes possible. With
many branch destinations it make sense that they are supplied by the
now big ROM as well.
The ALU has not only condition code outputs but a data output. This
"processed data" needs a home. This could be routed via more muxes to
the input of RAM, a display, a register or whatever. The RAM write
enable signal is supplied by a one bit output of the ROM , now our
program repertoire includes a WRITE to memory operation.
It is not difficult to perceive that here is the making of a simple completely general purpose computer of arbitrary word size.
Presented here are two zero bit computer based machines I have
constructed to perform an actual needed task that at the time could not
be easily done with a microprocessor. The design is twenty years old
using thirty year old components to solve a problem twenty years ago!
a simple and effective static ram testing machine based on ZBCs
The zero bit microsequencer concept should also be understood in a
newer way of understanding the operation of combinatorial logic.
The classical view is that of the philosophical logician that
models behaviour in terms of truth tables . This view is correct,
and is the ultimate source of wisdom when the particular behaviour of a
logic map needs to be uniquely specified. It is, however,
difficult to turn the truth table into a humanely understandable or
meaning form. The logic elements should be understood in terms of
signal flow. Real digital devices deal with dynamic situations and real
physical conditions. They have an effect on to the signals presented to
them. They should be thought of as small control elements that are
presented with a generalized concept of signal, a signal flow and a
control element and maybe a transforming element. It is not usually helpfull to view them as logic because real brains do not generally think logically.