Page 2 of 2

Re: Programmable computer

Posted: January 29th, 2017, 2:55 pm
by gameoflifemaniac
So the second prime printer calculates all primes up to 223?

Re: Programmable computer

Posted: January 29th, 2017, 3:25 pm
by blah
Okay. I Did It Myself. I installed python on my laptop and then moved the assembled files onto my PC. My program was actually incomplete, by the way; I forgot the print instruction. Technically it would still have simulated the CA (which is rule 102, by the way) but it wouldn't have displayed it. Here's the corrected version:

Code: Select all

write a 1
print a
add a a b
xor a b a
goto 1
Also, the assembler program has a few missing features. Namely labels and the ability to pre-set the contents of registers, rather than having to use write instructions at the beginning of the program. Maybe I'll make a Lua version myself with these features.

I would post the file, but apparently I can only post an attachment of up to 256 kilobytes. I compressed it and I got a filesize similar to what dvgrn posted (~650kb) but it's still too big for me to post.

Re: Programmable computer

Posted: January 29th, 2017, 3:59 pm
by simeks
gameoflifemaniac wrote:So the second prime printer calculates all primes up to 223?
Yes, and after that it gets confused by arithmetic overflow and claims all odd numbers from 229 to 255 are prime numbers...
I use this C program to simulate the behaviour:

Code: Select all

#include <stdlib.h>
#include <stdio.h>

#define u8 unsigned char

int main (void)
{
		int ic = 0;
		
		u8 a = 0;
		u8 b = 0;
		u8 c = 0;
		u8 d = 0;
		u8 e = 0;
		u8 f = 0;
		u8 g = 0;
		
L00:	ic++; f = 224;
L01:	ic++; g = 2;
L02:	ic++; a = 5;
L03:	ic++; b = 3;
L04:	ic++; c = 0;
L05:	ic++; e = ~a;
L06:	ic++; e++;
L07:	ic++; d = b + e;
L08:	ic++; c++;
L09:	ic++; d = d + b;
L10:	ic++; e = d & f;
L11:	ic++; if (e != 0) goto L13;
L12:	ic++; goto L14;
L13:	ic++; goto L08;
L14:	ic++; if (d != 0) goto L16;
L15:	ic++; goto L24;
L16:	ic++; e = ~c;
L17:	ic++; e = b + e;
L18:	ic++; e = (e & 0x80 ? 0xff : 0x00);
L19:	ic++; if (e != 0) goto L21;
L20:	ic++; goto L23;
L21:	ic++; b = b + g;
L22:	ic++; goto L04;
L23:	ic++; printf ("%3d, ic = %5d\n", a, ic);
L24:	ic++; a = a + g;
				if (a < 5) return 0;
L25:	ic++; goto L03;

		return 0;
}

Re: Programmable computer

Posted: January 30th, 2017, 8:40 am
by gameoflifemaniac
So what's with 225 and 227?

Re: Programmable computer

Posted: February 11th, 2017, 3:09 am
by gameoflifemaniac
Your calculator calculated all the primes up to 199. It took our computer a week.

Re: Programmable computer

Posted: March 10th, 2017, 5:26 pm
by Coban
Hi,
I made an english document that summarizes the functioning of my in-game computer:
https://drive.google.com/open?id=0B-4kR ... UJZWTlOMTg

Re: Programmable computer

Posted: October 30th, 2019, 10:51 am
by dvgrn
Coban wrote:
March 10th, 2017, 5:26 pm
Hi,
I made an english document that summarizes the functioning of my in-game computer:
https://drive.google.com/open?id=0B-4kR ... UJZWTlOMTg
Due to past experiences with links to online resources evaporating over time, my instinct is to put a copy of this very nice document somewhere that's likely to remain accessible (and be backed up). Right here seems good -- PDF format:
8-bit-computer-documentation.zip
(126.53 KiB) Downloaded 229 times

Re: Programmable computer

Posted: October 30th, 2019, 11:15 am
by Coban
Actually there is also a Github repo :
https://github.com/nicolasloizeau/gol-computer

Re: Programmable computer

