

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Problem set #8 for the comp 411 - computer organization course offered at the university of north carolina at chapel hill during the fall 2006 semester. The problem set includes four problems related to turing machines, simplified shifts, and control logic rom. Students are required to answer questions about turing machine implementation, behavior, and design, as well as the impact of lori acan's encoding approach on hardware and the utility of her proposed instruction.
Typology: Assignments
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Comp 411 Computer Organization Spring 2006
Problem Set # Issued Thursday,10/25/06; Due Thursday, 11/1/
Homework Information: Some of the problems are probably too long to be done the night before the due date, so plan accordingly. Late homework will not be accepted. Feel free to get help from others, but the work you hand in should be your own.
Problem 1. “How many 1s could a TM write, if a TM could write 1s?”
In the following problem consider Turing machines with the following specifications. Each Turing machine has n states labeled {S1, S2, … Sn}, the Turing machine begins in state S1and halts by transitioning to the special state S0, each cell of the Turing machine’s tape can contain either a “1” or a “0”, and each move of the Turing machine is based solely on its current state and the value of the tape cell under the tape head. A move consists of first modifying the contents of the current tape cell under the head of the Turing machine, moving the tape either left, L, or right, R, followed by a transition to the next state.
The following truth table defines the behavior of a Turing machine. Note that in this FSM the outputs are a function of both the current state and the tape value.
Current State
Tape Value
Write Tape Move
Next State S1 0 1 L S S1 1 1 R S S2 0 1 R S S2 1 1 R S S3 0 1 R S S3 1 1 L S
(A) How large a ROM is required to implement an n-state Turing machine that adheres to the given specification (give the number of words and the bits-per-word)? Ignoring the possibility of equivalent machines, in general how many n-state Turing machines are there?
(B) Given an infinite tape (in both directions), with “0”s in every cell. What will the Turing machine described by the truth table above leave on the tape when it halts? Show the status of the tape in the region around the head after each move.
(C) Design a 2-state Turing Machine that writes as many “1”s as possible onto an all zero (in both directions) tape and then halts. Hint: you can write four “1”s.
(D) Suppose that we choose to ignore the value of the cell under the read head, thus turning our Turing machine into a finite-state machine. In this case, how many “1”s can we write if the FSM has n states?
Problem 2. “Simplified Shifts”
Lori Acan, a budding computer architect, realized that the hardware implementation of the sll, slr, sar, and lui instructions could be simplified, if they were encoded as follows:
op=000000 shamt rt rd 0 func=000000 sll^ rd,^ rt,^ shamt op=000000 shamt rt rd 0 func=000010 srl^ rd,^ rt,^ shamt op=000000 shamt rt rd 0 func=000011 sra^ rd,^ rt,^ shamt op=001111 10000 rt 16-bit immediate lui^ rt,^ imm
(A) Comment on how Lori’s new encoding approach impacts the hardware implementation.
(B) Does Lori’s new encoding impact the hardware implementation of the variable shift instructions (sllv, srav, and srlv)?
Lori has also suggested that the lui instruction be replaced with the following more general instruction:
op=001111 shamt rt 16-bit immediate lsi^ rt,^ imm,^ shamt
Load the specified register, rt, with the value of the signed-immediate constant shifted left by the unsigned instruction field, shamt.
(C) Does Lori’s proposed lsi instruction require any additional hardware modification to the miniMIPS data path beyond those need for her new encodings?
(D) Discuss the utility of Lori’s new instruction. Specifically, what capabilities does it provide over lui. Comment on whether lui a subset of the lsi instruction’s functionality?
(E) Discuss the implications of Lori’s choice to treat the 16-bit immediate value as a signed number. Does it impact the data path? How does the set of constants that can be generated vary in comparison to an unsigned implementation?