Docsity

AVR_Microcontroller_Programming_Test.pdf, Exams of Programmable Logic Controllers

Toggle sidebar
bg1
Independent Computer Engineering Practice Material Page 1
AVR Microcontroller Programming Test
Batch 4 · Exam 156 · 100 multiple-choice questions
Instructions
Choose the single best answer for each question. Each question has four options (A–D). The correct answer
and a concise explanation follow each question for self-study.
Scope and status
Independently prepared practice material. This is not an official examination or certification paper. Consult the applicable syllabus for
exact learning outcomes.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download AVR_Microcontroller_Programming_Test.pdf and more Exams Programmable Logic Controllers in PDF only on Docsity!

AVR Microcontroller Programming Test

Batch 4 · Exam 156 · 100 multiple-choice questions

Instructions

Choose the single best answer for each question. Each question has four options (A–D). The correct answer

and a concise explanation follow each question for self-study.

Scope and status

Independently prepared practice material. This is not an official examination or certification paper. Consult the applicable syllabus for exact learning outcomes.

Questions, Answers & Explanations

1. A test suite has 72 passing tests out of 80. What percentage pass? (Related focus: virtual memory.)

A. 8% B. 80% C. 90% D. 92% Correct answer: C — 90% Explanation: 72 / 80 × 100 = 90%.

2. A system transfers 6,000 bytes in 2 seconds. What is the average transfer rate? (Related focus: locality of reference.)

A. 300 B/s B. 3,000 B/s C. 6,002 B/s D. 12,000 B/s Correct answer: B — 3,000 B/s Explanation: Transfer rate = 6,000 / 2 = 3,000 bytes per second.

3. Which is the primary role of an interrupt in many processor systems? (Related focus: memory hierarchy.)

A. To notify the processor that an event may need service B. To permanently stop instruction execution C. To replace all memory D. To guarantee higher throughput in every workload Correct answer: A — To notify the processor that an event may need service Explanation: Interrupts notify the processor of events; the system's interrupt design determines how they are serviced.

4. Why should an ADC reference voltage be stable? (Related focus: cache.)

A. It defines the input-voltage scale mapped to digital codes B. It makes sampling unnecessary C. It removes quantization D. It forces every reading to zero Correct answer: A — It defines the input-voltage scale mapped to digital codes Explanation: The reference sets the conversion range and therefore influences the mapping from input voltage to output code.

5. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: RAM.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

6. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: ROM.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

14. Why should an ADC reference voltage be stable? (Related focus: locality of reference.)

A. It defines the input-voltage scale mapped to digital codes B. It makes sampling unnecessary C. It removes quantization D. It forces every reading to zero Correct answer: A — It defines the input-voltage scale mapped to digital codes Explanation: The reference sets the conversion range and therefore influences the mapping from input voltage to output code.

15. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: memory hierarchy.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

16. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: cache.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

17. A 16-bit unsigned value can represent how many distinct values? (Related focus: RAM.)

A. 16 B. 256 C. 32, D. 65, Correct answer: D — 65, Explanation: A 16-bit field has 2¹n = 65,536 distinct bit patterns.

18. A clock period is 4 ns. What is the corresponding frequency? (Related focus: ROM.)

A. 25 MHz B. 100 MHz C. 250 MHz D. 4 GHz Correct answer: C — 250 MHz Explanation: Frequency is 1/T = 1/(4 × 10nn s) = 250 MHz.

19. A cache has 800 hits in 1,000 accesses. What is its hit rate? (Related focus: virtual memory.)

A. 8% B. 20% C. 80% D. 125% Correct answer: C — 80% Explanation: Hit rate = 800 / 1,000 × 100 = 80%.

20. A 5 V source supplies 0.3 A. What is the ideal power delivered? (Related focus: locality of reference.)

A. 0.06 W B. 1.5 W C. 5.3 W D. 15 W Correct answer: B — 1.5 W Explanation: P = V × I = 5 × 0.3 = 1.5 W.

