25.12.2012 Views

MIPS Assembly Language Programming

MIPS Assembly Language Programming

MIPS Assembly Language Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.5. EXERCISES 15<br />

1.5 Exercises<br />

1.5.1<br />

Complete the following table:<br />

1.5.2<br />

Decimal 123<br />

Binary 01101100<br />

Octal 143<br />

Hex 3D<br />

ASCII Z<br />

1. Invent an algorithm for multiplying two unsigned binary numbers. You may<br />

find it easiest to start by thinking about multiplication of decimal numbers<br />

(there are other ways as well, but you should start on familiar ground).<br />

1.5.3<br />

1. Invent an algorithm for dividing two unsigned binary numbers. You may find<br />

it easiest to start by thinking about long division of decimal numbers.<br />

2. Your TF complains that the division algorithm you invented to solve the previous<br />

part of this problem is too slow. She would prefer an algorithm that gets<br />

an answer that is “reasonably close” to the right answer, but which may take<br />

considerably less time to compute. Invent an algorithm that has this property.<br />

Find the relationship between “reasonably close” and the speed of your<br />

algorithm.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!