EE319K Spring 2011 Exam 1B
Solution
Page 1
Jonathan W. Valvano
February 25, 2011
2:00pm2:50pm
(4) Question 1.
The basis elements are 1000=27, 0100=9, 0010=3, and 0001=1* 27+0*9+2*3+1=34
(3) Question 2.
Answer true/false for each of the following three statements
Part a)
True, the stack pointer (SP) points to the data on top of the stack.
Part b)
False, the order in which I add the numbers does not affect the final value of RegA.
Part c)
False, dropout error cannot occur on a logical left shift (e.g.,
lsla
). Overflow can occur.
(4) Question 3.
Consider
ldab #6
subb #251
Convert to signed, 251 = 251256 = 5. Subtract two signed 6  5 is 1. This fits so V=0.
Convert to unsigned 6 = 6+256 = 250. Subtract unsigned 250251 is 1. Does not fit, C=1.
(4) Question 4.
What is the binary representation of 8bit signed number 11?
Method 1) +11 is 8+2+1 or 00001011. Negative is 2’s complement. Complement 1111,0100, then add 1.
11110101
Method 2) Look at basis elements, need 128,64,32,16,4,1, so
11110101
Method 3) 11 is the same binary as 11+256 = 245. 245/16=15 remainder 5. So hex is $F5
(20) Question 5.
The current through LED resistor 25mA = (520.5)/R. Solve for R= 2.5V/25mA = 100
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 BARD
 Addition, Binary numeral system, RTS, Jonathan W. Valvano

Click to edit the document details