Computer Organization & Design 2. Edition

These are my solutions for some of the exercises of Computer Organization & Design 2. Edition by David A. Patterson and John L. Hennessy. All of them were made by me, with no guarantee whatsoever. They could all be flawed, incomplete, etc., but I still hope that they are useful, correct and understandable. Usage is unlimited, but don't use them for cheating by claiming that you made them yourself, your instructor could be smarter than you think ...

Please note that all of the files here may not show correctly in Notepad, because of Unix linebreaks. Please use any other editor that just works (vim, gvim, kwrite, kate, smarteditor, emacs, whatever).

[right arrow] Sourcecodefiles

Exerciselinkfile typeremarks
Exercise 3.1showC sourceC equivalent of given asm source.
Exercise 4.29showC sourceShows bit representation of float in hex.
Exercise 4.30showC++ sourceShows bit representation of float in hex.
Exercise 7.13showC++ sourceHelper progr. to determine the right answer.
Exercise 7.18showC++ sourceHelper progr. to determine the right answer.
Exercise 7.19showC++ sourceHelper progr. to determine the right answer.
Exercise 7.45showC++ sourceSmall experiment to determine the order of array elements in mem in C/C++.
Exercise 8.13showOpenOffice.org Calc doc.Solution to exercise.
Exercise 8.14showOpenOffice.org Calc doc.Solution to exercise.
Exercise 8.24showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise 8.25 (notes)showremarksSome debug output of XSPIM I needed.
Exercise 8.25 (pseudo)showpseudocodeC-Style pseudocode as preparation for 'the real thing' (MIPS asm).
Exercise 8.25showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise 8.26 (notes)showremarksMemory positions and other infos I needed for debugging.
Exercise 8.26showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.2 (original)showMIPS asm source (run with (X)SPIM)Original source.
Exercise A.2 (shorter)showMIPS asm source (run with (X)SPIM)Shorter version (solution to exercise).
Exercise A.6showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.7showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.8showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.9showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.10showMIPS asm source (run with (X)SPIM)Solution to exercise.
Exercise A.10showC sourcePlays towers of hanoi.



[right arrow] Solutions (prose)

Please note that 'range' doesn't mean that all exercises in between are completely present, there may be gaps.

Chapterlinkrange (first solution)range (last solution)
4showExercise 4.12Exercise 4.41
5showExercise 5.1Exercise 5.36
6showExercise 6.1Exercise 6.29
7showExercise 7.1Exercise 7.45
8showExercise 8.1Exercise 8.24
AshowExercise A.1Exercise A.9
CshowExercise C.2Exercise C.7



[right arrow] Misc. Documents

I've written a short paper about some quirks with XSPIM, some things to know about exception handlers, etc. Probably quite useful: XSPIM_quirks.html.

What could also come handy for some of the exercises: I've written a simple PHP script that takes a hex-dump of a floating point number (32 and 64 bit only at present), analyses it and shows the semantic of the different bits. You can enter the hex dump here, and download the source code here.

Only available in German at the moment, but the usage is extremely straightforward: Just paste the hex dump in the upper field (for example: ABCDEF01), select the endian-ness in the lower field (MIPS is big endian), and push the button. The result should be understandable even if you don't speak a single German word. The most interesting statements are the colored bit dump (red=sign bit, green=exponent bits, blue=mantissa bits) and the final result (in bold).





Letzte Änderung dieser Datei: 03 Mar 2008 00:23
Aktuelle Zeit auf dem Server: 19 May 2012 21:39