Assignment 7, due Oct 17Solutions
Part of
the homework for CS:2630, Fall 2019
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper in discussion section on Thursday. Some parts of assignments may be submitted on-line and completed in discussion section. 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!
Background: Consider this set of boolean logic equations describing a digital system with 2 inputs a and b, and one output, e.
c = ab
d = a + b
e = c + d
a) Draw a circuit diagram for this circuit. Grading will account for neatness, so consider drawing it on scratch paper first and then redrawing it once you figure out how to make it nice looking. (0.5 points)
b) Draw a truth table for it, showing the inputs a and b, the intermediate values c and d and the final value e. Again, neatness counts. (0.5 point)
input | intermediate | final | ||
a | b | c | d | e |
---|---|---|---|---|
0 | 0 | 0 | 1 | 1 |
0 | 1 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 |
1 | 1 | 1 | 0 | 1 |
c) This system of equations computes a logical function closely related to one of the functions discussed in the first half of Chapter 8 of the notes. What function and what is the relationship? (0.5 point)
The inverse of exclusive-or.
A question: What does the carry out of the adder tell you? That is, when computing a – b, does a carry out imply some relationship (greater, less, equal) between the two numbers? What about the lack of a carry out? (0.5 point)
Carry out means a ≥ b or that there is no borrow from more significant digits.
Note: This is why the Hawk BGEU and BLTU instructions are equivalent to BCS and BCR.
Note: It doesn't matter what input to the ALU is shifted, just that one input is. What matters is that left shift goes on the input to the ALU and right shift on the output.