Beruflich Dokumente
Kultur Dokumente
RESEARCH ARTICLE
OPEN ACCESS
ABSTRACT
This paper focuses on the Turing Machine usage as a basic calculator. The basic calculator here refers the four
primary arithmetic operations. Those are namely 1.Addition, 2.Subtraction, 3.Multiplication, and 4. Division.
The Turing Machine has the favorable circumstances as compared with the other abstract machines the Finite
Automata and the Pushdown Automata. The Turing Machine has the vital feature called bi-directional
movement. This aspect makes the Turing Machine to support the construction of the basic calculator. The
transition diagram and transition table also derived for each calculation. The processing of input for each
operation also given.
Keywords:- Turing Machine, Addition, Subtraction, Multiplication, Division
I.
INTRODUCTION
A. Turing Machine
The Turing Machine is septuplets. The Turing
machine mathematically models a mechanically
operating machine on a tape [1]. It has the tape for
taking input from the cell. The tape by default has the
blank symbol (#) in all the cells. The head for moving
in the right or left direction to perform read/write
operation. A state register that has the initial value, as a
start state for storing the Turing Machine's state. Then
a finite table of instruction.
B. Basic Calculator
III.
II.
ARITHMETIC OPERATIONS
RELATED WORKS
www.ijetajournal.org
Page 1
International Journal of Engineering Trends and Applications (IJETA) Volume 2 Issue 6, Nov-Dec 2015
T able. I . T ransition Table of the Turing Machine that perform the
addition operation
States
Input
E
s0
#,R, s1
s1
E,R, s1
E,R, s1
s2
E,R, s2
#,L, s3
s3
#,S, h a
s 0 , # EEEEE+EE#
States
Input
Step 1: s 1 , # EEEEE+EE#
E
s0
#,R, s1
Step 3: s 1 , # EEEEE+EE#
s1
#,R, s2
Step 4: s 1 , # EEEEE+EE#
s2
E,R, s2
-,R, s3
Step 5: s 1 , # EEEEE+EE#
s3
E,R, s3
#,L, s4
Step 6: s 1 , # EEEEE+EE#
s4
#,L, s5
s5
E,L, s6
#,S,h a
s6
E,L, s6
-,L, s7
s7
E,L, s8
#,S,h a
s8
E,L, s8
#,R, s1
Step 2: s 1 , # EEEEE+EE#
Step 7: s 2 , # EEEEEEEE#
Step 8: s 2 , # EEEEEEEE#
Step 9: s 2 , # EEEEEEEE#
Step 10: s 3 , # EEEEEEEE#
h a, # EEEEEEE##
www.ijetajournal.org
Page 2
International Journal of Engineering Trends and Applications (IJETA) Volume 2 Issue 6, Nov-Dec 2015
Step 1: s 1 , #EE-EE#
Step 8: h a, # #E## #
Step 2: s 2, ##E-EE#
Step 3: s 2, ##E-EE#
Step 4:s 3 , ##E-EE#
Step 5: s 3 , ##E-EE#
Step 6: s 3 , ##E-EE#
S0 , # E-EE#
Step 7: s 4 , ##E-EE#
Step 1: s 1 , # E-EE#
Step 8: s 5 , ##E-E##
Step 2: s 2, # #-EE#
Step 9: s 6 ,##E-E##
Step 3: s 3, # #-EE#
Step 5: s 3 , # #-EE#
Step 6: s 4 , # #-EE#
Step 7: s 5 , # #-E##
Step 8: s 6 , # #-E##
Step 9: s 7 , # #-E##
h a, # #-E##
S0 ,#EE-E#
Step 1: s 1 , # EE-E#
Step 2: s 2, # #E-E#
Step 3: s 2, # #E-E#
Step 4:s 3 , # #E-E#
Step 5: s 3 , # #E-E#
Step 6: s 4 , # #E-E#
Step 7: s 5 , # #E-# #
www.ijetajournal.org
Page 3
International Journal of Engineering Trends and Applications (IJETA) Volume 2 Issue 6, Nov-Dec 2015
The subroutine concept used to implement the
multiplication operation [12]. The input given here is
unary 1. Ex. The number 7 represented as 1111111.
Input : # 11*111####
s 0 , # 11*111####
Step 1: s 1 , # #1*111#### Step 2: s 4 , # #1*111####
Step 3: s 5 , # #1*111#### Step 4: s 6 , # #1*E11####
Step 5: s 6 , # #1*E11#### Step 6: s 6 , # #1*E11####
Step 7: s 7 , # #1*E11Z### Step 8: s 7 , # #1*E11Z###
Step 9: s 7 , # #1*E11Z### Step 10: s 7 , # #1*E11Z###
Step 11: s 5 , # #1*E11Z###, Step 12: s 6 , # #1*EE1Z###
Step 13: s 6 , # #1*EE1Z###, Step 14: s 6 , # #1*EE1Z###
Fig.3.T ransition Diagram of the T uring Machine to perform the
multiplication operation
T able. III . T ransition Table of the T uring Machine that perform the
multiplication operation
States
Input
s 0
#,R,s 1
s1
1,R,s 4
1,R,s 2
s2
1,R,s 2
1,R,s 2
#,L,s 3
s3
#,S,
ha
s4
1,R,s 4
*,R,s 5
s5
E,R,s 6
Z,L,s 8
s6
1,R,s6
Z,R,s6
Z,L,s7
s7
1,L,s7
E,R,s5
Z,L,s7
s9
1,L,s8
1,L,s9
*,L,s9
#,R,s0
www.ijetajournal.org
Page 4
International Journal of Engineering Trends and Applications (IJETA) Volume 2 Issue 6, Nov-Dec 2015
Step 7: s 3 , ## 11111####, Step 8: s 3 , ## 11111####
Step 9: s 4 , ## 11111####, Step 10: s 5 , ## 1111E####
Step 11: s 8 , ## 1111E####, Step 12: s 9 , ## 1111E####
Step 13: s 9 , ## 1111E####, Step 14: s 9 , ## 1111E####
Step 15: s 9 , ## 1111E####, Step 16: s 1 , ## 1111E####,
Step 17: s 2 , ### 111E####, Step 18: s 2 , ### 111E####
Step 19: s 2 , ### 111E####, Step 20: s 3 , ### 111E####
Step 21: s 3 , ### 111E####, Step 22: s 3 , ### 111E####
Fig.4.T ransition Diagram of the T uring Machine to perform the
division operation
T able. IV . T ransition Table of the Turing Machine that perform the
multiplication operation
States
Input
1
s0
#,R,s1
s1
#,R,s2
#,R,s10
s2
1,R,s2
,R,s3
s3
1,R,s3
E,R,s3
Z,L,s4
#,L,s4
s4
E,L,s5
E,L,s4
s5
1,L,s8
,R,s6
s6
1,R,s6
Z,L,s8
s8
1,L,s8
,L,s9
Z,L,s8
s9
1,L,s9
#,R,s1
S10
#,R,s10
1,R,s10
#,S, h a
Input : # 111111####
s 0 ,# 111111####
www.ijetajournal.org
Page 5
International Journal of Engineering Trends and Applications (IJETA) Volume 2 Issue 6, Nov-Dec 2015
Step 67: s 10 , ########1Z##, Step 68: s 10 , ########11##,
h a, ########11##,
IV.CONCLUSION
The Turing Machine bi-directional movement both
in forward and backward direction supports the
implementation of the basic calculator. This capability
can be used to build the Turing Machine for finding
modulus value for the given input.
REFERENCE
[1] Available
online
at
https://en.wikipedia.org/wiki/Turing_machine
[2] A.M.Turing, "On Computable Numbers, with
an Application to the Entscheidungs
problem". Proceedings of the London
Mathematical Society. Vol.2, No.42, pp. 230
265, 1937.
[3] N. Chomsky, "Three models for the
description of language", IRE Transactions on
Information Theory, Vol.2, No.3, pp. 113-124,
1956.
[4] A. Church, "The Calculi of LambdaConversion," Annals of Mathematics Studies,
Vol 6, Princeton University Press, Princeton,
New Jersey.1941.
[5] S. C. Kleene, "General recursive functions of
natural numbers," Mathematische Annalen
112:5 (1936) 727-742.
[6] A. A. Markov, "Theory of Algorithms," Trudy
Mathematicheskogo Instituta imeni V. A.
Steklova 42 (1954).
[7] E. L. Post, "Formal reductions of the general
combinatorial decision problem," American
Journal of Mathematics 65 (1943) 197-215.
[8] E. L. Post, "Finite combinatory processes.
Formulation I," Journal of Symbolic Logic 1
(1936), 103-105.
[9] Lin, S. And Rad, T. (1965). Computer
Studies of Turing Machine Problems, Journal
of ACM, Vol. 12, pp. 196-212.
[10] Boolos, G. S. And Jeffrey, R. C. (1974).
Computability
and
Logic,
Cambridge:
Cambridge University Press.
www.ijetajournal.org
Page 6