Multiple Choice Questions and Answers on 8051 Microcontroller
Q1. Which of the following commands will copy the contents of location 4H to the accumulator?
a) MOV A, 04H
b) MOV A, L4
c) MOV L4, A
d) MOV 04H, A
Answer: a
Q2. The statement LCALL READ passes control to the line labelled READ.
a) True
b) False
Answer: a
Q3. Which of the following commands will copy the contents of RAM whose address is in register 0 to port 1?
a) MOV @ P1, R0
b)MOV @ R0, P1
c) MOV P1, @ R0
d) MOV P1, R0
Answer: c
Q4. The following program will cause the 8051 to be stuck in a loop:
LOOP: | MOV A, #00H |
JNZ LOOP |
a) True
b) False
Answer: b
Q5. The contents of the accumulator after this operation
MOV A,#2BH
ORL A,00H
will be:
a) 1B H
b) 2B H
c) 3B H
d) 4B H
Answer: b
Q6. The I/O port that does not have a dual-purpose role is:
a) port 0
b) port 1
c) port 2
d) port 3
Answer: b
Q7. To interface external EPROM memory for applications, it is necessary to demultiplex the address/data lines of the 8051.
a) True
b) False
Answer: a
Q8. The following command will copy the accumulator to the location whose address is 23H:
MOV 23H,A
a) True
b) False
Answer: a
Q9. What is the difference between the 8031 and the 8051?
a) The 8031 has no interrupts.
b) The 8031 is ROM-less.
c) The 8051 is ROM-less.
d) The 8051 has 64 bytes more memory.
Answer: b
Q10. The special function registers can be referred to by their hex addresses or by their register names.
a) True
b) False
Answer: a
Q11. The designs of a centigrade thermometer and a PWM speed-control circuit can be implemented by the 8051.
a) True
b) False
Answer: a
Q12. The number of data registers is:
a) 8
b) 16
c) 32
d) 64
Answer: c
Q13. Which of the following commands will move the value at port 3 to register 2?
a) MOV P2, R3
b) MOV R3, P2
c) MOV 3P, R2
d) MOV R2, P3
Answer: d
Q14. This program code will read data from port 0 and write it to port 2, and it will stop looping when bit 3 of port 2 is set:
STAT: | MOV A, PO |
MOV P2,A | |
JNB P2.3, STAT |
a) True
b) False
Answer: a
Q15. This program code will be executed once:
STAT: | MOV A, #01H |
JNZ STAT |
a) True
b) False
Answer: b
Q16. Which of the following instructions will move the contents of register 3 to the accumulator?
a) MOV 3R, A
b) MOV R3, A
c) MOV A, R3
d) MOV A, 3R
Answer: c
Q17. Which of the following statements will add the accumulator and register 3?
a) ADD @R3, @A
b) ADD @A, R3
c) ADD R3, A
d) ADD A, R3
Answer: d
Q18. Data transfer from I/O to external data memory can only be done with the MOV command.
a) True
b) False
Answer: b
Q19. Which of the following commands will move the number 27H into the accumulator?
a) MOV A, P27
b) MOV A, #27H
c) MOV A, 27H
d) MOV A, @27
Answer: b
Q 20. The internal RAM memory of the 8051 is:
a) 32 bytes
b) 64 bytes
c) 128 bytes
d) 256 bytes
Answer: c
Q 21. This program code will be executed continuously:
STAT: | MOV A, #01H |
JNZ STAT |
a) True
b) False
Answer: a
Q22. The 8051 has ________ 16-bit counter/timers
a) 1
b) 2
c) 3
d) 4
Answer: b
Q23. The address space of the 8051 is divided into four distinct areas: internal data, external data, internal code, and external code.
a) True
b) False
Answer: a
Q24. Data transfer from I/O to external data memory can only be done with the MOVX command.
a) True
b) False
Answer: a
Q24. The 8051 can handle ________ interrupt sources.
a) 3
b) 4
c) 5
d) 6
Answer: c
Q25. The special function registers are maintained in the next 128 locations after the general-purpose data storage and stack.
a) True
b) False
Answer: a
Q26. This statement will set the address of the bit to 1 (8051 Micro-controller):
SETB 01H
a) True
b) False
Answer: b
Q27. MOV A, @ R1 will:
a) copy R1 to the accumulator
b) copy the accumulator to R1
c) copy the contents of memory whose address is in R1 to the accumulator
d) copy the accumulator to the contents of memory whose address is in R1
Answer: c
Q28. A label is used to name a single line of code.
a) True
b) False
Answer: a
Q29. The following program will receive data from port 1, determine whether bit 2 is high, and then send the number FFH to port 3:
READ: MOV A,P1
ANL A,#2H
CJNE A,#02H,READ
MOV P3,#FFH
a) True
b) False
Answer: a
Q30. Device pins XTAL1 and XTAL2 for the 8051 are used for connections to an external oscillator or crystal.
a) True
b) False
Answer: a
Q31. An alternate function of port pin P3.4 in the 8051 is:
a) Timer 0
b) Timer 1
c) interrupt 0
d) interrupt 1
Answer: a
Q32. Both registers TL0 and TL1 are needed to start Timer 0.
a) True
b) False
Answer: b
Q33. The I/O ports that are used as address and data for external memory are:
a) ports 1 and 2
b) ports 1 and 3
c) ports 0 and 2
d) ports 0 and 3
Answer: c
Q34. The last 96 locations in the internal data memory are reserved for general-purpose data storage and stack.
a) True
b) False
Answer: b
Q35. The 8051 has ________ parallel I/O ports.
a) 2
b) 3
c) 4
d) 5
Answer: c
Q36. The total external data memory that can be interfaced to the 8051 is:
a) 32K
b) 64K
c) 128K
d) 256K
Answer: b
Q37. Which of the following instructions will move the contents of the accumulator to register 6?
a) MOV 6R, A
b) MOV R6, A
c) MOV A, 6R
d) MOV A, R6
Answer: b
Q38. The following command will rotate the 8 bits of the accumulator one position to the left:
RL A
a) True
b) False
Answer: a
Q39. An alternate function of port pin P3.0 (RXD) in the 8051 is:
a) serial port input
b) serial port output
c) memory write strobe
d) memory read strobe
Answer: a
Q40. The ADC0804 has ________ resolution.
a) 4-bit
b) 8-bit
c) 16-bit
d) 32-bit
Answer: b
Q41. A HIGH on which pin resets the 8051 microcontroller?
a) RESET
b) RST
c) PSEN
d) RSET
Answer: b
Q42. An alternate function of port pin P3.1 in the 8051 is:
a) serial port input
b) serial port output
c) memory write strobe
d) memory read strobe
Answer: b
Q43. Which of the following instructions will load the value 35H into the high byte of timer 0?
a) MOV TH0, #35H
b) MOV TH0, 35H
c) MOV T0, #35H
d) MOV T0, 35H
Answer: a
Q44. Bit-addressable memory locations are:
a) 10H through 1FH
b) 20H through 2FH
c) 30H through 3FH
d) 40H through 4FH
Answer: b
Q45. The 8-bit address bus allows access to an address range of:
a) 0000 to FFFFH
b) 000 to FFFH
c) 00 to FFH
d) 0 to FH
Answer: c
Q46. The contents of the accumulator after this operation
MOV A,#0BH
ANL A,#2CH
will be
a) 11010111
b) 11011010
c) 00001000
d) 00101000
Answer: c
Q47. The last 96 locations in the internal data memory are reserved for general-purpose data storage and stack.
a) True
b) False
Answer: b
Q48. Device pins XTAL1 and XTAL2 for the 8051 are used for connections to an external oscillator or crystal.
a) True
b) False
Answer: a
Q49. Both registers TL0 and TL1 are needed to start Timer 0.
a) True
b) False
Answer: b
Q50. Microcontrollers often have:
a) CPUs
b) RAM
c) ROM
d) all of the above
Answer: d