ANU: The Australian National University
_____________________________________________________________________
[ANU] [DCS] [Jim Grundy] [COMP2031&ENGN2003] [Lectures] [Laboratories] [Handouts] [Reading] [Help] [Java] [Assessment]
_____________________________________________________________________
[Assessment] [Assignment 1] [Assignment 2] [Assignment 3] [Quiz]
_____________________________________________________________________

COMP2031 & ENGN2003: Assignment 3

Dates

Handed Out: Wednesday 12 May
Due In: 1200 Monday 31 May
Marked: Friday 18 June

Your assignment will be returned to you in your laboratory class in week 13. Uncollected assignments will be available from the department office from the following week.

Solution and Marking

Your assignment will be marked according to a standard marking guide. The files for a sample solution to the assignment can be downloaded below.

Task

Your task is to implement a simple program in the C programming language to analyse the address space and range of devices attached to a computer bus. You are required to test your code using the principles covered in class and to write a short report describing the test cases you used and why.

Detailed information about the assignment is contained in the printed requirements, which is available via the handouts page.

Frequently Asked Questions

  1. What time is the assignment due in?
    The assignment is now due at 1200 (midday) Monday 31 May.
  2. How come I get a compiler error when I try to use a function from the math (or your other favourite) library?
    The compiler doesn't know about the functions supplied by most libraries unless you explictly tell it to link with those libraries. This is done by setting a flag on the compiler command line. If you check the manual page for a function it should tell you what flags you will need to set on the compiler in order to use it. For example, if you look up a function from the math library, pow for example, using the man command (i.e., you type `man pow' at the UNIX prompt) you will see that you need to add `-lm' to the command line to use it.
  3. If the user gives an incorrect input, should the program reprompt them to enter the input, or just give an error message and stop?
    Either would be acceptable, though reprompting would be nicer.
  4. What if the user gives input that isn't even a number?
    Don't worry about that - assume that the input will always be a number.
  5. Do I have to include invariants on the loops?
    Is the pope catholic?
  6. In the example included in the assignment specification, some of the output looks like this:
    The base address of the device is 41984 dec or 0xA400 hex
    I can get my program to print `...0xa400' or `...0XA400', but not `...0xA400' like it is in the sample. What gives?
    What gives is that I should have asked you to print it out as `...0xa400' or `...0XA400'. Either of those will do.
  7. Can I assume there is some limit on the width of the bus? After all, the address space of a nice wide, say 128-bit, bus will be bigger than can be represented in an integer.
    You can assume that the the bus width is narrow enough so that integer computation is sufficient to compute the correct answer.
_____________________________________________________________________
[Assessment] [Assignment 1] [Assignment 2] [Assignment 3] [Quiz]
_____________________________________________________________________
[ANU] [DCS] [Jim Grundy] [COMP2031&ENGN2003] [Lectures] [Laboratories] [Handouts] [Reading] [Help] [Java] [Assessment]
_____________________________________________________________________
Feedback & Queries: Jim Grundy
Date Last Modified: Thu 11 Nov 1999
Universal Ressource Locator: http://cs.anu.edu.au/student/comp2031/assignment3.html