Docsity

Past Exam Questions | Introduction to Computing | E E 306, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
Department of Electrical and Computer Engineering
The University of Texas at Austin
EE 306, Fall, 2004
Yale Patt, Instructor
TAs: Siddharth Balwani, Linda Bigelow, Tommy Buell, Jeremy Carrillo, Aamir Hasan,
Danny Lynch, Rustam Miftakhutdinov, Veynu Narasiman, Vishal Parikh, Basit Sheikh
Final Exam, December 10, 2004
Name:
Problem 1 (20 points):
Problem 2 (15 points):
Problem 3 (15 points):
Problem 4 (15 points):
Problem 5 (15 points):
Problem 6 (15 points):
Problem 7 (15 points):
Problem 8 (15 points):
Total (125 points):
Note: Please be sure that your answers to all questions (and all supporting work that is required) are
contained in the space provided.
Note: Please be sure your name is written legibly on each sheet of the exam.
I will not cheat on this exam.
Signature
GOOD LUCK!
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Past Exam Questions | Introduction to Computing | E E 306 and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

Department of Electrical and Computer Engineering The University of Texas at Austin

EE 306, Fall, 2004 Yale Patt, Instructor TAs: Siddharth Balwani, Linda Bigelow, Tommy Buell, Jeremy Carrillo, Aamir Hasan, Danny Lynch, Rustam Miftakhutdinov, Veynu Narasiman, Vishal Parikh, Basit Sheikh Final Exam, December 10, 2004

Name:

Problem 1 (20 points):

Problem 2 (15 points):

Problem 3 (15 points):

Problem 4 (15 points):

Problem 5 (15 points):

Problem 6 (15 points):

Problem 7 (15 points):

Problem 8 (15 points):

Total (125 points):

Note: Please be sure that your answers to all questions (and all supporting work that is required) are contained in the space provided.

Note: Please be sure your name is written legibly on each sheet of the exam.

I will not cheat on this exam.

Signature

GOOD LUCK!

Problem 1 (20 points):

Part a (5 points): The following program is assembled. Complete the symbol table entry for THIS.

Note: Descriptions for pseudo-ops such as .ORIG, .END, .FILL, .BLKW, and .STRINGZ can be found in the auxiliary packet.

.ORIG x LD R0,START TRAP x HALT START .STRINGZ "Let’s go!" THIS .STRINGZ "and THAT" .END

Symbol Address START x

THIS

Part b (5 points): The finite state machine shown below has one external input and two external outputs. The output for each state is shown inside the state. The machine is initially in state A and receives an input string of n 1’s followed by a single 0. What does a final output of 00 signify about n?

State D State A State B State C

Answer:

Part c (5 points): During the execution of the following program, how many times does the instruction labeled AA get executed?

.ORIG x AND R1, R1, # ADD R3, R1, # AA ADD R3, R3, R BRnp AA HALT .END

Answer:

Problem 2 (15 points):

In this problem you are asked to design a logic circuit that computes nm, for 2-bit unsigned integers n, m.

n

m

2

2

n k

m

n^ m (expressed as rk- 1 rk- 2 … r 0 )

Part a : What is the maximum value of n? of m?

Part b : What is the maximum possible value for nm?

Part c : In the block diagram above, what is the value of k?

Part d : Construct the truth table for the logic function that computes nm. (Assume 0^0 = 1)

Problem 2 (continued) :

Part e : Construct the logic circuit for the output r 3.

Problem 3 continued :

Part a : In 15 words or fewer each, what function is performed for each of the four values of X.

X=

X=

X=

X=

Part b : What important situation can no longer occur if we replace WE by the 2-bit signal X? (In 15 words or fewer, please.)

Answer:

Problem 4 (15 points):

What does the following program do? Explain in the box provided below.

.ORIG x AND R1, R1, # AND R2, R2, # LDI R0, IN_ADDR L0 BRz END BRp L ADD R1, R1, # L1 ADD R0, R0, R BRnzp L END ADD R1, R1, #- BRnz L ADD R2, R2, # L2 ST R2, OUTPUT HALT IN_ADDR .FILL x OUTPUT .BLKW x .END

Answer:

Problem 6 (15 points):

It has been suggested that we use the unimplemented LC-3 opcode to add push and pop to the LC-3 ISA, as follows:

PUSH: 1110 SR 000 0 00000 POP: 1110 DR 000 1 00000

The assembly language syntax is:

PUSH SR POP DR

Pushing and popping works as discussed in the textbook, using R6 as the stack pointer. The table shown below shows the contents of several memory locations before and after the following assembly language program is executed.

Before After x3FFB 0 8 x3FFC 0 16 x3FFD 0 4 x3FFE 0 4 x3FFF 0 3

LD R6, STACK; *

AND R0, R0 #0; *

PUSH R

ADD R1, R1,

PUSH R

ADD R2, R1,

PUSH R2 ; *

PUSH R

ADD R3, R2, R2 ; *

PUSH R

PUSH R

ADD R3, R2, R

PUSH R

HALT

STACK .FILL x .END

Note that three of the instructions are missing from the assembly language program, and that four instruc- tions have a * in the comment field.

Your job:

Part a : Fill in the three missing instructions in the program, one per box, in the boxes provided.

Part b : For each of the four instructions with the * comment, provide the corresponding machine language instruction in the box to the right of it.

Part c : What is the contents of R6 after this program halts?

Problem 7 (15 points):

What does the following program do? Explain in not more than 15 words in the box provided below.

.ORIG x AND R1, R1, # ADD R2, R1, # ADD R3, R1, # LDI R0, IN_ADDR L0 AND R4, R0, R BRz L ADD R1, R1, # L1 ADD R1, R1, R ADD R3, R3, R ADD R2, R2, #- BRp L AND R4, R0, R BRz L ADD R1, R1, # L2 ST R1, OUTPUT HALT IN_ADDR .FILL x OUTPUT .BLKW x .END

Answer:

If you are not sure what this program does, answer the following questions for partial credit. If you know what it does, you do not need to answer these questions.

Part a (1 points): Where in memory is the input to the program:

Answer:

Part b (1 points): Where in memory is the output of the program:

Answer:

Part c (2 points): At the end of the program what are the contents of the following registers (for any input):

R2: R3:

Part d (1 points): What input will cause the output to be 0:

Answer:

Part e (2 points): What is the output for the following binary inputs: