EE319K-FinalF10 - 1/11 EE 319K Fall 2010 Final Exam Ramesh...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1/11 EE 319K Fall 2010 Final Exam Ramesh Yerraballi Full Name(eid) : Duration : 3 hours This is a closed book exam; You may use your calculators; Write answers within the space (box) provided after each of the questions. There are 11 questions on the test, read all of them first so you may properly allocate your time to answer them. Please provide comments for all code you write to help understand your answer and possibly award you partial credit. You may use the back of the sheets for extra space. 1. [ 4 pts ] Can a race condition occur when no interrupts are in use? If your answer is yes, give an example. If your answer is no, give your reasoning. 2. [ 4 pts ] Consider a right-justified unsigned 10-bit ADC with a range of 0 to +10V (not like the 9S12 which has a 0 to +5V range). What ADC value would you get if the analog input were 1.00V? 3. [ 4 pts ] List at least four uses of the Stack on the 9S12. Page 2 of 9 4. [ 8 pts ] The assembly code on the left calls a C subroutine to convert an input number passed by call- by-reference. The C subroutine takes the input and modifies it to the converted value. The conversion involves a multiplication by 3.142. Perform the multiplication with minimal loss of precision, without the use of floating point arithmetic. You may assume that the input number has a range of 0 to 300. Assembly Caller Code C Callee Code Number rmb 2 … ldd #Number jsr Convert ;Call C routine Convert ;Expect Number to be ; 3.142 x Number after ; call //Write the C routine that does the // conversion 5. [ 5 pts ] What is the resistance needed for R in the circuit so the output voltage Vout is 2V? Vout +5V 10 k Ω R 6. [ 5 pts ] These six events all occur during each output compare 0 interrupt. 1) The TCNT equals TC0 and the hardware sets the flag bit (e.g., C0F=1) 2) The output compare 0 vector address is loaded into the PC 3) The I bit in the CCR is set by hardware 4) The CCR, A, B, X, Y, PC are pushed on the stack 5) The software executes something like movb #$01,TFLG1 ldd TC0 addd #5000 std TC0 6) The software executes rti Which of the following sequences could be possible? Pick one answer A-F (only one is correct) A) 1,2,3,4,5,6 B) 4,1,3,5,2,6 C) 1,3,4,2,5,6 D) 1,4,3,2,5,6 E) 5,3,2,1,4,6 F) None of the above sequences are possible 7. [ 4 pts ] Give one advantage and one potential problem with passing parameters using call-by- reference Page 2 of 9 4. [ 8 pts ] The assembly code on the left calls a C subroutine to convert an input number passed by call- by-reference. The C subroutine takes the input and modifies it to the converted value. The conversion involves a multiplication by 3.142. Perform the multiplication with minimal loss of precision, without the use of floating point arithmetic. You may assume that the input number has a range of 0 to 300....
View Full Document

{[ snackBarMessage ]}

Page1 / 11

EE319K-FinalF10 - 1/11 EE 319K Fall 2010 Final Exam Ramesh...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online