Computer Science 361.01

Computer Organization

Fall 2003

Homework 5: Due Tuesday, October 7th at 10:00 AM

70 points

 

Please do individually and begin early.

I will not answer questions on this assignment anytime after Monday 4PM.

 

 

1. (20 points) Complete the BitString.cpp implementation so that it converts any given part of a BitString to the equivalent decimal integer.

 

 

2. (30 points) Write and test Pep/7 Level 3 programs that will

 

a)  solve problem 14 page 175 – an easy warmup to get you used to the software!

 

b)  solve problem 16 page 175 – you’ll have to wrestle with the fact that input and output is always a single byte.  You’ll have to mask back and forth between integers and chars.

 

c)  solve the problem we outlined in class that would cause us to use a “branch”:

 

            Load a number from memory into the Accumulator.

            Branch if non-negative (greater than or equal to zero) to the Store instruction.

            Multiply (effectively) contents of Accumulator by –1.

            Store byte from Accumulator into Memory.

            Write the byte to output.

            Stop.

           

 

3. (20 points) Do page 174 #6 parts a, b, c, g, h.  Assume at the start of each part that the contents are what are shown on the bottom of the previous page.