Quiz1F03sol

# Quiz1F03sol - ff byte is \$EC altogether \$EA E9 EC (10)...

This preview shows page 1. Sign up to view the full content.

EE319K Fall 2003 Quiz 1 Solution Page 1 Jonathan W. Valvano September 26, 2003 11:00am-11:50am (5) Question 1. Answer A,B,C,D,E A) nonvolatile (5) Question 2. Answer \$00 to \$FF 171=16*10+11= \$AB (4) Part 3a. Specify RegB 101-110 = -9 which is –9+256 = 247 (2) Part 3b. Specify 0 or 1 C=1 because –9 is out of range (2) Part 3c. Specify 0 or 1 V=0 because –9 is in range (2) Part 3d. Specify 0 or 1 Z=0 because the result is not zero (2) Part 3e. Specify 0 or 1 N=1 because the result is negative (10) Question 4. Specify D D = 0.001 (10) Question 5. Show the machine code convert 20 to 9-bit binary 0,0001,0100, 16+4 complement 1,1110,1011, then add one to get -20 in 9-bit binary 1,1110,1100 op code is \$EA, xb byte 9-bit Y index is \$E9, (negative)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ff byte is \$EC altogether \$EA E9 EC (10) Question 6. What value is pushed address of next instruction is \$F126 (10) Question 7. Simplified memory cycles R/W Addr Data changes (memory, RegY not changed) 1 \$F129 \$EA IR=\$EA, PC=\$F12A 1 \$F12A \$4A EAR=\$098A, PC=\$F12B 1 \$098A \$8A RegB=\$8A (40) Question 8. Write the assembly language program that implements a thermostat. org \$f000 main movb #\$FF,DDRB output is heater movb #0,DDRA input is temperature sensor loop ldaa PORTA check temperature cmpa #2*68 too cold? bhs notCold movb #\$FF,PORTB turn on heater notCold cmpa #2*72 too hot? bls notHot movb #\$00,PORTB turn off heater notHot bra loop org \$fffe fdb main...
View Full Document

Ask a homework question - tutors are online