CPSC 100, Fall 1997:
Answers to Quiz #2

This is the second quiz from the course Computer Science 100: Principles of Computer Science, taught by David Eck. The answers that are included here are sample answers only. There might be many other answers to a given problem that would also receive full credit. See the home page for the text, The Most Complex Machine, for more information about the course.


Question 1: Count to twelve in binary. That is, list the base-2 numbers corresponding to the base-10 numbers 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.

Answer:

           1 = 12          5 = 1012          9 = 10012 
           2 = 102         6 = 1102         10 = 10102 
           3 = 112         7 = 1112         11 = 10112 
           4 = 1002        8 = 10002        12 = 11002 

Question 2:Draw the logic circuit that corresponds to the boolean expression:

(A and (not (B or C))) or (B and (not C))

Answer:


Question 3: In the following circuits, label the output of every gate, to show whether it is ON or OFF.

Answer: The labels that have to be added are shown in red:


Question 4: Define the term ALU.

Answer: The ALU (Arithmetic-Logic Circuit) is the part of the CPU that performs the basic arithmetic and logical operations on binary numbers. It can perform a variety of operations, such as addition, subtraction, left-shift, etc. The ALU has control wires that tell it which operation to perform.


Question 5: Sometimes, we categorize input wires to a circuit as either data inputs or control wires. From the point of view of a human, what is the difference between data inputs and control wires? What is the difference from the point of view of the circuit?

Answer: Many circuits are meant to perform operations on data that is provided as input to the circuit. Data inputs provide the data to be manipulated (in the form of a binary number encoded by turning the data input wires ON to represent a 1 or OFF to represent a 0). A control wire is used to control the operation of the circuit. (For example, it might tell the circuit which of several operations to perform on the data. An example of this would be the control wires of an ALU. Alternatively, turning a control wire on and off might make the circuit perform some action. An example of this would be the Load-Data wire of a memory circuit, which tells the circuit to remember the data that is currently on its data input wires.)

Form the point of view of the circuit, there is no difference between data input wires and control wires. All the circuit sees is wires that can be turned on and off. The circuit responds to this according to the way in which it was constructed. The categories "data input" and "control wire" represent the meaning that the human user has assigned to the wires. The categories help the human to understand the circuit, but the circuit, of course, doesn't understand anything and has no knowledge of the meanings of its input wires. Literally speaking, the circuit does not have a point of view!


David Eck, 26 September 1997