TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits delay models flipflops adders and arithm... counters LFSR and selftest memories programmable logic state-machine editor misc. demos I/O and displays DCF-77 clock relays (switch-le... CMOS circuits (sw... RTLIB logic RTLIB registers Prima processor D*CORE MicroJava Pic16 cosimulation Mips R3000 cosimu... TinyMips int... TinyMips Sieve TinyMips stack TinyMips mul... TinyMips loa... TinyMips mul... TinyMips wit... TinyMips UAR... TinyMips UAR... TinyMips int... TinyMips int... Mips fast Sieve TinyMips wit... Mips - game ... Mips prime n... Intel MCS4 (i4004) image processing ... [Sch04] Codeumsetzer [Sch04] Addierer [Sch04] Flipflops [Sch04] Schaltwerke [Sch04] RALU, Min... [Fer05] State-Mac... [Fer05] PIC16F84/... [Fer05] Miscellan... [Fer05] Femtojava FreeTTS | TinyMipsWithRam: Conway's game of life
Circuit Description
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. Usage 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 (2.7.2.3) 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) | ||||
Impressum | http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/76-mips/31-life-onchip/life.html |