COS 111, Fall 1997 - Problem Sets

Problem sets before midterm, numbered 1 through 5


Problem Set 5

Due by 5pm, Tuesday October 21

Brookshear, Chapter Three Review Problems 1; 8; 9; 14; 18; (pg 126)


Problem Set 4

Due by 5pm, Tuesday October 14

Problem 1: (This problem uses the machine language of Appendix C in Brookshear.) Someone wrote the following 2-instruction sequence attempting to interchange the contents of registers 1 and 2:

             4012
             4021

a) This sequence does not work. Execute it assuming the initial contents of register 1 is F5 (hexadecimal) and the initial contents of register 2 is 7A (hexadecimal). Show the result of each instruction, and describe in general terms what actually happens.
b) Write a new instruction sequence that does correctly interchange the contents of registers 1 and 2. (Hint: you need a third register.)

Brookshear, Chapter Two Review Problems 8; 11; 12; 15-c; 39. (pgs 84 - 87)

Note: problem 39 requires you understand an number of concepts we have only touched on in class. In particular, you must understand the use of the logical AND operation of section 2.5 as well as memory-mapped I/O in section 2.6. This problem is only worth 10 points, and you should not spend an inordinate amount of time on it.

Show your work on all problems. Without it, we can't give partial credit.

Extra credit (10 points) The machine of Appendix C in Brookshear has no subtraction operation. In class, we added one. This was not actually necessary, because the operations of Brookshear's machine can be used to form the two's complement of the contents of a register. If a number x is represented in the register, forming the two's complement of x gives the representation of (-x). Then (-x) can be added to the contents of another register, with the effect of subtracting x from the contents of the second register. Give a sequence of machine instructions that takes the contents of register 1, forms the two's complement, and changes the contents of register 1 to be that two's complement.
Hint: consider the logic operation XOR (section 2.5).


Problem Set 3

Due by 5pm, Tuesday October 7

From Brookshear, Chapter One Review Problems 30; 31; 32 - b and c; 44 -f c and e; 46 (pp. 54-55).

From Brookshear, Chapter Two Review Problems 2; 5 (pg 84). For problem 5, use the machine given in Appendix C of Brookshear. Describe the events in English; you do not need to use machine language.

Extra credit (15 points) Brookshear, Chapter One Review Problem 50 (pg 55). Hint: Start by writing the decimal number each bit pattern would represent if it is excess 16 notation and if it is two's complement notation.


Problem Set 2

Due by 5pm, Tuesday September 30

Write an equation using AND, OR, and NOT that expresses the Boolean function given in this truth table:

           x y z | f(x,y,z)
          -------|---------
           0 0 0 |    1
           0 1 0 |    0
           1 0 0 |    1
           1 1 0 |    0
           0 0 1 |    0
           0 1 1 |    0
           1 0 1 |    0
           1 1 1 |    0

From Brookshear, Chapter One Review Problems 3; 4; 15; 16; 17; 40 - d, e and the computation (4 - 12).


Problem Set 1

Due by 5pm, Tuesday September 23

From Brookshear, Chapter One Review Problems 1, 6, 27, 28 (pp. 52-54); for problem 27a, also write the answer in hexadecimal notation.

From Brookshear, Chapter Three Review Problems 21, 23, 27 (pp. 126-127).


Back to COS 111 front page | Schedule and Readings | Labs | Course Newsgroup | Links | What's New?