📝 Read/Write Control Logic in 8085A Microprocessor (17 MCQs)
Processor Access Control Inside the 8251A
The read/write control logic of the 8251A manages data and control transfers between the USART and the 8085A. It responds to chip selection, read and write commands, and the C/D selection input. These signals determine whether the processor writes a character, reads received data, loads a control word or obtains communication status.
Meaning of CS, C/D, RD and WR Signals
CS is active low and selects the 8251A. C/D distinguishes data from control or status operations: low selects data, while high selects control or status. RD and WR are active-low read and write inputs. CLK provides internal timing, and RESET is active high.
Register Selection During Read and Write Operations
With the device selected, C/D low and WR low, the data bus transfers a character into the transmitter. With C/D low and RD low, the processor reads the receive buffer. With C/D high, a write loads the mode or command word according to the initialization state, while a read returns status information.
Example of Reading the Status Register
Suppose an address decoder selects the 8251A at status port 81H and data port 80H. The 8085 executes IN 81H with C/D high and RD active. The controller places the status byte on D0–D7, allowing software to test TxRDY, RxRDY and error flags.
Coordination with the 8085A I/O Interface
The processor's address decoder generates CS for the assigned port addresses, while the I/O read and write controls connect to RD and WR. C/D can be connected to a decoded address bit. In a system using the 8085 multiplexed AD0–AD7 lines, an address latch separates the low-order address from data.
Clarifying Data and Control Register Access
'C/D low selects the command register' is incorrect because it selects the data path. 'RD and WR are active high' is incorrect because both control inputs are active low. 'CS high enables the USART' is incorrect because CS must be low for a register access.
Control Signal Combinations in 8251A Interface Questions
Determine the operation by combining CS, C/D, RD and WR rather than considering one signal alone. Remember that C/D low accesses transmit or receive data, while C/D high accesses control or status. Identify the active-low controls and explain how address decoding connects the USART to the 8085A I/O space.
Read/Write Selection and Processor Control Terms
- CS - Active-low chip selection input.
- C/D - Selects data or control/status.
- RD - Active-low processor read input.
- WR - Active-low processor write input.
- RESET - Active-high device reset.
- CLK - Supplies internal device timing.
📝 All Read/Write Control Logic in 8085A Microprocessor MCQs
Q1. What is the maximum number of bytes that can be transferred in a single DMA operation using the 8257 controller?
📖 Explanation: The 8257 uses a 14‑bit field in the terminal count register to hold the transfer size, allowing values from 0 up to . Because the count represents bytes, the highest practical transfer is 16 KB (16 384 bytes) when the controller is programmed to use the full range. Option B reflects this limit. The other choices either exceed the register capacity or are too small, making them incorrect.
Q2. Which bits of the 16‑bit terminal count register are used to store the operation code that selects read or write mode?
📖 Explanation: The two most significant bits of the terminal count register (bits 15 and 14) are reserved for the operation code, indicating whether the DMA channel will perform a read or a write. This design lets the controller quickly determine the transfer direction. Bits 13‑12, 7‑6, and 1‑0 are used for other purposes such as the actual count, so they do not define the mode.
Q3. A system programmer configures a DMA channel to move 20 000 bytes. Will the 8257 accept this transfer without processor intervention?
📖 Explanation: The terminal count register can store only 14 bits for the byte count, giving a maximum of bytes. Since 20 000 bytes exceeds this limit, the controller cannot complete the transfer on its own and would require the CPU to intervene or split the transfer. Therefore option B is correct; the other statements either misinterpret the limit or ignore the register size.
Q4. What role does the HRQ (HOLD Request) pin play in coordinating DMA with the CPU?
📖 Explanation: HRQ is asserted by the DMA controller when it needs control of the system bus. The CPU, upon seeing HRQ, must complete any current bus cycles, place the bus in a high‑impedance state, and wait for the HLDA (HOLD Acknowledge) signal. This handshake ensures that the DMA transfer can proceed without contention. Resetting the controller, acknowledging data, or selecting a channel are unrelated functions, making the other options incorrect.
Q5. In a configuration where Channel 2 is assigned to a disk drive, the address register holds 0x1A00 and the terminal count register holds 0x0C00. How many bytes will be transferred before the terminal count is reached?
📖 Explanation: The terminal count register stores the byte count in its lower 14 bits. Hexadecimal 0x0C00 equals bytes. The DMA controller decrements this count each byte transferred until it reaches zero, signalling completion. Therefore the transfer length is 3072 bytes, matching option A. The other numeric options arise from mis‑reading the hex value or adding extra bytes that are not represented in the register.
Q6. How does the DACK (DMA Acknowledge) signal interact with the IOR and IOW lines during a read operation?
📖 Explanation: During a read cycle, the DMA controller asserts DACK to inform the peripheral that it is the current bus master. At the same time, the IOR (I/O Read) line is driven low to indicate that a read transaction is occurring. IOW remains high because no write is taking place. Hence option A correctly describes the coordination. Options B and C describe write‑related behavior, and D is inaccurate because DACK does influence the I/O control lines.
Q7. A microprocessor issues a HOLD request while a DMA transfer is in progress. If the DMA controller asserts HLDA, what should the CPU do next?
📖 Explanation: When the DMA controller drives HLDA high, it is granting the bus to the DMA engine. The CPU must cease any further bus activity and wait until HLDA is de‑asserted before resuming normal operation. Continuing execution (option A) would cause bus contention, while immediately releasing the bus (option C) is redundant because HLDA already indicates control transfer. Resetting the DMA controller (option D) is unnecessary and would abort the transfer.
Q8. Why does the 8257 include a separate Mode Set Register for each channel?
📖 Explanation: Each DMA channel can operate in a different mode—such as demand, single, block, or cascade—and may require distinct address increment or decrement behavior. The Mode Set Register holds these per‑channel settings, enabling the controller to manage multiple devices with differing requirements simultaneously. Storing actual data, generating interrupts, or handling power are not functions of the Mode Set Register, so the remaining choices are incorrect.
Q9. A system uses channel 0 for a printer that requires block transfers of 256 bytes. The programmer loads the terminal count register with 0x0100. After the transfer completes, which pin indicates that the count has reached zero?
📖 Explanation: When the terminal count register decrements to zero, the 8257 asserts the TC (Terminal Count) pin to signal that the programmed byte count has been exhausted. This pin can be used to trigger an interrupt or to start a new operation. HRQ relates to bus arbitration, READY indicates peripheral readiness, and MARK is used for modulo addressing, none of which directly indicate count exhaustion.
Q10. What is the effect of setting the MARK pin high while the DMA controller is operating in auto‑initialize mode?
📖 Explanation: When MARK is asserted, the controller interprets it as a signal to reload the address registers with the values stored in the base registers during auto‑initialize. This allows continuous circular transfers without CPU intervention. The other options describe functions that are not associated with MARK: disabling requests, clearing counts, or generating interrupts are handled by different pins or registers.
Q11. A designer connects DRQ3 to a peripheral that generates requests at irregular intervals. Which pin must be monitored by the CPU to know when the DMA controller has finished the current transfer?
📖 Explanation: The TC (Terminal Count) pin goes active when the DMA channel’s count reaches zero, indicating that the programmed transfer has completed. Monitoring TC lets the CPU determine when the bus is again available or when it should prepare for the next operation. READY signals peripheral status, HRQ is used for bus arbitration, and RESET merely initializes the controller, so they do not directly convey transfer completion.
Q12. Explain how the combination of AEN (Address Enable) and ADSTB (Address Strobe) pins allows the 8257 to perform address multiplexing on the system bus.
📖 Explanation: AEN is asserted when the DMA controller wants to place an address on the bus, temporarily disabling other address drivers. ADSTB then generates a strobe that tells the system to latch the presented address. This coordinated action lets the controller share the same physical lines for both address and data, reducing pin count. The other statements mischaracterize the pins’ functions or claim no relationship, which is inaccurate.
Q13. A system requires a DMA transfer of exactly 16 384 bytes from memory to an I/O device. The programmer sets the terminal count register to its maximum value. Which two most significant bits of the register must be cleared to indicate a write operation, and what is the hexadecimal value written to the register?
📖 Explanation: The terminal count register uses bits 15‑14 for the operation code; clearing them (00) selects a write operation. The remaining 14 bits hold the byte count, and the largest value they can represent is decimal, which is 0x3FFF in hexadecimal. Therefore the correct combination is 00 for the mode bits and 0x3FFF for the count, matching option A. The other options either set the mode bits incorrectly or exceed the 14‑bit count limit.
Q14. During a DMA operation, the CPU reads the status word register and sees the bits pattern 0b0101 0010. Interpreting this pattern, which of the following statements is true?
📖 Explanation: In the 8257 status word, bits 7‑4 indicate which channel is currently active, and bit 2 (TC) signals whether the terminal count has been reached. The pattern 0101 0010 shows bit 6 (channel 1 flag) set while the TC bit (bit 2) is low, meaning the channel is active and the count is still pending. Hence option A correctly describes the situation. The other statements either misread the bit fields or assume error flags that are not present in this pattern.
Q15. Why does the 8257 require both a separate Data Bus Buffer and a Read/Write Logic block instead of using a single bidirectional buffer?
📖 Explanation: The Data Bus Buffer isolates the DMA controller from the system data lines, while the Read/Write Logic determines whether the transfer is a read or a write and generates the appropriate control signals. Keeping these functions separate lets the controller manage data direction and timing independently, improving reliability and allowing precise coordination with peripheral signals. Reducing delay, increasing power, or minimizing pins are not the primary reasons for this architectural split.
Q16. If the clock input (CLK) to the 8257 is driven at 4 MHz and a DMA transfer moves one byte per clock cycle, how long will it take to transfer the maximum 16 K bytes?
📖 Explanation: At 4 MHz, the controller can transfer 4 000 000 bytes each second. The maximum transfer size is 16 384 bytes. Dividing the byte count by the transfer rate gives seconds, which is approximately 4 ms. Therefore option A is correct. The other time values correspond to slower clock rates or multiple‑byte cycles, which do not match the given conditions.
Q17. How does the modulo (MARK) pin influence the address generation when the DMA controller is set to page mode, and what advantage does this provide for circular buffer implementations?
📖 Explanation: When MARK is asserted in page mode, the address generator treats the high‑order bits of the address as a fixed page value, causing the low‑order bits to wrap around once they reach the page limit. This behavior creates a natural circular buffer without software intervention, allowing continuous streaming of data. Resetting to zero, disabling increment, or generating interrupts are unrelated to the paging function, making the other options incorrect.