CS 101 Homework 6 - Challenge problem [up to 2 extra points]

Consider the two circuits shown below. Both circuits take two 8-bit numbers A and B as input, i.e. the 16 bits A7...A0 and B7...B0, which appear along the top of the two diagrams below. ('7' is the highest-order bit, and '0' the lowest-order bit. For instance, if A = 19, which is 00010011 in binary, then the bits A4, A1, and A0 are 1 and the others are 0.) Each circuit is comprised of 8 identical subcircuits. Each subcircuit takes just one pair of bits as input, e.g. A7 and B7. The subcircuits also take input(s) from the left and produce output(s) to the right, which become the input(s) of the next subcircuit. The final output(s) of the right-most subcircuit are considered the output of the entire circuit. The left-most inputs are held constant (to 0 or 1 as shown). The contents of each subcircuit are shown in the dashed box underneath. The small arrows on the wires indicate the flow of the signals, i.e., from outputs to inputs.

(Note that the overall design is quite similar to the 4-bit adder from the circuit lecture on slide 19, which takes two 4-bit numbers as input, and is comprised of 4 identical subcircuits.)

  1. Determine the function of the circuit below. It has a single output "R" (i.e., the output "Rout" of the right-most subcircuit). What function does "R" compute, given any two 8-bit numbers A and B as input? Note that each of the 8 subcircuits consists of one XNOR gate (i.e., an XOR followed by a NOT) and one AND gate. Note also that the leftmost "Rin" input receives a constant 1.

    Hw6 Challenge Circuit 1

     

  2. Determine the function of the circuit below. It has two outputs "P" and "Q" (i.e., the outputs "Pout" and "Qout" of the right-most subcircuit). What function do "P" and "Q" compute, given any two 8-bit numbers A and B as input? Note that each of the 8 subcircuits consists of two OR gates, two 3-input AND gates, and 4 NOT gates. Note also that the leftmost "Pin" and "Qin" inputs receive a constant 0.

    Hw6 Challenge Circuit 2