21. A test suite has 72 passing tests out of 80. What percentage pass? (Related focus: memory hierarchy.)

A. 8% B. 80% C. 90% D. 92% Correct answer: C — 90% Explanation: 72 / 80 × 100 = 90%.

22. A system transfers 6,000 bytes in 2 seconds. What is the average transfer rate? (Related focus: cache.)

A. 300 B/s B. 3,000 B/s C. 6,002 B/s D. 12,000 B/s Correct answer: B — 3,000 B/s Explanation: Transfer rate = 6,000 / 2 = 3,000 bytes per second.

23. Which is the primary role of an interrupt in many processor systems? (Related focus: RAM.)

A. To notify the processor that an event may need service B. To permanently stop instruction execution C. To replace all memory D. To guarantee higher throughput in every workload Correct answer: A — To notify the processor that an event may need service Explanation: Interrupts notify the processor of events; the system's interrupt design determines how they are serviced.

24. Why should an ADC reference voltage be stable? (Related focus: ROM.)

A. It defines the input-voltage scale mapped to digital codes B. It makes sampling unnecessary C. It removes quantization D. It forces every reading to zero Correct answer: A — It defines the input-voltage scale mapped to digital codes Explanation: The reference sets the conversion range and therefore influences the mapping from input voltage to output code.

25. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: virtual memory.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

26. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: locality of reference.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

27. A 16-bit unsigned value can represent how many distinct values? (Related focus: memory hierarchy.)

A. 16 B. 256 C. 32, D. 65, Correct answer: D — 65, Explanation: A 16-bit field has 2¹n = 65,536 distinct bit patterns.

35. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: RAM.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

36. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: ROM.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

37. A 16-bit unsigned value can represent how many distinct values? (Related focus: virtual memory.)

A. 16 B. 256 C. 32, D. 65, Correct answer: D — 65, Explanation: A 16-bit field has 2¹n = 65,536 distinct bit patterns.

38. A clock period is 4 ns. What is the corresponding frequency? (Related focus: locality of reference.)

A. 25 MHz B. 100 MHz C. 250 MHz D. 4 GHz Correct answer: C — 250 MHz Explanation: Frequency is 1/T = 1/(4 × 10nn s) = 250 MHz.

39. A cache has 800 hits in 1,000 accesses. What is its hit rate? (Related focus: memory hierarchy.)

A. 8% B. 20% C. 80% D. 125% Correct answer: C — 80% Explanation: Hit rate = 800 / 1,000 × 100 = 80%.

40. A 5 V source supplies 0.3 A. What is the ideal power delivered? (Related focus: cache.)

A. 0.06 W B. 1.5 W C. 5.3 W D. 15 W Correct answer: B — 1.5 W Explanation: P = V × I = 5 × 0.3 = 1.5 W.

41. A test suite has 72 passing tests out of 80. What percentage pass? (Related focus: RAM.)

A. 8% B. 80% C. 90% D. 92% Correct answer: C — 90% Explanation: 72 / 80 × 100 = 90%.

42. A system transfers 6,000 bytes in 2 seconds. What is the average transfer rate? (Related focus: ROM.)

A. 300 B/s B. 3,000 B/s C. 6,002 B/s D. 12,000 B/s Correct answer: B — 3,000 B/s Explanation: Transfer rate = 6,000 / 2 = 3,000 bytes per second.

43. Which is the primary role of an interrupt in many processor systems? (Related focus: virtual memory.)

A. To notify the processor that an event may need service B. To permanently stop instruction execution C. To replace all memory D. To guarantee higher throughput in every workload Correct answer: A — To notify the processor that an event may need service Explanation: Interrupts notify the processor of events; the system's interrupt design determines how they are serviced.

44. Why should an ADC reference voltage be stable? (Related focus: locality of reference.)

A. It defines the input-voltage scale mapped to digital codes B. It makes sampling unnecessary C. It removes quantization D. It forces every reading to zero Correct answer: A — It defines the input-voltage scale mapped to digital codes Explanation: The reference sets the conversion range and therefore influences the mapping from input voltage to output code.

45. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: memory hierarchy.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

46. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: cache.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

47. A 16-bit unsigned value can represent how many distinct values? (Related focus: RAM.)

A. 16 B. 256 C. 32, D. 65, Correct answer: D — 65, Explanation: A 16-bit field has 2¹n = 65,536 distinct bit patterns.

48. A clock period is 4 ns. What is the corresponding frequency? (Related focus: ROM.)

A. 25 MHz B. 100 MHz C. 250 MHz D. 4 GHz Correct answer: C — 250 MHz Explanation: Frequency is 1/T = 1/(4 × 10nn s) = 250 MHz.

56. Which evidence best demonstrates that cache meets its specification?

A. A repeatable test with recorded measurements and pass criteria B. A verbal assurance without data C. A single power-on test regardless of function D. An unlabeled drawing Correct answer: A — A repeatable test with recorded measurements and pass criteria Explanation: Repeatable tests tied to acceptance criteria provide objective evidence of compliance.

57. A defect related to cache occurs intermittently. What should an engineer do first?

A. Replace every nearby component immediately B. Reproduce the conditions and record inputs, timing, and measurements C. Ignore the issue until it becomes permanent D. Change several variables at once Correct answer: B — Reproduce the conditions and record inputs, timing, and measurements Explanation: Reproducing and documenting the fault helps isolate causes and preserves useful evidence.

58. Two modules interpret cache differently. What is the best corrective action?

A. Agree on and document a common interface contract, then test both modules B. Allow each module to keep its own undocumented interpretation C. Remove integration testing D. Change an unrelated subsystem Correct answer: A — Agree on and document a common interface contract, then test both modules Explanation: A shared contract clarifies expected behavior and provides a basis for integration tests.

59. After changing cache, which practice best checks for unintended side effects?

A. Delete the old test results B. Run relevant regression tests and compare with a known baseline C. Skip tests if the build succeeds D. Avoid recording the build version Correct answer: B — Run relevant regression tests and compare with a known baseline Explanation: Regression tests help detect whether a change broke previously working behavior.

60. How should an engineer choose between alternative implementations of cache?

A. Select the option with the most features regardless of need B. Compare requirement fit, constraints, performance, risk, and lifecycle cost C. Always choose the newest technology D. Make the choice without recording a rationale Correct answer: B — Compare requirement fit, constraints, performance, risk, and lifecycle cost Explanation: A defensible engineering choice considers requirements and constraints, then records the trade-off rationale.

61. What is the main engineering purpose of RAM in a computer system?

A. To support a defined function that can be evaluated against requirements B. To remove the need for verification C. To ensure components can never fail D. To eliminate design documentation Correct answer: A — To support a defined function that can be evaluated against requirements Explanation: RAM supports a defined system function. Requirements, verification, and documentation remain important.

62. Which evidence best demonstrates that RAM meets its specification?

A. A repeatable test with recorded measurements and pass criteria B. A verbal assurance without data C. A single power-on test regardless of function D. An unlabeled drawing Correct answer: A — A repeatable test with recorded measurements and pass criteria Explanation: Repeatable tests tied to acceptance criteria provide objective evidence of compliance.

63. A defect related to RAM occurs intermittently. What should an engineer do first?

A. Replace every nearby component immediately B. Reproduce the conditions and record inputs, timing, and measurements C. Ignore the issue until it becomes permanent D. Change several variables at once Correct answer: B — Reproduce the conditions and record inputs, timing, and measurements Explanation: Reproducing and documenting the fault helps isolate causes and preserves useful evidence.

64. Two modules interpret RAM differently. What is the best corrective action?

A. Agree on and document a common interface contract, then test both modules B. Allow each module to keep its own undocumented interpretation C. Remove integration testing D. Change an unrelated subsystem Correct answer: A — Agree on and document a common interface contract, then test both modules Explanation: A shared contract clarifies expected behavior and provides a basis for integration tests.

65. After changing RAM, which practice best checks for unintended side effects?

A. Delete the old test results B. Run relevant regression tests and compare with a known baseline C. Skip tests if the build succeeds D. Avoid recording the build version Correct answer: B — Run relevant regression tests and compare with a known baseline Explanation: Regression tests help detect whether a change broke previously working behavior.

66. How should an engineer choose between alternative implementations of RAM?

A. Select the option with the most features regardless of need B. Compare requirement fit, constraints, performance, risk, and lifecycle cost C. Always choose the newest technology D. Make the choice without recording a rationale Correct answer: B — Compare requirement fit, constraints, performance, risk, and lifecycle cost Explanation: A defensible engineering choice considers requirements and constraints, then records the trade-off rationale.

67. What is the main engineering purpose of ROM in a computer system?

A. To support a defined function that can be evaluated against requirements B. To remove the need for verification C. To ensure components can never fail D. To eliminate design documentation Correct answer: A — To support a defined function that can be evaluated against requirements Explanation: ROM supports a defined system function. Requirements, verification, and documentation remain important.

68. Which evidence best demonstrates that ROM meets its specification?

A. A repeatable test with recorded measurements and pass criteria B. A verbal assurance without data C. A single power-on test regardless of function D. An unlabeled drawing Correct answer: A — A repeatable test with recorded measurements and pass criteria Explanation: Repeatable tests tied to acceptance criteria provide objective evidence of compliance.

69. A defect related to ROM occurs intermittently. What should an engineer do first?

A. Replace every nearby component immediately B. Reproduce the conditions and record inputs, timing, and measurements C. Ignore the issue until it becomes permanent D. Change several variables at once Correct answer: B — Reproduce the conditions and record inputs, timing, and measurements Explanation: Reproducing and documenting the fault helps isolate causes and preserves useful evidence.

77. After changing virtual memory, which practice best checks for unintended side effects?

A. Delete the old test results B. Run relevant regression tests and compare with a known baseline C. Skip tests if the build succeeds D. Avoid recording the build version Correct answer: B — Run relevant regression tests and compare with a known baseline Explanation: Regression tests help detect whether a change broke previously working behavior.

78. How should an engineer choose between alternative implementations of virtual memory?

A. Select the option with the most features regardless of need B. Compare requirement fit, constraints, performance, risk, and lifecycle cost C. Always choose the newest technology D. Make the choice without recording a rationale Correct answer: B — Compare requirement fit, constraints, performance, risk, and lifecycle cost Explanation: A defensible engineering choice considers requirements and constraints, then records the trade-off rationale.

79. What is the main engineering purpose of locality of reference in a computer system?

A. To support a defined function that can be evaluated against requirements B. To remove the need for verification C. To ensure components can never fail D. To eliminate design documentation Correct answer: A — To support a defined function that can be evaluated against requirements Explanation: locality of reference supports a defined system function. Requirements, verification, and documentation remain important.

80. Which evidence best demonstrates that locality of reference meets its specification?

A. A repeatable test with recorded measurements and pass criteria B. A verbal assurance without data C. A single power-on test regardless of function D. An unlabeled drawing Correct answer: A — A repeatable test with recorded measurements and pass criteria Explanation: Repeatable tests tied to acceptance criteria provide objective evidence of compliance.

81. A defect related to locality of reference occurs intermittently. What should an engineer do first?

A. Replace every nearby component immediately B. Reproduce the conditions and record inputs, timing, and measurements C. Ignore the issue until it becomes permanent D. Change several variables at once Correct answer: B — Reproduce the conditions and record inputs, timing, and measurements Explanation: Reproducing and documenting the fault helps isolate causes and preserves useful evidence.

