Image:
 Author: Hendrik314 Group: Technical Filesize: 114.74 kB Date added: 2017-08-15 Rating: 6.5 Downloads: 3209 Views: 594 Comments: 3 Ratings: 4 Times favored: 0 Made with: Algodoo v2.1.0 Tags:
|
This is the first scene I upload on Algobox. It is a mechanical, binary, Turing complete and freely programmable registermachine, powered by a marble.
It features 16x6 Bits of instruction storage and 4 8 Bit Registers.
The bits are the light grey boxes, that can shift slightly left or right or change the way of the marble.
The registers are counting registers. They can be incremented and decremented by the marble. This mechanism is an extended version of a mechanism that can be found several times on youtube.
One example: https://www.youtube.com/watch?v=GcDshWmhF4A
The first part the marble passes for every instruction is the decoder for the Instruction pointer, where it is directed to the current Instruction. The marble copies the instruction into the instruction register.
After that it passes the instruction decoder, which brings it to the instruction specific path.
The left path is for JUMPs. It just copies the instruction argument into the instruction pointer
The 4 paths next to it, each for one register, test, if those are ZERO.
The 4 paths on the right increment and decrement the registers.
At the end of each instruction (except JUMPs) the Instruction pointer is incremented, so the next line of code can be read.
The programme is entered with the fixated red squares, that change the marbles way. Red squares are logical ones, a missing square is a zero.
Instructions are:
00: Increment Register
01: Decrement Register
10: If Not Zero (Do next line only if the Register is not Zero, else skip it. To skip it, the instruction pointer is incremented by 2)
11: Unconditional Jump
The Registers are adressed with a binary number as well. They have to be written in the two lowest Bits (which are actually at the top) of the Argument.
Jump targets are 4 Bits long and also written in the Argument
To demonstrate the machine, I programmed it to calculate the Fibonacci Sequence. Honestly I never watched it reach more than 13, because it takes very very long to do anything. And the bigger the number the longer it takes. Maybe I make another computer with more instructions in the future.
I actually wanted to realize it without any script, but I didn't want the scene to become even bigger. So the marble is brought back to it's origin after every instruction with a little oncollide script and also the results are stored in a string with a script. The computer itself works without any script though.
I hope this explains it a bit. If something is not clear yet or you find a bug or you have a question or suggestion, please let me know. Thanks. |