wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Microcontroller Quiz

Total questions: 40

Worksheet time: 23mins

Name
Class
Date
1.

The contents of the B register need to be transferred to the TMOD register. What is the correct sequence of instructions?

a)

PUSH B; POP TMOD

b)

MOV TMOD, B

c)

MOV A, B; MOV TMOD, A

d)

MOV TMOD, B; MOV B, TMOD

2.

How would you set Timer 1 to the value A23Dh?

a)

A. MOV TH1, #A2h; MOV TL1, #3Dh

b)

B. MOV TH1, #3Dh; MOV TL1, #A2h

c)

C. MOV TH1, #A3h; MOV TL1, #2Dh

d)

D. MOV TH1, #A2h; MOV TL1, #2Dh

3.

Identify the correct sequence of instructions to exchange the contents of the Stack Pointer (SP) and the Program Status Word (PSW).

a)

A. MOV PSW, SP; MOV SP, PSW

b)

B. PUSH SP; POP PSW

c)

C. MOV A, SP; MOV SP, PSW; MOV PSW, A

d)

D. SWAP SP, PSW

4.

Select the correct sequence of instructions to transfer the data from the internal RAM location F1h to registers R0 and R3.

a)

A. MOV R0, F1h

b)

B. MOV R3, F1h

c)

C. MOV A, F1h; MOV R0, A; MOV R3, A

d)

D. MOV A, R0; MOV A, R3; MOV F1h, A

5.

Which of the following is true regarding the number of pins on the 8051 and Z80 microprocessors?

a)

A) The 8051 has 58 pins in a DIP, whereas the Z80 microprocessor has 40 pins.

b)

B) The 8051 has 40 pins in a DIP, while the Z80 microprocessor has a total of 58 pins.

c)

C) Both the 8051 and Z80 microprocessors have the same number of pins in a DIP.

d)

D) The Z80 microprocessor has 40 pins, whereas the 8051 has 58 pins.

6.

What is the execution time of a single-byte instruction for a microcontroller with a 6 MHz crystal?

a)

A) 1 microsecond

b)

B) 2 microseconds

c)

C) 6 microseconds

d)

D) 12 microseconds

7.

Which registers are capable of performing division operations?

a)

A) ACC and B

b)

B) ACC and DPTR

c)

C) ACC and PSW

d)

D) ACC and SP

8.

When the 8051 microcontroller is reset, what is the initial address of the stack pointer?

a)

A) 00H

b)

B) 07H

c)

C) 08H

d)

D) 0FH

9.

Which ports of the 8051 microcontroller are used for external memory access?

a)

A) Port 0 and Port 1

b)

B) Port 1 and Port 2

c)

C) Port 0 and Port 2

d)

D) Port 2 and Port 3

10.

How can an I/O pin in the 8051 microcontroller function as both an input and output?

a)

A) By configuring the pin as an input using Port 3 only.

b)

B) By writing a 0 to the pin for output and a 1 for input.

c)

C) By writing a 1 to the pin for output and a 0 for input.

d)

D) By using external memory to switch between input and output modes.

11.

Which port of the 8051 microcontroller has no alternate function?

a)

A) Port 0

b)

B) Port 1

c)

C) Port 2

d)

D) Port 3

12.

You are given two bytes in RAM locations 34h and 35h. The objective is to add these two bytes and store the result in registers R5 (Least Significant Byte) and R6 (Most Significant Byte). Which of the following instructions will correctly perform this task?

a)

MOV A, 34h | ADD A, 35h | MOV R5, A | MOV R6, #00h

b)

MOV A, 34h | ADD A, 35h | MOV R6, A | MOV R5, #00h

c)

MOV A, 34h | ADD A, 35h | MOV R5, A | MOV R6, B

d)

MOV A, 34h | ADD A, 35h | MOV R5, A | MOV R6, #01h

13.

Which of the following is NOT a feature of the 8051 microcontroller's internal architecture?

a)

A. 4KB of ROM

b)

B. 128 bytes of RAM

c)

C. 16-bit Timer

d)

D. 32-bit ALU

14.

How many general-purpose registers does the 8051 microcontroller have in each register bank?

a)

A. 8

b)

B. 16

c)

C. 4

d)

D. 32

15.

Which of the following is NOT a component of the 8051’s internal architecture?

a)

A. Arithmetic and Logic Unit (ALU)

b)

B. Accumulator (A)

c)

C. Program Counter (PC)

d)

D. Floating Point Unit (FPU)

16.

Which addressing mode is used in the following instruction? MOV A, #55h

a)

A. Direct Addressing

b)

B. Indirect Addressing

c)

C. Immediate Addressing

d)

D. Register Addressing

17.

What is the result of the instruction INC A?

a)

A. Increments the accumulator by 2

b)

B. Increments the memory by 1

c)

C. Increments the accumulator by 1

d)

D. Increments the program counter by 1

18.

Which instruction is used to rotate the accumulator left?

a)

A. RLC A

b)

B. RR A

c)

C. RL A

d)

D. RRC A

19.

