CSC 258 midterm sample questions

No aids permitted, but there is a list of algebraic identities attached.
Time allotted: about 40 or 50 minutes (but it might be a bit longer than the list of questions below, I think)

(Something like this note will appear on the midterm cover:)
Since time is short, be careful not to get stuck on one question to the exclusion of others. Not everyone will necessarily be able to finish this test within the ?? minutes. The amount of marks or answer-space allotted does not indicate how long it will take you to complete the question nor the size of the correct answer.
(The answer space doesn't appear below, obviously.)


1. Simplify x+x y bar + y bar + xz algebraically (not using truth tables).

Answer:
x+x y bar + y bar +xz
= x+ y bar +xz
= x+xz+ y bar
= x+ y bar


2. What is the output sequence of the following "counter", after it gets established in its cycle?

Answer: 1, 2, 3, 1, 2, 3, ...

(or any other equivalent sequence, since it is infinite in both directions; e.g. 2, 3, 1, 2, 3, 1, ...)

(of course you can write the numbers in binary instead, and indeed you might find that more natural: 01, 10, 11, 01, 10, 11, ...)


3. As an eight-bit binary number, 12 is 00001100. As an eight-bit binary number, 18 is 00010010. Show how we subtract 18-12 by adding the two's-complement of 12.

Answer:
Flip 00001100 and add 1, to get a representation of -12:

11110011
+      1
--------
11110100
Add 18 plus this -12 value:
00010010
11110100
--------
00000110
which is 6.


4. The hypothetical (and admittedly somewhat silly) XY flip-flop has the following truth table:

XYQn+1
00Q<sub>n</sub> bar
01Q<sub>n</sub> bar
101
110

Just as we designed a circuit for the JK flip-flop based on a master-slave SR flip-flop, design a circuit for the XY flip-flop based on the JK flip-flop. Formulate expressions for J and K in terms of Qn, X, and Y, and draw a circuit. Recall that in the JK flip-flop, J is the "set" line.

(N.B. your expressions for J and K need not necessarily mention all of Qn, X, and Y.)

 
Answer:

J = (XY) bar
K = X bar +Y


Detailed explanation of that question 4 answer (some of this might appear in your answer on a midterm, or not; the above would be worth the full marks):

We can augment the above table by deciding whether we want to "set", "reset" (clear), or "toggle":

XYQn+1action
00Q<sub>n</sub> bartoggle
01Q<sub>n</sub> bartoggle
101set
110reset

This, then, gives us desired values for J and K:

XYQn+1actionJK
00Q<sub>n</sub> bartoggle11
01Q<sub>n</sub> bartoggle11
101set10
110reset01

And that leads to the above two equations, J = (XY) bar and K = X bar +Y.


[midterm information] [main course page]