CSC 406: Systems I

Homework 2

Due by 5:45 pm on Thursday, September 23



Please write precise and concise answers.

Reading

Read sections 2.1 and 2.2 of BO as well as the lecture 2 notes.

BO = Computer Systems by Bryant and O'Hallaron

Make sure that you work out every practice problem in BO! Peek at the solutions (presented at the end of the chapter) if you have to.

Assignment

If you have not already, subscribe to the class Discord server.

Unzip file hw2.zip
$ unzip /home/lperkovi/public/hw2.zip
and move to newly created directory hw2:
$ cd hw2
Open file hw2.c for editing and do the homework:
$ emacs hw2.c
Solve the following 4 problems and write the solutions as a comment at the beginning of file hw2.c:

1. Convert 
0xFEBADC98 from hex to binary.

2. Convert 10101111 01010011 10111001 10001010 from binary to hex.

3. Convert 0x0000AB from hex to decimal notation.

4. Convert  11111110  from binary to decimal notation.

Then do p
roblems 2.59, 2.60, 2.61 (A,B,C only), 2.66, and 2.68 in BO by implementing the appropriate functions in hw2.c.

Note that the main program is used to test your implementations. When done, submit the homework as follows:
$ make submit
cp -i hw2.c /home/lperkovi/dropbox/hw2-`whoami`.c