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

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 DocumentRight 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. There have to be at least two threads for a race condition to occur. A single thread will not be interrupted in the middle of its update. 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? ADC Value range with 10-bit ADC is 0 to 1023 which for an input voltage range of 0 to +10V implies a resolution of 10/1023 (the smallest unit measured). Therefore a voltage of 1.00V corresponds to an ADC value of 1/(10/1023) = 102.3/20 ≈ 102. 3. [ 4 pts ] List at least four uses of the Stack on the 9S12. 1. Passing input/output parameters to/from subroutines 2. Saving return addresses of subroutines 3. Allocate Local variables 4. Saving thread state when an Interrupt occurs 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 void Convert(unsigned short *num) { unsigned short x = *num; *num = x*3 + x/10 + (x*4)/100 + (x*2)/1000; } 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....
View Full Document

This note was uploaded on 02/20/2012 for the course EE 319K taught by Professor Bard during the Fall '08 term at University of Texas.

Page1 / 7

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

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