Homework 4
This homework is worth 10 points.
When you complete this homework you should
- Be able to use TKGate to implement basic circuits.
- Understand how to translate simple problem descriptions into solutions implemented in basic logic.
All non-circuit answers should be typed. All circuits should be implemented in TKGate in a single file. Use comments to label the circuits with the problem number. Make sure that the input and output for circuits are labeled as well.
All circuits should be implementd using only and, or and not gates.
- [3 points] Develop a two input logical equivalence tester.
- Derive a truth table which for a circuit that takes two inputs, a and b, and produces a 1 when the inputs are equal and a 0 when the inputs are not equal.
- Using the circuit from part A, develop a boolean equation which produces a 1 if the two variables are the same and a 0 otherwise.
- Using only and, or and not gates, create a circuit in TKGate which implements the equation and circuit in the previous parts.
- [3 points] Show that DeMorgan's law: a+b = a · b is true
- Develop a two input circuit for a+b
- Develop a two input circuit for a · b
- Use the circuits from 2A and 2B to provide input to the circuit developed in 1C.
- [4 points] Assume a number X consists of 3 bits, x2, x1 and x0. Write a logical function and construct a circuit in TKGate to
- Detect if X is 0, or all input is 0. If all input is 0, output a 1, otherwise output a 0.
- Detect if X is negative in 3 bit two's complement representation. If the number is negative, output a 1, otherwise output a 0.
- [2 pionts] Develop a circuit which given a 4 bit WOMBAT op-code, determines if the instrucion is a math-class (add, subtract, multiply, divide) instruction. Output a 1 if the opcode indicates a math instruction and a 0 otherwise.
All answers must be submitted in a typed document, including screen shots of the circuits at the beginning of class on the due date. In addition, you should submit the .v file to your instructor as an attachment to an email before class time on the due date. Failure to submit the .v file will result in loss of 5 points.