CS481 Webpages: main · syllabus · papers · assignments · listserver · John Cochran (TA)

CS481: Assignment 1 Sample Answers

A1 - Due: Tuesday 2003.02.17. Released: 2003.02.06

Abridged Answers: Below we give abridged sample answers to help you check against your own.

  1. 1-7-68 (Compare display technologies.) Document the current price of RAM.

    Answer: 25 x 80 x 1 = 2,000 bytes (1 byte per position). 1024 x 768 x 3 = 2,359,296 bytes (3 bytes = 24 bits), say about 2MB. At 1980 prices, it's about $10 for the 25x80 and about $11,520 for the bitmap. Today's prices, range varies from about $0.25-$1/MB (DRAM) to tens of dollars; several forms of documenting price of RAM are possible, as discussed in class.

  2. 1-12-68 (Alternative design for MMU.) Hint: Concurrency is possible on low-level MMU operations.

    Answer: Both methods are logically equivalent, because they produce the same physical address for legal addresses, and fault for addresses out of bounds. However their performance will be different - the insight here is that if one adds first and compares the real address against the limit, then the addition work is always done, even for illegal addresses, and the comparison cannot be started until the addition is complete. In the other case, an illegal address can be detected before completing or even starting the addition, and in particular the comparison and the addition can be done in parallel. In the parallel case, when the comparison indicates an illegal address, the addition can be simply abandoned.

  3. 1-21-69 (Compare types of files.)

    Answer: Block files admit seeking to specific blocks (and subsequent reading or writing there), giving random-access at block granularity. Character files do not enjoy such access.

  4. 2-1-153 (Missing transitions in process state diagram.)

    Answer: Two transitions are missing in the state diagram; let us consider them in turn. Transition "5", from Blocked to Running is unnecessary but plausible. Generally, a process goes from Running to Blocked to Ready, even it no other process runs in the interim. But one can argue for "5", as follows. Suppose process P is blocked, say on I/O, and no other (user!) process is ready. Then the event for which P was blocked happened (say I/O completed) and the kernel decides to run P again. However, it is not necessary to represent the situation with this transition -typically the process will get back to Running via Ready, i.e., via "4" and "3" in the diagram. Transition "6" from Ready to Blocked is implausible, because by definition a process becomes blocked by executing a Down on a semaphore or some I/O or other synchronous event, and also by definition a process that is ready is not blocked and not running, so while in that state it cannot progress to the part of its code where a blocking event is to be executed.

  5. 2-11-154 (Compare single-threaded to multiple-threaded server.)

    Answer: A single-threaded server deals with all requests sequentially, hence it takes (2/3) 15 msec + (1/3)(15+75) msec on average to process requests, i.e., 40msec, for a rate of 25 requests a second. A multithreaded server can accept a request every 15 msec, because if the request is a miss, during the 75 msec wait by its thread, other threads can execute. Thus its rate is 66.6/sec

 

Page Created 2003.02.20 11:00