Game of Life example program
Copyright 2012-2013, Sinclair R.F., Inc.

Introduction

Conway's Game of Life, see Wikipedia, is used as an example of a more complicated SSBCC.9x8 application.

The processor is used to propagate the machine state on a periodic basis as controlled by user input, the FPGA fabric is used to generate the output video, and several external SRAM are used as a ping pong buffer for the video display.

Scripts to build the game for various development boards are listed by FPGA vendor name.

Theory of Operation

The bit pattern for the game of life is stored in a 256x256 memory as 256x32 8-bit values. I.e., in 8 kB of RAM. Two copies of this memory are used, one for the image being displayed and one for the image being computed.

The processor reads three lines of the image into buffers and computes the new line of output based on those. This architecture allows the processor to do an in-place update for the maximum update rate.

Serial Protocol

This section lists the commands to configure and operate the game.

Command Description
c clear the game and turn off wrapping
h halt the game
i I set the update interval to I
Note: I must be between 0 and 255 inclusive
r run the game indefinitely
s step the game (do one iteration of the game)
w toggle wrapping
+ N M set the pixel on the N'th column and M'th row
Note: N and M must be within the size constraints for the game (nominally 0 to 255 inclusive).
- N M clear the pixel on the N'th column and M'th row

Digital to NTSC Converter