Conway's Game of Life On FPGA: Mojo V2 FPGA Development Board
Conway's Game of Life On FPGA: Mojo V2 FPGA Development Board
1
automata as the processes 84 digital IO pins
necessarily don’t occur sequentially.
8 analog inputs
8 general purpose LEDs
Background Theory
1 reset button
The game of life by John Conway
runs on simple rules as follows: 1 LED to show when the
FPGA is correctly configured
1. A live cell with fewer than
two live neighbours dies, as if On board voltage regulation
caused by under-population. that can handle 4.8V - 12V
2. A live cell with two or three A microcontroller
live neighbours lives on to the (ATmega16U4) used for
next generation. configuring the FPGA, USB
3. A live cell with more than communications, and reading
three live neighbours dies, as the analog pins
if by overcrowding.
4. A dead cell with exactly three On board flash memory to
live neighbours becomes a store the FPGA configuration
live cell, as if by reproduction. file
Source: fpga4fun.com/PongGame
4
Here R and C are the arrays of i.e. the next state of our cellular
I/O pins in mojo board to which grid. The module ‘copy’ assigns
row and column pins of the LED the values in next to
matrix (16X16) are connected. R corresponding cells in arr.
and C are defined as outputs from
The module ‘light’ is for POV.
the mojo-top. We had to
Any state of the game of life is
configure these pins in the
being displayed using Persistence
mojo.ucf file; mojo.ucf is where
of Vision. This is the module
we configure the I/O pins of the
which sends output to R and C
mojo board with some pins
pins. This module takes as input
configured by default to internal
a 256 bit array and depending on
elements of the board.
the state of each LED lights up
The default clock of the board each of them one by one at a
(clk) is a 50 MHz clock which is frequency of 50 MHz.
too fast to have a noticeable
The module ‘pin’ takes as input
updating of present state of the
the array arr, i.e. the present state
cell to the next. C1 is a 1 Hz
of the LED matrix and its
clock which has been slowed
function is to give the next state
down using the following
of the matrix in form of output
module:
next following the rules of the
module count (clk, b); game of life. In other words,
input clk; // synthesis according to the present state of
attribute PERIOD clk "50 MHz" the neighbouring cells of the cell
reg [25:0] count = 0; under consideration, it assigns
output reg b = 0; // one pulse per
the next state of the cell in the
second array next. For checking the
rules, we simply add the states
(1-live, 0-dead) of the neighbours
always @ (posedge clk) begin
and compare. For e.g. if arr[x] is
b <= (count == 50000000 - 2); live and the neighbours add upto
count <= b ? 0 : count + 1; 5, we assign next[x] to be a dead
end
cell.
5
All these modules run parallel to CounterX <= CounterX + 1;
give fast execution. If always @(posedge clk)
summarized, the ‘pin’ module if(CounterXmaxed)
initializes and updates the states.
CounterY <= CounterY + 1;
The ‘light’ module implements
POV for displaying the current endmodule
state. The module ‘copy’ copies Module vga:
the array next onto array arr.
module vga(input clk, input [9:0]
Code for Version 2: CounterX, input [9:0] CounterY, output
vga_HS, output vga_VS
This version of Conway’s game
);
of life gets displayed on a VGA
reg vga_HS, vga_VS;
screen. This is not as elegantly
simple as version-1. always @(posedge clk)
Mojo V2
Female VGA
Connector
7
Limitations and Compromises Another idea is to simulate
spread of diseases and
There are some limitations to the
mutation at cellular level.
latest version of the project:
There are several more
The code for initial seeding applications of FPGAs.
needs to be changed whenever One of the ideas we were
a different initial seed is considering is making a
needed. genetic algorithm solver
The code is not robust at using FPGAs.
present. For scaling up the FPGAs can be used in bots
display, the code has to be making their execution
changed significantly, faster due to parallel
especially when it comes to processing.
VGA display which mainly To emphasize on the scope
involves hard coding. of FPGA: it can be used to
We haven’t been able to design any circuit be it a
implement user interfacing to simple AND gate or a
the game till now. Once the microprocessor.
game is set on, user can not
change the state of a desired
cell. References
http://embeddedmicro.com/tut
Future Prospects and Scope orials/mojo/
User interfacing can be https://www.youtube.com/wat
added to the game. This ch?v=pkJAWpkaiHg
would mean the user can
set the initial seeding and http://www.asic-world.com/
further user can access any
cell and change its state in http://www.fpga4fun.com/Pon
run-time of the game. gGame.html
There can be more than
two states associated with
each cell corresponding to
growth and aging using a
color gradient instead of
just one color.
8
Team: E_Trix
Team Members:
Avani Samdariya,
Krati Agrawal,
Samyak Jain, and
Sanjari Srivastava
Acknowledgements:
Arjun Bhasin
Avi Singh (Mentor)
Kevin Jose
Piyush Awasthi