<s>
A	O
counter	B-Application
machine	I-Application
is	O
an	O
abstract	B-Application
machine	I-Application
used	O
in	O
a	O
formal	O
logic	O
and	O
theoretical	O
computer	O
science	O
to	O
model	O
computation	O
.	O
</s>
<s>
It	O
is	O
the	O
most	O
primitive	O
of	O
the	O
four	O
types	O
of	O
register	B-Application
machines	I-Application
.	O
</s>
<s>
A	O
counter	B-Application
machine	I-Application
comprises	O
a	O
set	O
of	O
one	O
or	O
more	O
unbounded	O
registers	O
,	O
each	O
of	O
which	O
can	O
hold	O
a	O
single	O
non-negative	O
integer	O
,	O
and	O
a	O
list	O
of	O
(	O
usually	O
sequential	O
)	O
arithmetic	O
and	O
control	O
instructions	O
for	O
the	O
machine	O
to	O
follow	O
.	O
</s>
<s>
The	O
counter	B-Application
machine	I-Application
is	O
typically	O
used	O
in	O
the	O
process	O
of	O
designing	O
parallel	O
algorithms	O
in	O
relation	O
to	O
the	O
mutual	O
exclusion	O
principle	O
.	O
</s>
<s>
When	O
used	O
in	O
this	O
manner	O
,	O
the	O
counter	B-Application
machine	I-Application
is	O
used	O
to	O
model	O
the	O
discrete	O
time-steps	O
of	O
a	O
computational	O
system	O
in	O
relation	O
to	O
memory	O
accesses	O
.	O
</s>
<s>
For	O
a	O
given	O
counter	B-Application
machine	I-Application
model	O
the	O
instruction	O
set	O
is	O
tinyfrom	O
just	O
one	O
to	O
six	O
or	O
seven	O
instructions	O
.	O
</s>
<s>
Using	O
the	O
instructions	O
mentioned	O
above	O
,	O
various	O
authors	O
have	O
discussed	O
certain	O
counter	B-Application
machines	I-Application
:	O
</s>
<s>
The	O
three	O
counter	B-Application
machine	I-Application
base	O
models	O
have	O
the	O
same	O
computational	O
power	O
since	O
the	O
instructions	O
of	O
one	O
model	O
can	O
be	O
derived	O
from	O
those	O
of	O
another	O
.	O
</s>
<s>
All	O
are	O
equivalent	O
to	O
the	O
computational	O
power	O
of	O
Turing	B-Architecture
machines	I-Architecture
.	O
</s>
<s>
Due	O
to	O
their	O
unary	O
processing	O
style	O
,	O
counter	B-Application
machines	I-Application
are	O
typically	O
exponentially	O
slower	O
than	O
comparable	O
Turing	B-Architecture
machines	I-Architecture
.	O
</s>
<s>
The	O
counter	B-Application
machine	I-Application
models	I-Application
go	O
by	O
a	O
number	O
of	O
different	O
names	O
that	O
may	O
help	O
to	O
distinguish	O
them	O
by	O
their	O
peculiarities	O
.	O
</s>
<s>
Minsky	B-Application
machine	I-Application
,	O
because	O
Marvin	O
Minsky	O
(	O
1961	O
)	O
formalized	O
the	O
model	O
.	O
</s>
<s>
Abacus	B-Application
machine	I-Application
,	O
the	O
name	O
Lambek	O
(	O
1961	O
)	O
gave	O
to	O
his	O
simplification	O
of	O
the	O
Melzak	O
(	O
1961	O
)	O
model	O
,	O
and	O
what	O
Boolos-Burgess-Jeffrey	O
(	O
2002	O
)	O
calls	O
it	O
.	O
</s>
<s>
Lambek	O
machine	O
,	O
an	O
alternative	O
name	O
Boolos-Burgess-Jeffrey	O
(	O
2002	O
)	O
gave	O
to	O
the	O
abacus	B-Application
machine	I-Application
.	O
</s>
<s>
Used	O
as	O
a	O
base	O
for	O
the	O
successor	O
RAM	B-Application
model	I-Application
.	O
</s>
<s>
Schönhage	O
as	O
a	O
base	O
for	O
his	O
RAM0	O
and	O
RAM1	O
models	O
that	O
lead	O
to	O
his	O
pointer	B-Application
machine	I-Application
SMM	O
model	O
,	O
also	O
discussed	O
briefly	O
in	O
van	O
Emde	O
Boas	O
(	O
1990	O
)	O
:	O
</s>
<s>
Other	O
counter	B-Application
machines	I-Application
:	O
Minsky	O
(	O
1967	O
)	O
demonstrates	O
how	O
to	O
build	O
the	O
three	O
base	O
models	O
(	O
program/Minsky/Lambek	O
-abacus	O
,	O
successor	O
,	O
and	O
Elgot-Robinson	O
)	O
from	O
the	O
superset	O
of	O
available	O
instructions	O
described	O
in	O
the	O
lead	O
paragraph	O
of	O
this	O
article	O
.	O
</s>
<s>
The	O
proofs	O
of	O
Minsky	O
(	O
1961	O
,	O
1967	O
)	O
that	O
a	O
single	O
register	O
will	O
suffice	O
for	O
Turing	B-Algorithm
equivalence	I-Algorithm
requires	O
the	O
two	O
instructions	O
{	O
MULtiply	O
k	O
,	O
and	O
DIV	O
k	O
}	O
to	O
encode	O
and	O
decode	O
the	O
Gödel	O
number	O
in	O
the	O
register	O
that	O
represents	O
the	O
computation	O
.	O
</s>
<s>
are	O
adequate	O
(	O
but	O
the	O
Gödel	O
number	O
is	O
still	O
required	O
to	O
demonstrate	O
Turing	B-Algorithm
equivalence	I-Algorithm
;	O
also	O
demonstrated	O
in	O
Elgot-Robinson	O
1964	O
)	O
.	O
</s>
<s>
A	O
counter	B-Application
machine	I-Application
consists	O
of	O
:	O
</s>
<s>
"	O
accumulator	O
"	O
(	O
See	O
Random-access	B-Application
machine	I-Application
for	O
more	O
on	O
this	O
)	O
.	O
</s>
<s>
The	O
program	O
store	O
(	O
instructions	O
of	O
the	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
)	O
is	O
not	O
in	O
the	O
same	O
physical	O
"	O
space	O
"	O
as	O
the	O
registers	O
.	O
</s>
<s>
Usually	O
,	O
but	O
not	O
always	O
,	O
like	O
computer	B-Application
programs	I-Application
the	O
instructions	O
are	O
listed	O
in	O
sequential	O
order	O
;	O
unless	O
a	O
jump	O
is	O
successful	O
,	O
the	O
default	O
sequence	O
continues	O
in	O
numerical	O
order	O
.	O
</s>
<s>
Alternative	O
instruction-sets	O
are	O
discussed	O
in	O
the	O
supplement	O
Register-machine	B-Application
models	I-Application
.	O
</s>
<s>
And	O
in	O
fact	O
the	O
following	O
is	O
summary	O
of	O
how	O
the	O
primitive	B-Architecture
recursive	I-Architecture
functions	I-Architecture
such	O
as	O
ADD	O
,	O
MULtiply	O
and	O
EXPonent	O
can	O
come	O
about	O
(	O
see	O
Boolos-Burgess-Jeffrey	O
(	O
2002	O
)	O
p.45-51	O
)	O
.	O
</s>
<s>
In	O
general	O
,	O
we	O
can	O
build	O
any	O
partial	O
-	O
or	O
total	O
-	O
primitive	B-Architecture
recursive	I-Architecture
function	I-Architecture
that	O
we	O
wish	O
,	O
by	O
using	O
the	O
same	O
methods	O
.	O
</s>
<s>
Indeed	O
,	O
Minsky	O
(	O
1967	O
)	O
,	O
Shepherdson-Sturgis	O
(	O
1963	O
)	O
and	O
Boolos-Burgess-Jeffrey	O
(	O
2002	O
)	O
give	O
demonstrations	O
of	O
how	O
to	O
form	O
the	O
five	O
primitive	B-Architecture
recursive	I-Architecture
function	I-Architecture
"	O
operators	O
"	O
(	O
1-5	O
below	O
)	O
from	O
the	O
base	O
set	O
(	O
1	O
)	O
.	O
</s>
<s>
But	O
what	O
about	O
full	O
Turing	B-Algorithm
equivalence	I-Algorithm
?	O
</s>
<s>
However	O
,	O
the	O
reader	O
needs	O
to	O
be	O
cautioned	O
that	O
,	O
even	O
though	O
the	O
μ	O
operator	O
is	O
easily	O
created	O
by	O
the	O
base	O
instruction	O
set	O
does	O
n't	O
mean	O
that	O
an	O
arbitrary	O
partial	O
recursive	O
function	O
can	O
be	O
easily	O
created	O
with	O
a	O
base	O
model	O
--	O
Turing	B-Algorithm
equivalence	I-Algorithm
and	O
partial	O
recursive	O
functions	O
imply	O
an	O
unbounded	O
μ	O
operator	O
,	O
one	O
that	O
can	O
scurry	O
to	O
the	O
ends	O
of	O
the	O
register	O
chain	O
ad	O
infinitum	O
searching	O
for	O
its	O
goal	O
.	O
</s>
<s>
INC	O
(	O
47,528	O
)	O
and	O
DEC	O
(	O
39,347	O
)	O
and	O
this	O
will	O
exhaust	O
the	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
's	O
TABLE	O
of	O
instructions	O
.	O
</s>
<s>
No	O
matter	O
how	O
"	O
big	O
"	O
the	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
is	O
,	O
we	O
can	O
find	O
a	O
function	O
that	O
uses	O
a	O
"	O
bigger	O
"	O
number	O
of	O
registers	O
.	O
</s>
<s>
The	O
problems	O
are	O
discussed	O
in	O
detail	O
in	O
the	O
article	O
Random-access	B-Application
machine	I-Application
.	O
</s>
<s>
(	O
1	O
)	O
Unbounded	O
capacities	O
of	O
registers	O
versus	O
bounded	O
capacities	O
of	O
state-machine	B-Architecture
instructions	O
:	O
How	O
will	O
the	O
machine	O
create	O
constants	O
larger	O
than	O
the	O
capacity	O
of	O
its	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
?	O
</s>
<s>
(	O
2	O
)	O
Unbounded	O
numbers	O
of	O
registers	O
versus	O
bounded	O
numbers	O
of	O
state-machine	B-Architecture
instructions	O
:	O
How	O
will	O
the	O
machine	O
access	O
registers	O
with	O
address-numbers	O
beyond	O
the	O
reach/capability	O
of	O
its	O
finite	B-Architecture
state	I-Architecture
machine	I-Architecture
?	O
</s>
<s>
For	O
every	O
Turing	B-Architecture
machine	I-Architecture
,	O
there	O
is	O
a	O
2CM	O
that	O
simulates	O
it	O
,	O
given	O
that	O
the	O
2CM	O
's	O
input	O
and	O
output	O
are	O
properly	O
encoded	O
.	O
</s>
<s>
First	O
,	O
a	O
Turing	B-Architecture
machine	I-Architecture
can	O
be	O
simulated	O
by	O
a	O
finite-state	B-Architecture
machine	I-Architecture
(	O
FSM	O
)	O
equipped	O
with	O
two	O
stacks	B-Application
.	O
</s>
<s>
Then	O
,	O
two	O
stacks	B-Application
can	O
be	O
simulated	O
by	O
four	O
counters	O
.	O
</s>
<s>
A	O
Turing	B-Architecture
machine	I-Architecture
consists	O
of	O
an	O
FSM	O
and	O
an	O
infinite	O
tape	O
,	O
initially	O
filled	O
with	O
zeros	O
,	O
upon	O
which	O
the	O
machine	O
can	O
write	O
ones	O
and	O
zeros	O
.	O
</s>
<s>
Each	O
half	O
of	O
the	O
tape	O
can	O
be	O
treated	O
as	O
a	O
stack	B-Application
,	O
where	O
the	O
top	O
is	O
the	O
cell	O
nearest	O
the	O
read/write	O
head	O
,	O
and	O
the	O
bottom	O
is	O
some	O
distance	O
away	O
from	O
the	O
head	O
,	O
with	O
all	O
zeros	O
on	O
the	O
tape	O
beyond	O
the	O
bottom	O
.	O
</s>
<s>
Accordingly	O
,	O
a	O
Turing	B-Architecture
machine	I-Architecture
can	O
be	O
simulated	O
by	O
an	O
FSM	O
plus	O
two	O
stacks	B-Application
.	O
</s>
<s>
Moving	O
the	O
head	O
left	O
or	O
right	O
is	O
equivalent	O
to	O
popping	O
a	O
bit	O
from	O
one	O
stack	B-Application
and	O
pushing	O
it	O
onto	O
the	O
other	O
.	O
</s>
<s>
A	O
stack	B-Application
containing	O
zeros	O
and	O
ones	O
can	O
be	O
simulated	O
by	O
two	O
counters	O
when	O
the	O
bits	O
on	O
the	O
stack	B-Application
are	O
thought	O
of	O
as	O
representing	O
a	O
binary	O
number	O
(	O
the	O
topmost	O
bit	O
on	O
the	O
stack	B-Application
being	O
the	O
least	O
significant	O
bit	O
)	O
.	O
</s>
<s>
Pushing	O
a	O
zero	O
onto	O
the	O
stack	B-Application
is	O
equivalent	O
to	O
doubling	O
the	O
number	O
.	O
</s>
<s>
Two	O
counters	O
can	O
simulate	O
this	O
stack	B-Application
,	O
in	O
which	O
one	O
of	O
the	O
counters	O
holds	O
a	O
number	O
whose	O
binary	O
representation	O
represents	O
the	O
bits	O
on	O
the	O
stack	B-Application
,	O
and	O
the	O
other	O
counter	O
is	O
used	O
as	O
a	O
scratchpad	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
an	O
FSM	O
with	O
two	O
counters	O
can	O
simulate	O
four	O
counters	O
,	O
which	O
are	O
in	O
turn	O
simulating	O
two	O
stacks	B-Application
,	O
which	O
are	O
simulating	O
a	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
Therefore	O
,	O
an	O
FSM	O
plus	O
two	O
counters	O
is	O
at	O
least	O
as	O
powerful	O
as	O
a	O
Turing	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
A	O
Turing	B-Architecture
machine	I-Architecture
can	O
easily	O
simulate	O
an	O
FSM	O
with	O
two	O
counters	O
,	O
therefore	O
the	O
two	O
machines	O
have	O
equivalent	O
power	O
.	O
</s>
<s>
The	O
result	O
is	O
not	O
surprising	O
,	O
because	O
the	O
two-counter	O
machine	O
model	O
was	O
proved	O
(	O
by	O
Minsky	O
)	O
to	O
be	O
universal	O
only	O
when	O
the	O
argument	O
N	O
is	O
appropriately	O
encoded	O
(	O
by	O
Gödelization	O
)	O
to	O
simulate	O
a	O
Turing	B-Architecture
machine	I-Architecture
whose	O
initial	O
tape	O
contains	O
N	O
encoded	O
in	O
unary	O
;	O
moreover	O
,	O
the	O
output	O
of	O
the	O
two-counter	O
machine	O
will	O
be	O
similarly	O
encoded	O
.	O
</s>
<s>
This	O
phenomenon	O
is	O
typical	O
of	O
very	O
small	O
bases	O
of	O
computation	O
whose	O
universality	O
is	O
proved	O
only	O
by	O
simulation	O
(	O
e.g.	O
,	O
many	O
Turing	O
tarpits	O
,	O
the	O
smallest-known	O
universal	O
Turing	B-Architecture
machines	I-Architecture
,	O
etc	O
.	O
</s>
<s>
"	O
Theorem	O
:	O
Any	O
counter	B-Application
machine	I-Application
can	O
be	O
simulated	O
by	O
a	O
2CM	O
,	O
provided	O
an	O
obscure	O
coding	O
is	O
accepted	O
for	O
the	O
input	O
and	O
output.	O
"	O
</s>
<s>
"	O
Theorem	O
:	O
There	O
is	O
no	O
two	O
counter	B-Application
machine	I-Application
that	O
calculates	O
2N	O
[	O
if	O
one	O
counter	O
is	O
initialised	O
to	O
N ]	O
.	O
"	O
</s>
