Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz1 - 8051 Microcontrollers

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
1.You are designing a system where Port 0 of the 8051 must function as both data and address lines for external memory. What additional connection is necessary to enable this feature?
a)
a) Directly connect Port 0 to the external memory
b)
b) Use an external pull-up resistor on Port 0
c)
c) Connect Port 0 to ALE (Address Latch Enable) and use a latch
d)
d) Set Port 0 as an output port using MOV P0, #0xFF
2.
2.You need to generate a 1ms delay using an 8051 microcontroller clocked at 12 MHz. If each instruction takes 1 machine cycle and one machine cycle is 1µs, how many iterations should a delay loop execute to achieve a 1ms delay?
a)
a) 10
b)
b) 100
c)
c) 1000
d)
d) 10,000
3.
3.A student wants to toggle the bits of Port 1 continuously without affecting other ports. Which of the following code snippets will achieve this in Assembly?
a)
MOV A, P1 CPL A MOV P1, A
b)
MOV A, #0xFF MOV P1, A
c)
CLR P1 SETB P1
d)
MOV P1, #0x55 MOV P1, #0xAA
4.
4.An 8051 microcontroller is executing a program when an external interrupt (INT0) occurs. What will happen immediately after the interrupt is triggered?
a)
a) The processor jumps to the ISR corresponding to INT0.
b)
b) The current instruction is immediately aborted, and ISR execution begins.
c)
c) The processor finishes the current instruction, then jumps to the ISR.
d)
d) The interrupt is ignored if the EA (Enable All) bit is cleared.
5.
5.A program running on the 8051 needs to store frequently accessed variables. Given the options below, which memory location will result in the fastest access time?
a)
a) External RAM at address 0x2000
b)
b) Internal RAM at address 0x30
c)
c) Bit-addressable memory at 0x20
d)
d) Special Function Registers (SFRs) at 0x90
6.

6.What will be the result in A after executing the following code ANL A, R2, assuming A = 0xF0 and R2 = 0x0F?

a)
a) A = 0x00
b)
b) A = 0xFF
c)
c) A = 0x0F
d)
d) A = 0xF0
7.
7. What will be the result in register A after executing the following code? MOV A, #55H CJNE A, #55H, NEXT INC A NEXT: NOP
a)
a) A = 55H
b)
b) A = 56H
c)
c) A = 00H
d)
d) A = 54H
8.
8.You want to transfer data from internal RAM addresses 30H to 3FH to 40H to 4FH using indirect addressing. Which instruction set would best accomplish this task?
a)
a) Use MOVC with a code pointer
b)
b) Use MOVX with DPTR
c)
c) Use a loop with MOV A, @R0 and MOV @R1, A
d)
d) Use XCH with external memory
9.
9. You have the following Embedded C statement: PORTA = (PORTA & 0xF0) | 0x0A; What is the effect of this operation?
a)
a) It clears the upper nibble and sets lower to 0x0A
b)
b) It sets the upper nibble to 0xF0
c)
c) It preserves the upper nibble and sets the lower nibble to 0x0A
d)
d) It toggles all bits of PORTA
10.
10.You are interfacing a 4KB external RAM with 8051. Which of the following address lines should be used for chip-select decoding?
a)
a) A0–A11
b)
b) A12–A15
c)
c) A10–A14
d)
d) A11–A14
11.
11.Pins from _____ are known as Port2 in 8051 Microcontroller.
a)
21-28
b)
21-29
c)
20-28
d)
20-29
12.

12.The circuit is powered/supplied by pin (a)   of 8051 MC.

13.

13. The given code puts AC flag in value (a)   MOV A, #0FFH SETB C ADDC A,#01

14.

14. If A=90H, what is the content of A after the following instruction RRC A if CY=1

a)
C8H
b)
B7H
c)
C1H
d)
48H
15.
15. Which of the following registers is used to enable or disable specific interrupts in 8051?
a)
a) TCON
b)
b) IE
c)
c) IP
d)
d) SCON
16.
16. Which interrupt is associated with serial communication in 8051?
a)
a) INT0
b)
b) INT1
c)
c) TI/RI
d)
d) TF1
17.
17. Which instruction will effectively clear the accumulator and also affect the CY flag?
a)
a) CLR A
b)
b) MOV A, #00H
c)
c) SUBB A, A
d)
d) ANL A, #00H
18.
18. You need to multiply the contents of register A and B, and then store the higher byte of the result in R2. Which of the following is the best instruction sequence?
a)
a) MUL AB followed by MOV R2, A
b)
b) MUL AB followed by MOV R2, B
c)
c) MOV A, R2 followed by MUL AB
d)
d) ADD A, B followed by MOV R2, A
19.
19. If the instruction CJNE A, #50H, LABEL is executed and A contains 50H, what happens?
a)
a) Jump to LABEL
b)
b) A is cleared
c)
c) CY is set
d)
d) No jump occurs, and CY is cleared
20.
20. Which instruction sequence will correctly rotate the contents of accumulator left by 1 bit without affecting the carry flag?
a)
a) RL A
b)
b) RLC A
c)
c) SWAP A followed by SWAP A
d)
d) MOV C, ACC.7 followed by RLC A