Professional Documents
Culture Documents
C2 MCQ
C2 MCQ
Answer: b) A microcontroller is a microprocessor system with additional features built for a specific
task. It is integrated altogether into one single chip.
a) Central Processing Unit (CPU), Storage Elements, and Input/Output Module (IO)
b) Central Processing Unit (CPU), Storage Elements, and Serial/Parallel Communication Ports
d) Central Processing Unit (CPU), Storage Elements, and Read-only Memory (ROM)
e) Central Processing Unit (CPU), Storage Elements, and Random Access Memory (RAM)
Answer: e) Central Processing Unit (CPU), Storage Elements, and Random Access Memory (RAM)
Explanation: A microprocessor system is a computer system that comprises many elements, including
a Central Processing Unit (CPU), Storage Elements, such as Read-only Memory (ROM) and Random
Access Memory (RAM), Input/Output Module (IO), Serial/Parallel Communication Ports, and
Timer/Interrupt Modules.
•The microprocessor is typically chosen based on the specific requirements of the application
a) No I/O ports
b) Timer
c) ADC
d) RAM
e) ROM
Answer: d) RAM
Explanation: A microprocessor system includes a CPU (microprocessor) but does not have any RAM,
ROM, or I/O ports. These components must be added externally to make the system functional.
c) Lower cost
d) Smaller size
Explanation: Microcontrollers have a fixed amount of on-chip ROM, RAM, and number of I/O ports,
which makes them ideal for many applications in which cost and space are critical considerations. In
contrast, general-purpose microprocessors require external components to be added, which can make
the system bulkier and more expensive.
Explanation: An embedded product uses a microprocessor (or microcontroller) to do one task and one
task only. The software is typically burned into ROM or flash memory, and the microprocessor is
chosen based on the specific requirements of the application.
A) Microprocessors
B) Embedded products
C) Pre-learned topics
D) RAM memory
E) Peripheral devices
Explanation: The content states that "Some knowledge obtained prior undertaking this subject include
Numbering systems, Binary / Octal / Hexadecimal numbers, Decimal to binary / octal / hexadecimal
conversions, Binary data – sign & magnitude, Standard Data codes –Gray, ASCII & EBCDIC,
Combinational Logic Circuits and its operations, Adder, decoder, multiplexer, Electronic operating
characteristics, Input switch, keypad matrix, Common anode / cathode LEDs, 7 segment display."
These are all examples of pre-learned topics.
Explanation: The content states that "An embedded product uses a microprocessor (or microcontroller)
to do one task and one task only. There is only one application software that is typically burned into
ROM." Therefore, an embedded product typically has one application software burned into ROM.
Explanation: The content states that "A PC, in contrast with the embedded system, can be used for any
number of applications." Therefore, the main difference between an embedded system and a PC is that
a PC can be used for any number of applications.
4. What is the purpose of a microcontroller in a peripheral device?
D) To be connected to a PC
Explanation: The content states that "Each one peripheral has a microcontroller inside it that performs
only one task." Therefore, the purpose of a microcontroller in a peripheral device is to perform only one
task.
D) Pre-learned topics
Explanation: The content states that "Chapter 1.4 discusses the Intel 8051 Microcontroller." Therefore,
the microcontroller discussed in Chapter 1.4 is the Intel 8051 Microcontroller.
a) Output switch
b) Input switch
c) Keypad matrix
a) Input switch
b) Keypad matrix
e) 7 segment display
3. Which of the following numbering systems is used to represent the number 13?
a) Decimal
b) Binary
c) Octal
d) Hexadecimal
Answer: d) Hexadecimal
b) Magnitude representation
c) Bit
d) Nibble
e) Byte
Explanation: Signed number representation is used to represent negative numbers in binary data.
5. Which of the following data codes is used to represent characters with unique binary data values?
a) Gray Code
b) ASCII Code
c) EBCDIC Code
d) Reflective Code
Explanation: ASCII Code is used to represent characters with unique binary data values.
Explanation: EBCDIC stands for Extended Binary Coded Decimal Interchange Code and is widely used
by IBM systems. It is 8 bits wide and each character has its own unique binary data value.
2. What is the width of the binary data value for characters in EBCDIC Code?
A. 4 bits
B. 5 bits
C. 6 bits
D. 7 bits
E. 8 bits
Answer: E. 8 bits.
Explanation: The binary data value for characters in EBCDIC Code is 8 bits wide.
3. What are HALF ADDER and FULL ADDER?
A. Types of switches
B. Types of displays
C. Types of encoders
D. Types of decoders
Explanation: HALF ADDER and FULL ADDER are types of combinational logic systems.
A. A type of display
B. A type of switch
C. A type of encoder
D. A type of decoder
5. What are the four digital components that a processor can be built on?
Explanation: The four digital components that a processor can be built on are Registers, ALU, Control
Unit, and Memory.
o another
1. Which of the following is NOT a digital component of a processor?
a) Registers
d) Internal Interconnections
Explanation: A processor is built on four digital components, which are Registers, ALU, CU, and
Internal Interconnections. Therefore, all of the above options are digital components of a processor.
Answer: c) It points to the memory address location of a program code due to be fetched.
Explanation: The Program Counter (PC) register is a type of register that points to the memory address
location of a program code due to be fetched. The PC value usually begins at 00H upon power-up or
reset.
3. Which register is the main register for storing ALU resulting data?
c) Accumulator (ACC)
Explanation: The Accumulator (ACC) register is the main register for storing ALU resulting data. It can
perform operations such as shift, rotate, add, subtract, and invert.
e) It contains flag signals of the Accumulator status such as Zero, Parity, Overflow, Sign, etc.
Answer: e) It contains flag signals of the Accumulator status such as Zero, Parity, Overflow, Sign, etc.
Explanation: The Program Status Word (PSW) register is a register that contains control bits for a
processor and flag signals of the Accumulator status such as Zero, Parity, Overflow, Sign, etc. The bit
representation may differ from one processor to another.
1. What is the purpose of the PSW register in the processor's Arithmetic Logic Unit?
Answer: e) To store status signals generated by the ALU operations. The PSW register stores the flag
signals of the Accumulator status such as Zero, Parity, Overflow, Sign etc.
2. What is the function of the Stack Pointer (SP) register in the processor?
e) To direct the processor's operation and tell the memory, ALU and I/O peripherals on how to respond
to a certain program instruction.
Answer: a) To store the specific address for stacking data. The Stack Pointer (SP) register stores the
specific address for stacking data and updates a new pointer address every time an address is used for
stack.
e) To direct the processor's operation and tell the memory, ALU and I/O peripherals on how to respond
to a certain program instruction.
Answer: e) To direct the processor's operation and tell the memory, ALU and I/O peripherals on how to
respond to a certain program instruction. The Control Unit is the brain for the processor where it directs
the processor's operation and tells the memory, ALU and I/O peripherals on how to respond to a certain
program instruction. It consists of multiple levels of sequences and events that will interpret the
program code and transmit and receive control signals throughout the processor.
a Last-In-First-Out (LIFO) data structure, where the last data item pushed onto the stack is the first one
to be popped off.
•The stack pointer (SP) register is used to keep track of the current top of the stack.
•When a subroutine or interrupt program is executed, the processor pushes the current program
counter (PC) value onto the stack, so that it can be retrieved later.
•The processor then jumps to the subroutine or interrupt program, and executes it.
•When the subroutine or interrupt program is finished, the processor pops the previous PC value from
the stack, and resumes execution from that point.
3. To point the memory address location for the processor to fetch instructions
Answer: 3. To point the memory address location for the processor to fetch instructions. The program
counter (PC) register is used to keep track of the memory address location for the processor to fetch
instructions.
Answer: 2. To store important data temporarily. The stack is used to temporarily store important data
when a subroutine or interrupt program is executed.
ectural Concept
Answer: c) To store temporary data processing. The stack operates as a reserved area to store current
important values such as program counter, accumulator, program status word and others.
2. What does the value shown by the stack pointer register represent?
Answer: c) The address in the RAM. The value shown by the stack pointer register represent the
address in the RAM.
3. What is the concept used by the stack when storing and retrieving data?
c) Random Access
d) Sequential Access
e) None of the above
Answer: b) Last In First Out. The stacking operation uses the Last In First Out concept.
4. Which of the following is NOT a key factor that a microcontroller should have?
a) Input feature
b) Output feature
c) Timer/delay feature
Answer: e) All of the above are key factors. A microcontroller should have the ability to detect or sense
the surrounding – input feature, provide a certain amount of response – output feature, exploit the
response frequency – timer/delay feature, provide prioritize response – interrupt feature, contain
storage for program – non-volatile memory feature, and contain storage for temporary data processing
– RAM feature.
a) ADC/DAC module
b) IP module
c) GSM module
Answer: d) All of the above. Apart from key elements, additional features may be taken into
consideration such as ADC/DAC module, IP module, and GSM module.
1. Which of the following additional features may be taken into consideration along with the key
elements mentioned above?
A) Bluetooth module
B) ADC/DAC module
C) Wi-Fi module
D) NFC module
E) GPS module
Answer: B) ADC/DAC module
Explanation: Along with the key elements mentioned above, additional features such as ADC/DAC
module may be taken into consideration.
Explanation: Z80 from Zilog is an 8-bit microcontroller based on Intel 8080 architecture.
Explanation: MC6811 from Motorola has built-in EEPROM and RAM, digital I/O, timer, ADC, and
RS232, making it the most powerful microcontroller among the given options.
A) Flash memory
B) SRAM
C) DRAM
D) ROM
E) Cache memory
Answer: D) ROM
Explanation: The 8051 microcontroller has two types of memory, program memory (ROM) and data
memory (RAM).
1. Which instruction is used for 8-bit addition between the accumulator, a second operand, and the
previous value of the CY flag?
a) DA
b) SUBB
c) OADDC
d) MOV
e) ADD
Answer: c) OADDC
Explanation: OADDC is used for 8-bit addition between the accumulator, a second operand, and the
previous value of the CY flag. It is useful for 16-bit addition in two steps, and the CY flag is set/reset
appropriately.
2. Which instruction is used to format the accumulator into a proper 2 digit packed BCD number?
a) DA
b) SUBB
c) OADDC
d) MOV
e) ADD
Answer: a) DA
Explanation: DA is used to format the accumulator into a proper 2 digit packed BCD number. It
operates only on the accumulator. If the lower nibble is greater than 9, the A flag is set to 1 and 6 is
added to the lower nibble. If the upper nibble is greater than 9, the C flag is set to 1 and 6 is added to
the upper nibble.
3. Which instruction is used to subtract an operand and the previous value of the borrow (carry) flag
from the accumulator?
a) DA
b) SUBB
c) OADDC
d) MOV
e) ADD
Answer: b) SUBB
Explanation: SUBB is used to subtract an operand and the previous value of the borrow (carry) flag
from the accumulator. The result is always saved in the accumulator, and the CY flag is set/reset
appropriately. Subtraction uses adder circuitry.
Note: The example given for SUBB in the content is incorrect. The correct example should be:
1) A = 23H
2) A = 1CH
3) A = 3FH
4) A = 20H
5) A = 21H
Answer: 2) A = 1CH
Explanation: SUBB subtracts the second operand from the first operand and subtracts the carry flag.
Here, A is subtracted by R3 (23H) and the result is stored in A. A = A - R3 - CY. As CY is not set, it is
considered as 0. Therefore, A = 3FH - 23H - 0 = 1CH.
b) What is the purpose of the OINC instruction?
Explanation: OINC instruction increments the operand by one. The operand can be a register, a direct
address, an indirect address, or the data pointer.
1) A = 99H, B = 0EH
2) A = 0EH, B = 99H
3) A = 99H, B = 99H
4) A = 0EH, B = 0EH
Explanation: OMUL AB multiplies A by B and places the result in A (lower byte) and B (higher byte).
The product has 16 bits. Here, A = 25H and B = 65H. Therefore, A * B = 25H * 65H = E99H. The lower
byte of the product is 99H and the higher byte is 0EH.
1) A = 9, B = 5
2) A = 5, B = 9
3) A = 10, B = 95
4) A = 95, B = 10
Answer: 1) A = 9, B = 5
Explanation: ODIV AB divides A (numerator) by B (denominator) and places the result in A (quotient)
and B (remainder). The product has 16 bits. Here, A = 95 and B = 10. Therefore, A / B = 9 with a
remainder of 5. Hence, A = 9 and B = 5.
e) What is the purpose of taking 2's complement of the source operand?
1) To add to A
3) To subtract from A
4) To multiply A by B
Explanation: Taking 2's complement of the source operand is used to perform subtraction. It is done by
inverting all the bits of the source operand and adding 1 to it. The result is then added to the destination
operand to perform subtraction.
a) 5
b) 9
c) 10
d) 15
Answer: c) 10. Explanation: The instruction "MOV B,#10" moves the value 10 to register B.
2. What is the value of A and B after the instruction "O DIV AB; A=9, B=5"?
a) A=9, B=5
b) A=5, B=9
c) A=1, B=4
d) A=4, B=1
Answer: a) A=9, B=5. Explanation: The instruction "O DIV AB" divides register A by register B and
stores the quotient in A and the remainder in B.
3. What is the value of CY, AC, and P flag after the addition of 9CH and 64H in the following
instructions?
MOV A, #9CH
ADD A, #64H
Answer: c) CY=0, AC=0, P=1. Explanation: The addition of 9CH and 64H results in the value A=00H
and CY=0. The AC flag is not affected by this operation. The accumulator has an even number of 1s,
so P=1.
a) ANL
b) ORL
c) XRL
d) CPL
e) CLR
Answer: b) ORL. Explanation: The logical operation ORL has no effect on the flag.
a) ANL
b) ORL
c) XRL
d) CPL
e) CLR
Answer: a) ANL. Explanation: The logical operation ANL works on byte-sized operands or the CY flag.
•OSWAP A
MSB LSB
1. What is the result of the ANL operation on the value 35H and OFH?
a) 30H
b) 05H
c) 3FH
d) 00H
e) 01H
Answer: b) 05H. The ANL operation performs a bitwise AND between the two values, resulting in A =
35H AND 0FH, which is equal to 05H.
2. What is the result of the ORL operation on the value 04H and 30H?
a) 34H
b) 3CH
c) 00H
d) 3EH
e) 04H
Answer: a) 34H. The ORL operation performs a bitwise OR between the two values, resulting in A =
04H OR 30H, which is equal to 34H.
3. What is the result of the XRL operation on the value 54H and 78H?
a) 2CH
b) 24H
c) 7CH
d) 50H
e) 28H
Answer: a) 2CH. The XRL operation performs a bitwise XOR between the two values, resulting in A =
54H XOR 78H, which is equal to 2CH.
Answer: a) To complement the value of a bit or the accumulator. The OCPL instruction is used to
complement the value of a bit or the accumulator.
a) 39H
b) E4H
c) 1CH
d) 38H
e) 74H
Answer: b) E4H. The RL operation performs a bitwise rotation to the left on the accumulator, resulting
in A = 72H rotated to the left, which is equal to E4H.
a) 13H, CY = 0
b) 09H, CY = 1
c) 33H, CY = 0
d) 19H, CY = 1
e) 26H, CY = 0
Answer: b) 09H, CY = 1. The RRC operation performs a bitwise rotation to the right through the carry
on the accumulator, resulting in A = 26H rotated to the right through the carry, which is equal to 09H,
with the carry flag set to 1.
a) 9AH
b) A9H
c) 6CH
d) 96H
e) 69H
Answer: b) A9H. The OSWAP operation swaps the upper and lower nibbles of the accumulator,
resulting in A = 9AH swapped, which is equal to A9H.
a) A = 0101 0101, CY = 1
b) A = 0101 0110, CY = 1
c) A = 1010 1011, CY = 0
d) A = 1010 1010, CY = 1
e) A = 1010 1010, CY = 0
Explanation: The RRC instruction rotates the bits of A to the right by one position, and the bit that is
shifted out is stored in the CY flag. In this case, A = 1010 1011 is rotated to the right to become A =
0101 0101, and the CY flag is set to 1. Then, the value of A is updated to A = 0101 0110, with the CY
flag still set to 1.
a) A = 72H
b) A = 27H
c) A = 2H
d) A = 7H
Answer: e) A = 72H, but with the upper and lower nibbles swapped
Explanation: The OSWAP instruction swaps the upper and lower nibbles of the accumulator. In this
case, the initial value of A is 27H, which has the nibbles 2 and 7. After the OSWAP instruction, the
value of A becomes 72H, with the nibbles swapped.
3. Which of the following instructions is used to push data onto the stack?
a) OMOV
b) OMOVC
c) OPUSH
d) OPOP
e) OXCH
Answer: c) OPUSH
Explanation: The OPUSH instruction is used to push data onto the stack. The stack is a region of
memory used for temporary storage of data during subroutine calls and interrupts. The data is pushed
onto the stack in Last-In-First-Out (LIFO) order.
a) OMOV
b) OMOVC
c) OPUSH
d) OPOP
e) OXCHD
Answer: e) OXCHD
Explanation: The OXCHD instruction is used to exchange the low-order nibble of the accumulator with
the contents of a memory location. This instruction is useful for operations involving binary-coded
decimal (BCD) arithmetic.
5. Which of the following instructions is used to load the accumulator with a byte from program
memory?
a) OMOV
b) OMOVC
c) OMOVX
d) OMOV C, bit
Answer: b) OMOVC
Explanation: The OMOVC instruction is used to load the accumulator with a byte from program
memory. This instruction is commonly used for accessing data elements of look-up tables stored in
program memory. The address of the byte to be loaded is specified using the PC (program counter)
and the instruction pointer.
1. Which instruction is used to load the accumulator with a byte from program memory?
a) OMOVC A, @A+DPTR
b) OMOVC A, @A+PC
c) OMOVX A, @Ri
d) XCH A, direct
e) PUSH
Explanation: The instruction OMOVC A, @A+PC is used to load the accumulator with a byte from
program memory.
2. Which instruction is used for data transfer between the accumulator and a byte from external data
memory?
a) OMOVC A, @A+DPTR
b) OMOVX A, @DPTR
c) XCH A, Rn
d) PUSH
e) OMOVX A, @Ri
Explanation: The instruction OMOVX A, @DPTR is used for data transfer between the accumulator and
a byte from external data memory.
a) XCH A, Rn
b) XCH A, direct
c) OMOVX A, @Ri
d) XCHD A, @Ri
e) PUSH
Answer: a) XCH A, Rn
Explanation: The instruction XCH A, Rn is used to exchange the accumulator and a byte variable.
d) To increment/decrement the stack pointer and copy a byte into/from the stack
e) To exchange the lower digit of the accumulator with the lower digit of a memory location
Answer: d) To increment/decrement the stack pointer and copy a byte into/from the stack
Explanation: The PUSH/POP instruction is used to increment/decrement the stack pointer and copy a
byte into/from the stack.
5. Which instruction is used to exchange the lower digit of the accumulator with the lower digit of a
memory location identified indirectly by the index register?
a) XCH A, Rn
b) XCH A, direct
c) OMOVX A, @Ri
d) XCHD A, @Ri
e) PUSH
Explanation: The instruction XCHD A, @Ri is used to exchange the lower digit of the accumulator with
the lower digit of a memory location identified indirectly by the index register.
JNC
Which of the following is true about the accumulator and internal memory location exchange in the
8051 microcontroller?
Answer: B. The lower 4-bits of each are modified. This is because only the lower 4-bits of the internal
memory location identified indirectly by the index register are exchanged with the accumulator.
Which of the following flags cannot be directly altered by the Boolean Operations group of instructions
in the 8051 microcontroller?
A. P flag
B. OV flag
C. AC flag
D. CY flag
Answer: A. P flag. The P, OV, and AC flags cannot be directly altered by the Boolean Operations group
of instructions in the 8051 microcontroller.
Answer: C. Set a bit or the CY flag. The SETB instruction is used to set a bit or the CY flag in the 8051
microcontroller.
Answer: B. Complement a bit or the CY flag. The CPL instruction is used to complement a bit or the CY
flag in the 8051 microcontroller.
Which of the following instructions is used for data transfer between a bit and the CY flag in the 8051
microcontroller?
A. ORL
B. ANL
C. MOV
D. JNC
Answer: C. MOV. The MOV instruction is used for data transfer between a bit and the CY flag in the
8051 microcontroller.
Answer: A) Copies the CY flag to bit 3F of the bit addressable memory. This instruction moves the
value 3FH into the accumulator and then copies the CY flag to bit 3F of the bit addressable memory.
Answer: A) Jump to a relative address if CY is set/cleared. The OJC/JNC instruction allows the
program to jump to a relative address if the carry flag (CY) is set or cleared.
A) OJB jumps to a relative address if a bit is set, while JNB jumps to a relative address if a bit is cleared
B) OJB jumps to a relative address if a bit is cleared, while JNB jumps to a relative address if a bit is set
C) OJB jumps to a relative address if a bit is set and clears the bit, while JNB jumps to a relative
address if a bit is set
D) OJB jumps to a relative address if a bit is set, while JNB jumps to a relative address if a bit is set
Answer: A) OJB jumps to a relative address if a bit is set, while JNB jumps to a relative address if a bit
is cleared. The OJB/JNB instructions allow the program to jump to a relative address if a bit is set or
cleared.
Answer: D) To allow jumping to any memory location. The unconditional branching instructions allow
the program to jump to any memory location without any condition.
A) OJC
B) OJB
C) LJMP
D) JNB
Answer: C) LJMP. LJMP is an example of an unconditional branching instruction that allows the
program to jump to a 16-bit address of the target location.
. What is the maximum memory location that can be jumped to using unconditional branching in the
8051 microcontroller?
a) 1000H
b) FFFFH
c) 2000H
d) 8000H
e) 5000H
Answer: b) FFFFH
Explanation: The 8051 microcontroller can jump to any memory location between 0000H and FFFFH
using unconditional branching.
2. Which of the following is an example of an absolute jump instruction in the 8051 microcontroller?
a) JMP
b) ACALL
c) LCALL
d) AJMP
e) None of the above
Answer: d) AJMP
Explanation: AJMP is an absolute jump instruction in the 8051 microcontroller. It uses an 11-bit address
and is a 2-byte instruction.
3. What happens when an absolute jump instruction is executed in the 8051 microcontroller?
a) The high-order 5 bits in the PC are replaced with the destination address.
b) The low-order 11 bits in the PC are replaced with the destination address.
c) Both the high-order 5 bits and the low-order 11 bits in the PC are replaced with the destination
address.
Answer: b) The low-order 11 bits in the PC are replaced with the destination address.
Explanation: When an absolute jump instruction is executed in the 8051 microcontroller, the low-order
11 bits in the PC are replaced with the destination address. The high-order 5 bits in the PC stay the
same.
a) JMP
b) ACALL
c) LCALL
d) AJMP
Answer: b) ACALL
Explanation: ACALL is a subroutine instruction in the 8051 microcontroller. It uses an 11-bit address
and is used to call a subroutine within the same 2K byte.
c) To provide a way to call the same subroutine from multiple places in the program.
Explanation: A subroutine in the 8051 microcontroller is used to perform tasks that need to be
performed frequently, make the program more structured and save memory space, and provide a way
to call the same subroutine from multiple places in the program. After executing the subroutine, the
program will return to the original location where the subroutine was called.
Which subroutine instruction pushes the 16-bit address of the next instruction on the stack and updates
the stack pointer?
Answer: A and B. Both Absolute Call – ACALL and Long Call – LCALL push the 16-bit address of the
next instruction on the stack and update the stack pointer.
Which return instruction pops the return address from the stack and continues execution there?
C) Both A and B
D) Neither A nor B
Answer: A. Return from subroutine – RET pops the return address from the stack and continues
execution there.
A) jz
B) jnz
C) djnz
What is the maximum distance a subroutine can be located from the main program when using Long
Call – LCALL?
A) 2K byte
B) 64K byte
C) 11-bit address
D) 16-bit address
Answer: B. Long Call – LCALL allows the subroutine to be located anywhere within 64K byte address.
1. What is the purpose of the jz and jnz instructions in the 8051 microcontroller?
Answer: b) To check if a register is zero and jump accordingly. The jz instruction jumps to a specified
location if the register A is zero, while the jnz instruction jumps to a specified location if the register A is
not zero.
a) add A, #03
b) add A, R2
d) mov R5, A
e) mov A, #0
Answer:
mov A, #0 ; clear A
Explanation: The code initializes register A to 0 and register R2 to 10. The add A, #03 instruction adds
3 to register A, and the djnz R2, AGAIN instruction decrements R2 and jumps back to the AGAIN label
if R2 is not zero. This process is repeated 10 times, and the final result is stored in register R5.
Answer: c) To compare two registers and jump if they are not equal. The cjne instruction compares the
value in register A or Rn with a given value or memory location, and jumps to a specified location if they
are not equal.
A) 0.6us
B) 0.75us
C) 1.2us
D) 1.5us
E) 2.4us
Answer: A) 0.6us
Explanation: Using the formula, period of machine cycle = 12/oscillator frequency, we get 12/20MHz =
0.6us.
2. How long does it take to execute the instruction "MOV R5,#FFH" for an 8051 system with a crystal
frequency of 12MHz?
A) 0.5us
B) 1.0us
C) 1.2us
D) 1.5us
E) 2.0us
Answer: C) 1.2us
Explanation: Using the formula, time to execute instruction = instruction set machine cycle x period of
machine cycle. Since "MOV R5,#FFH" has a machine cycle of 1, and the crystal frequency is 12MHz,
we get 1 x (12/12MHz) = 1us.
3. What is the time delay for the following program if the crystal frequency is 16MHz?
MOV A,#55H
ACALL DELAY
CPL A
SJMP AGAIN
;---time delay-------
RET
A) 108.5us
B) 136.5us
C) 217.0us
D) 435.0us
E) 870.0us
Answer: B) 136.5us
Explanation: The time delay is calculated by [(number of cycles in delay loop x 2) + 1 + 2] x period of
machine cycle. In this case, the delay loop has 100 cycles, so [(100x2) + 1 + 2] x (12/16MHz) =
136.5us.
4. What is the size of the delay in the following program if the crystal frequency is 11.0592MHz?
NOP
DJNZ R3,HERE
DJNZ R2,AGAIN
RET
A) 1.085us
B) 2.17us
C) 4.34us
D) 8.68us
E) 17.36us
Answer: D) 8.68us
Explanation: The delay loop has 150 x 200 = 30,000 cycles. Therefore, [(30,000x2) + 1 + 2] x
(12/11.0592MHz) = 8.68us.
5. For the following program, what is the period of machine cycle if the crystal frequency is 8MHz?
HERE: NOP
NOP
DJNZ R5,HERE
DJNZ R4,AGAIN
RET
A) 0.75us
B) 1.0us
C) 1.5us
D) 2.0us
E) 3.0us
Answer: C) 1.5us
Explanation: Using the formula, period of machine cycle = 12/oscillator frequency, we get 12/8MHz =
1.5us.
1. In the code snippet provided, what does the instruction "MOV R2,#200" do?
Answer: a) Moves the value 200 into register R2. This instruction initializes the value of register R2 to
200.
2. How long does the entire code snippet take to execute, given that Tmc = 1.085us?
a) 1085us
b) 217000us
c) 217651us
d) 140us
Answer: c) 217651us. This is calculated by adding the time it takes to execute the HERE loop (1085us)
and the time it takes to execute the AGAIN loop (200 x 1085us), and adding the additional time for the
instructions at the start and end of the AGAIN loop (651us).
3. In the code snippet provided in example 86, what is the value of Tmc?
a) 140
b) 55
c) 1.085us
d) Not specified