EE319K Lecture Lec03.ppt in class worksheet

Question 1. What is a logic analyzer?

Question 2. What is the difference between white-box and black-box testing?

Question 3. What are the two states of open collector logic?

Question 4. Explain how we will use open collector logic?

Question 5. To use an I/O pin as a UART function, to what value to we set AFSEL?

Question 6. How many UART modules does the LM4F120/TM4C123 have?

Question 7. What does it mean to say the SW1 switch on the board is negative logic?

Question 8. What does it mean to say the Blue LED on the board is positive logic?

Question 9. What is the difference between functional and performance debugging?

Question 10. Explain highly intrusive, minimally intrusive and non intrusive debugging?

Question 11. Can we tell by observing a 32-bit number in R0 whether it is signed or unsigned?

Question 12. After an addition of two unsigned numbers, the C bit is set. What does it mean?

Question 13. After an addition of two signed numbers, the V bit is set. What does it mean?

Question 14. After a subtraction of two unsigned numbers, the C bit is set. What does it mean?

Question 15. After a subtraction of two signed numbers, the V bit is set. What does it mean?

Question 16. Write assembly code to define two 32-bit variables Count and Mode. Write C code to define two signed 32-bit variables Count and Mode.

Question 17. When does a subroutine need to save and restore LR?

Question 18. Interface a switch to Port A bit 5 using positive logic.

Question 19. Interface a switch to Port A bit 6 using negative logic.

Question 20. Interface an LED to Port A bit 7 using positive logic. The LED parameters are 1.5V 20mA. Assume the output low voltage of a 7406 VOL is 0.5V.

Question 21. Interface an LED to Port A bit 4 using positive logic. The LED parameters are 1.4V 2mA. Assume the microcontroller output voltage VOH is 3.2V.

Question 22. What address allows us to access just pin PA7?

Question 23. Consider the relationship between voltage across a device and the current through it. Is a diode nonlinear or linear? Is a resistor is nonlinear or linear?
Question 24. Is a diode is directional or nondirectional? Is a resistor is directional or nondirectional?
Question 25. What electrical property determines optical brightness of an LED?
Question 26. What happens to LED as voltage increases from 2 to 25V?
Question 27. What happens to resistor as voltage increases from 2 to 25V?

------

Answer 1. A logic analyzer measures multiple digital signals versus time.

Answer 2. White-box testing looks at internal signals inside a system. Black-box testing just looks at input and output signals of a system.

Answer 3. The two states of open collector logic are low and off/float/hiZ.

Answer 4. We use the low-state of an open collector gate to activate current through an LED. We use the off-state of an open collector gate to shut off current through an LED.

Answer 5. We set AFSEL to 1 to use an I/O pin as a UART function, because it is an alternate function

Answer 6. There are 8 UART modules one the LM4F120/TM4C123

Answer 7. It means to true state (pushing the switch) creates a low voltage (0V or logic 0 input to computer). The false state (releasing the switch) creates a high voltage (3.3V or logic 1 input to computer).

Answer 8. It means a logic 1 (3.3V) output will create the true state (Blue LED on). It means a logic 0 (0V) output will create the false state (Blue LED off).

Answer 9. Functional debugging looks at the inputs and outputs in a static manner. Performance debugging not only looks at inputs/outputs but the time behavior of the system.

Answer 10. Intrusiveness is the level of how the debugging itself affects the system being tested. Highly intrusive means a large effect. Minimally intrusive means a small and inconsequential effect. Non intrusive means no effect at all.

Answer 11. No, we cannot tell by observing a 32-bit number in R0 whether it is signed or unsigned. It is the programmers job to know.

Answer 12. After an addition of two unsigned numbers, the C bit is set if the result does not fit back into the 32-bit register. C=1 means unsigned overflow

Answer 13. After an addition of two signed numbers, the V bit is set if the result does not fit back into the 32-bit register. V=1 means signed overflow

Answer 14. After a subtraction of two unsigned numbers, the C bit is set if the result DOES fit back into the 32-bit register. C=0 means unsigned overflow

Answer 15. After a subtraction of two signed numbers, the V bit is set if the result does not fit back into the 32-bit register. V=1 means signed overflow

Answer 16. Write assembly code to define two 32-bit variables Count and Mode.

AREA DATA, ALIGN=4

Count SPACE 4

Mode SPACE 4

Write C code to define two signed 32-bit variables Count and Mode.

int32_t Count;

int32_t Mode;

Answer 17. A subroutine needs to save and restore LR if it itself calls another subroutine.

Answer 18. Interface a switch to Port A bit 5 using positive logic.

Answer 19. Interface a switch to Port A bit 6 using negative logic.

Answer 20. R = (5-1.5-0.5V)/20 mA = 150 ohms

Answer 21. R = (3.2-1.4)/2 mA = 990 ohms

Answer 22. What address allows us to access just pin PA7?

Base address is 0x4000.4000

Offset for bit7 0x200

PA7 0x4000.4200

Answer 23. A diode is nonlinear. A resistor is linear.


Answer 24. A diode is directional. A resistor is nondirectional.


Answer 25. Electrical power (P=V*I) and the efficiency of the LED determine optical brightness of an LED


Answer 26. The LED will explode as voltage increases from 2 to 25V, current varies exponentially with voltage.


Answer 27. What happens depends on the resistor. The resistor will get warm as voltage increases from 2 to 25V, current varies linearly with voltage, power varies quadradically with voltage (P = V2/R). For example, a 1000 ohm resistor at 25 V will dissipate 0.625 W. Our resistors in EE319K are rated to dissipate only 0.25W, so the 1k resistor at 25 V will burn up. On the other hand, the 10 kohm resistor at 25 V will only dissipate 0.0625 W. The 10K resistor will get warm but continue to function.