CS 2011, A Term 1999
Professor Sergio A. Alvarez
Practice Problems for Test 3

Instructions: Read each problem carefully. Write your answers clearly. Include explanations. Unexplained answers may not receive full credit. Good luck!

  1. A C++ program contains the following declaration of an external assembly procedure:
       extern "C" void doublebyref(int x, int& y);

  2. Which of the following Boolean operators are complete in the sense that each of them alone (in sufficient quantities) suffices to compute any Boolean expression? For each operator that you claim is complete, give a general argument in support of your claim. For each operator that you claim is not complete, give a specific truth table that cannot be reproduced by any combination of operators of the given type.

  3. Consider the Boolean function g(A,B,C,D) that returns 1 if the 4-bit unsigned binary integer ABCD equals 0, 1, 2, 3, 8, or 10 (decimal), and returns 0 otherwise.

  4. Consider the basic latch circuit discussed in the lectures, containing two NOR gates, the first having output Q and inputs Q~, R, the second having output Q~ and inputs Q, S.

  5. Draw the circuit diagram for a 4-bit binary counter. Your circuit should have 4 outputs D0, D1, D2, D3, a clock input C, and a reset input R. The outputs should be set to 0 on the first rising clock edge occurring while the reset input is 1. The outputs should change on each rising clock input occurring while the reset output is 0, in such a way that the new outputs represent the result of incrementing the old outputs by 1 in the usual binary positional notation, with D0 as the least significant bit and D3 as the most significant bit. You may use standard flip-flops as building blocks.