Turing Machine lab helper v2

Turing Machine lab helper v2
I.
What is a Turing Machine?
Shortly, a Turing machine is a simple hypothetical device that manipulates symbols on a strip of tape according to a
table of rules.
II.
What we need?
Basic elements of Turing machine implemented in the program:
1. Memory tape, which we can freely modify.
2. Read-write header, which we can set in every place in the memory only by clicking in the memory cell.
3.Table of rules, where we specify how program should react for symbol in memory cell in a given state.
III.
How we should do this?
First things first, we must know some basic, simple theory from the lecture. I recommend solving tasks first on the
paper, so we can think over a given task and plan how our states should work. Personally I think the most important
thing is the proper definitions of our states. We should remember that this is low level programming and almost
every action (task) must be precisely described, and should have its different state.
IV.
How it works?
Example is given above: We are replacing every 0 with 1 and 1 with 0.
We are writing some symbols from defined set no the tape, then we can add or delete some rows or columns
according what we want to obtain.
In our case the first state (column) is looking for first non-empty cell, second is replacing of bits and last is the end
so in fact doing nothing. In rows are possible symbols.
We define actions for every encountered symbol in given state, for example first column and first row is filled with
$ 1 P – that means if we encounter $ we are writing the same symbol ($), then we are jumping to state 1, and then
going right on the tape (P -w prawo) to the next cell.
In some more complicated tasks on the laboratory classes we may need some kind of register to counting back and
forward, i recommend to create some additional states responsible for going to the end of the string of symbols and
there store some needed information.
V.
HAVE FUN! :)
Adam Andrzejczak, Macro Gr.1 Sem.5 2013/2014