|TAMS / Java / Hades / applets: contents | previous | next|
adders and arithm...
LFSR and selftest
I/O and displays
CMOS circuits (sw...
Mips R3000 cosimu...
Mips fast Sieve
Mips - game ...
Mips prime n...
Intel MCS4 (i4004)
image processing ...
[Sch04] RALU, Min...
|TinyMipsWithRam: Conway's game of life
This applet shows Conway's Game of Life,
a famous mathematical puzzle,
running on the TinyMips (with on-chip memory) connected to
a KS0108-controlled display.
The Game of Life algorithmThe algorithm demonstrated in this applet was first presented by mathematician John H. Conway in 1970. See the Wikipedia article for a concise description and some links. A rectangular game-board of arbitrary size is used, where each position on the board can be occupied (live) or empty. The total set of occupied positions is called a population or generation, and the following rules are applied to calculate the new generation at time step (i+1) from the generation at time step i:
A random initial population then evolves under the above rules until a steady state is reached. This can take a long time, on the order of 1000 iterations or more, because the rules are deliberately chosen to avoid premature extinction or overpopulation. While the gaming rules are simple, the evolution of the game often shows complex and interesting patterns. The following screenshot of the display shows a typical position:
The C source code of the game algorithm is shown below. The game board is represented as a large array, where shifts and adds are used to access the individual positions. One whole memory-word is used to store one bit of the game board; this representation wastes some memory, but allows watching the data in the memory editor during the program execution. For the same reason, shifts are used instead of multiplications. Naturally, shifts would also be a lot faster than multiplications on most low-end hardware.
Wait until the applet is loaded, then use the popup-menu (via popup > edit) to open the user-interface of the processor. Also, click on the symbol of the display (or use the popup again) to open the user-interface of the graphics display. Watch the evolution of the game positions.
The binary program running on the processor was compiled and linked with the GNU gcc (184.108.40.206) and binutils cross-compiler toolchain on a Linux x86 host, with the final ELF loading and relocation done via the Hades Elf2rom tool. See
|Print version | Run this demo in the Hades editor (via Java WebStart)|
|Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)|