CS30 Fall 2005 Quiz 4 - SPARC Architecture and IEEE Floating-Point - Prof. Richard Ord, Quizzes of Computer Science

The solutions to quiz 4 of the cs30 course offered in fall 2005. It covers topics such as accessing local variables in the sparc architecture, using specific instructions, and converting between binary fixed-point and ieee floating-point representations. Additionally, it discusses the limitations of leaf subroutines and the output of a given function call.

Typology: Quizzes

Pre 2010

Uploaded on 03/28/2010

koofers-user-0iu
koofers-user-0iu 🇺🇸

5

(1)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Signature __________________ Name_______________
cs30x____
Student ID _________________ Score:
Quiz 4
CSE 30
Fall 2005
#1.
To access local variables stored on the Runtime Stack in the SPARC architecture, you use a
____________________ offset relative to register ___________.
The ___________ instruction saves the current value of %pc in %o7.
The ret instruction adds __________ to the value in __________ and stores the result in __________.
In gdb, how do you set a breakpoint at a function named scooby?
_______________________________
The ___________ registers in the current register window set are mapped back to the ___________ registers as
part of the restore instruction.
________________ subroutines support recursion.
If we have a ret instruction, the next instruction should be ___________________.
#2.
a) Convert -76.12510 to binary fixed-point and single precision IEEE floating-point representation (expressed in
hexadecimal).
binary fixed-point __________________________________ x 20
IEEE floating-point _______________________________________ (hexadecimal)
b) Convert 0x428A8000 (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 2005 Quiz 4 - SPARC Architecture and IEEE Floating-Point - Prof. Richard Ord and more Quizzes Computer Science in PDF only on Docsity!

Signature __________________ Name_______________

cs30x____

Student ID _________________ Score:

Quiz 4

CSE 30

Fall 2005

To access local variables stored on the Runtime Stack in the SPARC architecture, you use a

____________________ offset relative to register ___________.

The ___________ instruction saves the current value of %pc in %o7.

The ret instruction adds __________ to the value in __________ and stores the result in __________.

In gdb, how do you set a breakpoint at a function named scooby?


The ___________ registers in the current register window set are mapped back to the ___________ registers as part of the restore instruction.

________________ subroutines support recursion.

If we have a ret instruction, the next instruction should be ___________________.

a) Convert - 76.125 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 0x428A8000 (single precision IEEE floating-point representation) to fixed-point decimal.

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

(over)

#3. Name 2 limitations of leaf subroutines.

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

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

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

return local; }