In the above program, what does the line TMOD = 0x01; do?

a)

A. Sets Timer 1 in 8-bit mode

b)

B. Configures Timer 0 in 16-bit mode

c)

C. Starts Timer 1

d)

D. Enables external interrupt 0

20.

Which peripheral is being controlled by the line sbit LED = P2^0; in the program?

a)

A. Timer

b)

B. Serial Port

c)

C. LED on Port 2

d)

D. External Interrupt

21.

What is the purpose of the while(TF0 == 0); in the delay function?

a)

A. To check if the accumulator is full

b)

B. To wait until Timer0 overflows

c)

C. To increment the program counter

d)

D. To enable external interrupt 0

22.

What happens when LED = 1; is executed in the program?

a)

A. The LED connected to Port 0 is turned on

b)

B. The LED connected to P2.0 is turned on

c)

C. The timer starts

d)

D. The microcontroller resets

23.

In the instruction MOV A, #55h, what addressing mode is being used?

a)

A. Direct Addressing

b)

B. Indirect Addressing

c)

C. Immediate Addressing

d)

D. Register Addressing

24.

What does the instruction MOV 30h, A do?

a)

A. Moves the value from memory location 30h to the accumulator.

b)

B. Moves the value from the accumulator to memory location 30h.

c)

C. Moves the value from the stack to the accumulator.

d)

D. Moves the value from register R0 to memory location 30h.

25.

Which of the following is the correct ALP to move data from memory location 20h to 21h using indirect addressing?

a)

MOV A, 20h | MOV 21h, A

b)

MOV R0, #20h | MOV A, @R0 | MOV R0, #21h | MOV @R0, A

c)

MOV A, #20h | MOV @21h, A

d)

MOV A, R1 | MOV 21h, A

26.

What does the following instruction do: INC A?

a)

A. Decreases the value in the accumulator by 1

b)

B. Increases the value in the accumulator by 2

c)

C. Increases the value in the accumulator by 1

d)

D. Clears the value in the accumulator

27.

In the ARM programming model, what does the CPSR register store?

a)

A. The stack pointer value

b)

B. The program counter value

c)

C. The current instruction

d)

D. Processor flags and mode

28.

Which ARM instruction is used to load a value from memory into a register?

a)

A. STR

b)

B. MOV

c)

C. LDR

d)

D. CMP

29.

What does the ARM instruction CMP R1, R2 do?

a)

A. Compares the values of R1 and R2, affecting the flags but not storing the result.

b)

B. Adds the values of R1 and R2, storing the result in R1.

c)

C. Moves the value of R1 to R2.

d)

D. Stores the value of R2 in memory at the address in R1.

30.

Which of the following ARM instructions will branch to a new address and also store the return address in the Link Register (LR)?

a)

A. B

b)

B. BL

c)

C. MOV

d)

D. LDR

31.

What is the purpose of the ARM instruction SWI?

a)

A. To switch between processor modes.

b)

B. To trigger a software interrupt.

c)

C. To store data in memory.

d)

D. To load data from memory into a register.

32.

Which of the following registers in ARM holds the address of the current instruction?

a)

A. R0

b)

B. R13 (SP)

c)

C. R15 (PC)

d)

D. R14 (LR)

33.

Which register is used in the 8051 to store the address for accessing external data memory?

a)

A. DPTR

b)

B. PC

c)

C. A

d)

D. PSW

34.

In the 8051, the bit-addressable memory area is located between which addresses?

a)

A. 00h - 0Fh

b)

B. 20h - 2Fh

c)

C. 00h - FFh

d)

D. 20h - 2Fh and 80h - 8Fh

35.

What happens when the 8051 executes the following instruction: MOV A, @R0?

a)

A. The content of register R0 is moved to register A.

b)

B. The content of the memory location pointed to by R0 is moved to A.

c)

C. The address of R0 is moved to A.

d)

D. The content of the accumulator is moved to R0.

36.

Which addressing mode is used in the instruction MOVC A, @A + DPTR?

a)

A. Immediate Addressing

b)

B. Register Addressing

c)

C. Indirect Addressing

d)

D. Indexed Addressing

37.

What is the size of the program counter (PC) in the 8051 microcontroller?

a)

A. 8 bits

b)

B. 16 bits

c)

C. 32 bits

d)

D. 64 bits

38.

What does the instruction ADD A, #10h do?

a)

D. Subtracts 10h from the accumulator

b)

A. Adds the value 10h to the accumulator

c)

B. Adds the value of memory location 10h to the accumulator

d)

C. Moves the value 10h to the accumulator

39.

What is the function of the instruction DJNZ R0, LABEL?

a)

A. Decrements R0 and jumps to LABEL if R0 is not zero

b)

D. Decrements R0 and jumps to LABEL if R0 is zero

c)

B. Jumps to LABEL unconditionally

d)

C. Increments R0 and jumps to LABEL

40.

Which of the following instructions will clear the accumulator?

a)

A. CLR A

b)

B. MOV A, #00h

c)

C. SETB A

d)

D. MOV A, #FFh