Submit as a PDF file via Moodle by 9:50AM Monday, March 9.
This exam was designed to produce short answers for each question, although
the justification of your answers (showing your work, showing a diagram if relevant, etc.)
is still important. With that in mind, your submission should have the following
structure:
- First, a one-page, neatly typed list of your short answers, without explanation.
- After that, however many pages you wish to include explaning your answers.
Some answers don't require much explanation. However, when you get an
answer wrong, showing your work can lead to significant partial credit if your reasoning
is sound but you made a small mistake.
You may consult your notes, any book, and the Internet. You may
not speak with any person other than Jeff Ondich, electronically or otherwise, about the content
of this exam. If you obtain relevant information from any source other than yourself,
cite your sources clearly.
(6 points)
- What is the 32-bit IEEE 754 representation of the number -43.375? Give your answer
as a single 8-digit hexadecimal number.
- To what number does the 32-bit IEEE 754 representation 0x40266666
correspond? Please express your answer as a fraction.
(Note: since the significand appears to have a repeating pattern, you
may find that extending that pattern infinitely gives you a simpler fraction than
the rounded off version stored in this 32-bit float.)
(10 points) Unicode, UTF-8, and their pals.
- What is the name of the document providing the technical specification of Unicode?
- What is the name of the document(s?) providing the technical specification of UTF-8?
- Who invented UTF-8, and when?
- What is the Unicode code point for the first letter in the Cherokee alphabet (or, more properly,
its "syllabic characters")? Express your answer as a 4-digit hexadecimal number.
- What is the UTF-8 representation of the first letter in the Cherokee alphabet?
Express your answer as a sequence of bytes expressed as 2-digit hexadecimal numbers.
- What is the UTF-16LE representation of the first letter in the Cherokee alphabet?
Express your answer as a sequence of bytes expressed as 2-digit hexadecimal numbers.
- Show the code point for the first letter in the Cherokee alphabet as a 16-bit
binary number. (For readability's sake, write the 16 bits as four blocks of four bits each, with
spaces between them.)
Then, show the UTF-8 bytes encoding that character in binary (again, as space-delimited 4-bit blocks).
Finally, identify which bits in the UTF-8 encoding correspond to the bits in the binary version
of the code point. You can do this by any reasonably readable method (e.g. coloring or underlining
the relevant bits).
- Among Unicode characters whose UTF-8 encodings consist of exactly three bytes, identify
the ones with the smallest and largest code points. Identify these two characters both
by their code points and their Unicode Names. (The Unicode Name of a character is
a text name like "LATIN CAPITAL LETTER A".)
- These two questions are too vague. The students do OK getting
the intended point, but don't reuse. Try something with Python codecs, maybe?
If you store characters encoded using UTF-8 in a file on a big-endian system, and the same characters
on a little-endian system, will the order of bytes in the file differ?
- If you store characters encoded using UTF-16 in a file on a big-endian system, and the same characters
on a little-endian system, will the order of bytes in the file differ?
(2 points) What's your favorite music album? (Don't ask what music I like--I'll tell you that
later. I'm just interested in what you like.)
(9 points) Consider our favorite non-pipelined datapath, Figure 4.17.
- Suppose PC is pointing to an address containing the instruction "li $a1, -45".
List the values for RegDst, Branch, MemRead, MemToReg, MemWrite, ALUSrc, and RegWrite. You
may specify each as 0, 1 or DC (for "don't care").
- As we have noted in class, this datapath does not support the bne
instruction. Suppose we replace the Branch control line with a 2-bit BranchType line BT_1 BT_0,
whose value is 00 if the instruction is not a branch,
01 for beq, and 10 for bne.
Give logic formulas for BT_1 and BT_0 In terms of the opcode
I_31 I_30 I_29 I_28 I_27 I_26 (i.e., the highest-order six bits of the
instruction). Make sure, of course, that your formulas never generate 11.
- Let's call the control line going into the multiplexor in the upper right of the diagram
PCSrc. Now that we have replaced the Branch control with BranchType, give a formula
for PCSrc in terms of BT_1, BT_0, and Zero. If we replace the existing AND gate with this
new formula, we will now have a datapath that supports both
beq and bne.
(9 points) Consider this slightly enhanced version of our
pipelined datapath with forwarding, Figure 4.56. Suppose
further that the sequence of instructions currently in the pipeline is:
lw $A, 24($sp) [MEM/WB]
add $B, $8, $9 [EX/MEM]
sub $5, $6, $7 [ID/EX]
beq $3, $4, loop [IF/ID]
where A and B are register numbers yet to be determined.
As usual in our exercises, assume the current contents of $k = 0x00001000 * k for each
k from 0 to 31.
- What are the current values of the lines marked X, Y, Rs, Rt, and Rd in the EX section
of the datapath?
- What values of A and B would cause ASrc1 = 1 and ASrc2 = 2?
- What values of A and B would cause ASrc1 = 2 and ASrc2 = 1?
- What values of A and B would cause ASrc1 = 2 and ASrc2 = 2?