rei1024 / rei1024.github.io

https://rei1024.github.io/
MIT License
2 stars 0 forks source link

alternate identifier for R, T, and SQ units #1

Open dvgrn opened 3 years ago

dvgrn commented 3 years ago

Hello! This seems like it might be a good way to bring up a potential difficulty with your online APGsembly emulator, and see if you'd be interested in collaborating on some further development.

Background

Nathaniel Johnston and I are working our way through writing the final chapters of a Game of Life textbook. Chapter 9, about universal computation, relies heavily on descriptions and examples involving the pi and phi calculators and the O(sqrt(log(t))) pattern.

As part of this project, we've slightly revised and extended APGsembly. The plan here is to make it so that the Python compiler -- the one that builds actual Life patterns starting with APGsembly code -- can compile an "old style" pi calculator pattern if you use old components like "R". But if you reference other types of registers like "U" registers, the compiler can equally well build working calculator patterns using the new registers.

Changes

For example, I rebuilt the R register mechanism using smaller and more modern Life circuitry. We decided to call the new version a "U" register -- "U" for "Unary" -- and we're using that in APGsembly code in the textbook. Inputs and outputs work the exact same way as the old "R" registers, so basically your simulator would still work on textbook code if "U" is used as an alias for "R".

Similarly, I simplified and reduced the R register, so that it's also much smaller and the internal mechanisms are quite a bit simpler. The new component is called "B" for "Binary", and here's where things get a little complicated. The B register only has four inputs instead of five -- there's no RESET. Also its DEC operation is now called TDEC, and it doesn't return an NZ value every time it processes an INC instruction.

The TDEC and INC changes are for the sake of consistency with the behavior of the U register. The lack of a RESET is because a READ operation automatically includes a RESET, and RESET is no longer needed. The new B register, unlike the old T register, is capable of reading empty space as a 0, which means there's no need to go through the complex initialization and highest-bit tracking process that the old T registers used internally. You can just INC the register to whatever bit you want to read or write, and it will work -- there's a "0" in every bit position by default.

Finally, I haven't tried to rebuild the SQ unit at all yet -- but we renamed it to go along with the new naming scheme. The new name is "B2D", and DECs have again been renamed to TDEC, since that is in fact what they do (test then decrement).

There are also some minor adjustments relating to the fact that we now have a script that can build a custom printer for any number of characters we might want, with any size bitmaps for each character.

Next Steps?

This Web-based APGsembly emulator is a really useful contribution to the development of Life-calculator-pattern programmability. I'm hoping that you might be interested in making your simulator work correctly with the APGsembly 2.0 that we'll be using in the textbook. If so, I can send along any missing details, plus the APGsembly 2.0 code that we've written so far for use in the textbook.

I've sent a PM in the conwaylife.com forum messaging system with contact information, in case you'd care to shift the conversation over to email.

rei1024 commented 3 years ago

@dvgrn Hello! Thanks for giving me the information. I will update my emulator to accept APGsembly 2.0.

If you can send the APGsembly 2.0 code to me, I think it really helps the development. I sent a PM with my email address.