Turing Trains

 

computational train track layouts

menu

Universal Computer

Each of the example layouts shown so far has been specifically designed to carry out a single function. A computer layout would be able to carry out many different functions by following a series of programmed steps. Different examples could be run by simply changing the program.

The computer uses a 'library' of built-in functions. We've already seen these layouts over the preceding pages. The functions are stacked one above the other, allowing common registers points to be linked together so data can be shared.

Program Loop

Any function can be 'called' from the main program loop. This will be 'programmed' (built) to carry out the requirements of each particular program, as a series of subroutine calls. Once each task is complete, the train returns back along the same track. We've already seen the idea of a program loop with sprung point subroutines.

At least one subroutine function will need to detect when the calculation is complete and return the train to its starting position. Without a 'Halt' condition, the program will run forever.

In theory, the program loop will be the only difference between any two computer layouts. In practice, to save space, only functions which are used will be shown in the library stack, so each layout will be different.

Multiplexer

To saves a multitude of parallel tracks, we'll employ a multiplexer. The circuit shows a 4-way multiplexer which connects the upper program loop with four lower functions.

If the train enters on line 2, it switches the two sets of linked points before travelling down the single vertical connecting line. The linked points ensure the train is delivered to the correct function. It then returns back along the same track.

Multiplexer
MUX layout
Click grass to pause/run train Click points to switch 0/1 Click start to reset train/points

Reset ""

To ensure accurate and repeatable results, it is important that all points are reset to their initial positions before each new calculation. Click the start circle to reset the train and again to reset all points.

Error Line ""

Most computer layouts include a vertical error line. This allows functions to return any overflow errors to an error siding back at the station. This saves time scanning a large layout for a train that may have stopped in an error siding somewhere. Unused Mux lines, Comparator outputs (usually C>n) are also returned as errors.

Alan Turing

Due to the Turing Halting conjecture, we can never prove that a train will return from a complex layout. If it becomes trapped in an infinite loop, the calculation will carry on forever and never return an answer. It may have no answer. The calculation may not be computable.

The computer layouts on the next few pages are small enough to check that there are no loops to trap the train.

Alan Turing
Alan Turing

The previous Average and Subtract layouts are straight forward to convert into program layouts. All Compound functions are also easily built, the program loop visiting each function in turn.

Hamming Weight is slightly different and Triangular Numbers allows for larger numbers.

The Fibonacci layout is new and the Switching Yard shows a possible design for a programmable area.

Also see how a vertical 'Clear and Error' line can be used to clear all points before each computer run. It is added to an example Triangular Number layout. Essential for a real train track layout but over complex for a web page where all points can be easily reset to 0.

Turing Trains | cr31.co.uk | 2017

 

use your browsers 'zoom' option to enlarge layouts