<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://conwaylife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rei</id>
	<title>LifeWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://conwaylife.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rei"/>
	<link rel="alternate" type="text/html" href="https://conwaylife.com/wiki/Special:Contributions/Rei"/>
	<updated>2026-09-09T02:26:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Cottonmouth&amp;diff=173234</id>
		<title>Cottonmouth</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Cottonmouth&amp;diff=173234"/>
		<updated>2026-06-09T02:33:08Z</updated>

		<summary type="html">&lt;p&gt;Rei: fix forum title&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Spaceship&lt;br /&gt;
|name         = Cottonmouth&lt;br /&gt;
|pname        = cottonmouth&lt;br /&gt;
|type         = Pushalong&lt;br /&gt;
|c            = 78&lt;br /&gt;
|bx           = 10&lt;br /&gt;
|by           = 34&lt;br /&gt;
|dir          = Orthogonal&lt;br /&gt;
|p            = 10&lt;br /&gt;
|m            = 10&lt;br /&gt;
|s            = c/10&lt;br /&gt;
|z            = c/10&lt;br /&gt;
|h            = 82&lt;br /&gt;
|symmetry     = -c&lt;br /&gt;
|discoverer   = AforAmpere&lt;br /&gt;
|discoveryear = 2018&lt;br /&gt;
|rulemin      = B3/S23&lt;br /&gt;
|rulemax      = B38/S238&lt;br /&gt;
|rulespecial  = [[Conway&#039;s Game of Life|Conway Life]]&lt;br /&gt;
|isorulemin   = B3-ky/S23-ck&lt;br /&gt;
|isorulemax   = B34ce5k6ae7c8/S234ce5ekn6-ae7e8&lt;br /&gt;
|plaintext    = true&lt;br /&gt;
|rle          = true&lt;br /&gt;
|synthesis    = 118&lt;br /&gt;
|viewerconfig = #C [[ TRACKLOOP 10 0 -1/10 THUMBSIZE 3 GPS 5 WIDTH 480 HEIGHT 800 ]]&lt;br /&gt;
|apgcode      = xq10_wo5995oz0gusoosugzst2y02tszwr4w4rzwos22soz08d0330d8zxc22c&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;Cottonmouth&#039;&#039;&#039; is a [[c/10 orthogonal]] [[pushalong]] for the [[copperhead]] and [[fireship]] discovered by [[AforAmpere]] on 24 March {{year|2018}}.&amp;lt;ref&amp;gt;{{LinkForumThread|f=2|t=2031|p=58357|title=Re: Spaceship Discussion Thread|author=AforAmpere|date=24 March 2018|format=ref}}&amp;lt;/ref&amp;gt; It is infinitely [[extensible]] because it has a copperhead-like formation in the front on which another cottonmouth can be placed.&lt;br /&gt;
&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
|pname        = cottonmouthextended&lt;br /&gt;
|viewerconfig = #C [[ AUTOSTART GPS 5 TRACKLOOP 10 0 -1/10 THUMBLAUNCH THUMBSIZE 2 THEME 6 ZOOM 8 WIDTH 480 HEIGHT 720 ]]&lt;br /&gt;
|position     = center&lt;br /&gt;
|caption      = The extended version of cottonmouth, attached to both a [[copperhead]] (left) and a [[fireship]] (right)&lt;br /&gt;
|style        = width:360px;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synthesis ==&lt;br /&gt;
On June 8, {{year|2026}}, [[vilc]] found a {{gliders|118}} synthesis of cottonmouth, starting from a copperhead and using 105 additional gliders to append the cottonmouth pushalong.&amp;lt;ref name=&amp;quot;post229583&amp;quot;/&amp;gt;&amp;lt;ref name=&amp;quot;j14752485318&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;j14752485318&amp;quot;&amp;gt;{{CiteCatagolueJob|job=14752485318|date=June 8, 2026}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post229583&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|p      = 229583&lt;br /&gt;
|title  = Re: Small Spaceship Syntheses&lt;br /&gt;
|author = vilc&lt;br /&gt;
|date   = June 8, 2026&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{LinkCatagolue|xq10_wo5995oz0gusoosugzst2y02tszwr4w4rzwos22soz08d0330d8zxc22c}}&lt;br /&gt;
* {{LinkWikipedia|Cottonmouth}} (name origin)&lt;br /&gt;
&lt;br /&gt;
[[Category:Patterns discovered by pseudonymous users]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Universal_computer&amp;diff=172442</id>
		<title>Universal computer</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Universal_computer&amp;diff=172442"/>
		<updated>2026-04-19T15:26:17Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add the 323&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Glossary}}&lt;br /&gt;
A &#039;&#039;&#039;universal computer&#039;&#039;&#039; in a [[cellular automaton]] is a system that can compute anything that a [http://en.wikipedia.org/wiki/Turing_machine Turing machine] can compute (another term for this is &#039;&#039;&#039;Turing-complete&#039;&#039;&#039;). A cellular automaton in which such a system exists is called &#039;&#039;&#039;universal&#039;&#039;&#039;. A universal computer may be either infinite or finite, but when combined with a [[universal constructor]], it is assumed to be finite.&lt;br /&gt;
&lt;br /&gt;
==Universal computers in Life==&lt;br /&gt;
In 1982, [[John Conway]] proved in &#039;&#039;[[Winning Ways]]&#039;&#039; that the [[Game of Life]] has a (finite) universal computer, as well as a universal constructor. Proving the universality of a cellular automaton with simple rules was in fact Conway&#039;s aim in Life right from the start. The universal computer uses [[glider]] logic and a [[sliding block memory]], and the proof of its existence is also outlined in [[The Recursive Universe]].&lt;br /&gt;
&lt;br /&gt;
In April 2000, [[Paul Rendell]] constructed a direct implementation of a [[Turing machine]].&amp;lt;ref&amp;gt;{{cite web|url=http://rendell-attic.org/gol/tm.htm|title=A Turing Machine in Conway&#039;s Game of Life|author=Paul Rendell|date=April 2, 2000}}&amp;lt;/ref&amp;gt; This computer is infinite, as it requires an infinite length of tape for the Turing Machine.&lt;br /&gt;
&lt;br /&gt;
In 2002, using [[Dean Hickerson]]&#039;s [[sliding block memory]], [[Paul Chapman]] constructed an implementation of a Minsky Register Machine (a machine of the same capability as a Turing Machine), which he extended to a Universal Register Machine, a finite universal computer.&amp;lt;ref&amp;gt;{{cite web|url=http://www.igblan.free-online.co.uk/igblan/ca/|title=Life Universal Computer|author=Paul Chapman|date=November 11, 2002|archiveurl=https://web.archive.org/web/20230716132432/http://www.igblan.free-online.co.uk/igblan/ca/|archivedate=July 16, 2023}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 2009, [[Adam P. Goucher]] built a [[Spartan universal computer-constructor]], which has three infinite binary memory tapes (program tape, data tape and marker tape). This allows data to be stored in linear space, rather than the exponential space that a Register Machine uses.&lt;br /&gt;
&lt;br /&gt;
In 2010, Paul Rendell completed a [[universal Turing machine|universal version]] of his Turing machine pattern, followed in 2011 by a [[fully universal Turing machine|fully universal]] version, removing the previous requirement (needed for true universality) that the initial Life pattern must have unbounded size and infinite population.&lt;br /&gt;
&lt;br /&gt;
In 2016, [[Nicolas Loizeau]] created an [[8-bit programmable computer]] pattern, using only four basic parts: a [[twogun|period-60 glider gun]], a [[buckaroo|90° glider reflector]], a p30 [[glider duplicator]], and a [[eater1|glider eater]]. Later an improved scalable version was announced in 2021.&lt;br /&gt;
&lt;br /&gt;
In December 2024, [[blah]] created the 323, a 32-bit load-store CPU designed for the [[HashLife]] algorithm.&amp;lt;ref name=&amp;quot;post200720&amp;quot; /&amp;gt; It uses a von-Neumann architecture with 15 registers and the RAM.&lt;br /&gt;
&lt;br /&gt;
==Universal computers in other cellular automata==&lt;br /&gt;
===In [[Life-like cellular automata]]===&lt;br /&gt;
For a universal computer to be finite, it must either be given sufficient memory for a computation prior, or employ a universal constructor. For the latter case, it must be able to escape its own bounding box and diamond, so in a non-strobing rule, its rulestring must contain at least one of the birth transitions &amp;lt;tt&amp;gt;{1,2,3}&amp;lt;/tt&amp;gt;, or when [[isotropic non-totalistic]], at least one birth transition in each of the sets &amp;lt;tt&amp;gt;{1c,1e,2c,2a,3i}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{1c,1e,2e,2a,3a}&amp;lt;/tt&amp;gt;, respectively, meaning there is an upper bound of &amp;lt;tt&amp;gt;2&amp;lt;sup&amp;gt;101&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;100&amp;lt;/sup&amp;gt;+(2&amp;lt;sup&amp;gt;99&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;98&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;97&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;/2&amp;lt;sup&amp;gt;99&amp;lt;/sup&amp;gt;=145*2&amp;lt;sup&amp;gt;95&amp;lt;/sup&amp;gt;&amp;lt;/tt&amp;gt; INT rules with Turing-complete finite patterns on infinite planes.&lt;br /&gt;
&lt;br /&gt;
For strobing rules, where &amp;lt;tt&amp;gt;~&amp;lt;/tt&amp;gt; denotes the absence of a transition, these prerequisite sets are instead &amp;lt;tt&amp;gt;{~b1c,~b1e,~b2c,~b2a,~b3i,s7c,s7e,s6c,s6a,s5i}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{~b1c,~b1e,~b2e,~b2a,~b3a,s7c,s7e,s6e,s6a,s5a}&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[David Eppstein]] and Dean Hickerson proved that {{rl|B35/S236}} has a universal computer and universal constructor, using the same method of proof that Conway used to prove that Life is universal.&amp;lt;ref&amp;gt;{{cite web|url=http://www.ics.uci.edu/~eppstein/ca/b35s236/|title=B35/S236|author=D. Eppstein}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===In multi-state circuitry rules===&lt;br /&gt;
[[Tim Hutton]] has implemented [[Codd]]&#039;s design for a universal computer in Codd&#039;s 8-state cellular automaton.&amp;lt;ref&amp;gt;{{cite web|url=https://github.com/GollyGang/ruletablerepository/wiki/CoddsDesign|title=Rule Table Repository|author=Tim Hutton}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well-known rule {{rl|WireWorld}} allows construction of very small and robust logic gates, triggers, memory banks etc. In September 2004 David Moore and Mark Owen released a Wireworld computer, in which the results of calculations are shown in seven-segment displays by running &amp;quot;electrons&amp;quot;. The computer&#039;s instruction set is a highly orthogonal RISC architecture. The program, CPU status and data are stored in a bank of 64 16-bit registers. According to the authors, the computer was designed, with the help of many others, between 1990 and 1992. The version of it included in [[Golly]] is preprogrammed to compute and display the sequence of [[prime number]]s. Likely this was the first computer in a cellular automaton that looks like a computer from human perspective.&lt;br /&gt;
&lt;br /&gt;
In 2021 [[Yoel Matveyev]] released the largest known cellular automation computer called [[Izhora]] based on his own 4-state rule FireWorld.&amp;lt;ref name=&amp;quot;post136309&amp;quot; /&amp;gt; It has 256 kilobytes of memory, a {{times|256|128}} memory-mapped pixel display and a keyboard driven by a [[Golly]] script. Its 32-bit CPU uses a single operation, subtract and branch if zero or negative (SUBLEQ), from which all other operations can be synthesized. Examples include 256-bit factorials, primes and Fibonacci numbers. Tools such as an assembler and emulator are provided for programming it.&lt;br /&gt;
&lt;br /&gt;
Other examples of cellular automation computers include a partial emulation of a real-world Picoblaze microcontroller and a custom multicore CPU.&lt;br /&gt;
&lt;br /&gt;
==Universality of predecessor-finding==&lt;br /&gt;
On August 20, 2023, [[Ville Salo]] and [[Ilkka Törmä]] proved that arbitrary [[Boolean satisfiability problem]]s could be encoded to problems of finding predecessors of specific patterns, with the corollary that the process of reversing a single iteration (or otherwise proving that a pattern is a [[Garden of Eden]]) is computationally universal.&amp;lt;ref name=&amp;quot;arxiv2308.10198&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post200720&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|p          = 200720&lt;br /&gt;
|format     = ref&lt;br /&gt;
|title      = The 323: A 32-bit computer&lt;br /&gt;
|author     = blah&lt;br /&gt;
|date       = December 31, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post136309&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|p          = 136309&lt;br /&gt;
|format     = ref&lt;br /&gt;
|title      = Izhora (Fireworld2 computer)&lt;br /&gt;
|author     = Yoel Matveyev&lt;br /&gt;
|date       = October 5, 2021&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;arxiv2308.10198&amp;quot;&amp;gt;[[Ville Salo]], [[Ilkka Törmä]], [https://arxiv.org/abs/2308.10198 &#039;&#039;Computing backwards with Game of Life, part 1: wires and circuits&#039;&#039;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{LinkWikipedia|Turing_completeness|name=Turing completeness}}&lt;br /&gt;
* {{LinkLexicon|lex_u.htm#universalcomputer}}&lt;br /&gt;
* {{LinkForumThread|f=11|t=3362|title=Resources pertaining to computation in cellular automata}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Universal computation| ]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=172439</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=172439"/>
		<updated>2026-04-19T13:45:27Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add description for MUL action&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^17, 2^18 or higher, depending on the size of the program. These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #COMPONENTS B0&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 #COMPONENTS B0&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039; divides the number by 2. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039; adds 10 and then divides the number by 2. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]], Chapter 9: Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=221972#p221972 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;br /&gt;
[[Category:Universal computation]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=172428</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=172428"/>
		<updated>2026-04-18T13:57:52Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add #COMPONENTS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^17, 2^18 or higher, depending on the size of the program. These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #COMPONENTS B0&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 #COMPONENTS B0&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]], Chapter 9: Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=221972#p221972 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;br /&gt;
[[Category:Universal computation]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Wire&amp;diff=172406</id>
		<title>Wire</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Wire&amp;diff=172406"/>
		<updated>2026-04-14T14:56:33Z</updated>

		<summary type="html">&lt;p&gt;Rei: Fix link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Glossary}}&lt;br /&gt;
A &#039;&#039;&#039;wire&#039;&#039;&#039; is a repeating pattern that a [[signal]] can travel along without making any permanent change to the pattern.&amp;lt;ref&amp;gt;{{citeCGoLMC|section=Section 4.5.1}}&amp;lt;/ref&amp;gt; If instead the pattern is destroyed by the travelling signal (i.e. it [[burn]]s from one end) it is a [[fuse]].&amp;lt;ref&amp;gt;{{citeCGoLMC|section=Section 4.5.2|page=103}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first documented wire was discovered by [[Dean Hickerson]] in March {{year|1997}} while studying some period-3 [[oscillator]]s found by [[Achim Flammenkamp]]. It transmits signals that travel through the wire diagonally at two-thirds of the [[speed of light]]. This was the inspiration for Hickerson&#039;s [[drifter]] [[search program]], which led to the discovery of a 5c/9 wire a month later.&lt;br /&gt;
&lt;br /&gt;
Hickerson also used his program to search for a wire signal elbow, hoping to use it to construct a fast signal loop and solve the [[omniperiodicity]] problem; this effort was unsuccessful for [[Life]], with the closest match being a 2c/3 [[signal elbow]] found in July {{year|1997}} that turned a single signal into a reflected double signal.&lt;br /&gt;
&lt;br /&gt;
Signals on wires are harder to manipulate as compared to signals in a vacuum, especially in the form of [[glider]]s, for which there is a rich and growing [[toolkit]].&amp;lt;ref&amp;gt;{{citeCGoLMC|section=Section 4.7}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==2c/3 wire==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;2c/3 wire&#039;&#039;&#039; was discovered by Dean Hickerson in {{year|1997}}. It can be found in the &#039;&#039;misc&#039;&#039; section of [[jslife]] under the name &#039;&#039;signals 2c3d&#039;&#039;.&amp;lt;ref name=&amp;quot;jslife&amp;quot;&amp;gt;{{CiteSummersPattern|name=jslife|accessdate=June 6, 2022}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
|position     = center&lt;br /&gt;
|pname        = 2c3wire&lt;br /&gt;
|caption      = Diagonal 2c/3 wire&lt;br /&gt;
|viewerconfig = #C [[ AUTOSTART THUMBSIZE 2 HEIGHT 600 WIDTH 600 X 8 Y 4 ZOOM 8 GPS 10 LOOP 128 PAUSE 2 ]]&lt;br /&gt;
|style        = width:300px;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Each signal is made up of two half-signals that can be separated from each other by an arbitrary number of [[ticks]].&lt;br /&gt;
&lt;br /&gt;
Considerable effort has been spent on finding a way to turn a [[2c/3]] signal 90 or 180 degrees, since this would have been one way to prove that Life was omniperiodic. There is a known 2c/3 [[converter]] shown under [[signal elbow]], which converts a standard 2c/3 signal into a double-length signal. This is usable in some situations, but unfortunately it fails when its input is a double-length signal, so it cannot be used to complete two or more consecutive turns. It could only produce zigzag wires in any case rather than completing a loop, since the wire coming out of the elbow is a mirror image of the input wire.&lt;br /&gt;
&lt;br /&gt;
In February {{year|2004}}, [[Noam Elkies]] discovered a [[glider synthesis]] of a reaction that can repeatably insert a signal into the upper end of a 2c/3 wire. See [[stable pseudo-Heisenburp]] for details. In 2011, a [[p11 double-length signal injector]] was found that allows signals to be injected periodically.&lt;br /&gt;
&lt;br /&gt;
On September 11, {{year|2017}}, [[Martin Grant]] reduced the cost of the synchronized input to five gliders, or three gliders plus a [[Herschel]].&amp;lt;ref name=&amp;quot;post50807&amp;quot; /&amp;gt; In {{year|2024}}, a double [[beehive push catalyst]] variant was found that uses only 4 gliders to activate a 2c/3 wire, with a recovery time of 56,&amp;lt;ref name=&amp;quot;post179988&amp;quot; /&amp;gt; or just two [[pi heptomino]]s following each other on the same track. (See [[Tutorials/Catalyses#Beehive push catalyst replacements]]). Compact engineered solutions requiring just one input Herschel have been completed with [[recovery time]] 151 ticks&amp;lt;ref name=&amp;quot;post180139&amp;quot; /&amp;gt; and 171 ticks&amp;lt;ref name=&amp;quot;post179942&amp;quot; /&amp;gt; in March 2024, and with recovery time 132 ticks in April 2024.&amp;lt;ref name=&amp;quot;post181846&amp;quot; /&amp;gt; The current fastest 2c/3 signal injector has a repeat time of 126.&amp;lt;ref name=&amp;quot;post181888&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Devices that extract a signal from a 2c/3 wire have also been built. Before 2024, the lowest repeat time of a standard 2c/3 signal receiver was 964 ticks,&amp;lt;ref name=&amp;quot;post135690&amp;quot; /&amp;gt; and that of a double-length signal was 970 ticks,&amp;lt;ref name=&amp;quot;post137526&amp;quot; /&amp;gt; both of which were achieved by [[Goldtiger997]] in {{year|2021}} by using complex [[staged recovery]] systems. On March 31, {{year|2024}}, [[Entity Valkyrie]] constructed a new [[pseudo-Heisenburp]] device with a repeat time of 742 ticks at both the input end (the highway robber) and the output end (the 2c/3 to glider converter).&amp;lt;ref name=&amp;quot;post181579&amp;quot; /&amp;gt; On July 4, {{year|2024}}, Entity Valkyrie improved the repeat time at the receiver end to 708 ticks using an alternate [[bait]] proposed by [[Simon Ekström]].&amp;lt;ref name=&amp;quot;post189015&amp;quot; /&amp;gt; On August 1, {{year|2025}}, [[TigerCub414]] built a receiver with a repeat time of 629 ticks;&amp;lt;ref name=&amp;quot;post215428&amp;quot;/&amp;gt; on August 3, [[Entity Valkyrie]] improved the repeat time to 570 ticks using the same bait object.&amp;lt;ref name=&amp;quot;post215500&amp;quot;/&amp;gt; Two days later, TigerCub414 improved the repeat time even further, to 504 ticks.&amp;lt;ref name=&amp;quot;post215632&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==5c/9 wire==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;5c/9 wire&#039;&#039;&#039; was discovered by Dean Hickerson in 1997.&lt;br /&gt;
&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
|position     = center&lt;br /&gt;
|pname        = 5c9wire&lt;br /&gt;
|caption      = Diagonal 5c/9 wire&lt;br /&gt;
|viewerconfig = #C [[ AUTOSTART THUMBSIZE 2 HEIGHT 600 WIDTH 600 X 8 Y 4 ZOOM 6 GPS 10 LOOP 180 PAUSE 2 ]]&lt;br /&gt;
|style        = width:300px;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Oscillators have been found that inject signals of various periods including 9, 10, 11, and [[p47 lumps of muck hassler|47]] into a 5c/9 wire.&amp;lt;ref&amp;gt;{{cite web|url=https://conwaylife.com/ref/DRH/sig.inj.html|title=Dean Hickerson&#039;s signal-injector collection}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible to convert a 2c/3 wire signal into a 5c/9 signal; the viewer above shows the aforementioned five-glider input reaction for a 2c/3 signal and its subsequent conversion to 5c/9 signal. Another elementary 5c/9 signal injector involves a [[lumps of muck]] reaction,&amp;lt;ref name=&amp;quot;post54568&amp;quot; /&amp;gt; which can be made from the synchronized [[2-glider collision]] at a repeat time of 62 ticks&amp;lt;ref name=&amp;quot;post54617&amp;quot; /&amp;gt;, a single Herschel with a much higher repeat time&amp;lt;ref name=&amp;quot;post101243&amp;quot; /&amp;gt;, or a fixed-period lumps of muck hassler that uses a specific catalyst (such as the p47).&lt;br /&gt;
&lt;br /&gt;
No elementary converter has yet been found for 5c/9 to 2c/3 &amp;amp;ndash; or any other viable signal type, for that matter. However, in November 2025, [[James Pascua]] completed a multistage composite converter for 5c/9 signals, which allowed for the completion of the first closed loop containing a segment of 5c/9 wire.&amp;lt;ref name=&amp;quot;post221926&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==c/2 wire==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;c/2 wire&#039;&#039;&#039; was discovered by [[Hartmut Holzwart]] in {{year|2003}}.&lt;br /&gt;
&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
|position     = center&lt;br /&gt;
|pname        = c2wire&lt;br /&gt;
|caption      = Diagonal c/2 wire&lt;br /&gt;
|viewerconfig = #C [[ AUTOSTART THUMBSIZE 2 HEIGHT 440 ZOOM 8 GPS 10 LOOP 40 PAUSE 2 ]]&lt;br /&gt;
|style        = width:300px;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Both halves of the signal (the non-uniform portion of the pattern) are needed, since the wire is offset by one cell between the two half signals.&lt;br /&gt;
&lt;br /&gt;
It is technically possible to use [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=3507 Extrementhusiast&#039;s construction and detection mechanisms from 2018] to complete a c/2 diagonal [[telegraph]] pattern that can send one bit of information every few thousand ticks. Or a somewhat higher transmission rate can be arranged with a mechanism similar to the one used in Louis-François Handfield&#039;s [[high-bandwidth telegraph]]. No complete c/2 diagonal telegraph has been built to date.&lt;br /&gt;
&lt;br /&gt;
==Lightspeed wire==&lt;br /&gt;
&lt;br /&gt;
The [[zebra stripes]] [[agar]] can be used to form a wire. Below are several signals which can travel through such a wire at [[lightspeed]] (one cell to the right per generation).&lt;br /&gt;
&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
|position     = center&lt;br /&gt;
|pname        = zebrawiresignals&lt;br /&gt;
|caption      = Several lightspeed signals travel through a zebra stripes wire&lt;br /&gt;
|viewerconfig = #C [[ AUTOSTART THUMBSIZE 2 HEIGHT 360 WIDTH 800 GPS 10 LOOP 138 ZOOM 6 ]]&lt;br /&gt;
|style        = width:300px;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Another type of lightspeed wire is &amp;quot;beehive wire&amp;quot;:  an orthogonal chain of beehives can be burned non-destructively at lightspeed, as described in the [[telegraph]] article.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post50807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Stable signal converters&lt;br /&gt;
|p      = 50807&lt;br /&gt;
|author = Martin Grant&lt;br /&gt;
|date   = September 11, 2017&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post135690&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 135690&lt;br /&gt;
|author = Goldtiger997&lt;br /&gt;
|date   = September 12, 2021&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post137526&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 137526&lt;br /&gt;
|author = Goldtiger997&lt;br /&gt;
|date   = November 11, 2021&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post54568&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Interacting with LoM&lt;br /&gt;
|p      = 54568&lt;br /&gt;
|author = Adam P. Goucher&lt;br /&gt;
|date   = January 2, 2018&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post54617&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Interacting with LoM&lt;br /&gt;
|p      = 54617&lt;br /&gt;
|author = Chris Cain&lt;br /&gt;
|date   = January 3, 2018&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post101243&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: The Hunting of the Elementary Conduits&lt;br /&gt;
|p      = 101243&lt;br /&gt;
|author = Sphenocorona&lt;br /&gt;
|date   = July 28, 2020&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post179942&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 179942&lt;br /&gt;
|author = Entity Valkyrie&lt;br /&gt;
|date   = March 8, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post179988&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 179988&lt;br /&gt;
|author = EvinZL&lt;br /&gt;
|date   = March 10, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post180139&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 180139&lt;br /&gt;
|author = Dave Greene&lt;br /&gt;
|date   = March 12, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post181579&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 181579&lt;br /&gt;
|author = Entity Valkyrie&lt;br /&gt;
|date   = March 31, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post181846&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 181846&lt;br /&gt;
|author = C. R. Hilton&lt;br /&gt;
|date   = April 4, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post181888&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 181888&lt;br /&gt;
|author = Adam P. Goucher&lt;br /&gt;
|date   = April 5, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post189015&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 189015&lt;br /&gt;
|author = Entity Valkyrie&lt;br /&gt;
|date   = July 4, 2024&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post215428&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 215428&lt;br /&gt;
|author = TigerCub414&lt;br /&gt;
|date   = August 1, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post215500&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 215500&lt;br /&gt;
|author = Entity Valkyrie&lt;br /&gt;
|date   = August 3, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post215632&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Faster 2c/3 Wires&lt;br /&gt;
|p      = 215632&lt;br /&gt;
|author = TigerCub414&lt;br /&gt;
|date   = August 5, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post221926&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Stable signal converters&lt;br /&gt;
|p      = 221926&lt;br /&gt;
|author = James Pascua&lt;br /&gt;
|date   = November 27, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{LinkGoLNews|2005/02/stable_2c3_signal_receiver.html|archivedate=20100523082242|title=Stable 2c/3 signal receiver|date=February 7, 2005|author=Dave Greene}}&lt;br /&gt;
* {{LinkLexicon|lex_w.htm#wire|name=Wire}}&lt;br /&gt;
* {{LinkLexicon|lex_1.htm#a-2c3wire|name=2c/3 wire}}&lt;br /&gt;
* {{LinkLexicon|lex_1.htm#a-5c9wire|name=5c/9 wire}}&lt;br /&gt;
* {{LinkLexicon|lex_l.htm#lightspeedwire|name=Lightspeed wire}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=WinLifeSearch&amp;diff=171145</id>
		<title>WinLifeSearch</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=WinLifeSearch&amp;diff=171145"/>
		<updated>2026-02-20T15:00:58Z</updated>

		<summary type="html">&lt;p&gt;Rei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|name            = WinLifeSearch&lt;br /&gt;
|image           = true&lt;br /&gt;
|url             = http://entropymine.com/jason/life/software/&lt;br /&gt;
|purpose         = Search for [[oscillator]]s and [[spaceship]]s&lt;br /&gt;
|createdby       = [[Jason Summers]]&lt;br /&gt;
|platform        = Windows&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;WinLifeSearch&#039;&#039;&#039; (abbreviated as &#039;&#039;&#039;WLS&#039;&#039;&#039;) is a graphical Windows port of [[David Bell]]&#039;s [[lifesrc]] search program for finding new [[oscillator]]s and [[spaceship]]s, written by [[Jason Summers]].&lt;br /&gt;
&lt;br /&gt;
==Known issues==&lt;br /&gt;
WLS has a rollover problem at around 2 billion calculations, where it rolls over to about -2 billion calculations.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[JavaLifeSearch]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://entropymine.com/jason/life/software/ WinLifeSearch homepage]&lt;br /&gt;
* [https://github.com/jsummers/winlifesearch WinLifeSearch on GitHub]&lt;br /&gt;
* {{LinkLexicon|lex_w.htm#winlifesearch}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Search software]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=0E0P_metacell&amp;diff=171144</id>
		<title>0E0P metacell</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=0E0P_metacell&amp;diff=171144"/>
		<updated>2026-02-20T14:56:22Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add further reading&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{UnitCell&lt;br /&gt;
|name         = 0E0P metacell&lt;br /&gt;
|pname        = 0e0pmetacell&lt;br /&gt;
|c            = ~ 18650000&lt;br /&gt;
|bx           = 261841&lt;br /&gt;
|by           = 261841&lt;br /&gt;
|sx           = 262144&lt;br /&gt;
|sy           = 262144&lt;br /&gt;
|p            = 68719476736&lt;br /&gt;
|discoverer   = Adam P. Goucher&lt;br /&gt;
|discoveryear = 2018&lt;br /&gt;
|nofile       = true&lt;br /&gt;
}}&lt;br /&gt;
The &#039;&#039;&#039;0E0P metacell&#039;&#039;&#039; is a [[unit cell]] constructed by [[Adam P. Goucher]] between 2014 and 2018.&amp;lt;ref&amp;gt;{{cite web|url=https://cp4space.wordpress.com/2018/11/12/fully-self-directed-replication/ |title=Fully Self-Directed Replication |publisher=Adam P. Goucher |date=November 12, 2018|accessdate=January 8, 2019}}&amp;lt;/ref&amp;gt;  Like Goucher&#039;s previous [[p1 megacell]], it is capable of simulating any [[rule]] using the [[Moore neighborhood|standard eight cell neighborhood]], including [[non-totalistic rule]]s.&lt;br /&gt;
&lt;br /&gt;
The new feature of the 0E0P metacell, and the one that explains its record-breaking large size, is the fact that a group of these metacells can be placed in an empty Life universe with no background grid of OFF metacells, and the entire universe then simulates the rule for which the 0E0P metacells are programmed, at a larger scale by a factor of {{eq|262144|2{{sup|18}}}}.  The acronym &amp;quot;0E0P&amp;quot; is short for &amp;quot;[State] Zero Encoded by Zero Population&amp;quot;, so the OFF state is simply a metacell-sized region of empty space.&lt;br /&gt;
&lt;br /&gt;
When one of these metacells turns off, it self-destructs completely, and when a metacell birth occurs, it must be constructed from the ground up by one of its neighbors.  This allows 0E0P metacell patterns, when viewed from very far away (e.g., at a size where an entire metacell takes up a single pixel in the display), to be indistinguishable from normal patterns that use the same rule -- except that the metacell patterns will run 2{{sup|36}} times more slowly, and if they&#039;re run at a step size lower than 2{{sup|36}}, intermediate states may be visible that will depart from a strict pixel-for-pixel match.&lt;br /&gt;
&lt;br /&gt;
The {{POTY|year=2018|rank=2|behind=[[Sir Robin]]}}&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
Each individual metacell behaves as an 8-state, 4-neighborhood BCC-automaton; the metacell receives a glider-based signal (a positive integer between 1 and 7, inclusive) from each of its (up to four) neighbours, and a 0 from any empty spaces if there are fewer than four neighbours. It then computes the quantity {{nowrap|8{{sup|3}} a + 8{{sup|2}} b + 8{{sup|1}} c + d}}, where {{nowrap|(a, b, c, d)}} are the four input signals, and indexes into a 4096-element lookup table to retrieve a value between 0 and 7 (the new ‘state’ of the metacell). If 0, it immediately self-destructs without constructing any children; if nonzero, it constructs a daughter machine in each vacant space. Finally, it broadcasts the new state as a signal to all four neighbours, before self-destructing. In doing so, the metacell behaves as a single cell in any 8-state 4-neighbor cellular automaton; as every 2-state 9-neighbour cellular automaton can be emulated at half the speed as an 8-state 4-neighbour cellular automaton, this allows the 0E0P metacell to emulate rules other than Life, which also allows it to act as a parity-rule [[replicator]], a [[reflectorless rotating oscillator]] (with some limits), and a [[SMOS]] if programmed correctly.&lt;br /&gt;
&lt;br /&gt;
In a healthy 0E0P metacell pattern, metacells could be thought of as living on a diagonally-oriented checkerboard. They&#039;re allowed to be present on the dark squares of the checkerboard &#039;&#039;&#039;only&#039;&#039;&#039; during even 2{{sup|35}}-tick half-cycles, and on the light squares of the checkerboard only during odd half-cycles.  At the beginning of each even half-cycle, or in other words at the beginning of each full metatick, the presence or absence of an 0E0P metacell on a dark square corresponds with the presence or absence of an ON cell in an equivalent Life grid (assuming the metacell is programmed to emulate B3/S23).  At other times during the 0E0P&#039;s replication cycle, the correspondence with cells on a Life grid won&#039;t be as clean, but every 2{{sup|36}} ticks the 0E0P metapattern will come back into perfect alignment.&lt;br /&gt;
&lt;br /&gt;
Every period-2{{sup|36}} cycle of an 0E0P metacell consists of two period-2{{sup|35}} half-cycles. In each half-cycle, all metacells make sure that there are child metacells all around them, on the other checkerboard square color -- either by building them, or by attempting to build them and having the construction recipe cleanly eaten by an eater that&#039;s part of an already existing child in that location.&lt;br /&gt;
&lt;br /&gt;
Notice that with the 45-degree checkerboard orientation, each grid location in the emulated Life pattern is only half filled by a 0E0P metacell (if one is present). In other words, the metacells are diamond-shaped, not square; their sides don&#039;t line up with the emulated Life grid.&lt;br /&gt;
&lt;br /&gt;
Switching checkerboard colors and expanding to four surrounding metacells twice (for two half-cycles) effectively ensures that all eight metacells surrounding any given ON metacell on the same checkerboard square color are occupied by child metacells. These are all the neighbor locations for that particular metacell.  No effect can travel faster than lightspeed in the range-1 Moore-neighborhood rules that the 0E0P metacell can emulate, so at the end of two half-cycles, metacells are present in every location where a metacell could possibly be needed to turn ON in the next metatick.&lt;br /&gt;
&lt;br /&gt;
There&#039;s no direct communication between an 0E0P metacell and its nearest possible living neighbor metacells to the north, south, east, and west -- i.e., the nearest same-color squares on the 45-degree-angled checkerboard -- let alone between it and the other possibly-living neighbor cells, two checkerboard squares away diagonally. However, by the end of each full cycle, communication between parent and child metacells during each half-cycle has effectively transmitted neighbor state information from one dark-square metacell to all its dark-square neighbors. This means that at the end of each half-cycle, every &amp;quot;potentially alive&amp;quot; 0E0P metacell has all the information it needs to decide whether it should transition to a &amp;quot;fully alive&amp;quot; state and start building child metacells, or if it should immediately self-destruct instead.&lt;br /&gt;
&lt;br /&gt;
==LifeViewer demo==&lt;br /&gt;
To demonstrate the full 0E0P metacell cycle and the early self-destruct option, the [[LifeViewer]] demo below shows how a glider made of metacells proceeds through a full 2{{sup|36}} period (or &amp;quot;metatick&amp;quot;). Note that the gap between metacells where the equivalent cells would be diagonally adjacent will not be visible at the proper zoom level. &lt;br /&gt;
{{LV:Viewer|x = 233, y = 233, rule = none&lt;br /&gt;
206.I$205.3I$204.5I$203.7I$202.3IEIE3I$201.3IEIEIE3I$200.5IEIEIE3I$&lt;br /&gt;
201.5IEIE3I$202.3IEIE3I$203.3IE3I$204.5I$205.3I$206.I8$186.I39.I$185.&lt;br /&gt;
3I37.3I$184.5I35.5I$183.7I33.7I$182.3IDID3I31.9I$181.3IDIDID3I29.6IE&lt;br /&gt;
4I$180.5IDIDID3I27.8IE4I$181.5IDID3I29.4IEIE4I$182.3IDID3I31.6IE2I$&lt;br /&gt;
183.3ID3I33.7I$184.5I35.5I$185.3I37.3I$186.I39.I8$166.I39.I$165.3I37.&lt;br /&gt;
3I$164.5I35.5I$163.7I33.2IHIH2I$162.3ICIC3I31.2IHIHIH2I$161.3ICICIC3I&lt;br /&gt;
29.2IHIHIDIH2I$160.5ICICIC3I27.4IHIHIDIH2I$161.5ICIC3I29.4IDIDIH2I$&lt;br /&gt;
162.3ICIC3I31.2IHIHID2I$163.3IC3I33.2IHIH2I$164.5I35.2IH2I$165.3I37.&lt;br /&gt;
3I$166.I39.I8$146.I39.I$145.3I37.3I$144.5I35.5I$143.7I33.2ICIC2I$142.&lt;br /&gt;
3IBIB3I31.2ICICIC2I$141.3IBHBHB3I29.2ICICICIC2I$140.5IBIBHB3I27.4ICIC&lt;br /&gt;
ICIC2I$141.5IBHB3I29.4ICICIC2I$142.3IBHB3I31.2ICICIC2I$143.3IB3I33.2I&lt;br /&gt;
CIC2I$144.5I35.2IC2I$145.3I37.3I$146.I39.I8$126.I39.I$125.3I37.3I$&lt;br /&gt;
124.5I35.5I$123.7I33.2IBIB2I$122.3IAIA3I31.2IBHBHB2I$121.3IAGAGA3I29.&lt;br /&gt;
2IBHBHBHB2I$120.5IAIAGA3I27.4IBHBHBHB2I$121.5IAGA3I29.4IBHBHB2I$122.&lt;br /&gt;
3IAGA3I31.2IBHBHB2I$123.3IA3I33.2IBHB2I$124.5I35.2IB2I$125.3I37.3I$&lt;br /&gt;
126.I39.I8$106.I39.I$105.3I37.3I$104.5I35.5I$103.7I33.2IAIA2I$102.3IA&lt;br /&gt;
IA3I31.2IAGAGA2I$101.3IAFAFA3I29.2IAGAGAGA2I$100.5IAIAFA3I27.4IAGAGAG&lt;br /&gt;
A2I$101.5IAFA3I29.4IAGAGA2I$102.3IAFA3I31.2IAGAGA2I$103.3IA3I33.2IAGA&lt;br /&gt;
2I$104.5I35.2IA2I$105.3I37.3I$106.I39.I8$86.I39.I$85.3I37.3I$84.5I35.&lt;br /&gt;
5I$83.7I33.2IAIA2I$82.3IAIA3I31.2IAFAFA2I$81.3IAFAFA3I29.2IAFAFAFA2I$&lt;br /&gt;
80.7IAFA3I27.4IAFAFAFA2I$81.5IAFA3I29.4IAFAFA2I$82.3IAFA3I31.2IAFAFA&lt;br /&gt;
2I$83.7I33.2IAFA2I$84.5I35.2IA2I$85.3I37.3I$86.I39.I8$66.I39.I$65.3I&lt;br /&gt;
37.3I$64.5I35.5I$63.7I33.2IAIA2I$62.3IAIA3I31.2IAFAFA2I$61.4IFAFA3I&lt;br /&gt;
29.2IAFAFAFA2I$60.7IAFA3I27.4IAFAFAFA2I$61.5IAFA3I29.4IAFAFA2I$62.4IF&lt;br /&gt;
A3I31.2IAFAFA2I$63.7I33.2IAFA2I$64.5I35.5I$65.3I37.3I$66.I39.I8$46.I&lt;br /&gt;
39.I$45.3I37.3I$44.5I35.5I$43.7I33.2IAIA2I$42.9I31.2IAFAFA2I$41.4IFAF&lt;br /&gt;
A3I29.3IFAFAFA2I$40.8IFA3I27.5IFAFAFA2I$41.6IFA3I29.4IAFAFA2I$42.4IFA&lt;br /&gt;
3I31.3IFAFA2I$43.7I33.3IFA2I$44.5I35.5I$45.3I37.3I$46.I39.I8$26.I39.I&lt;br /&gt;
$25.3I37.3I$24.5I35.5I$23.7I33.7I$22.9I31.3IFAFA2I$21.4IFIF4I29.3IFAF&lt;br /&gt;
AFA2I$20.8IF4I27.5IFAFAFA2I$21.6IF4I29.5IFAFA2I$22.4IF4I31.3IFAFA2I$&lt;br /&gt;
23.7I33.3IFA2I$24.5I35.5I$25.3I37.3I$26.I39.I8$6.I39.I$5.3I37.3I$4.5I&lt;br /&gt;
35.5I$3.7I33.7I$2.9I31.3IFIF3I$.4IEIE4I29.3IFIFIF3I$8IE4I27.5IFIFIF3I&lt;br /&gt;
$.6IE4I29.5IFIF3I$2.4IE4I31.3IFIF3I$3.7I33.3IF3I$4.5I35.5I$5.3I37.3I$&lt;br /&gt;
6.I39.I8$26.I$25.3I$24.5I$23.7I$22.3IEIE3I$21.3IEIEIE3I$20.5IEIEIE3I$&lt;br /&gt;
21.5IEIE3I$22.3IEIE3I$23.3IE3I$24.5I$25.3I$26.I!&lt;br /&gt;
#C [[ COLOR 1 Yellow COLOR 2 Orange COLOR 3 Pink COLOR 4 Gray COLOR 5 Purple ]]&lt;br /&gt;
#C [[ COLOR 6 Blue COLOR 7 Cyan COLOR 8 Red COLOR 9 Green ]]&lt;br /&gt;
#C [[ LABELSIZE 12 LABELALPHA 1 LABELANGLE 315 COLOR LABEL White ]]&lt;br /&gt;
#C [[ GRID ANGLE 45 HEIGHT 600 THEME MCell GRIDMAJOR 0 ]]&lt;br /&gt;
#C [[ POI X -108 Y 92 Z 32 POITRANS 0 ]] Point of interest #1&lt;br /&gt;
#C [[ LABEL 11 211 16 &amp;quot;Here&#039;s where it all starts\n-- five metacells forming a glider, in Stage E\n(shown in purple)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -88 Y 72 Z 32 POITRANS 0 ]] POI #2&lt;br /&gt;
#C [[ LABEL 31 191 16 &amp;quot;Metacells move to Stage F (blue).\n-- ready to start constructing children, SE first&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -68 Y 52 Z 32 POITRANS 0 ]] POI #3&lt;br /&gt;
#C [[ LABEL 51 171 16 &amp;quot;Metacells remain in Stage F (blue).\nChildren constructed SE of each metacell\n(yellow cells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -48 Y 32 Z 32 POITRANS 0 ]] POI #4&lt;br /&gt;
#C [[ LABEL 71 151 16 &amp;quot;Metacells remain in Stage F (blue).\nChildren constructed NE of each metacell\n(yellow cells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -28 Y 12 Z 32 POITRANS 0 ]] POI #5&lt;br /&gt;
#C [[ LABEL 91 131 16 &amp;quot;Metacells remain in Stage F (blue).\nChildren constructed NW of each metacell\n(yellow cells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -8 Y -8 Z 32 POITRANS 0 ]] POI #6&lt;br /&gt;
#C [[ LABEL 111 111 16 &amp;quot;Metacells remain in Stage F (blue).\nChildren constructed SW of each metacell\n(yellow cells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 12 Y -28 Z 32 POITRANS 0 ]] POI #7&lt;br /&gt;
#C [[ LABEL 130 90 16 &amp;quot;Original metacells move to Stage G (cyan).\nParent metacells send their own states\nto each immediate neighbor. All receiving neighbors\nare recently constructed child metacells.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 32 Y -48 Z 32 POITRANS 0 ]] POI #8&lt;br /&gt;
#C [[ LABEL 150 70 16 &amp;quot;Metacells move to Stage H (red)\nThe cycle is complete. The original metacells self-destruct.\nState signals from the original metacells are collected and\nstored in registers in each neighboring child cell,\nwhich have all now moved to Stage B (orange)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 52 Y -68 Z 32 POITRANS 0 ]] POI #9&lt;br /&gt;
#C [[ LABEL 170 50 16 &amp;quot;Original metacells are gone now\n(green is the background state, completely empty).\nThe four child metacells move to Stage C (pink)\nIn each metacell, the collected state values from each\nneighbor are used to calculate the future state of the cell.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 72 Y -88 Z 32 POITRANS 0 ]] POI #10&lt;br /&gt;
#C [[ LABEL 190 30 16 &amp;quot;The child metacells move to Stage D (gray)\nIf a child metacell&#039;s new calculated state is 0, it\nself-destructs. Here all 13 child metacells survive.\nThis is what always happens in the first\nhalf-cycle, when a Moore-neighborhood rule\nis being emulated.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 92 Y -108 Z 32 POITRANS 0 ]] POI #11&lt;br /&gt;
#C [[ LABEL 211 11 16 &amp;quot;The thirteen child metacells move to Stage E (purple)\nThe construction/signal/collect/decide cycle begins again.\nThis cycle happens twice in each 2^36 0E0P metacell cycle.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -88 Y 112 Z 32 POITRANS 0 ]] POI #12&lt;br /&gt;
#C [[ LABEL 30 230 16 &amp;quot;The cycle restarts.\nNow there are thirteen metacells, all in Stage E\n(shown in purple)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -68 Y 92 Z 32 POITRANS 0 ]] POI #13&lt;br /&gt;
#C [[ LABEL 50 210 16 &amp;quot;The thirteen metacells move to Stage F (blue)\n-- ready to start constructing children, SE first&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -48 Y 72 Z 32 POITRANS 0 ]] POI #14&lt;br /&gt;
#C [[ LABEL 70 190 16 &amp;quot;The thirteen metacells remain in Stage F (blue).\nThirteen children are constructed in the SE\n(yellow metacells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -28 Y 52 Z 32 POITRANS 0 ]] POI #15&lt;br /&gt;
#C [[ LABEL 90 170 16 &amp;quot;The thirteen metacells remain in Stage F (blue).\nFour more children are constructed in the NE\n(yellow metacells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X -8 Y 32 Z 32 POITRANS 0 ]] POI #16&lt;br /&gt;
#C [[ LABEL 110 150 16 &amp;quot;The thirteen metacells remain in Stage F (blue).\nFour more children are constructed in the NW\n(yellow metacells, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 12 Y 12 Z 32 POITRANS 0 ]] POI #17&lt;br /&gt;
#C [[ LABEL 130 130 16 &amp;quot;The thirteen metacells remain in Stage F (blue).\nOne more child is constructed in the SW\n(yellow metacell, Stage A)&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 32 Y -8 Z 32 POITRANS 0 ]] POI #18&lt;br /&gt;
#C [[ LABEL 150 110 16 &amp;quot;Metacells move to Stage G (cyan).\nEach parent metacell sends its own state to each neighbor.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 52 Y -28 Z 32 POITRANS 0 ]] POI #19&lt;br /&gt;
#C [[ LABEL 170 90 16 &amp;quot;Parent metacells move to Stage H (red).\nChild metacells move to stage B (orange).\nThe parent metacells self-destruct, as always.\nState signals from the parent cell are stored in registers\nin the new child cells.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 72 Y -48 Z 32 POITRANS 0 ]] POI #20&lt;br /&gt;
#C [[ LABEL 190 70 16 &amp;quot;The thirteen parent metacells are gone now -- back to the\ngreen background state, completely empty.\nThe twenty-two child metacells move to Stage C (pink)\nIn each metacell, the collected neighbor states\nare used to calculate the future state of the metacell.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 92 Y -68 Z 32 POITRANS 0 ]] POI #21&lt;br /&gt;
#C [[ LABEL 210 50 16 &amp;quot;The twenty-two child metacells move to Stage D (gray)\nIf a child metacell&#039;s calculated state is 0, it self-destructs.\nIn this case, where a B3/S23 glider is being emulated,\nonly five of the twenty-two child metacells survive.&amp;quot; ]]&lt;br /&gt;
#C [[ POI X 112 Y -88 Z 32 POITRANS 0 ]] POI #22&lt;br /&gt;
#C [[ LABEL 230 30 16 &amp;quot;The five remaining metacells move to Stage E (purple).\nEmpty background locations are shown in green.&amp;quot; ]]&lt;br /&gt;
#C [[ POI INITIAL X 132 Y -108 Z 32 POITRANS 0 ]] POI #23 (initial position, because of INITIAL keyword)&lt;br /&gt;
#C [[ LABEL 245 6 16 &amp;quot;Press &#039;J&#039; or &#039;Shift+J&#039; keys, or &amp;lt; and &amp;gt; buttons,\nto move forward or backward through 0E0P stages.&amp;quot; WIDTH 640 ]]}}&lt;br /&gt;
&lt;br /&gt;
==Complexity==&lt;br /&gt;
The metacell&#039;s circuitry is sufficiently complex that a single Conway&#039;s Life meta-[[glider]] requires a compressed pattern file several megabytes in size.&amp;lt;ref name=&amp;quot;post65737&amp;quot; /&amp;gt;  It can be run in Golly at small step sizes with no difficulty, but simulating an entire replication cycle (half a metatick) is very difficult.  On current computers it might take about half a CPU-year using Golly&#039;s standard HashLife algorithm.&lt;br /&gt;
&lt;br /&gt;
An order of magnitude improvement over [[HashLife]] is available via Goucher&#039;s special-purpose [[StreamLife]] algorithm.  However, even using StreamLife it might take several months to simulate the eight replication cycles (four full metaticks) needed to return a metaglider to its original phase.  The original experimental verification of a single metatick (12:05 to 12:35 in Cabaret&#039;s video below), using rule where a single ON cell is a still life, took about a month.&lt;br /&gt;
&lt;br /&gt;
==Videos==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|CfRSVPhzN5M|640|left|Thomas Cabaret&#039;s video explaining various self-replicating machines in cellular automata, including a comprehensive explanation (from 7:35 to 13:05) of the operation of the 0E0P metacell}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- do not remove whitespace, this is needed for correct format --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[OTCA metapixel]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post65737&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|author     = Dave Greene&lt;br /&gt;
|title      = Re: Thread for basic questions&lt;br /&gt;
|date       = November 8, 2018&lt;br /&gt;
|accessdate = January 9, 2019&lt;br /&gt;
|p          = 65737&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Further reading==&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]], Chapter 12: The 0E0P Metacell&lt;br /&gt;
&lt;br /&gt;
[[Category:Patterns with between 10,000,000 and 99,999,999 cells]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=171141</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=171141"/>
		<updated>2026-02-20T14:48:56Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^17, 2^18 or higher, depending on the size of the program. These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]], Chapter 9: Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=221972#p221972 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;br /&gt;
[[Category:Universal computation]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=CatForce&amp;diff=171140</id>
		<title>CatForce</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=CatForce&amp;diff=171140"/>
		<updated>2026-02-20T14:48:02Z</updated>

		<summary type="html">&lt;p&gt;Rei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Software&lt;br /&gt;
|name      = CatForce&lt;br /&gt;
|url       = https://github.com/simsim314/CatForce&lt;br /&gt;
|purpose   = Finding oscillators and conduits&lt;br /&gt;
|createdby = [[Michael Simkin]]&lt;br /&gt;
|platform  = Unix; Windows&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;CatForce&#039;&#039;&#039; is an optimized [[search program]] written by [[Michael Simkin]] in {{year|2015}}, performing a brute-force enumeration of small [[Spartan]] objects in a limited area, instead of a depth-first tree search. One major purpose of CatForce is to find [[glider synthesis|glider-constructible]] completions for [[signal]] [[conduit]]s. An early CatForce discovery was the [[B60]] conduit, which enabled a [[Simkin glider gun|record-breaking new glider gun]].&lt;br /&gt;
&lt;br /&gt;
In May {{year|2022}}, [[Mitchell Riley]] created a modification of CatForce, both significantly improving speed and adding a [[static symmetry|symmetry]] option.&amp;lt;ref name=&amp;quot;post145414&amp;quot; /&amp;gt; This new version of the program was used to find numerous new oscillators, with some of the notable examples being the [[p84 honey farm hassler]], [[58P37]], [[Cribbage]] and [[74P34]].&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post145414&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: CatForce new catalyst search utility (LifeAPI based)&lt;br /&gt;
|p      = 145414&lt;br /&gt;
|author = Mitchell Riley&lt;br /&gt;
|date   = May 10, 2022&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[LifeAPI]]&lt;br /&gt;
* [[QuFince]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://github.com/simsim314/CatForce CatForce] on GitHub (original)&lt;br /&gt;
* [https://github.com/mvr/CatForce/tree/depth-first-periodic CatForce] on GitHub (Mitchell Riley&#039;s modification)&lt;br /&gt;
* {{LinkLexicon|lex_c.htm#catforce}}&lt;br /&gt;
* {{LinkForumThread|f=9|t=1678|title=CatForce new catalyst search utility (LifeAPI based)}}&lt;br /&gt;
* {{LinkForumThread|p=149317|title=Re: CatForce new catalyst search utility (LifeAPI based)}} (setup tutorial for symmetric CatForce)&lt;br /&gt;
* {{LinkForumThread|format=ref|f=12|t=6038|title=CatForce port to INT attempt}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Search software]]&lt;br /&gt;
[[Category:Catalysts and catalyses]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Kinetic_symmetry&amp;diff=170302</id>
		<title>Kinetic symmetry</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Kinetic_symmetry&amp;diff=170302"/>
		<updated>2026-02-14T07:26:21Z</updated>

		<summary type="html">&lt;p&gt;Rei: Fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub|The pattern with oscillators displaying the 43 temporal symmetry types needs fully explanatory text/caption; it might also be good to produce a version of that illustration showing Hickerson-format labels, instead of their pairs-of-Catagolue-symmetry-designator equivalents; and more details and/or references have been [https://conwaylife.com/forums/viewtopic.php?p=201738#p201738 requested] for the Spaceship section}}&lt;br /&gt;
A &#039;&#039;&#039;kinetic symmetry&#039;&#039;&#039; (contrast [[static symmetry]]) describes the spatial and temporal symmetries of [[still life]]s, [[oscillator]]s and [[spaceship]]s. It combines a pattern&#039;s spatial (rotational and reflectional) symmetries from the more general [[static symmetry]] with symmetrical transformations of said pattern arising from its evolution.&amp;lt;ref name=&amp;quot;post138823&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== On a square grid ==&lt;br /&gt;
[[File:kinetic_symmetry_diagram.png|center|672px]]&lt;br /&gt;
There are a total of 43 different kinetic symmetries possible on a usual [[square grid]], comprised of the 16 static symmetries (D8_2 is excluded) with 27 possible time transformations. The ratio of a pattern&#039;s [[mod]] to its [[period]], for rules on a square grid, can only be 1, 2 or 4.&lt;br /&gt;
&lt;br /&gt;
Oscillators have a much wider range of possible kinetic symmetries than still lifes. It is easy to see that the 27 time transformations cannot apply to still lifes by definition, as they require the pattern to have distinct phases that can be compared to each other, and therefore the pattern has to evolve over time (which still lifes do not).&lt;br /&gt;
&lt;br /&gt;
Both still lifes and oscillators can exhibit a wider range of symmetries than spaceships can, at least as far as isotropic rules are concerned. Many higher kinetic symmetries, notably those involving rotation or with reflection happening on more than one axis, would forbid the pattern from having a nonzero displacement, as the symmetry would either force it to move in two directly opposing directions or redirect it back to its starting point. Many spaceships can have glide symmetry, which oscillators cannot have due to having no overall displacement. However, glide symmetry very closely resembles certain mirror symmetries which oscillators do exhibit.&lt;br /&gt;
&lt;br /&gt;
=== Kinetic symmetry naming system ===&lt;br /&gt;
[[Dean Hickerson]] invented a compact naming system for kinetic symmetries.&amp;lt;ref&amp;gt;{{CiteHickersonOscillators|accessdate=December 13, 2021}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For still lifes, as well as oscillators and spaceships which have identical mods to periods, an initial symbol stands for a kind of transformation, and a symbol following it refers to the type of region where said transformation is centered.&lt;br /&gt;
&lt;br /&gt;
Oscillators and spaceships of unequal period and mod will follow this string with another string detailing how the pattern&#039;s symmetry changes if all phases of the pattern are taken into account.&lt;br /&gt;
&lt;br /&gt;
==== Symbols ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Symbol&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
! n&lt;br /&gt;
| No symmetry&lt;br /&gt;
|-&lt;br /&gt;
! -&lt;br /&gt;
| One line of orthogonal mirror symmetry&lt;br /&gt;
|-&lt;br /&gt;
! /&lt;br /&gt;
| One line of diagonal mirror symmetry&lt;br /&gt;
|-&lt;br /&gt;
! +&lt;br /&gt;
| Two lines of orthogonal mirror symmetry&lt;br /&gt;
|-&lt;br /&gt;
! x&lt;br /&gt;
| Two lines of diagonal mirror symmetry&lt;br /&gt;
|-&lt;br /&gt;
! *&lt;br /&gt;
| Two lines each of orthogonal and diagonal mirror symmetry&lt;br /&gt;
|-&lt;br /&gt;
! r&lt;br /&gt;
| 90-degree rotational symmetry&lt;br /&gt;
|-&lt;br /&gt;
! .&lt;br /&gt;
| 180-degree rotational symmetry&lt;br /&gt;
|-&lt;br /&gt;
! c&lt;br /&gt;
| Transformation is centered on the center of a cell&lt;br /&gt;
|-&lt;br /&gt;
! e&lt;br /&gt;
| Transformation is centered on the edge of a cell&lt;br /&gt;
|-&lt;br /&gt;
! k&lt;br /&gt;
| Transformation is centered on the vertex of a cell&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Still lifes ===&lt;br /&gt;
These are equivalent to static symmetries (excluding D8_2). The corresponding static symmetries are detailed in the table for each type.&lt;br /&gt;
&lt;br /&gt;
{{:Table of equivalent static symmetries}}&lt;br /&gt;
&lt;br /&gt;
=== Oscillators ===&lt;br /&gt;
There are 43 oscillator symmetry types. In Hickerson&#039;s notation, each of those 43 types has a two-part identifier starting with generation 0&#039;s symmetry type, and appending the symmetry type of the full set of all phases of the oscillator.&lt;br /&gt;
&lt;br /&gt;
16 out of those oscillator symmetry types consist of two identical parts, as in &amp;quot;xkxk&amp;quot; for example:  the identifier is a doubled version of the single-phase symmetry type from the table above (&amp;quot;xk&amp;quot; in this case). An oscillator with any of these 16 symmetry types will have a mod that is equal to its period.&lt;br /&gt;
&lt;br /&gt;
The remaining (27 = 43 - 16) oscillator symmetry types consist of two different parts (as in &amp;quot;-c+e&amp;quot; or &amp;quot;nrk&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Note that &amp;quot;xk&amp;quot; by itself refers to one of the 16 single-generation symmetry types, while &amp;quot;xkxk&amp;quot; refers to one of the 43 oscillator symmetry types. The sets of identifiers for still lifes and for oscillators are completely disjoint. This helpful property makes it easy to tell whether a descriptor refers to a single-generation symmetry type or an oscillator symmetry type.&lt;br /&gt;
&lt;br /&gt;
In the table below, &amp;quot;composite symmetry&amp;quot; refers to the symmetry type of the collection of phases of the oscillator that can be matched up to each other:&lt;br /&gt;
* for patterns with a mod equal to half their period, the union of the pattern&#039;s initial state and the state it appears in at half its period&lt;br /&gt;
* for patterns with a mod equal to a quarter their period, the union of the pattern&#039;s initial phase, generation [period/4], generation [period/2] and generation [3period/4]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Name&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Symmetry&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Transform&amp;lt;br&amp;gt;names&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | &amp;lt;abbr title=&amp;quot;Period divided by mod&amp;quot;&amp;gt;p/m&amp;lt;/abbr&amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Description&lt;br /&gt;
&amp;lt;!--Image--&amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Example&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | [[Gutteroid]]s&lt;br /&gt;
|-&lt;br /&gt;
! Static&lt;br /&gt;
! Composite&lt;br /&gt;
|-&lt;br /&gt;
! n-c&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! -c&amp;lt;br&amp;gt;D2_+1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | FlipX&amp;lt;br&amp;gt;FlipY&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across an orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_466t186z6961696.png|64px]]&amp;lt;br&amp;gt;[[xp2_466t186z6961696|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! n-e&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! -e&amp;lt;br&amp;gt;D2_+2&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across an orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Blockongriddle.png|64px]]&amp;lt;br&amp;gt;[[Block on griddle]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! n/&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! /&amp;lt;br&amp;gt;D2_x&lt;br /&gt;
! Flip⟍&amp;lt;br&amp;gt;Flip⟋&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across a diagonal line during (period/2)&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Mutteringmoat1.png|64px]]&amp;lt;br&amp;gt;[[Muttering moat 1]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! n.c&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! .c&amp;lt;br&amp;gt;C2_1&lt;br /&gt;
! rowspan=&amp;quot;3&amp;quot; | Rot180&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears rotated 180 degrees during (period/2)&amp;lt;br&amp;gt;Rotation is centered on the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_0ml1ik8z1259a6.png|64px]]&amp;lt;br&amp;gt;[[xp2_0ml1ik8z1259a6|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| central cell&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! n.e&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! .e&amp;lt;br&amp;gt;C2_2&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears rotated 180 degrees during (period/2)&amp;lt;br&amp;gt;Rotation is centered on the edge of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Laputa.png|64px]]&amp;lt;br&amp;gt;[[Laputa]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! n.k&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! .k&amp;lt;br&amp;gt;C2_4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears rotated 180 degrees during (period/2)&amp;lt;br&amp;gt;Rotation is centered on the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.3.3.png|64px]]&amp;lt;br&amp;gt;[[2.3.3|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! nrc&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! rc&amp;lt;br&amp;gt;C4_1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Rot90CW&amp;lt;br&amp;gt;Rot90CCW&lt;br /&gt;
| 4&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears rotated 90 degrees every (period/4)&amp;lt;br&amp;gt;Rotation is centered on the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Dinnertable.png|64px]]&amp;lt;br&amp;gt;[[Dinner table]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| central cell&amp;lt;br&amp;gt;p/4&lt;br /&gt;
|-&lt;br /&gt;
! nrk&lt;br /&gt;
! n&amp;lt;br&amp;gt;C1&lt;br /&gt;
! rk&amp;lt;br&amp;gt;C4_4&lt;br /&gt;
| 4&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears rotated 90 degrees every (period/4)&amp;lt;br&amp;gt;Rotation is centered on the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Sixtynine.png|64px]]&amp;lt;br&amp;gt;[[Sixty-nine]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! -c+c&lt;br /&gt;
! -c&amp;lt;br&amp;gt;D2_+1&lt;br /&gt;
! +c&amp;lt;br&amp;gt;D4_+1&lt;br /&gt;
! rowspan=&amp;quot;4&amp;quot; | FlipXOrRot180&amp;lt;br&amp;gt;FlipYOrRot180&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_+1 symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Piston.png|64px]]&amp;lt;br&amp;gt;[[Piston]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! -c+e&lt;br /&gt;
! -c&amp;lt;br&amp;gt;D2_+1&lt;br /&gt;
! +e&amp;lt;br&amp;gt;D4_+2&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_+1 symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Byflops.png|64px]]&amp;lt;br&amp;gt;[[by flops]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! -e+e&lt;br /&gt;
! -e&amp;lt;br&amp;gt;D2_+2&lt;br /&gt;
! +e&amp;lt;br&amp;gt;D4_+2&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_+2 symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_0giligz344k743zw121.png|64px]]&amp;lt;br&amp;gt;[[xp2_0giligz344k743zw121|unnamed]]&amp;lt;/center&amp;gt; &lt;br /&gt;
| 1 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! -e+k&lt;br /&gt;
! -e&amp;lt;br&amp;gt;D2_+2&lt;br /&gt;
! +k&amp;lt;br&amp;gt;D4_+4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_+2 symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.5.6.png|64px]]{{br}}{{LinkCatagolue|code=xp2_g8j1qc6i0qdj8gz12pgb6c90bmp21|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! /xc&lt;br /&gt;
! /&amp;lt;br&amp;gt;D2_x&lt;br /&gt;
! xc&amp;lt;br&amp;gt;D4_x1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Flip⟍OrRot180&amp;lt;br&amp;gt;Flip⟋OrRot180&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_x symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular diagonal line during (period/2)&amp;lt;br&amp;gt;Lines meet at the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_066oo4g53zc8502046.png|64px]]&amp;lt;br&amp;gt;[[xp2_066oo4g53zc8502046|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! /xk&lt;br /&gt;
! /&amp;lt;br&amp;gt;D2_x&lt;br /&gt;
! xk&amp;lt;br&amp;gt;D4_x4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D2_x symmetry&amp;lt;br&amp;gt;Appears flipped across a perpendicular diagonal line during (period/2)&amp;lt;br&amp;gt;Lines meet at the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Tripole.png|64px]]&amp;lt;br&amp;gt;[[Tripole]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .c+c&lt;br /&gt;
! .c&amp;lt;br&amp;gt;C2_1&lt;br /&gt;
! +c&amp;lt;br&amp;gt;D4_+1&lt;br /&gt;
! FlipOrth&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_1 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two perpendicular orthogonal lines during (period/2)&amp;lt;br&amp;gt;Both lines pass through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_g8j1cdj8gz01cb38c1.png|64px]]&amp;lt;br&amp;gt;[[xp2_g8j1cdj8gz01cb38c1|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .cxc&lt;br /&gt;
! .c&amp;lt;br&amp;gt;C2_1&lt;br /&gt;
! xc&amp;lt;br&amp;gt;D4_x1&lt;br /&gt;
! FlipDiag&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_1 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two diagonal lines during (period/2)&amp;lt;br&amp;gt;Lines meet at the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Bipole.png|64px]]&amp;lt;br&amp;gt;[[Bipole]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .crc&lt;br /&gt;
! .c&amp;lt;br&amp;gt;C2_1&lt;br /&gt;
! rc&amp;lt;br&amp;gt;C4_1&lt;br /&gt;
! Rot90&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_1 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Rotation is centered on the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_2aa08060922zgg50p050lkgzw1.png|64px]]&amp;lt;br&amp;gt;[[xp2_2aa08060922zgg50p050lkgzw1|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| central cell&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .e+e&lt;br /&gt;
! .e&amp;lt;br&amp;gt;C2_2&lt;br /&gt;
! +e&amp;lt;br&amp;gt;D4_+2&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | FlipOrth&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_2 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two perpendicular orthogonal lines during (period/2)&amp;lt;br&amp;gt;Line may pass through either cell centers and edges, or cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.6.0.png|64px]]{{br}}{{LinkCatagolue|code=xp2_0o4cjia3s4oz5t2q3hcei2t5zw11622611|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| 1 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .k+k&lt;br /&gt;
! .k&amp;lt;br&amp;gt;C2_4&lt;br /&gt;
! +k&amp;lt;br&amp;gt;D4_+4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_4 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two perpendicular orthogonal lines during (period/2)&amp;lt;br&amp;gt;Both lines pass through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:xp2_0e0j0944z44i0p0e.png|64px]]&amp;lt;br&amp;gt;[[xp2_0e0j0944z44i0p0e|unnamed]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! .kxk&lt;br /&gt;
! .k&amp;lt;br&amp;gt;C2_4&lt;br /&gt;
! xk&amp;lt;br&amp;gt;D4_x4&lt;br /&gt;
! FlipDiag&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_4 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two diagonal lines during (period/2)&amp;lt;br&amp;gt;Lines meet at the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Clock.png|64px]]&amp;lt;br&amp;gt;[[Clock]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! .krk&lt;br /&gt;
! .k&amp;lt;br&amp;gt;C2_4&lt;br /&gt;
! rk&amp;lt;br&amp;gt;C4_4&lt;br /&gt;
! Rot90&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C2_4 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Rotation is centered on the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.6.3.png|64px]]{{br}}{{LinkCatagolue|code=xp2_g80c0gxcg2c0v1k4z11tp10244g084410gzx10g442014480gjnggzw45gv06816x106021|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! +c*c&lt;br /&gt;
! +c&amp;lt;br&amp;gt;D4_+1&lt;br /&gt;
! *c&amp;lt;br&amp;gt;D8_1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | FlipDiagOrRot90&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D4_+1 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Could also be interpreted as diagonal flipping on one of two lines&amp;lt;br&amp;gt;Rotation is centered on/lines intersect at the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Blinker.png|64px]]&amp;lt;br&amp;gt;[[Blinker]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! +k*k&lt;br /&gt;
! +k&amp;lt;br&amp;gt;D4_+4&lt;br /&gt;
! *k&amp;lt;br&amp;gt;D8_4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D4_+4 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Could also be interpreted as diagonal flipping on one of two lines&amp;lt;br&amp;gt;Rotation is centered on/lines intersect at the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:4.10.2.png|64px]]{{br}}{{LinkCatagolue|code=xp4_y1gs2ib8owo8bi2sgzgs2ib88g35i2222i53g88bi2sgzxji1wvwuwuwvw1ijz2egjk542h8iggggi8h245kjge2zy012egjl46w64ljge21zy51y21|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! xc*c&lt;br /&gt;
! xc&amp;lt;br&amp;gt;D4_x1&lt;br /&gt;
! *c&amp;lt;br&amp;gt;D8_1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | FlipOrthOrRot90&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D4_x1 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Could also be interpreted as horizontal flipping on one of two lines&amp;lt;br&amp;gt;Rotation is centered on/lines intersect at the center of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Washingmachine.png|64px]]&amp;lt;br&amp;gt;[[Washing machine]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 orthogonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! xk*k&lt;br /&gt;
! xk&amp;lt;br&amp;gt;D4_x4&lt;br /&gt;
! *k&amp;lt;br&amp;gt;D8_4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has D4_x4 symmetry&amp;lt;br&amp;gt;Appears rotated 90 degrees either clockwise or anticlockwise during (period/2)&amp;lt;br&amp;gt;Could also be interpreted as horizontal flipping on one of two lines&amp;lt;br&amp;gt;Rotation is centered on/lines intersect at the vertex of a cell&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.5.2.png|64px]]{{br}}{{LinkCatagolue|code=xp2_ggw392g5jwggzpi81k1g08281kpzy0ca049c|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| none&lt;br /&gt;
|-&lt;br /&gt;
! rc*c&lt;br /&gt;
! rc&amp;lt;br&amp;gt;C4_1&lt;br /&gt;
! *c&amp;lt;br&amp;gt;D8_1&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | FlipOrthOrDiag&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C4_1 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two perpendicular orthogonal lines during (period/2)&amp;lt;br&amp;gt;Both lines pass through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:2.5.0.png|64px]]{{br}}{{LinkCatagolue|code=xp2_wc4oql2gkcz25ice08or1i52zw110252011|style=raw|patternname=unnamed}}&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 orthogonal&amp;lt;br&amp;gt;2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|-&lt;br /&gt;
! rk*k&lt;br /&gt;
! rk&amp;lt;br&amp;gt;C4_4&lt;br /&gt;
! *k&amp;lt;br&amp;gt;D8_4&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern has C4_4 symmetry&amp;lt;br&amp;gt;Appears flipped across one of two perpendicular orthogonal lines during (period/2)&amp;lt;br&amp;gt;Both lines pass through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Quad.png|64px]]&amp;lt;br&amp;gt;[[Quad]]&amp;lt;/center&amp;gt;&lt;br /&gt;
| 2 diagonal&amp;lt;br&amp;gt;p/2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following shows oscillators displaying each of the 43 temporal symmetry types:&lt;br /&gt;
{| style=&amp;quot;margin:auto;width:300px;&amp;quot;&lt;br /&gt;
{{EmbedViewer&lt;br /&gt;
| viewerconfig = #C [[ GPS 20 THUMBSIZE 2 ZOOM 4 WIDTH 1640 HEIGHT 1000 ]]&lt;br /&gt;
| pname        = temporalsymmetrytypes&lt;br /&gt;
| position     = center&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
row 1: [[Caterer]], [[Honey thieves]], [[Beluchenko&#039;s p40]], [[22P36]], [[Kok&#039;s galaxy]], [[48P22.1]], [[1-2-3-4]], [[Short keys]], [[Heart]], [[Gray counter]], [[Pentadecathlon]], [[101]], [[Merzenich&#039;s p11]], [[Jason&#039;s p6]], [[Diamond ring]], [[Octagon 2]]{{br}}&lt;br /&gt;
row 2: [[Baker&#039;s dozen]], [[Merzenich&#039;s p64]], [[Achim&#039;s p144]], [[Windmill]], [[Achim&#039;s p16]], [[44P10]], [[Tumbler]], [[Heavyweight emulator]], [[46P10]], [[68P32.1]], [[A for all]], [[Washing machine]], [[Unicycle ]]{{br}} &lt;br /&gt;
row 3: [[Trans-queen bee shuttle]], [[2.2.6]], [[Two pre-L hasslers]], [[Eureka]], [[Traffic light hasslers#p30|p30 traffic light hassler]], [[p24 shuttle]]{{br}}&lt;br /&gt;
row 4: [[Blocker]], [[Achim&#039;s p8]]{{br}}&lt;br /&gt;
row 5: [[Champagne glass]], [[p196 pi-heptomino hassler]]{{br}}&lt;br /&gt;
row 6: [[Rob&#039;s p16]]{{br}}&lt;br /&gt;
row 7: [[30P6.1]]{{br}}&lt;br /&gt;
row 8: [[Four eaters hassling lumps of muck]]{{br}}&lt;br /&gt;
row 9: [[Twirling T-tetsons 2]]&lt;br /&gt;
&lt;br /&gt;
==== Array ====&lt;br /&gt;
&amp;lt;small&amp;gt;&amp;lt;small&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|composite\static||C1||D2_+1||D2_+2||C2_2||D4_+2||D2_x||C2_1||C2_4||D4_+1||D4_+4||D4_x1||D4_x4||C4_1||C4_4||D8_1||D8_4&lt;br /&gt;
|-&lt;br /&gt;
|C1||[[File:eater1.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D2_+1||[[File:xp2_466t186z6961696.png|64px]]||[[File:hat.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D2_+2||[[File:Blockongriddle.png|64px]]||||[[File:capandtable.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|C2_2||[[File:Laputa.png|64px]]||||||[[File:Aircraftcarrier.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D4_+2||||[[File:Byflops.png|64px]]||[[File:xp2_0giligz344k743zw121.png|64px]]||[[File:2.6.0.png|64px]]||[[File:beehive.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D2_x||[[File:Mutteringmoat1.png|64px]]||||||||||[[File:boat.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|C2_1||[[File:xp2_0ml1ik8z1259a6.png|64px]]||||||||||||[[File:longsnake.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|C2_4||[[File:2.3.3.png|64px]]||||||||||||||[[File:Snake.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D4_+1||||[[File:Piston.png|64px]]||||||||||[[File:xp2_g8j1cdj8gz01cb38c1.png|64px]]||||[[File:Hatcissiamesehat.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D4_+4||||||[[File:2.5.6.png|64px]]||||||||||[[File:xp2_0e0j0944z44i0p0e.png|64px]]||||[[File:xs32_8o6ll6o8z23cllc32.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D4_x1||||||||||||[[File:xp2_066oo4g53zc8502046.png|64px]]||[[File:Bipole.png|64px]]||||||||[[File:ship.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D4_x4||||||||||||[[File:Tripole.png|64px]]||||[[File:Clock.png|64px]]||||||||[[File:barge.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|C4_1||[[File:Dinnertable.png|64px]]||||||||||||[[File:xp2_2aa08060922zgg50p050lkgzw1.png|64px]]||||||||||||[[File:spiral.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|C4_4||[[File:Sixtynine.png|64px]]||||||||||||||[[File:2.6.3.png|64px]]||||||||||||[[File:xs36_354m88ge93zoie122d4ko.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D8_1||||||||||||||||||[[File:Blinker.png|64px]]|| ||[[File:Washingmachine.png|64px]]||||[[File:2.5.0.png|64px]]||||[[File:tub.png|64px]]&lt;br /&gt;
|-&lt;br /&gt;
|D8_4||||||||||||||||||||[[File:4.10.2.png|64px]]||||[[File:2.5.2.png|64px]]||||[[File:Quad.png|64px]]||||[[File:block.png|64px]]&lt;br /&gt;
|}&amp;lt;/small&amp;gt;&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Spaceships ===&lt;br /&gt;
Due to the constraints of isotropy, spaceships in 2D cannot have rotational symmetry any higher than C1. This limits the possible symmetries for a spaceship to eight. The following four symmetries describe spaceships with no time symmetry:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Catagolue equivalent&lt;br /&gt;
! Description&lt;br /&gt;
! Diagram&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
! n&lt;br /&gt;
! C1&lt;br /&gt;
| No symmetry&lt;br /&gt;
| [[File:Symmetry C1.png|64px]]&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:25p3h1v0.1.png|64px]]&amp;lt;br&amp;gt;[[25P3H1V0.1]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! -c&lt;br /&gt;
! D2_+1&lt;br /&gt;
| One line of orthogonal mirror symmetry&amp;lt;br&amp;gt;Line passes through cell centers and edges&lt;br /&gt;
| [[File:Symmetry D2_+1.png|64px]]&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Dart.png|64px]]&amp;lt;br&amp;gt;[[Dart]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! -e&lt;br /&gt;
! D2_+2&lt;br /&gt;
| One line of orthogonal mirror symmetry&amp;lt;br&amp;gt;Line passes through cell edges and vertices&lt;br /&gt;
| [[File:Symmetry D2_+2.png|64px]]&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:56p6h1v0.png|64px]]&amp;lt;br&amp;gt;[[56P6H1V0]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! /&lt;br /&gt;
! D2_x&lt;br /&gt;
| One line of diagonal mirror symmetry&lt;br /&gt;
| [[File:Symmetry D2_x.png|64px]]&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:37p4h1v1.2.png|64px]]&amp;lt;br&amp;gt;[[37P4H1V1.2]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The remaining four symmetries describe spaceships which are temporally symmetric:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Static symmetry&lt;br /&gt;
! Composite symmetry&lt;br /&gt;
! period/mod&lt;br /&gt;
! Description&lt;br /&gt;
&amp;lt;!--Image--&amp;gt;&lt;br /&gt;
! Example&lt;br /&gt;
|-&lt;br /&gt;
! n-c&lt;br /&gt;
! n (C1)&lt;br /&gt;
! -c (D2_+1)&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across an orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell centers and edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Lwss.png|64px]]&amp;lt;br&amp;gt;[[Lightweight spaceship]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! n-e&lt;br /&gt;
! n (C1)&lt;br /&gt;
! -e (D2_+2)&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across an orthogonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell edges and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Twohwssdraggingboat.png|64px]]&amp;lt;br&amp;gt;[[Two HWSS dragging boat]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! n/&lt;br /&gt;
! n (C1)&lt;br /&gt;
! / (D2_x)&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across a diagonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell centers and vertices&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:P8swantagalong.png|64px]]&amp;lt;br&amp;gt;[[p8 swan tagalong]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! n/e&lt;br /&gt;
! n (C1)&lt;br /&gt;
! /e (no static equivalent)&lt;br /&gt;
| 2&lt;br /&gt;
| Pattern is asymmetric&amp;lt;br&amp;gt;Appears flipped across a diagonal line during (period/2)&amp;lt;br&amp;gt;Line passes through cell edges&lt;br /&gt;
&amp;lt;!--| pending--&amp;gt;&lt;br /&gt;
| &amp;lt;center&amp;gt;[[File:Glider.png|64px]]&amp;lt;br&amp;gt;[[Glider]]&amp;lt;/center&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
n/e is a kinetic symmetry exclusive to spaceships in which the diagonal line of reflection passes through the midpoints of the edges of cells, but never the vertices or cell centers. Only spaceships which move an odd number of cells diagonally in a period cycle can have this kinetic symmetry; those which move an even distance will have standard n/ symmetry.&amp;lt;ref&amp;gt;https://conwaylife.com/forums/viewtopic.php?f=7&amp;amp;t=1898&amp;amp;p=158648#p158648&amp;lt;/ref&amp;gt; Indeed, oscillators with n/ symmetry translate by a total of 0 cells diagonally, an even number.&lt;br /&gt;
&lt;br /&gt;
=== Related terms ===&lt;br /&gt;
&lt;br /&gt;
==== Flipper ====&lt;br /&gt;
&#039;&#039;&#039;&#039;Flipper&#039;&#039;&#039;&#039; can refer to any oscillator that appears reflected across an orthogonal or diagonal line halfway through its period cycle. There are many kinetic symmetries in which an oscillator flips halfway through its period:&lt;br /&gt;
&lt;br /&gt;
* n-c, n-e, n/, -c+c, -c+e, -e+e, -e+k, /xc and /xk: flip across one line&lt;br /&gt;
* .c+c, .cxc, .e+e, .k+k and .kxk: flip across one of two perpendicular lines&lt;br /&gt;
* rc*c and rk*k: flip across one of four lines&lt;br /&gt;
* +c*c, +k*k, xc*c and xk*k: can be considered as either flipping across one of two perpendicular lines or as rotating 90 degrees around their center&lt;br /&gt;
&lt;br /&gt;
==== Glide symmetry ====&lt;br /&gt;
A spaceship is said to be &#039;&#039;&#039;glide symmetric&#039;&#039;&#039; if it exhibits [https://en.wikipedia.org/wiki/Glide_reflection glide reflection] - that is, it becomes its mirror image halfway through its period cycle, alongside moving in its direction of travel. In practice, this means that the spaceship has either the n-c, n-e, n/ or n/e kinetic symmetries.&lt;br /&gt;
&lt;br /&gt;
The term &amp;quot;flipper&amp;quot; is also sometimes used for these spaceships. The two terms are equivalent to some extent, as any glide symmetric spaceship is a flipper and any spaceship that is a flipper is glide symmetric.&lt;br /&gt;
&lt;br /&gt;
== On other grids ==&lt;br /&gt;
&lt;br /&gt;
=== Euclidean ===&lt;br /&gt;
See [[Hexagonal tiling#Symmetries|here]] for a list of all oscillator time symmetries on [[Hexagonal tiling|{6,3}]] or [[Triangular tiling|{3,6}]].&lt;br /&gt;
&lt;br /&gt;
The time symmetries on [[Cubic honeycomb|{4,3,4}]] are listed [[Cubic grid symmetries#Kinetic symmetries|here]].&lt;br /&gt;
&lt;br /&gt;
Symmetries on [[Tesseractic honeycomb|{4,3,3,4}]], [[16-cell honeycomb|{3,3,4,3}]] and [[24-cell honeycomb|{3,4,3,3}]] have been enumerated and given quaternion-based names, but have not been assigned human-readable names so far, likely due to the sheer quantity of even the static symmetries.&lt;br /&gt;
&lt;br /&gt;
Symmetries on [[Penteractic honeycomb|{4,3,3,3,4}]] and higher are yet to be investigated at all.&lt;br /&gt;
&lt;br /&gt;
Rules and symmetries on dense Euclidean tilings such as {5/2,10} and {8/3,8} have not been investigated so far due to their chaotic nature.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot;&lt;br /&gt;
|+ Symmetry types per grid&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | [[Schläfli symbol]]&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | Static&lt;br /&gt;
! colspan=&amp;quot;6&amp;quot; | Kinetic&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | Spaceship&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Totals&lt;br /&gt;
|-&lt;br /&gt;
! p/2&lt;br /&gt;
! p/3&lt;br /&gt;
! p/4&lt;br /&gt;
! p/6&lt;br /&gt;
! p/8&lt;br /&gt;
! p/12&lt;br /&gt;
! p&lt;br /&gt;
! p/2&lt;br /&gt;
! p/3&lt;br /&gt;
! p/4&lt;br /&gt;
! Osc&lt;br /&gt;
! Ship&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;14&amp;quot; | Exceptional regular tilings&lt;br /&gt;
|-&lt;br /&gt;
! [[Triangular tiling|{3,6}]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 14&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 17&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 3&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | -&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | -&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | -&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 3&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 4&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | -&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | -&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 35&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 7&lt;br /&gt;
|-&lt;br /&gt;
! [[Hexagonal tiling|{6,3}]]&lt;br /&gt;
|-&lt;br /&gt;
! [[16-cell honeycomb|{3,3,4,3}]]&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 501&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1569&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 77&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 143&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 70&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 4&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 1&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | 2365&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
|-&lt;br /&gt;
! [[24-cell honeycomb|{3,4,3,3}]]&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;14&amp;quot; | &#039;&#039;n&#039;&#039;-hypercubic honeycombs&lt;br /&gt;
|-&lt;br /&gt;
! [[Apeirogon|{∞}]]&lt;br /&gt;
| 3&lt;br /&gt;
| 2&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| 1&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| 5&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
! [[Square tiling|{4,4}]]&lt;br /&gt;
| 16&lt;br /&gt;
| 25&lt;br /&gt;
| -&lt;br /&gt;
| 2&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| 4&lt;br /&gt;
| 4&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| 43&lt;br /&gt;
| 8&lt;br /&gt;
|-&lt;br /&gt;
! [[Cubic honeycomb|{4,3,4}]]&lt;br /&gt;
| 92&lt;br /&gt;
| 220&lt;br /&gt;
| 7&lt;br /&gt;
| 14&lt;br /&gt;
| 4&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| 22&lt;br /&gt;
| 39&lt;br /&gt;
| 2&lt;br /&gt;
| 2&lt;br /&gt;
| 337&lt;br /&gt;
| 65&lt;br /&gt;
|-&lt;br /&gt;
! [[Tesseractic honeycomb|{4,3,3,4}]]&lt;br /&gt;
| 686&lt;br /&gt;
| 2535&lt;br /&gt;
| 38&lt;br /&gt;
| 235&lt;br /&gt;
| 46&lt;br /&gt;
| 2&lt;br /&gt;
| -&lt;br /&gt;
| style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
| 3542&lt;br /&gt;
| style=&amp;quot;background-color:#ffc7ce&amp;quot; | ?&lt;br /&gt;
|-&lt;br /&gt;
! [[Penteractic honeycomb|{4,3,3,3,4}]]&lt;br /&gt;
| colspan=&amp;quot;13&amp;quot; style=&amp;quot;background-color:#aaaaaa&amp;quot; | unknown&lt;br /&gt;
|-&lt;br /&gt;
! [[Hexeractic honeycomb|{4,3,3,3,3,4}]]&lt;br /&gt;
| colspan=&amp;quot;13&amp;quot; style=&amp;quot;background-color:#aaaaaa&amp;quot; | unknown&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In general, an &#039;&#039;n&#039;&#039;-dimensional cubic honeycomb will have kinetic symmetries where the mod is the period divided by &#039;&#039;n&#039;&#039; as well as symmetries where it is divided by 2&#039;&#039;n&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Hyperbolic ===&lt;br /&gt;
Cellular automata have been investigated on compact hyperbolic tilings; paracompact and noncompact tilings are generally not considered due to the existence of ideal an ultra-ideal elements. There are an infinite number of possible compact tilings in 2D hyperbolic space.&lt;br /&gt;
&lt;br /&gt;
For a tiling {p,q} where both p and q are prime, there are eight possible symmetries.&amp;lt;ref&amp;gt;https://conwaylife.com/forums/viewtopic.php?f=11&amp;amp;t=6640&amp;amp;p=220362#p220640&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[LifeWiki:Project OmniOsci]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post138823&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format = ref&lt;br /&gt;
|title  = Re: Help with symmetries&lt;br /&gt;
|p      = 138823&lt;br /&gt;
|author = GUYTU6J&lt;br /&gt;
|date   = December 13, 2021&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
{{LinkLexicon|lex_f.htm#flipper|name=Flipper}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=169571</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=169571"/>
		<updated>2026-02-05T15:56:34Z</updated>

		<summary type="html">&lt;p&gt;Rei: faster B2D&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^17, 2^18 or higher, depending on the size of the program. These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=221972#p221972 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=165940</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=165940"/>
		<updated>2025-11-30T00:55:53Z</updated>

		<summary type="html">&lt;p&gt;Rei: update link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;B2D&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
* This B2D unit&#039;s internal circuitry operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=221972#p221972 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=164633</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=164633"/>
		<updated>2025-09-29T09:51:48Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add READ B2D sets 0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;B2D&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
* This B2D unit&#039;s internal circuitry operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y) and then sets it equal to 0. Returns Z if the value is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=202346#p202346 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=163296</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=163296"/>
		<updated>2025-07-27T05:45:51Z</updated>

		<summary type="html">&lt;p&gt;Rei: Add transition table for ADD and SUB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;B2D&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 01 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 01 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 01 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 01&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 10&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 00&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 11 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || NZ&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Current !! Next !! Output&lt;br /&gt;
|-&lt;br /&gt;
| 00 || 11 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 01 || 00 || Z&lt;br /&gt;
|-&lt;br /&gt;
| 10 || 00 || NZ&lt;br /&gt;
|-&lt;br /&gt;
| 11 || 11 || Z&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
* This B2D unit&#039;s internal circuitry operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y). Returns Z if the current state is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=202346#p202346 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Conway%27s_Game_of_Life:_Mathematics_and_Construction&amp;diff=163178</id>
		<title>Conway&#039;s Game of Life: Mathematics and Construction</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Conway%27s_Game_of_Life:_Mathematics_and_Construction&amp;diff=163178"/>
		<updated>2025-07-18T15:09:14Z</updated>

		<summary type="html">&lt;p&gt;Rei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Book&lt;br /&gt;
|name            = Conway&#039;s Game of Life: Mathematics and Construction&lt;br /&gt;
|image           = true&lt;br /&gt;
|iname           = isbn9781794816961&lt;br /&gt;
|type            = Book&lt;br /&gt;
|authors         = Nathaniel Johnston and Dave Greene&lt;br /&gt;
|isbn            = 978-1794816961&lt;br /&gt;
|link            = https://conwaylife.com/book/&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Conway&#039;s Game of Life: Mathematics and Construction&#039;&#039;&#039;&#039;&#039; is a textbook about Life by [[Nathaniel Johnston]] and [[Dave Greene]]. In development since April 2016, it was released for beta readers on September 23, 2021 and officially launched on March 11, 2022.&lt;br /&gt;
&lt;br /&gt;
==Chapters==&lt;br /&gt;
#Early Life&lt;br /&gt;
#[[Still life|Still Lifes]]&lt;br /&gt;
#[[Oscillator]]s&lt;br /&gt;
#[[Spaceship]]s and Moving Objects&lt;br /&gt;
#[[Glider synthesis|Glider Synthesis]]&lt;br /&gt;
#[[Periodic circuit|Periodic Circuitry]]&lt;br /&gt;
#[[Stable circuit|Stable Circuitry]]&lt;br /&gt;
#[[Gun]]s and [[Glider stream|Glider Stream]]s&lt;br /&gt;
#[[Universal computer|Universal Computation]]&lt;br /&gt;
#[[Self-supporting|Self-Supporting]] Spaceships&lt;br /&gt;
#[[Universal constructor|Universal Construction]]&lt;br /&gt;
#The [[0E0P metacell|0E0P Metacell]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction/Errata|Errata and Anachronisms]] in the book&lt;br /&gt;
* [[LifeWiki:Bookshelf]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [https://conwaylife.com/book/ PDF and relevant RLE files]&lt;br /&gt;
* [https://www.lulu.com/en/us/shop/dave-greene-and-nathaniel-johnston/conways-game-of-life/hardcover/product-ev72jn.html?page=1&amp;amp;pageSize=4 Hardcover] from Lulu.com&lt;br /&gt;
* [https://www.kickstarter.com/projects/777855805/conways-game-of-life-textbook-launch Kickstarter] for special-edition copies&lt;br /&gt;
* [https://github.com/nathanieljohnston/game-of-life-book GitHub repository]&lt;br /&gt;
* {{LinkForumThread|f=7|t=5418|title=Beta Reader Thread for Game of Life Textbook}}&lt;br /&gt;
* {{LinkForumThread|f=7|t=5591|title=Conway&#039;s Game of Life Textbook Launch}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;br /&gt;
[[Category:Books and articles]]&lt;br /&gt;
{{DISPLAYTITLE:&#039;&#039;Conway&#039;s Game of Life: Mathematics and Construction&#039;&#039;}}&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162660</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162660"/>
		<updated>2025-07-01T11:50:24Z</updated>

		<summary type="html">&lt;p&gt;Rei: Fix description and typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;B2D&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; increments and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; increments the number (modulo 4). No return signal.&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
* This B2D unit&#039;s internal circuitry operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y). Returns Z if the current state is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=202346#p202346 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=Universal_computer&amp;diff=162645</id>
		<title>Universal computer</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=Universal_computer&amp;diff=162645"/>
		<updated>2025-06-30T05:14:02Z</updated>

		<summary type="html">&lt;p&gt;Rei: Archived URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Glossary}}&lt;br /&gt;
A &#039;&#039;&#039;universal computer&#039;&#039;&#039; in a [[cellular automaton]] is a system that can compute anything that a [http://en.wikipedia.org/wiki/Turing_machine Turing machine] can compute (another term for this is &#039;&#039;&#039;Turing-complete&#039;&#039;&#039;). A cellular automaton in which such a system exists is called &#039;&#039;&#039;universal&#039;&#039;&#039;. A universal computer may be either infinite or finite, but when combined with a [[universal constructor]], it is assumed to be finite.&lt;br /&gt;
&lt;br /&gt;
==Universal computers in Life==&lt;br /&gt;
In 1982, [[John Conway]] proved in &#039;&#039;[[Winning Ways]]&#039;&#039; that the [[Game of Life]] has a (finite) universal computer, as well as a universal constructor. Proving the universality of a cellular automaton with simple rules was in fact Conway&#039;s aim in Life right from the start. The universal computer uses [[glider]] logic and a [[sliding block memory]], and the proof of its existence is also outlined in [[The Recursive Universe]].&lt;br /&gt;
&lt;br /&gt;
In April 2000, [[Paul Rendell]] constructed a direct implementation of a [[Turing machine]].&amp;lt;ref&amp;gt;{{cite web|url=http://rendell-attic.org/gol/tm.htm|title=A Turing Machine in Conway&#039;s Game of Life|author=Paul Rendell|date=April 2, 2000}}&amp;lt;/ref&amp;gt; This computer is infinite, as it requires an infinite length of tape for the Turing Machine.&lt;br /&gt;
&lt;br /&gt;
In 2002, using [[Dean Hickerson]]&#039;s [[sliding block memory]], [[Paul Chapman]] constructed an implementation of a Minsky Register Machine (a machine of the same capability as a Turing Machine), which he extended to a Universal Register Machine, a finite universal computer.&amp;lt;ref&amp;gt;{{cite web|url=http://www.igblan.free-online.co.uk/igblan/ca/|title=Life Universal Computer|author=Paul Chapman|date=November 11, 2002|archiveurl=https://web.archive.org/web/20230716132432/http://www.igblan.free-online.co.uk/igblan/ca/|archivedate=July 16, 2023}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In 2009, [[Adam P. Goucher]] built a [[Spartan universal computer-constructor]], which has three infinite binary memory tapes (program tape, data tape and marker tape). This allows data to be stored in linear space, rather than the exponential space that a Register Machine uses.&lt;br /&gt;
&lt;br /&gt;
In 2010, Paul Rendell completed a [[universal Turing machine|universal version]] of his Turing machine pattern, followed in 2011 by a [[fully universal Turing machine|fully universal]] version, removing the previous requirement (needed for true universality) that the initial Life pattern must have unbounded size and infinite population.&lt;br /&gt;
&lt;br /&gt;
In 2016, [[Nicolas Loizeau]] created an [[8-bit programmable computer]] pattern, using only four basic parts: a [[twogun|period-60 glider gun]], a [[buckaroo|90° glider reflector]], a p30 [[glider duplicator]], and a [[eater1|glider eater]]. Later an improved scalable version was announced in 2021.&lt;br /&gt;
&lt;br /&gt;
==Universal computers in other cellular automata==&lt;br /&gt;
===In [[Life-like cellular automata]]===&lt;br /&gt;
For a universal computer to be finite, it must either be given sufficient memory for a computation prior, or employ a universal constructor. For the latter case, it must be able to escape its own bounding box and diamond, so in a non-strobing rule, its rulestring must contain at least one of the birth transitions &amp;lt;tt&amp;gt;{1,2,3}&amp;lt;/tt&amp;gt;, or when [[isotropic non-totalistic]], at least one birth transition in each of the sets &amp;lt;tt&amp;gt;{1c,1e,2c,2a,3i}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{1c,1e,2e,2a,3a}&amp;lt;/tt&amp;gt;, respectively, meaning there is an upper bound of &amp;lt;tt&amp;gt;2&amp;lt;sup&amp;gt;101&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;100&amp;lt;/sup&amp;gt;+(2&amp;lt;sup&amp;gt;99&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;98&amp;lt;/sup&amp;gt;+2&amp;lt;sup&amp;gt;97&amp;lt;/sup&amp;gt;)&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;/2&amp;lt;sup&amp;gt;99&amp;lt;/sup&amp;gt;=145*2&amp;lt;sup&amp;gt;95&amp;lt;/sup&amp;gt;&amp;lt;/tt&amp;gt; INT rules with Turing-complete finite patterns on infinite planes.&lt;br /&gt;
&lt;br /&gt;
For strobing rules, where &amp;lt;tt&amp;gt;~&amp;lt;/tt&amp;gt; denotes the absence of a transition, these prerequisite sets are instead &amp;lt;tt&amp;gt;{~b1c,~b1e,~b2c,~b2a,~b3i,s7c,s7e,s6c,s6a,s5i}&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;{~b1c,~b1e,~b2e,~b2a,~b3a,s7c,s7e,s6e,s6a,s5a}&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[David Eppstein]] and Dean Hickerson proved that {{rl|B35/S236}} has a universal computer and universal constructor, using the same method of proof that Conway used to prove that Life is universal.&amp;lt;ref&amp;gt;{{cite web|url=http://www.ics.uci.edu/~eppstein/ca/b35s236/|title=B35/S236|author=D. Eppstein}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===In multi-state circuitry rules===&lt;br /&gt;
[[Tim Hutton]] has implemented [[Codd]]&#039;s design for a universal computer in Codd&#039;s 8-state cellular automaton.&amp;lt;ref&amp;gt;{{cite web|url=https://github.com/GollyGang/ruletablerepository/wiki/CoddsDesign|title=Rule Table Repository|author=Tim Hutton}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well-known rule {{rl|WireWorld}} allows construction of very small and robust logic gates, triggers, memory banks etc. In September 2004 David Moore and Mark Owen released a Wireworld computer, in which the results of calculations are shown in seven-segment displays by running &amp;quot;electrons&amp;quot;. The computer&#039;s instruction set is a highly orthogonal RISC architecture. The program, CPU status and data are stored in a bank of 64 16-bit registers. According to the authors, the computer was designed, with the help of many others, between 1990 and 1992. The version of it included in [[Golly]] is preprogrammed to compute and display the sequence of [[prime number]]s. Likely this was the first computer in a cellular automaton that looks like a computer from human perspective.&lt;br /&gt;
&lt;br /&gt;
In 2021 [[Yoel Matveyev]] released the largest known cellular automation computer called [[Izhora]] based on his own 4-state rule FireWorld.&amp;lt;ref name=&amp;quot;post136309&amp;quot; /&amp;gt; It has 256 kilobytes of memory, a {{times|256|128}} memory-mapped pixel display and a keyboard driven by a [[Golly]] script. Its 32-bit CPU uses a single operation, subtract and branch if zero or negative (SUBLEQ), from which all other operations can be synthesized. Examples include 256-bit factorials, primes and Fibonacci numbers. Tools such as an assembler and emulator are provided for programming it.&lt;br /&gt;
&lt;br /&gt;
Other examples of cellular automation computers include a partial emulation of a real-world Picoblaze microcontroller and a custom multicore CPU.&lt;br /&gt;
&lt;br /&gt;
==Universality of predecessor-finding==&lt;br /&gt;
On August 20, 2023, [[Ville Salo]] and [[Ilkka Törmä]] proved that arbitrary [[Boolean satisfiability problem]]s could be encoded to problems of finding predecessors of specific patterns, with the corollary that the process of reversing a single iteration (or otherwise proving that a pattern is a [[Garden of Eden]]) is computationally universal.&amp;lt;ref name=&amp;quot;arxiv2308.10198&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post136309&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|p          = 136309&lt;br /&gt;
|format     = ref&lt;br /&gt;
|title      = Izhora (Fireworld2 computer)&lt;br /&gt;
|author     = Yoel Matveyev&lt;br /&gt;
|date       = October 5, 2021&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;arxiv2308.10198&amp;quot;&amp;gt;[[Ville Salo]], [[Ilkka Törmä]], [https://arxiv.org/abs/2308.10198 &#039;&#039;Computing backwards with Game of Life, part 1: wires and circuits&#039;&#039;]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{LinkWikipedia|Turing_completeness|name=Turing completeness}}&lt;br /&gt;
* {{LinkLexicon|lex_u.htm#universalcomputer}}&lt;br /&gt;
* {{LinkForumThread|f=11|t=3362|title=Resources pertaining to computation in cellular automata}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Universal computation| ]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162619</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162619"/>
		<updated>2025-06-29T15:53:29Z</updated>

		<summary type="html">&lt;p&gt;Rei: Update to APGsembly 2.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt). In 2024, branoc created a version of the compiler and emulator based on the updated specifications from &#039;&#039;[[Conway&#039;s Game of Life: Mathematics and Construction]]&#039;&#039; textbook.&amp;lt;ref name=&amp;quot;post199807&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;B2D&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and B2D.&lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever executes HALT_OUT (or HALT) action.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Action1, Action2, Action3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID.&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Action.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of actions to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC B0, NOP&lt;br /&gt;
 A1; NZ; A2; INC B0, NOP&lt;br /&gt;
 A2; Z; A1; SET B0, NOP&lt;br /&gt;
 A2; NZ; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
This loads the B0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC B0, NOP&lt;br /&gt;
 A2; *; A1; SET B0, NOP&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;HALT&#039;&#039; - The HALT_OUT action halts the entire computation and emits a glider. The HALT action halts the entire computation without emitting a glider.&lt;br /&gt;
# &#039;&#039;U&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;B&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - multiplier&lt;br /&gt;
# &#039;&#039;B2D&#039;&#039; - a two-dimensional binary register. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of U, B, ADD, SUB, and MUL units, one B2D unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width B2D units.&lt;br /&gt;
&lt;br /&gt;
Before 2021, &amp;quot;U&amp;quot; was written as &amp;quot;R&amp;quot; (short for &amp;quot;register&amp;quot;), and &amp;quot;B2D&amp;quot; was written as &amp;quot;SQ&amp;quot; (short for &amp;quot;square&amp;quot;). The &amp;quot;T&amp;quot; (short for &amp;quot;tape&amp;quot;) unit was an older version of the binary register, and differed in some ways from the B unit.&amp;lt;ref name=&amp;quot;rename2021&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== U: Sliding block register ===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter U, short for &amp;quot;unary&amp;quot; -- for example, U0, U1, U2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;U Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Ux&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Ux&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
=== B: Binary string register ===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with B, short for &amp;quot;binary&amp;quot; -- for example, B0, B1, B2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and TDEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command. SET might be more clearly named &amp;quot;WRITE 1&amp;quot;, but SET is the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Bx&#039;&#039; increases the position of reading head. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Bx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Bx&#039;&#039; returns the state of the binary string value located at reading head and then sets it equal to 0. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Bx&#039;&#039; sets the state of the current binary bit to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== ADD: adder ===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having a 2-bit number. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039; incrementes the number (modulo 4). No return signal.&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039; incrementes and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
=== SUB: subtractor ===&lt;br /&gt;
&lt;br /&gt;
The subtractor works same as the adder, but using 2-bit two&#039;s complement arithmetic.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039; incrementes the number (modulo 4). No return signal.&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039; right-shifts the number. Returns Z if the value before the action is even and NZ if odd.&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039; decrements and then right-shifts the number. Returns Z if the value before the action is odd and NZ if even.&lt;br /&gt;
&lt;br /&gt;
=== MUL ===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== B2D: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* B2D is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* B2D can be used as memory array as well as 2d plotter.&lt;br /&gt;
* B2D register commands contain the string &amp;quot;B2D&amp;quot; in APGsembly code -- e.g., INC B2DX, TDEC B2DX, READ B2D, etc.&lt;br /&gt;
* The B2D has two arms X and Y. Each arm can be moved with INC and TDEC -- e.g., INC B2DX, TDEC B2DY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ B2D command. Unlike B where you must follow with SET or RESET, READ B2D will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET B2D command, so only SET B2D is implemented.&lt;br /&gt;
* This B2D unit&#039;s internal circuitrly operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;B2D Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC B2DX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC B2DY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC B2DX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;TDEC B2DY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ B2D&#039;&#039; returns the state of the binary value located at (X, Y). Returns Z if the current state is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET B2D&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
=== Digit printer ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [[Conway&#039;s Game of Life: Mathematics and Construction]] Chapter 9. Universal Computation&lt;br /&gt;
* [https://conwaylife.com/forums/viewtopic.php?p=202346#p202346 A compiler and emulator] written in Lua for use in Golly.&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly. This is an old (1.0) version.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;post199807&amp;quot;&amp;gt;{{LinkForumThread&lt;br /&gt;
|format     = ref&lt;br /&gt;
|p          = 199807&lt;br /&gt;
|title      = Re: Smaller Pi Calculator Challenge&lt;br /&gt;
|author     = branoc&lt;br /&gt;
|date       = December 14, 2024&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;rename2021&amp;quot;&amp;gt;{{cite web&lt;br /&gt;
|url=https://github.com/rei1024/apgsembly-emulator/issues/1&lt;br /&gt;
|title=alternate identifier for R, T, and SQ units&lt;br /&gt;
|author=Dave Greene&lt;br /&gt;
|website=GitHub&lt;br /&gt;
|date=November 20, 2020&lt;br /&gt;
|accessdate = June 29, 2025&lt;br /&gt;
}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
	<entry>
		<id>https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162610</id>
		<title>APGsembly</title>
		<link rel="alternate" type="text/html" href="https://conwaylife.com/w/index.php?title=APGsembly&amp;diff=162610"/>
		<updated>2025-06-29T10:27:06Z</updated>

		<summary type="html">&lt;p&gt;Rei: new URL for the web emulator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;general purpose calculator&#039;&#039;&#039; (&#039;&#039;&#039;GPC&#039;&#039;&#039;) is a way to implement computational tasks inside Conway&#039;s Game of Life. It is [[Turing complete]] and programmed by a special-purpose programming language called &#039;&#039;&#039;APGsembly&#039;&#039;&#039;. The first computational Life patterns using this technology were constructed by [[Adam P. Goucher]] in 2009 and 2010. The [[Spartan universal computer-constructor]], [[pi calculator]] and [[phi calculator]] patterns, and a related pattern programmed to grow at [[Osqrtlogt|O(sqrt(log(t)))]], had all the same basic general-purpose components that make up the GPC.&lt;br /&gt;
&lt;br /&gt;
Goucher&#039;s original compiler/editor was written in DarkBasic, which became difficult to run on modern computers. In 2019 a Golly Python-script compiler was written by [[Dave Greene]] to create a Conway&#039;s Life pattern corresponding to APGsembly code, and a visual emulator and debugger was written by [[Michael Simkin]] and Dave Greene. At that time the logic circuitry was adjusted to include a standard set of components, and the resulting &amp;quot;GPC&amp;quot; was shown to be capable of supporting any of the three programs (pi, phi, or Osqrtlogt).&lt;br /&gt;
&lt;br /&gt;
The base GPC pattern includes just the logic and memory circuitry; an additional subpattern representing an APGsembly program should be attached to a GPC to produce a complete calculator, printer, or other functional pattern.  The additional subpattern is basically a finite-state machine.  Each line in an APGsembly program corresponds to a state, and there are JUMP instructions for each possible return value (Z or NZ), pointing to the next state that the machine should enter. Each line of code can trigger one or more commands, or &amp;quot;actions&amp;quot;, and it&#039;s important to make sure that each line includes exactly one action that returns a zero/nonzero value. &lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The GPC includes a ticking clock in the form of two synchronized glider guns of period 2^20, 2^22 or higher, depending on what components are being used (see &#039;&#039;&#039;SQ&#039;&#039;&#039; below). These guns emit a glider each time an action has been executed with a return value of either Z or NZ, represented by a glider emitted on one of two possible output [[lane]]s, as a result of the most recent output-producing action. These actions are triggered by an input glider emitted by the calculator program pattern, sent into special computational units on specific lanes to trigger a specific action (ADD, SUB, WRITE, READ, INC, etc.) defined by the APGsembly code. &lt;br /&gt;
&lt;br /&gt;
Thus the GPC has four major physical components: &lt;br /&gt;
&lt;br /&gt;
# Clock.&lt;br /&gt;
# Program code.&lt;br /&gt;
# Computational unit array.&lt;br /&gt;
# Printer and SQ &lt;br /&gt;
&lt;br /&gt;
== The computational cycle ==&lt;br /&gt;
&lt;br /&gt;
Every 2^N generations, a glider gun initiates an action based on the output from the previous cycle.  The gun waits long enough that an output has most likely returned.  If no output has in fact appeared (this can happen when retrieving data from a very long data tape, for example) the gun waits for another cycle and checks again, using a [[universal regulator]] mechanism.&lt;br /&gt;
* The return signal is always a one-bit output value, either Z or NZ.&lt;br /&gt;
* Each cycle is expected to return exactly one such output.&lt;br /&gt;
&lt;br /&gt;
== Program code ==&lt;br /&gt;
&lt;br /&gt;
APGsembly code consists of a list of actions to be performed for each &#039;&#039;state ID&#039;&#039;, for each possible return value (Z or NZ). The program consists of lines of code; each state ID corresponds to two lines of code, one for Z and one for NZ.&lt;br /&gt;
#The program must start with INITIAL, and will halt if it ever reaches a state where none of the actions return a Z/NZ response.&lt;br /&gt;
#If the program is written according the usual rules (i.e. a single return signal per line), it will run indefinitely.&lt;br /&gt;
#Two or more actions with Z/NZ responses for a single state are technically illegal, and will likely (though not inevitably) cause chaotic explosions in the calculator pattern.&lt;br /&gt;
&lt;br /&gt;
Each line of code consists of 4 parts, separated by semicolons and optional whitespace:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StateID; Z/NZ; NextStateID; Op1, Op2, Op3, etc.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;StateID.&#039;&#039;&#039; Each line&#039;s first element is a state ID.  This can be thought of as a line number, except that pairs of successive lines usually share the same state ID.&lt;br /&gt;
#&#039;&#039;&#039;Z/NZ.&#039;&#039;&#039; Each line&#039;s second element is either Z or NZ. Only the line matching the Z or NZ return value from the previous cycle will actually be executed.&lt;br /&gt;
#&#039;&#039;&#039;NextStateID&#039;&#039;&#039; Each line&#039;s third element defines the state that will be executed on the next clock tick, if that line is executed.&lt;br /&gt;
#&#039;&#039;&#039;Op.&#039;&#039;&#039; Each line&#039;s fourth element defines a comma-separated list of operations, or &amp;quot;actions&amp;quot;, to be executed. These actions are inputs to the computational units. Some actions will not return anything and only change the state of the computational unit; some will return either Z or NZ depending on the internal state of a particular unit. It is the programmer&#039;s task to make sure there is exactly one return value.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 INITIAL; Z; A2; NOP&lt;br /&gt;
 INITIAL; NZ; A2; NOP&lt;br /&gt;
 A1; Z; A2; INC T0&lt;br /&gt;
 A1; NZ; A2; INC T0&lt;br /&gt;
 A2; Z; A1; READ T0, SET T0&lt;br /&gt;
 A2; NZ; A1; READ T0, SET T0&lt;br /&gt;
&lt;br /&gt;
This loads the T0 register with an increasing number of &#039;1&#039; bits. Notice that each state ID &#039;&#039;&#039;INITIAL&#039;&#039;&#039;, &#039;&#039;&#039;A1&#039;&#039;&#039;, and &#039;&#039;&#039;A2&#039;&#039;&#039; appears twice in the program, once for each possible Z return and once for each NZ return.&lt;br /&gt;
&lt;br /&gt;
A syntactic shortcut added in the new compiler is the use of &amp;quot;*&amp;quot; to mean &amp;quot;both Z and NZ&amp;quot;, and &amp;quot;ZZ&amp;quot; to mean &amp;quot;only Z is possible&amp;quot; for a given state.  The above sample program could be written more compactly as&lt;br /&gt;
&lt;br /&gt;
 INITIAL; ZZ; A2; NOP&lt;br /&gt;
 A1; *; A2; INC T0&lt;br /&gt;
 A2; *; A1; READ T0, SET T0&lt;br /&gt;
&lt;br /&gt;
== Computational units ==&lt;br /&gt;
&lt;br /&gt;
There are currently 6 types of logic units, though it is possible to add more.  Each type of logic unit has one or more actions, triggered by glider inputs on specific lanes.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;NOP&#039;&#039; - The NOP action sends a Z output directly, and takes no other action.&lt;br /&gt;
# &#039;&#039;R&#039;&#039; - sliding block register (holds a single integer value, stored in unary)&lt;br /&gt;
# &#039;&#039;T&#039;&#039; - binary string register (holds an arbitrary-length string of binary digits)&lt;br /&gt;
# &#039;&#039;ADD&#039;&#039; - adder&lt;br /&gt;
# &#039;&#039;SUB&#039;&#039; - subtractor&lt;br /&gt;
# &#039;&#039;MUL&#039;&#039; - ... we&#039;re not sure how to use this, but it shows up in the pi and phi calculator code, apparently as a binary-to-decimal converter. &lt;br /&gt;
# &#039;&#039;SQ&#039;&#039; - a two-dimensional (&#039;&#039;square&#039;&#039;) array of data. &lt;br /&gt;
&lt;br /&gt;
The calculator can have an arbitrary number of R, T, ADD, SUB, and MUL units, one SQ unit, and one digit printer or character printer.  Future versions of the compiler/emulator will support other components, such as an arbitrary number of fixed-width SQ units.&lt;br /&gt;
&lt;br /&gt;
===R: Sliding block===&lt;br /&gt;
&lt;br /&gt;
* Sliding block registers in APGsembly code are denoted by keywords starting with the letter R, short for &amp;quot;register&amp;quot; -- for example, R0, R1, R2, etc.&lt;br /&gt;
* A sliding block register has very simple logic. It represents a single number, and all you can do with it is INC (increase by 1) and TDEC (test and decrease by 1).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;R Actions:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Rx&#039;&#039; will increase the register by 1. No return signal.&lt;br /&gt;
* &#039;&#039;TDEC Rx&#039;&#039; will decrease the register by 1. Returns NZ if the register &amp;gt; 0, otherwise Z.&lt;br /&gt;
&lt;br /&gt;
===T: Binary string register===&lt;br /&gt;
&lt;br /&gt;
* Binary string registers in APGsembly code are denoted by keywords starting with T, short for &amp;quot;tape&amp;quot; -- for example, T0, T1, T2, etc.&lt;br /&gt;
* A binary string register has a &amp;quot;reading head&amp;quot; that can be moved forward and backward along the tape with INC and DEC, just like a sliding block register.&lt;br /&gt;
* A binary string register can store arbitrarily-large binary strings. A program can only retrieve one bit at a time using READ command, followed by SET or RESET actions.  SET and RESET might be more clearly named &amp;quot;WRITE 1&amp;quot; and &amp;quot;WRITE 0&amp;quot;, but SET and RESET are the terms used in existing APGsembly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;T Actions&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;INC Tx&#039;&#039; increases the position of reading head. Returns Z unless the space is empty then it returns NZ.&lt;br /&gt;
* &#039;&#039;DEC Tx&#039;&#039; decreases the position of reading head. Returns NZ unless at 0.&lt;br /&gt;
* &#039;&#039;READ Tx&#039;&#039; return the state of the binary string value located at reading head. Returns Z if the value is 0 and NZ if 1.&lt;br /&gt;
* &#039;&#039;SET Tx&#039;&#039; sets the state of the current binary bit to 1. Must be after READ action which removes the previous state. No return signal.&lt;br /&gt;
* &#039;&#039;RESET Tx&#039;&#039; sets the state of the current binary bit to 0. Must be after READ action which removes the previous state. No return signal.&lt;br /&gt;
&lt;br /&gt;
===ADD: adder===&lt;br /&gt;
&lt;br /&gt;
One should think about the adder as having two bits, A and B. Each of them can be either 0 or 1, and each of these options is an input to the adder. An A input just changes the state of the adder unit, whereas a B input returns the result.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;A0&#039;&#039; is not implemented as an input, because there is nothing to change.&lt;br /&gt;
* &#039;&#039;A1&#039;&#039; is a valid input&lt;br /&gt;
* &#039;&#039;B0&#039;&#039;, &#039;&#039;B1&#039;&#039; should come after A is initialized.&lt;br /&gt;
* The adder returns (Ax + By + Memory) % 2&lt;br /&gt;
* The adder stores Memory = (Ax + By + Prev Memory &amp;gt;= 2)&lt;br /&gt;
* The &amp;quot;carry&amp;quot; memory bit is stored in the unit until the next use of the adder.&lt;br /&gt;
* If you are not sure about the state of the adder, just send B0 and you can be sure the memory is cleared.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ADD Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD A1&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD B0&#039;&#039;&lt;br /&gt;
* &#039;&#039;ADD B1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===SUB: subtractor===&lt;br /&gt;
&lt;br /&gt;
The subtractor works exactly the same as the adder, except for subtracting two numbers bit by bit, keeping in internal memory a 0 or 1 &amp;quot;carry&amp;quot; value. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SUB Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB A1&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB B0&#039;&#039;&lt;br /&gt;
* &#039;&#039;SUB B1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===MUL===&lt;br /&gt;
&lt;br /&gt;
MUL keeps a number between 0 and 10 in an internal register. MUL 0 divides the number by 2 (i.e., bit shifts it by 1 bit), and MUL 1 adds 10 and &#039;&#039;then&#039;&#039; divides the number by 2. The point of doing this is that performing MUL commands in succession can be used to multiply binary numbers one bit at a time, with the internal memory of the MUL component keeping track of future carry bits. This is used in the digit extraction step of the [[pi calculator|pi]] and [[phi calculator]] programs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MUL Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 0&#039;&#039;&lt;br /&gt;
* &#039;&#039;MUL 1&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===SQ: 2d binary register ===&lt;br /&gt;
&lt;br /&gt;
* SQ is two-dimensional binary register and is unbounded in positive X and Y directions. &lt;br /&gt;
* SQ can be used as memory array as well as 2d plotter.&lt;br /&gt;
* SQ register commands contain the string &amp;quot;SQ&amp;quot; in APGsembly code -- e.g., INC SQ, DEC SQ, READ SQ, etc.&lt;br /&gt;
* The SQ has two arms X and Y. Each arm can be moved with INC and DEC -- e.g., INC SQX, DEC SQY.&lt;br /&gt;
* A program can retrieve a bit located at (X, Y) via the READ SQ command. Unlike T where you must follow with SET or RESET, READ SQ will always set the (X, Y) bit back to 0 (empty space). This means there is no need for a RESET SQ command, so only SET SQ is implemented.&lt;br /&gt;
* This SQ unit&#039;s internal circuitrly operates fairly slowly. If an APGsembly program makes use of this component, a clock gun of at least period 2^22 is required.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SQ Actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;INC SQX&#039;&#039; increases the position of the X arm. No return signal.&lt;br /&gt;
* &#039;&#039;INC SQY&#039;&#039; increases the position of the Y arm. No return signal.&lt;br /&gt;
* &#039;&#039;DEC SQX&#039;&#039; decreases the position of X arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;DEC SQY&#039;&#039; decreases the position of Y arm, or if it&#039;s at 0 already, keeps it there. Returns Z if already at 0, otherwise NZ.&lt;br /&gt;
* &#039;&#039;READ SQ&#039;&#039; returns the state of the binary value located at (X, Y). Returns Z if the current state is 0 (empty), otherwise NZ.&lt;br /&gt;
* &#039;&#039;SET SQ&#039;&#039; sets the state at (X, Y) to 1 (breaks if the cell is set to 1). No return signal.&lt;br /&gt;
&lt;br /&gt;
===Digit printer===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;digit printer&#039;&#039; can print &amp;quot;.&amp;quot; and digits 0-9. No return signal.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Digit printer actions&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;OUTPUT x&#039;&#039;, for x = ., 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9.&lt;br /&gt;
&lt;br /&gt;
== Further details == &lt;br /&gt;
&lt;br /&gt;
* For further discussion and examples, or to ask questions, see [https://conwaylife.com/forums/viewtopic.php?f=2&amp;amp;t=4196 this conwaylife.com forum thread].&lt;br /&gt;
* [https://github.com/dvgrn/b3s23life/tree/main/calculator A compiler and debugger] for use in Golly.&lt;br /&gt;
* [https://rei1024.github.io/apgsembly-emulator/ An emulator] that works in a web browser.&lt;br /&gt;
&lt;br /&gt;
[[Category:Everything else]]&lt;/div&gt;</summary>
		<author><name>Rei</name></author>
	</entry>
</feed>