Question

Draw a Turing Machine that increments a ternary number by 1. Also, explain your approach in...

Draw a Turing Machine that increments a ternary number by 1. Also, explain your approach in brief.

Note: For example, if the input is 22 (representing the decimal number 8), then the output should be 100 (representing the decimal number 9). For this task, consider a two-sided infinite tape

Show the computation (sequence of configurations) of the above Turing Machine for input “22”.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

0->0, L 4o 4i 0 1-1, L B->0, R 0, L 1>1, L 0->0,L 0->0, R B-> B, R 09B, R 95 qs 97Note: B is for Blank.

Algorithm:

  1. Add a 0 at the beginning of the string (To be able to handle overflow).
  2. Traverse through the string to get to the LSB.
  3. Traversing backwards (LSB to MSB); use NOT operator on every 1 until you reach a 0 (Since we added a 0 at the beginning, we are certain that we will eventually reach a 0)
  4. use NOT operator on said 0.
  5. Traverse backwards until you reach the beginning of string.
  6. If the first bit is equal to 0, you have to remove it with blank.
  7. If the first bit is equal to 1, it means that overflow has occurred. (Nothing needs to be done in if you reach this step)
Add a comment
Know the answer?
Add Answer to:
Draw a Turing Machine that increments a ternary number by 1. Also, explain your approach in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Turing machine that subtracts two from the input string corresponding a ternary number.

    Implement a Turing machine that subtracts two from the input string corresponding a ternary number. More specifically, suppose w = an−1an−2 . . . a1a0 is the input string with ai ∈ {0, 1, 2}. Your Turing machine should subtract two from w “in-place”, i.e., at the end of the computation the tape should contain the result, w − 2 and the tape head should be at the start of that string. Upon a successful operation, halt on accept. Otherwise,...

  • Third time posting, can someone answer please. Question 2. Consider the Turing machine defined as follows....

    Third time posting, can someone answer please. Question 2. Consider the Turing machine defined as follows. input alphabet {1} Tape alphabet = { 1,0, x,□} where □ represents a blank Set of states (A, B, C, D Initial state A set of accept states = {D} Transition function: 6(A, z) = (A,z, R) 6(A, □)-(C,D, L) (i) Draw a transition graph for this Turing machine. (ii) Determine the output of the Turing machine for each of the following input i)...

  • Write a TM (Turing Machine) program that adds two base two numbers. Input is two nonnegative inte...

    Write a TM (Turing Machine) program that adds two base two numbers. Input is two nonnegative integers in base 2 with a plus sign between them. Output is their sum in base 2, with nothing else left on the tape. So first decrement, then increment. Use an online Turing Machine Simulator to see how it works. Use the following language for the program: current state, read symbol, next state, write symbol, direction [directions are (< left, > right, s stay)]...

  • Answer and explain your answer QUESTION 5 A Turing machine M with start state go and...

    Answer and explain your answer QUESTION 5 A Turing machine M with start state go and accepting state of has the following transition function: 1 8(q,a) 0 B 40 (90,1,R) (91,1,R) (9f,B,R) 91 (42,0,L) (42,1,L) (92,B,L) 42 (90,0,R) 9f Deduce what M does on any input of O's and I's. Hint: consider what happens when M is started in state qo at the left end of a sequence of any number of 0's (including zero of them) and a 1....

  • Please answer WARM-UP and PREDICTION. PROBLEM #1: ELECTRIC FIELD VECTORS As part of your internship with...

    Please answer WARM-UP and PREDICTION. PROBLEM #1: ELECTRIC FIELD VECTORS As part of your internship with a local power company, you have been assigned to a team reviewing published research about the effects of electric fields on human health. To evaluate the merits of apparently conflicting research, you need a computer program to simulate the electric field due to complicated charge configurations. Your team leader has assigned you the task of evaluating such a program. To test the program, you...

  • PLEASE ANSWER QUESTION 1 & 2. ALSO PLEASE SUBMIT CODE + PDF OF REPORT/ASSIGNMENT Problem1 You are choreographing a...

    PLEASE ANSWER QUESTION 1 & 2. ALSO PLEASE SUBMIT CODE + PDF OF REPORT/ASSIGNMENT Problem1 You are choreographing a circus show with various animals. For one act, you are given two kangaroos on a number line ready to jump in the positive direction (i.e, toward positive infinity). The first kangaroo starts at location z1 and moves at a rate of vl meters per jump. The second kangaroo starts at location z2 and moves at a rate of u2 meters per...

  • C++: Translating mRNA sequence help Homework Description Codon 1 You are working in a bioinformatics lab...

    C++: Translating mRNA sequence help Homework Description Codon 1 You are working in a bioinformatics lab studying messenger RNA (mRNA) sequences. mRNA is a sequence of the nucleotide bases (Adenine, Cytosine, Guanine, and Uracil) that conveys information stored in DNA to Ribosomes for translation into proteins. The bases in the sequences are denoted by the first letters of the nucleotide bases (e.g. A, C, G, and U). A sequence of mRNA is made up of hundres to thousands of nucleotide...

  • Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b):...

    Use only if else nested if else only otherwise your answer won't be entertained. Problem 1(b): Write a program that gives remainder without using modulus operator and loops. The first number entered will be dividend and second number entered will be divisor. Sample input: 15 6 Sample output: Remainder is 3 In a right triangle, the square of the length of one side is equal to the sum of the squares of the length of the other two sides. Write...

  • number 4 and 5 please! PROBLEM STATEMENT A logic circuit is needed to add multi-bit binary...

    number 4 and 5 please! PROBLEM STATEMENT A logic circuit is needed to add multi-bit binary numbers. A 2-level circuit that would add two four-bit numbers would have 9 inputs and five outputs. Although a 2-level SOP or POS circuit theoretically would be very fast, it has numerous drawbacks that make it impractical. The design would be very complex in terms of the number of logic gates. The number of inputs for each gate would challenge target technologies. Testing would...

  • IN JAVA PLEASE HELP! ALSO PLEASE ADD COMMENTS Summary Build two classes (Fraction and Fraction Counter)...

    IN JAVA PLEASE HELP! ALSO PLEASE ADD COMMENTS Summary Build two classes (Fraction and Fraction Counter) and a Driver for use in counting the number of unique fractions read from a text file. We'll use the ArrayList class to store our list of unique Fraction Counters. Rather than designing a monolithic chunk of code in main like we did in the previous homework, we'll practice distributing our code into containers (called classes) that you will design specifically to tackle this...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT