EE319K_EXAM1_B_2010_FALL

EE319K_EXAM1_B_2010_FALL - EE319K Fall 2010 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 2010 Exam 1B Page 1 Jonathan W. Valvano October 1, 2010 10:00am-10:50am First:_________________ Last:_____________________ This is a closed book exam. You must put your answers on pages 1,2,3,4 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. The format is 8-bit signed. What is the hexadecimal representation of the value -60? (5) Question 2. When you add two 8-bit signed 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) Make it nonvolatile. B) Mask the data C) Make it friendly. D) Use interrupts. E) Implement ceiling and floor. F) Add drop out. G) Use promotion. H) Use demotion. I) Use unsigned math. (5) Question 3. Consider the following two instructions ldab #250 subb #-2 What will be the value of the overflow (V) bit? What will be the value of the carry (C) 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 2010 Exam 1B Page 2 Jonathan W. Valvano October 1, 2010 10:00am-10:50am (10) Question 4. Use a 7406 to interface an LED to PP5 of the 9S12. The desired operating point is 2.6V at 10 mA. At 10mA you can assume the V OL of the 7406 will be 0.4 V. (10) Question 5. Consider the following piece of code that starts at main $4000 CF4000 main lds #$4000 $4003 CE0008 ldx #8 $4006 34 loop pshx $4007 0706 bsr Sub1 $4009 31 puly $400A 0435F9 dbne x,loop $400D 183E stop $400F 09 Sub1 dex $4010 3D rts $FFFE org $FFFE $FFFE 4000 fdb main Part a) Think about how this program executes up to and including the first execution of dex Fill in specific hexadecimal bytes that are pushed on the stack. Using an arrow, label to which box the SP points. Your solution may or may not use all the boxes. Part b) How many times is the subroutine called after reset and before stop? (5) Question 6. Assume PC is $4000, Register D is initially $1122, and Register X is $2000. You may assume all RAM locations are initially 0. Show the simplified bus cycles occurring when the std 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. $4000 6C04 std 4,x R/W Addr Data Changes to D,X,Y,S,PC,IR,EAR $3FFD $3FFC $3FFF $3FFE $3FFB
Background image of page 2
EE319K Fall 2010 Exam 1B Page 3 Jonathan W. Valvano October 1, 2010 10:00am-10:50am For questions 7 8, and 9, don’t worry about establishing the reset vector, creating a main program, or initializing the stack pointer. You may use the following definitions PTP equ $0258 DDRP equ $025A (20) Question 7. Assume a positive logic switch is connected to PP1, and the direction register is properly initialized. Write assembly code that waits until the switch is pressed. (20) Question 8.
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.

This note was uploaded on 11/03/2010 for the course EE 319K taught by Professor Bard during the Spring '08 term at University of Texas.

Page1 / 8

EE319K_EXAM1_B_2010_FALL - EE319K Fall 2010 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