EE319K_EXAM1_B_2009 - EE319K Fall 2009 Exam 1B Page 1...

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

View Full Document Right Arrow Icon
EE319K Fall 2009 Exam 1B Page 1 Jonathan W. Valvano September 25, 2009 10:00am-10:50am First:_________________ Last:_____________________ This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Show your work, and put your answers in the boxes. Please read the entire quiz before starting. (5) Question 1. Assume an 8-bit signed integer format. Give the 8-bit binary representation of the value -88. (5) Question 2. When you add two 8-bit unsigned numbers an overflow error can occur. Which of the following techniques can be used to handle the problem of overflow? If there is more than one answer, give all answers that could work. A) Write software that is friendly. B) Write software using structured programming. C) Write software so there is drop out. D) Implement a ceiling and floor. E) Write software to mask the two input data F) Promote the numbers and perform the addition with this new precision. G) Demote the numbers and perform the addition with this new precision. H) Convert the numbers to signed and perform the addition with signed math. (5) Question 3. Consider the following two instructions ldab #-10 subb #200 What will be the value of the overflow (V) bit? What will be the value of the carry (C) bit? What will be the value of the negative (N) bit?
Background image of page 1

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

View Full DocumentRight Arrow Icon
EE319K Fall 2009 Exam 1B Page 2 Jonathan W. Valvano September 25, 2009 10:00am-10:50am (5) Question 4. Consider the result of executing the following three 9S12 assembly instructions. ldaa #100 ldab #3 mul What is the value in Register B after these three instructions are executed? (5) Question 5. We are designing an ohmmeter that measures resistance in the range of 0 to 3,999 Ω with a resolution of 1 Ω . What is the precision of this system in decimal digits ? (5) Question 6. How many bus cycles does it take to execute bsr on a real 9S12? (10) Question 7. Assume PC is $6000, and Register Y is initially $2233. You may assume location $0812 and $0813 are initially 0. Show the simplified bus cycles occurring when the sty instruction is executed. In the “ changes ” column, specify which registers get modified during that cycle, and the corresponding new values. Do not worry about changes to the CCR. Just show the one instruction. $6000 7D0812 sty $0812 R/W Addr Data Changes to A,B,X,Y,S,PC,IR,EAR (15) Question 8. Draw the circuit diagram interfacing two positive logic switches to PP7 and PP6. Please specify the resistance values for the resistors and the chip numbers (e.g., 7406) for any digital logic you use. You may assume PP7 and PP6 are inputs. PP7 PP6 9S12
Background image of page 2
EE319K Fall 2009 Exam 1B Page 3 Jonathan W. Valvano September 25, 2009 10:00am-10:50am For questions 9 and 10, you will write three subroutines. Don’t worry about establishing the reset vector, creating a main program, calling the subroutines or initializing the stack pointer. (25) Question 9.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

EE319K_EXAM1_B_2009 - EE319K Fall 2009 Exam 1B Page 1...

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

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