Turing Trains | Isometric | Wang Tiles | Maze Arrays | i Logo HOME

# Turing Trains

## Functions: Shift & Rotate Registers

These functions perform logical shift or rotate, either left or right, on data register A. In some layouts the lazy points are drawn close together so more stages can be shown.

### Shift Right (/2)

This 6-stage circuit shifts data one stage to the right. The least significant bit 'x1' is lost, so if the register represents a binary number then it is halved (divided by 2), with no fractional part. When all stages have been copied, the most significant bit 'x32' is set to 0.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

This circuit is used in the Random Number Generator. A compact (but wider) version of this circuit is used in the Average Function.

### Rotate Right

This 5-stage circuit rotates data one stage to the right in the same manner as the shift right circuit above. The difference is that the least significant bit 'x1' is not lost. It is stored in an extra lazy point and read into the most significant bit 'x16' position when all stages have been shifted.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

### Shift Left (x2)

This 6-stage circuit shifts data one stage to the left. The most significant bit 'x32' is lost. When all stages have been copied, the least significant bit 'x1' is set to 0. If the register represents a binary number (with a leading 0) then it is multiplied by 2.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

A compact (but wider) version of this circuit is used in the Multiplier circuit.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

This circuit uses single lazy points to hold the value from each stage before transferring it to the next. This allows all stages to be the same and the train works from LSB to MSB. Not used in any other layout.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

### Rotate Left

This 5-stage circuit rotates data one stage to the left. The most significant bit 'x16' is not lost. It is stored in an extra lazy point and read into the least significant bit 'x1' position when all stages have been shifted.

 Click layout to pause/run train Click points to switch 0/1 Click start circle to reset train/points

 cr31.co.uk
 zoom in to enlarge layouts