q3

q3 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Fall 2010 Quiz #3: November 5, 2010 Name Athena login name Score TA: Caitlin, 26-322 WF 10 WF 11 TA: Quentin, 34-303 WF 11 WF 12 TA: : Sabrina, 34-304 WF 12 WF 1 TA: : Steve, 34-303 WF 2 Note: There is reference material, of possible use in solving problems on this quiz, on the backs of quiz pages. Problem 1 (4 points): Wish I’d stayed awake during that lecture . .. For each of the following statements, indicate whether the statement is TRUE : proven fact; or ACCEPTED : unproven but generally accepted as true; or UNKNOWN : neither proven nor disproven; or FALSE : known to be untrue. (A) A Universal Turing Machine can compute every well-defined integer function. Circle one: ... TRUE . .. ACCEPTED . .. UNKNOWN . .. FALSE (B) Every well-defined integer function that can be computed by any digital computer that could possibly be built is computable by some Turing machine. Circle one: ... TRUE . .. ACCEPTED . .. UNKNOWN . .. FALSE (C) Bertrand Russell is the Pope. Circle one: ... TRUE . .. ACCEPTED . .. UNKNOWN . .. FALSE (D) In mathematics, there are statements that are both well-defined and true, but which cannot be proven. Circle one: ... TRUE . .. ACCEPTED . .. UNKNOWN . .. FALSE 6.004 Fall 2010 - 1 of 6 - Quiz #3 1 2 3 4 / 4 / 11 / 8 / 7 / 30
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 2 (11 points): Reverse Engineering a Mystery Function You’ve been commissioned by a government agency to reverse-engineer a mysterious procedure found on the disk of a Beta system used by a cyber-terrorist cell. You’ve given an incomplete copy of the C source language for the function f (shown below), as well as its complete translation to Beta assembly code shown to the right: // Mystery function: int f(int x) { int a = x & 5; // bitwise AND if (x == 0) return 0; else return ?????; } Note: you may wish to refer to reference material on the backs of quiz pages. (A) (2 points) Give the missing expression shown in the C code as “ ????? Write C expression for ????? above (B) (1 point) Is the value of the local variable a stored in the stack frame of the Beta program? If so, give its offset relative to the contents of BP ; otherwise, write “None”: Offset of a , or None: ___________ (C) (3 points) Give the 32-bit binary translation of the
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

q3 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online