CS202 - Assignment Four

Due: 2016-03-16 11:55p

Objectives

Problems

  1. [6 points] In class, we looked at the four generations of computers. You will note that the fourth generation started back in the seventies, and some significant advances in computing have come about since then. Are we still in the fourth generation, or are we in the fifth or the sixth? Tell me what generation you think we are currently in and what were the defining technologies that defined them. If you think we are still in the fourth generation, provide an argument for that instead. Your response should be short (no more than two paragraphs). This is a critical thinking exercise, so there isn’t a “correct” answer, but I want to see that some thought went into this. Also, you will find that there are many opinions online about what the fifth generation (and sixth) are. Most significantly, the Japanese set up a Fifth Generation project to push computing in the direction they felt it should go. I don’t want to hear about these — I want your own opinion informed by your personal observations. If you feel like you are too close to really see any changes (they did happen during your lifetime, after all, try to imagine yourself as a computer scientist from the 70’s and speculate what would blow your mind).

  2. [10 points] Martin, problem 16

  3. [15 points] Martin, problem 22

  4. [9 points] Martin, problem 24

  5. [12 points] Martin, problem 25

[20 points] Floating point

Martin describes an 8-bit floating point representation. I would like you to write a program that prints out all 256 different values that this representation can represent. Martin discusses both excess-4 and excess-3 for the representation of the exponent. Please use excess-3.

I strongly recommend starting by writing a function that takes an integer, uses bit manipulation to read the first byte out in Martin’s format (i.e., separates out the sign, exponent, and mantissa), and converts it into a floating point representation.

Note that Martin essentially follows the IEEE standard with respect to special values. If the exponent is 000, then the number is denormalized (i.e., no ghost 1). If the exponent is 111, then the number is +/- infinity if the mantissa is 0, and NaN if it is not.

For the output, I would like a two digit hexadecimal representation of the number being converted and the converted value. Keep the output of your program to this exact format (we will be diffing your output against mine). Here is what the start of the output looks like:

> ./float
00: 0.000000
01: 0.015625
02: 0.031250
03: 0.046875
04: 0.062500
05: 0.078125
06: 0.093750
07: 0.109375
08: 0.125000
09: 0.140625
0a: 0.156250
0b: 0.171875
0c: 0.187500
0d: 0.203125
0e: 0.218750
0f: 0.234375
10: 0.250000
11: 0.265625
12: 0.281250
13: 0.296875
14: 0.312500
...

Put this in a file called hw4.c


Turning in your work

My preference for the first part of this assignment would be that you turn it in electronically in a PDF or RTF file (not in a .doc or .docx file). however, I realize that since I’m asking you to do math the long way, I will accept handwritten submissions (provided I can actually read your handwriting).

The two programs should be handed in as separate files as indicated by their descriptions. Each function should be commented to describe its function (including extra information were requested). The top of each file should also include a comment including your name, date, assignment, compile instructions, and run instructions.

Submit the completed assignment on Moodle.