Assignment 7, due Jul 5Solutions
Part of
the homework for CS:2630, Summer 2018

On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (Tuesday or Thursday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
a) Give the truth table for a twoinput compare function that has a true output only when both inputs are equal. (0.5 points)
a  b  a = b 
0  0  1 
0  1  0 
1  0  0 
1  1  1 
b) Use the given methodology to derive the logic for a twoinput compare function. Do not delete any unneeded gates. Present your result as a neatly drawn logic diagram. Do not use any shorthand notations. (0.5 points)
Of course, there's no need to single out the and and and arrays as is done faintly in the above, and even the truth table values filled into the intersections and the row labels in the and gates are unneeded.
If someone does delete rows 1 and 2 in their answer to part b), it wouldn't count as an error, although it does obscure the connection to the truth table from which the circuit was derived. In that case, part c) of this problem wouldn't involve deleting any gates, it would just involve redrawing for neatness.
c) Redraw your solution from part b) without unneeded gates, aiming for maximum legibility. Again, present your result as a neatly drawn logic diagram. (0.5 points)
Straightening out the diagram so the logic flows strictly from left to right or from top to bottom is optional, and the row labels could have been deleted from the and gates.
d) Give a boolean expression in terms of the and, or and not operators that is exactly equivalent to the logic diagram you gave as your answer to part b. (0.5 points)
a b + a b
Here are the same numbers in their Gray code order:
a) Give the truth table for a binarytoGraycode converter. This will have 3 inputs and 3 outputs, so if the input is, for example, 010, the output will be 011, and if the input is 101, the output will be 111. (0.5 points)
binary  Gray  
b_{2}  b_{1}  b_{0}  g_{2}  g_{1}  g_{0} 
0  0  0  0  0  0 
0  0  1  0  0  1 
0  1  0  0  1  1 
0  1  1  0  1  0 
1  0  0  1  1  0 
1  0  1  1  1  1 
1  1  0  1  0  1 
1  1  1  1  0  0 
The specific labels on the inputs and outputs are, of course, not determined by the problem statement, but some kind of labels are needed to connect this to the corresponding logic diagram.
b) Use the methodology from Chapter 8 to convert that truth table to a logic diagram. Legibility counts! Again, do not abbreviate and do not delete any unneeded gates. (0.5 points)
You could, of course, add the truth table entries to the intersections.
It would not be wrong to omit row zero, although this obscures the connection to the underlying truth table.
If you simply connect output g_{2} to input b_{2}, deleting the or gate that drives that output and deleting row 7, the circuit would compute the same output, but this deletion is based on an adhoc observation about the relationship of g_{2} and b_{2}, and it ignores the methodology we are demonstrating, so it should be subject to a small penalty.