Question
Submit to urcourses in PDF, with circuit files submitted in .cct Be sure to follow all assignment expectations. Question 1 An encoder, as discussed in
Submit to urcourses in PDF, with circuit files submitted in .cct Be sure to follow all assignment expectations.
Question 1
An encoder, as discussed in class, makes the assumption that only one input line is active at a time. A priority encoder allows multiple inputs to be active, and outputs the binary representation for the highest priority line input currently active. Assume lower binary numbers have higher priority. For example, if lines 2, 3, and 7 are active, the output will be 0b010 ("2").
Design a 8-to-3 binary encoder, with priority in binary sequence (i.e. input line 0 has higher priority than input line 1 etc). There should also be an "active" output which is 1 when any input line is active, and "0" when all input lines are 0. If all input lines are 0, the output lines other than the "active" output are "don't care".
Implement and verify the circuit.
BONUS: Implement a similar circuit for an arbitrary priority sequence; for example, if line 3 had highest priority, followed by 4,0,2,1,5,7,6. Discuss how you might make a programmable priority encoder, where the input priority could be changed by a user in the field.
Question 2
(a) Given A = -12 and B = -10 in 2s complement representation (n = 5), in which of the following cases does overflow occur? Why or why not?
- A + B
- A - B
- -A + B
- -A - B
(b) For each of the following expressions, represent the two numbers in 2s complement representation (n = 8), perform the operation by hand using the algorithms presented in class, and verify the result in binary and in base 10. Although you can use a calculator to check your work, you should show your process for converting from decimal to binary and from binary to decimal.
- 27 + 81
- 127 - 81
Question 3
ALU flags report metadata about a calculation performed by the ALU. In class we discussed the flags N, Z, V, C.
(a) In your own words, define these flags and describe in plain English how they would be calculated.
(b) Why is the overflow flag referred to with the letter "V" instead of the letter "O"
(c) In x86 microprocessors, the "N" flag is replaced with the "S" flag, and a set of additional flags are present, including P, A, T, I, D. Select two of these additional flags, and research their purpose.
(d) How would you use the ALU and the result from the flags, alone or in combination, to indicate the truth value of A==B? A>=B? A>B?
BONUS: Would the flags used to interpret these results be the same for signed and unsigned numbers? why or why not?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started