EE319K_EXAM1_A_2010_FALL

EE319K_EXAM1_A_2010_FALL - EE319K Fall 2010 Exam 1A 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 1A 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 -50? (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) Mask the data B) Make it friendly. C) Use interrupts. D) Implement ceiling and floor. E) Add drop out. F) Use promotion. G) Use demotion. H) Use unsigned math. I) Make it nonvolatile. (5) Question 3. Consider the following two instructions ldab #-2 subb #250 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 1A Page 2 Jonathan W. Valvano October 1, 2010 10:00am-10:50am (10) Question 4. Use a 7406 to interface an LED to PT5 of the 9S12. The desired operating point is 2.5V at 20 mA. At 20mA you can assume the V OL of the 7406 will be 0.5 V. (10) Question 5. Consider the following piece of code that starts at main $5000 08 Add1 inx $5001 3D rts $5002 CF4000 main lds #$4000 $5005 CE000A ldx #10 $5008 34 loop pshx $5009 07F5 bsr Add1 $500B 30 pulx $500C 0435F9 dbne x,loop $500F 183E stop $FFFE org $FFFE $FFFE 5002 fdb main Part a) Think about how this program executes up to and including the first execution of inx 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 $5000, Register D is initially $2233, and Register X is $3000. 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. $5000 6C02 std 2,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 1A 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 PTT equ $0240 DDRT equ $0242 (20) Question 7. Assume a positive logic switch is connected to PT6, and the direction register is properly initialized. Write an 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 at Austin.

Page1 / 8

EE319K_EXAM1_A_2010_FALL - EE319K Fall 2010 Exam 1A 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