CMSI 2210: Homework Assignment #3
The following guidelines are expected for all homework submissions:
- All homework must be typed. Homework which is not typed will be returned ungraded and will be
subject to the late homework guidelines as set out on the syllabus page. PLEASE DO NOT scribble
something on lined paper and rip it out of your spiral notebook — hanging chads went out
with the presidential election in 2000.
- I don't care too much about what font you use or how large your margins are; however, you might
want to check out a monospaced font for typing code, as it will be easy to see the indentations.
- Speaking of indenting, PLEASE DON'T USE TABS TO INDENT YOUR CODE. Tabs can often
get interpreted differently by different computers and applications, and could make code that is
nicely formatted on your computer look
all over the map
on my computer or
printer. USE SPACES INSTEAD.
You can set up almost every modern text editor to insert spaces whenever you press the TAB key, or
you can simply pound the spacebar.
- Work with a group. I can't stress this enough; part of this policy is don't
split up the work – WORK TOGETHER on the assignment! DO NOT
DIVIDE UP THE WORK!. Doing assignments this way mimics an industry code development model
called
pair programming
which is part of the Extreme Programming [Agile] software development
method. Agile teams are prevalent in the industry now, so feel free to collaborate in your groups
as much as you want, doing the entire assignment together. Only submit ONE copy for the group.
- DO NOT SHARE YOUR WORK BETWEEN GROUPS. Doing so will count as plagiarism. If you
wish to discuss solutions with another group over coffee in the Lair, that's fine as long as it is
kept at the conceptual and you don't share your code between groups. Each group needs to
turn in its own unique version of the solutions.
- Repeat: you only need to turn in one copy per group.
- Submit your homework through GitHub, in your repository, and be sure to make
me a contributor so I have access. I cannot evaluate what I cannot see! If
I can't upload to your repo, you will not get an evaluation for the assignment.
Problems for Assignment #3
Learning Outcomes: 1) Understanding different
number representations; 2) Practice with the different common number bases used by computers;
3) Practice translating values between different bases; 4) Practice translating values between different
representations; and 5) Practice/understanding of carry, overflow, saturated, and modular computer
arithmetic
Please do all these problems without using a computer or calculator. The purpose of these
exercises is to help you develop your skill. Taking the time to practice will give you a better ability
and understanding of the material.
Questions about carry and overflow assume signed modular arithmetic, not saturated arithmetic.
These problems give you practice to demonstrate a basic understanding of the concepts of translating
between binary and decimal and hexadecimal, along with modular/saturated arithmetic and carry/overflow.
The problems in this section are very straightforward and should not be hard ~ you'll get good practice
here!
- Hex FAC3 in binary is:
- Hex FAC3 as an unsigned decimal is:
- Hex FAC3 as a signed decimal is:
- Hex 0064 in binary is:
- Hex 0064 as an unsigned decimal is:
- Hex 0064 as a signed decimal is:
- Hex 8000 in binary is:
- Hex 8000 as an unsigned decimal is:
- Hex 8000 as a signed decimal is:
- Decimal 8000 encoded in 16-bits (unsigned) is in hex:
- Decimal 8000 encoded in 16-bits (signed) is in hex:
- Decimal -11 encoded in 16-bits (signed) is in hex:
- Decimal -32717 encoded in 16-bits (signed) is in hex:
- Binary 10111101 in hex is:
- Binary 1011110100000001 as an unsigned decimal is:
- Binary 1011110100000001 as a signed decimal is:
- If we had 20-bit registers, the smallest signed decimal integer value would be:
- If we had 20-bit registers, the largest signed decimal integer value would be:
- The modular sum of 16-bit hex values 3511 + 4FFC is:
- The saturated sum of 16-bit hex values 3511 + 4FFC is:
- The 16-bit operation 0x3511 + 0x4FFC has a carry (Y or N):
- The 16-bit operation 0x3511 + 0x4FFC has a overflows (Y or N):
These problems give you more to think about with the concepts of number conversion and arithmetic.
- The modular sum of 16-bit hex values 6159 + F702 is:
- The saturated sum of 16-bit hex values 6159 + F702 is:
- The 16-bit operation 0x6159 + 0xF702 has a carry (Y or N):
- The 16-bit operation 0x6159 + 0xF702 has a overflows (Y or N):
- The modular sum of 16-bit hex values EEEE + C00C is:
- The saturated sum of 16-bit hex values EEEE + C00C is:
- The 16-bit operation 9EEE + AB0C has a carry (Y or N):
- The 16-bit operation 9EEE + AB0C has a overflows (Y or N):
- The negation of 16-bit word 0xB00F is:
- The negation of 16-bit word 0x2232 is:
- The negation of 16-bit word 0x8000 is:
- The negation of 32-bit word 0xFFF329BA is:
- 96.03125 as a 32-bit float, in hex is:
- -16777216 as a 32-bit float, in hex is:
- Hex 43700000, when interpreted as an IEEE-754 pattern, is in decimal:
- Hex C0FF0000, when interpreted as an IEEE-754 pattern, is in decimal:
These problems are difficult and will require you to do some research to get the answers.
They are considered optional and you will get extra credit for getting them
correct, one point per problem. For any you attempt for which your answer is
incorrect, you will NOT be penalized, you just won't get any credit for
that one.
- The largest finite IEEE-754 single precision float, in hex is:
- The smallest finite IEEE-754 single precision float, in hex is:
- The largest nonzero negative IEEE-754 single precision float, in hex is:
- The smallest nonezero positive IEEE-754 single precision float, in hex is:
- -5.125 X 290 as a 32-bit float, in hex is:
- 2-138 as a 32-bit float, in hex is:
- 1.5 X 2-143 as a 32-bit float, in hex is:
- Try this for a challenge, a puzzle, or the experience:
Hex C059000000000000, when iterpreted as a 64-bit IEEE-754 pattern, is in decimal: