Книга: Advanced PIC Microcontroller Projects in C
1.25 Exercises
1.25 Exercises
1. What is a microcontroller? What is a microprocessor? Explain the main difference between a microprocessor and a microcontroller.
2. Identify some applications of microcontrollers around you.
3. Where would you use an EPROM memory?
4. Where would you use a RAM memory?
5. Explain the types of memory usually used in microcontrollers.
6. What is an input-output port?
7. What is an analog-to-digital converter? Give an example of how this converter is used.
8. Explain why a watchdog timer could be useful in a real-time system.
9. What is serial input-output? Where would you use serial communication?
10. Why is the current sink/source capability important in the specification of an output port pin?
11. What is an interrupt? Explain what happens when an interrupt is recognized by a microcontroller?
12. Why is brown-out detection important in real-time systems?
13. Explain the difference between an RISC-based microcontroller and a CISC-based microcontroller. What type of microcontroller is PIC?
14. Convert the following decimal numbers into binary:
a) 23 b) 128 c) 255 d) 1023
e) 120 f) 32000 g) 160 h) 250
15. Convert the following binary numbers into decimal:
a) 1111 b) 0110 c) 11110000
d) 00001111 e) 10101010 f) 10000000
16. Convert the following octal numbers into decimal:
a) 177 b) 762 c) 777 d) 123
e) 1777 f) 655 g) 177777 h) 207
17. Convert the following decimal numbers into octal:
a) 255 b) 1024 c) 129 d) 2450
e) 4096 f) 256 g) 180 h) 4096
18. Convert the following hexadecimal numbers into decimal:
a) AA b) EF c) 1FF d) FFFF
e) 1AA f) FEF g) F0 h) CC
19. Convert the following binary numbers into hexadecimal:
a) 0101 b) 11111111 c) 1111 d) 1010
e) 1110 f) 10011111 g) 1001 h) 1100
20. Convert the following binary numbers into octal:
a) 111000 b) 000111 c) 1111111 d) 010111
e) 110001 f) 11111111 g) 1000001 h) 110000
21. Convert the following octal numbers into binary:
a) 177 b) 7777 c) 555 d) 111
e) 1777777 f) 55571 g) 171 h) 1777
22. Convert the following hexadecimal numbers into octal:
a) AA b) FF c) FFFF d) 1AC
e) CC f) EE g) EEFF h) AB
23. Convert the following octal numbers into hexadecimal:
a) 177 b) 777 c) 123 d) 23
e) 1111 f) 17777777 g) 349 h) 17
24. Convert the following decimal numbers into floating point:
a) 23.45 b) 1.25 c) 45.86 d) 0.56
25. Convert the following decimal numbers into floating point and then calculate their sum:
0.255 and 1.75
26. Convert the following decimal numbers into floating point and then calculate their product:
2.125 and 3.75
27. Convert the following decimal numbers into BCD:
a) 128 b) 970 c) 900 d) 125
- 1.1 Introduction
- 1.2 Microcontroller Systems
- 1.3 Microcontroller Features
- 1.4 Microcontroller Architectures
- 1.5 Number Systems
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.8 Converting Binary Numbers into Hexadecimal
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.10 Converting Hexadecimal Numbers into Decimal
- 1.11 Converting Decimal Numbers into Hexadecimal
- 1.12 Converting Octal Numbers into Decimal
- 1.13 Converting Decimal Numbers into Octal
- 1.14 Converting Octal Numbers into Binary
- 1.15 Converting Binary Numbers into Octal
- 1.16 Negative Numbers
- 1.17 Adding Binary Numbers
- 1.18 Subtracting Binary Numbers
- 1.19 Multiplication of Binary Numbers
- 1.20 Division of Binary Numbers
- 1.21 Floating Point Numbers
- 1.22 Converting a Floating Point Number into Decimal
- 1.23 BCD Numbers
- 1.24 Summary
- 1.25 Exercises
- 2.3 Exercises
- 3.5 Exercises
- 4.5 Exercises
- 5.5 Exercises
- CHAPTER 4 Functions and Libraries in mikroC
- CHAPTER 5 PIC18 Development Tools
- 1.6 Converting Binary Numbers into Decimal
- 1.7 Converting Decimal Numbers into Binary
- 1.9 Converting Hexadecimal Numbers into Binary
- 1.10 Converting Hexadecimal Numbers into Decimal
- 1.11 Converting Decimal Numbers into Hexadecimal
- 1.12 Converting Octal Numbers into Decimal