82. Two modules interpret locality of reference differently. What is the best corrective action?

A. Agree on and document a common interface contract, then test both modules B. Allow each module to keep its own undocumented interpretation C. Remove integration testing D. Change an unrelated subsystem Correct answer: A — Agree on and document a common interface contract, then test both modules Explanation: A shared contract clarifies expected behavior and provides a basis for integration tests.

83. After changing locality of reference, which practice best checks for unintended side effects?

A. Delete the old test results B. Run relevant regression tests and compare with a known baseline C. Skip tests if the build succeeds D. Avoid recording the build version Correct answer: B — Run relevant regression tests and compare with a known baseline Explanation: Regression tests help detect whether a change broke previously working behavior.

84. How should an engineer choose between alternative implementations of locality of reference?

A. Select the option with the most features regardless of need B. Compare requirement fit, constraints, performance, risk, and lifecycle cost C. Always choose the newest technology D. Make the choice without recording a rationale Correct answer: B — Compare requirement fit, constraints, performance, risk, and lifecycle cost Explanation: A defensible engineering choice considers requirements and constraints, then records the trade-off rationale.

85. A 4-bit unsigned counter holds 1111 n and is incremented by one. If it wraps modulo 16, what is the new value? (Related focus: memory hierarchy.)

A. 0000n B. 1000n C. 1110n D. 10000n Correct answer: A — 0000 n Explanation: Four bits represent 0–15. Incrementing 15 wraps to 0 in modulo-16 arithmetic.

86. Which Boolean expression is equivalent to NOT(A OR B)? (Related focus: cache.)

A. NOT A OR NOT B B. NOT A AND NOT B C. A AND B D. A OR NOT B Correct answer: B — NOT A AND NOT B Explanation: By De Morgan's law, NOT(A OR B) equals NOT A AND NOT B.

87. A 16-bit unsigned value can represent how many distinct values? (Related focus: RAM.)

A. 16 B. 256 C. 32, D. 65, Correct answer: D — 65, Explanation: A 16-bit field has 2¹n = 65,536 distinct bit patterns.

88. A clock period is 4 ns. What is the corresponding frequency? (Related focus: ROM.)

A. 25 MHz B. 100 MHz C. 250 MHz D. 4 GHz Correct answer: C — 250 MHz Explanation: Frequency is 1/T = 1/(4 × 10nn s) = 250 MHz.

89. A cache has 800 hits in 1,000 accesses. What is its hit rate? (Related focus: virtual memory.)

A. 8% B. 20% C. 80% D. 125% Correct answer: C — 80% Explanation: Hit rate = 800 / 1,000 × 100 = 80%.

90. A 5 V source supplies 0.3 A. What is the ideal power delivered? (Related focus: locality of reference.)

A. 0.06 W B. 1.5 W C. 5.3 W D. 15 W Correct answer: B — 1.5 W Explanation: P = V × I = 5 × 0.3 = 1.5 W.

98. A clock period is 4 ns. What is the corresponding frequency? (Related focus: cache.)

A. 25 MHz B. 100 MHz C. 250 MHz D. 4 GHz Correct answer: C — 250 MHz Explanation: Frequency is 1/T = 1/(4 × 10nn s) = 250 MHz.

99. A cache has 800 hits in 1,000 accesses. What is its hit rate? (Related focus: RAM.)

A. 8% B. 20% C. 80% D. 125% Correct answer: C — 80% Explanation: Hit rate = 800 / 1,000 × 100 = 80%.

100. A 5 V source supplies 0.3 A. What is the ideal power delivered? (Related focus: ROM.)

A. 0.06 W B. 1.5 W C. 5.3 W D. 15 W Correct answer: B — 1.5 W Explanation: P = V × I = 5 × 0.3 = 1.5 W.