Microprocessors · Digital Electronics
22 questions · asked in 13 of 26 years (2001–2026)
MCQ 20 · NAT 21-mark 18 · 2-mark 4
Questions 11–15 of 22
Answer: (A)
With memory-mapped I/O, the device is handled like a memory location (2500H). So we use memory-reference instructions.
- LXI H, 2500H puts the address 2500H into the HL pair. So HL now points to the device.
- MOV A, M takes the data from the location HL points to (the input device) and puts it in the accumulator.
MOV M, A (options B and D) sends the accumulator data out to the device. That is output, not input. LHLD 2500H (options C and D) fills HL with the contents of locations 2500H/2501H. It does not load the address 2500H.
Correct answer: (A)Such a division can be correctly performed by the following set of operatings
Answer: (A)
The figure shows:
- R1 is rotate right through carry. The LSB goes C, and C goes MSB.
- R2 is rotate right without carry. The LSB goes C, and the LSB also goes MSB.
- L1 and L2 are the same operations to the left (the MSB goes to C).
To divide a 2's complement number by 2, we do an arithmetic right shift. Every bit moves right and the sign bit is copied into the MSB. Take Reg = 11010110:
- L2: the MSB (sign bit = 1) goes to C and to the LSB, so Reg = 10101101 and C = 1.
- R2: this undoes L2, so Reg = 11010110 and C = 1 (C now holds the sign bit).
- R1: C (the sign) enters the MSB and the bits shift right, so Reg = 11101011. This is -21 = -42/2.
So the sequence L2, R2, R1 does the division correctly.
Correct answer: (A)Suppose Reg contains the 2's complement number 11010110. If this number is divided by 2 the answer should be
Answer: (D)
The 2's complement number 11010110 equals .
When we divide it by 2, we get . In 8-bit 2's complement: , so .
This is the same as an arithmetic right shift of 11010110. Every bit moves right by one place, and the sign bit (1) is copied into the MSB.
Option (A), 01101011, comes from a logical shift, and it changes the sign. The other options do not give -21.
Correct answer: (D)Answer: (C)
A bus request (BRQ, like HOLD in the 8085) only asks the CPU to release its buses. The CPU can do this at the end of any machine cycle, so BRQ is sampled after every machine cycle.
Option (A) swaps the two: it says BRQ is sampled once per instruction and INT after every machine cycle. Options (B) and (D) give both pins the same sampling point, which is not true.
Answer: (C)
Answer: (A)
XCHG
INR M
Why the others fail: INX H in (B) increments the HL pair itself (the address), not the memory byte. In (C), INX D increments the address in DE, and XCHG only swaps the pairs, so no memory byte changes. In (D), INR M runs before HL holds the address, so it increments the wrong location.
Answer: (A)
Keep practising