Docsity

CS30 Fall 2006 Quiz 4 Solutions - Prof. Richard Ord, Quizzes of Computer Science

Toggle sidebar
bg1
Signature __________________
Name_______________
cs30x____
Student ID _________________
Score:
Quiz 4
CSE 30
Fall 2006
#1. In a typical CISC architecture
A) Caller B) Called/Callee
_____ pushes the arguments onto the stack.
_____ allocates space for local variables.
_____ allocates space for the return value.
_____ saves the PC (program counter) as the return address.
_____ accesses the formal parameters via an offset from the FP (frame pointer).
_____ allocates space for the formal parameters.
#2. a) Convert -142.625
10
to binary fixed-point and single precision IEEE floating-point representation
(expressed in hexadecimal).
binary fixed-point __________________________________ x 2
0
IEEE floating-point _______________________________________ (hexadecimal)
b) Convert 0x42558000 (single precision IEEE floating-point representation) to fixed-point decimal.
fixed-point decimal ______________________________ (decimal / no exponential notation)
(over)
pf2

Partial preview of the text

Download CS30 Fall 2006 Quiz 4 Solutions - Prof. Richard Ord and more Quizzes Computer Science in PDF only on Docsity!

Signature __________________ Name_______________

cs30x____

Student ID _________________ Score:

Quiz 4

CSE 30

Fall 2006

#1. In a typical CISC architecture

A) Caller B) Called/Callee

_____ pushes the arguments onto the stack.

_____ allocates space for local variables.

_____ allocates space for the return value.

_____ saves the PC (program counter) as the return address.

_____ accesses the formal parameters via an offset from the FP (frame pointer).

_____ allocates space for the formal parameters.

#2. a) Convert -142.625 10 to binary fixed-point and single precision IEEE floating-point representation

(expressed in hexadecimal).

binary fixed-point __________________________________ x 2^0

IEEE floating-point _______________________________________ (hexadecimal)

b) Convert 0x42558000 (single precision IEEE floating-point representation) to fixed-point decimal.

fixed-point decimal ______________________________ (decimal / no exponential notation)

(over)

#3. Name 1 specific disadvantage of open subroutines.

Name 1 specific disadvantage of leaf subroutines.

#4. What gets printed with the function call mystery( 5 );?

int mystery( int param ) { int local = 40;

if ( local > param ) { local = local - param; printf( "%d\n", local ); /* Output the value of local followed by a newline / param = mystery( param + 10 ) + local; printf( "%d\n", param ); / Output the value of param followed by a newline */ } else { printf( "Stop\n" ); }

return local; }

Put answer here