Alptraum
New Member
Hi,
I want to build an 8 by 8 grid which has an input switch array and can play Conway's Game of Life. I am hoping to use a toroidal arrangement, which avoids the funny things which would happen when the chip tried to simulate a pattern outside of the grid. It also just makes the pattern last longer.
However, in order to do this (efficiently), I need to be able to change the values x and y in a coordinate (x,y) depending on what rules the cell follows, and this is made a lot easier by being able to do this.
At the moment, the basic outline for each pixel is:
1) Log pixel coordinate,
2) Sum number of 'live' (on) cells of the surrounding 8,
3) Output the final value of the cell based upon the rules of the game,
4) Store the result in a result register, separate to the current register, in order to prevent the system basing the results on the outputs of other cells.
5) Go to the next cell and repeat the procedure.
That should work fine, and I can program that, but only if I'm able to define x and y. I need to be able to set x=x+1 without creating an infinite loop and breaking maths, in order to progress through the grid.
Also, in order to do the toroidal arrangement effectively, I need to be able to say that 0 is the successor to 9, so that it reads the 8 surrounding cell states and doesn't read the edge as an edge.
Has anyone got any ideas how to do the above 2 paragraphs? Keep in mind that I have to do this in ASM.
Thanks.
I want to build an 8 by 8 grid which has an input switch array and can play Conway's Game of Life. I am hoping to use a toroidal arrangement, which avoids the funny things which would happen when the chip tried to simulate a pattern outside of the grid. It also just makes the pattern last longer.
However, in order to do this (efficiently), I need to be able to change the values x and y in a coordinate (x,y) depending on what rules the cell follows, and this is made a lot easier by being able to do this.
At the moment, the basic outline for each pixel is:
1) Log pixel coordinate,
2) Sum number of 'live' (on) cells of the surrounding 8,
3) Output the final value of the cell based upon the rules of the game,
4) Store the result in a result register, separate to the current register, in order to prevent the system basing the results on the outputs of other cells.
5) Go to the next cell and repeat the procedure.
That should work fine, and I can program that, but only if I'm able to define x and y. I need to be able to set x=x+1 without creating an infinite loop and breaking maths, in order to progress through the grid.
Also, in order to do the toroidal arrangement effectively, I need to be able to say that 0 is the successor to 9, so that it reads the 8 surrounding cell states and doesn't read the edge as an edge.
Has anyone got any ideas how to do the above 2 paragraphs? Keep in mind that I have to do this in ASM.
Thanks.