Posted: October 30th, 2019, 11:59 am
by dvgrn
Coban wrote:
October 30th, 2019, 11:15 am
Actually there is also a Github repo :
https://github.com/nicolasloizeau/gol-computer
Thanks! I've added a link to the repo in the new LifeWiki article, which is kind of a placeholder for the moment but at least it's a start.

I'm still intending to make a copy of the pattern available in Golly's Online Archives under Very Large Patterns -- probably a programmed sample with some comments explaining optimal Golly settings, where to look for the output, when to expect the first prime if it's the prime-calculating program, etc.

If anyone would like to contribute some comment text along these lines, I'd be most grateful! There are still dozens of patterns like this one that ought to be added to the Online Archives. Having to generate and review good comments for each one is the main thing that makes the migration process so slow.

Re: Programmable computer

Posted: November 8th, 2019, 8:22 pm
by Entity Valkyrie 2
Not sure if this is right thread:

XOR gate:

Code: Select all

x = 84, y = 269, rule = B3/S23
33bo$32bobo$32bobo$30b3ob2o$29bo$30b3ob2o$32bob2o3$27b2o$28bo$28bobo$
18bo10b2o$16b3o$15bo$15b2o$2o48b2o$bo48b2o$bob2o$2bo2bo7bo15bo$3b2o10b
o13bo$13b2o3b2o9b3o$18b2o11bo4$27bo3b2o$26bobo3bo$25bobo3bo$21b2obobo
3bo$21b2obo2b4obo$25bobo3bobo7b2o$21b2ob2o2bo2bobo7b2o$22bobo2b2o3bo$
10b2o10bobo$10b2o11bo6$82b2o$81bo$82bo32$33bo$32bobo$32bobo$30b3ob2o$
29bo$30b3ob2o$32bob2o3$27b2o$28bo$28bobo$18bo10b2o$16b3o$15bo$15b2o$2o
48b2o$bo48b2o$bob2o$2bo2bo7bo15bo$3b2o9b2o13bo$13b2o3b2o9b3o$18b2o11bo
4$27bo3b2o$26bobo3bo$25bobo3bo$21b2obobo3bo$21b2obo2b4obo$25bobo3bobo
7b2o$21b2ob2o2bo2bobo7b2o$22bobo2b2o3bo$10b2o10bobo$10b2o11bo6$82b2o$
81bo$82bo32$33bo$32bobo$32bobo$30b3ob2o$29bo$30b3ob2o$32bob2o3$27b2o$
28bo$28bobo$18bo10b2o$16b3o$15bo$15b2o$2o48b2o$bo48b2o$bob2o$2bo2bo7bo
15bo$3b2o10bo13bo$13b2o3b2o9b3o$18b2o11bo4$27bo3b2o$26bobo3bo$25bobo3b
o$21b2obobo3bo$21b2obo2b4obo$25bobo3bobo7b2o$21b2ob2o2bo2bobo7b2o$22bo
bo2b2o3bo$10b2o10bobo$10b2o11bo6$81b3o$81bo$82bo32$33bo$32bobo$32bobo$
30b3ob2o$29bo$30b3ob2o$32bob2o3$27b2o$28bo$28bobo$18bo10b2o$16b3o$15bo
$15b2o$2o48b2o$bo48b2o$bob2o$2bo2bo7bo15bo$3b2o9b2o13bo$13b2o3b2o9b3o$
18b2o11bo4$27bo3b2o$26bobo3bo$25bobo3bo$21b2obobo3bo$21b2obo2b4obo$25b
obo3bobo7b2o$21b2ob2o2bo2bobo7b2o$22bobo2b2o3bo$10b2o10bobo$10b2o11bo
6$81b3o$81bo$82bo!

Re: Programmable computer

Posted: November 8th, 2019, 9:00 pm
by dvgrn
Entity Valkyrie 2 wrote:
November 8th, 2019, 8:22 pm
XOR gate...
That one has been around for a decade or so -- back when forum message numbers were in the low triple digits. See also here for simeks' links to alternate XOR mechanisms (including this one).