CSCI 2321 (Computer Design), Spring 2020:
Homework 5
- Credit:
- Up to 10 extra-credit points.
Be sure you have read, or at least skimmed, the assigned readings
from Chapter 3.
Answer the following questions. You may write out your answers by
hand and scan them, or you may use a word processor
or other program, but please submit a PDF,
either directly by e-mail or by putting it in your “graded work”
folder on Google Drive, subfolder TurnIn,
and sending me e-mail that you've done so
(no need to share it with me -- I have access).
(You can make my job easier by not just sharing
another Google Drive file.)
For the e-mail,
please use a subject line that mentions the course and
the assignment (e.g.,
“csci 2321 hw 5” or
“computer design hw 5”).
- (Up to 2.5 extra-credit points.)
Show the bit representation for the base-10 value 63.25
in IEEE 754 single- and double-precision formats
(so you will be writing down a 32-bit value and a 64-bit value).
(To make your answer slightly less unreadable,
you might put spaces between groups of 4 or 8 bits.)
To get full credit you must show your work;
I want you to actually do this problem more or less by hand
rather than using a program that will just show you what's
in memory for a double or float.
- (Up to 2.5 extra-credit points.)
A 32-bit value doesn't have any particular intrinsic meaning;
instead its meaning depends on how it's interpreted.
For the 32-bit value represented by 0x02088022,
what does it mean if interpreted in each of the following ways?
- As a MIPS machine-language instruction
(give the instruction name,
e.g., add, and the operands).
- As an integer in two's complement form
(i.e., a signed number, with the high-order bit
determining the sign).
(You can write down your answer in terms of a sum
of powers of 2 or powers of 16,
e.g., you can write 0x21 as
or
.)
- As a floating-point number
in IEEE 754 single-precision format.
(You can write down your answer in binary scientific
notation,
e.g.,
for .)
- (Optional; up to 2.5 extra-credit points.)
Use the algorithm shown in Figures 3.3 and 3.4,
adapted to work on 6-bit quantities rather than 32-bit
quantities,
to multiply 50 (0x32) by 10 (0x0a).
Convert the result back to base-10 so you can check that
it's right.
(This is very much like the example in Figure 3.6,
but using 6 and 12 bits rather than 4 and 8.)
- (Optional; up to 2.5 extra-credit points.)
Use the algorithm shown in Figures 3.8 and 3.9,
adapted to work on 6-bit quantities rather than 32-bit
quantities,
to divide 60 (0x3c) by 17 (0x11).
Convert the result (quotient and remainder)
back to base-10 so you can check that it's right.
(This is very much like the example in Figure 3.10,
but using 6 and 12 bits rather than 4 and 8.)
Include the Honor Code pledge or just the word “pledged”,
plus at least one of the following about
collaboration and help (as many as apply).1Text in italics is explanatory or something for you to
fill in.
For programming assignments, this should go in the body of the e-mail
or in a plain-text file honor-code.txt (no word-processor files
please).
- This assignment is entirely my own work.
(Here, “entirely my own work” means that it's
your own work except for anything you got from the
assignment itself -- some programming assignments
include “starter code”, for example -- or
from the course Web site.
In particular, for programming assignments you can
copy freely from anything on the “sample programs page”.)
- I worked with names of other students on this
assignment.
- I got help with this assignment from
source of help -- ACM
tutoring, another student in the course, the instructor, etc.
(Here, “help” means significant help,
beyond a little assistance with tools or compiler errors.)
- I got help from outside source --
a book other than the textbook (give title and author),
a Web site (give its URL), etc..
(Here too, you only need to mention significant help --
you don't need to tell me that you
looked up an error message on the Web, but if you found
an algorithm or a code sketch, tell me about that.)
- I provided help to names of students on this
assignment.
(And here too, you only need to tell me about
significant help.)
Include a brief essay (a sentence or two is fine, though you can write
as much as you like) telling me what about the assignment you
found interesting, difficult, or otherwise noteworthy.
For programming assignments, it should go in the body of the e-mail
or in a plain-text file essay.txt (no word-processor files
please).
Footnotes
- ... apply).1
-
Credit where credit is due:
I based the wording of this list on a posting to a SIGCSE mailing list.
SIGCSE is the ACM's Special Interest Group on CS Education.
2020-04-06