Name______

CSCI 232 Computer Architecture Exam 1 Spring 2008

Instructions: This exam is closed book, closed notes, closed neighbor, closed computer, open mind. Read through the entire exam before answering any questions in order to find the easy questions and maximize your score by doing them first. Write legibly—if I can’t decipher it, I have to assume it is wrong. Show your answers in the space provided. If you need more space, use the back of one of the other test sheets and indicate where I might find your answer. Show your work if you want partial credit. There are 100 points on the test, not counting bonus questions. Good luck, and have fun!

1.  (10 points) We said that given AND, OR, and NOT logic functions you can construct any other logic function. We also showed that you only needed NAND or NOR gates to do the same thing. Would XOR gates work? Why or why not?

2.  (5 points) According to DeMorgan’s law, what is (a+b)’ equivalent to?

3.  (5 points) Use the distributive property to rewrite (a+b)(c+a).

4.  (5 points)Construct a T flip-flop using JK flip-flops.

5.  (10 points) Simplify w’x’y’z’ + w’xy’ + wy’z’ + wxy’z + wyz’ using a Karnaugh map.

6.  (10 points) Construct a logic circuit to implement w + xz + w’xy’ using only NAND gates.

7.  (10 points) Use two D flip-flops to construct an up counter that counts from 0 to 3.

8.  Using AND, OR, and NOT gates, build a 1 bit full adder.

9.  (15 points) Considering the following 8 bit patterns as 8 bit words in 1’s complement, 2’s complement, and sign-magnitude notation, what decimal values do they represent?

Bit Pattern / Sign Magnitude value / 1’s Complement value / 2’s Complement value
11111111
00000000
10000000
00110100
10110110

10.  (5 points) What is the current flowing through a 250 Ohm resistor that has a 5 volt difference of potential applied to its two ends?

11.  (5 points) What is the power dissipated by the resistor in question 10?

12.  (5 points) Using 4 full adders and any additional gates you need, design a circuit that adds and subtracts 4 bit 2’s complement numbers.

13.  (5 points) Given two 4 to 2 encoders and using any additional gates you need, design an 8 to 3 encoder. (Remember, an encoder takes n input lines, only one of which is high, and represents that as a log2n bit binary value indicating which of the n bits is high.)

BONUS: (5 points) Use exactly five 5’s and the basic operations of addition, subtraction, multiplication, division, and concatenation to represent as many of the digits from 0 to 9 as you can.

0 = ______

1 = ______

2 = ______

3 = ______

4 = ______

5 = ______

6 = ______

7 = ______

8 = ______

9 = ______

BONUS 2: (5 points) Use JK flip-flops to construct a3 bit Gray code counter that counts 000 -> 001 -> 011 -> 010 -> 110 -> 111 -> 101 -> 100 -> 000…

Page 5