🎓 BookMCQ
← Back to 12. Direct Memory Access Controller: 8257

📝 DMA Interfacing Circuit of 8257 (21 MCQs)

Connecting the 8257 Between the 8085A, Memory and Peripherals

The 8257 DMA interfacing circuit connects the controller to the 8085A system bus, memory and up to four peripheral devices. It permits the controller to become bus master after a request is accepted, allowing direct transfer between a selected peripheral and memory. Address latches, bus buffers and control connections ensure that address and data signals reach the correct system components.

HOLD and HLDA Connections for Bus Ownership Transfer

The 8257 HRQ output connects to the 8085A HOLD input, while the processor HLDA output returns to the controller's HLDA input. When a peripheral asserts DRQn, the controller requests the bus. After the 8085A releases its buses and asserts HLDA, the 8257 can conduct the DMA cycle.

Address Latch and Data Bus Connections in the DMA Circuit

The 8257 outputs the low address byte on A0–A7 and places the high byte on D0–D7. An external 8212 latch captures the high byte when ADSTB becomes active, supplying A8–A15. AEN controls bus isolation and prevents ordinary device-selection logic from responding to address information during DMA operation.

Example of a Peripheral-to-Memory DMA Write Connection

When a data-acquisition device raises DRQ2, the 8257 requests the system bus. After HLDA, DACK2 selects the device, I/OR reads its data, and MEMW writes the byte into the addressed memory location. The address advances after the transfer, and TC signals the final programmed cycle.

Control, Timing and Peripheral Selection Connections

MEMR and MEMW connect to memory control inputs, while I/OR and I/OW connect to peripheral read/write controls. READY accommodates devices requiring additional access time. CLK and RESET provide timing and initialization, CS selects the controller during programming, and DACK0–DACK3 identify the peripheral granted service.

Correcting Common DMA Circuit Connection Mistakes

'HRQ connects to the processor HLDA input' is incorrect because HRQ connects to HOLD and HLDA returns from the processor. 'The high address byte is permanently available on A0–A7' is incorrect because these lines carry the low byte. 'DACK is the processor bus request' is incorrect because HRQ performs that function.

Interfacing Diagrams and Signal Tracing for Examinations

Trace the request and acknowledgement path from DRQn through HRQ, HOLD, HLDA and DACKn. Identify the 8212 latch, ADSTB and AEN, then follow the memory and I/O control pairs for the required transfer direction. Distinguish the controller's programming connections from its bus-master connections during an actual DMA cycle.

Interface Signals and External Hardware Terms

  • HOLD - Requests processor bus release.
  • HLDA - Confirms processor bus release.
  • 8212 - Latches the high address byte.
  • AEN - Disables normal device selection.
  • DRQ - Requests a DMA transfer.
  • DACK - Selects the requesting peripheral.
  • READY - Allows DMA wait states.
4
Easy
11
Medium
6
Hard

📝 All DMA Interfacing Circuit of 8257 MCQs

Q1. What is the name of the programmable DMA controller used with the 8085 microprocessor?

A.8255
B.8257 ✅
C.8253
D.8259
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The 8257 is the dedicated programmable DMA controller designed to work with the 8085 and similar microprocessors. Option A (8255) is a programmable peripheral interface, not a DMA controller. Option C (8253) is a programmable interval timer, and Option D (8259) is an interrupt controller. Therefore, the correct answer is B because the 8257 provides the required DMA functionality, allowing direct memory‑I/O transfers without CPU intervention.

Q2. How many independent DMA channels does the 8257 controller provide?

A.2
B.3
C.4 ✅
D.5
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The 8257 offers four separate channels, each capable of handling its own address and count registers. Options A and B list fewer channels than the controller actually provides, while Option D exceeds the hardware capability. Because the controller was specifically designed to support up to four concurrent DMA operations, the correct answer is C, reflecting the four‑channel architecture that simplifies peripheral interfacing.

Q3. Why does using DMA reduce CPU overhead compared to programmed I/O?

A.It allows the CPU to execute instructions faster
B.It eliminates the need for the CPU to transfer each byte ✅
C.It increases bus speed
D.It reduces memory size
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: DMA transfers move data directly between memory and a peripheral, so the CPU no longer has to fetch each byte, store it in a register, and write it out again. Option A is inaccurate because execution speed is unrelated to DMA. Option C misstates the effect on bus velocity, and Option D confuses memory capacity. Hence, B is correct because removing per‑byte handling frees the CPU for other tasks.

Q4. What is the purpose of the 'Acknowledge' signal in a DMA transfer?

A.To start the CPU
B.To release the address bus
C.To indicate the controller is ready ✅
D.To reset the DMA controller
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: When an I/O device raises a DMA request, the CPU responds with an Acknowledge (ACK) signal, informing the DMA controller that it may take control of the bus. Option A suggests the opposite effect, Option B describes the HOLD/HLDA mechanism, and Option D is unrelated. Therefore, C is correct because the ACK tells the DMA unit that the system has granted permission to commence the transfer.

Q5. A system uses an 8257 DMA controller to transfer a block of 1024 bytes from memory address \0x2000\ to an I/O device. Which register pair must be programmed with the starting address?

A.Page register
B.Address register ✅
C.Count register
D.Mode register
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The starting address of a DMA transfer is stored in the address register (often split into low and high bytes). The page register holds only the upper bits of the address, not the full starting location. The count register keeps the byte count, while the mode register defines transfer type. Thus, the address register pair must be loaded with \0x2000\ to point the controller at the correct memory location.

Q6. If the DMA count register holds value \0x03FF\ (10 bits), how many bytes will be transferred before the controller signals completion?

A.1023 ✅
B.1024
C.511
D.512
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The count register in the 8257 stores the number of bytes minus one, so a value of \0x03FF\ equals decimal 1023. This means the controller will move 1023 + 1 = 1024 bytes, but the question asks for the number represented by the stored value, which is 1023. Options B, C, and D do not match the stored count, making A the correct choice.

Q7. How does the 8257 determine which channel gets bus control when multiple devices request DMA simultaneously?

A.Fixed priority ✅
B.Round‑robin
C.Random
D.FIFO
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The 8257 uses a fixed priority scheme, where channel 0 has the highest priority and channel 3 the lowest. This deterministic method ensures predictable arbitration. Round‑robin and FIFO would require additional logic not present in the 8257, while a random selection would be unsuitable for reliable system design. Consequently, the controller’s built‑in fixed‑priority logic makes option A the correct answer.

Q8. What is the role of the two most significant bits in the 8257 count register?

A.Define transfer mode
B.Select address bus width
C.Indicate operation type (read/write) ✅
D.Set interrupt vector
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The two high‑order bits of the count register are reserved to specify the direction of the transfer—whether the DMA controller reads from memory and writes to the peripheral or vice‑versa. They do not choose a transfer mode, bus width, or interrupt vector, which are controlled by other registers. Hence, option C correctly identifies the purpose of those bits.

Q9. A microcontroller needs to read data from a peripheral using DMA channel 2. The peripheral asserts DRQ. Which signal must the CPU assert to allow the DMA controller to take control?

A.HOLD ✅
B.HLDA
C.INTA
D.RESET
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When a peripheral raises a DMA request (DRQ), the CPU must respond with the HOLD signal, indicating that it is willing to relinquish the address and data buses. HLDA is the acknowledgment from the CPU that it has actually released the bus, INTA is for interrupt acknowledgment, and RESET clears the system. Therefore, the CPU asserts HOLD, making option A correct.

Q10. During a DMA write operation, after the CPU sends the Acknowledge signal, what is the next step performed by the 8257?

A.It increments the address register
B.It reads data from the peripheral
C.It places data on the data bus for the peripheral ✅
D.It generates an interrupt
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Once the CPU acknowledges the request, the DMA controller takes control of the bus and puts the next byte of data onto the data lines so the peripheral can receive it. Incrementing the address register occurs after the transfer, reading from the peripheral applies to a read operation, and interrupt generation happens only after the transfer completes. Therefore, placing data on the bus (option C) is the correct next action.

Q11. If a DMA transfer is set up with a count of \0x0000\, what will be the effect on the transfer?

A.Transfer 0 bytes ✅
B.Transfer 65536 bytes
C.Transfer 1 byte
D.Transfer 0xFFFF bytes
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: In the 8257, a count value of zero means that one byte will be transferred because the controller interprets the count as (value + 1). Thus, the transfer does not stop immediately (option A) nor does it interpret the zero as the maximum count (options B and D). Consequently, the correct outcome is a single‑byte transfer, option C.

Q12. A system requires simultaneous DMA transfers on two channels. How can the 8257 ensure that the second channel starts only after the first channel completes?

A.Use cascade mode
B.Enable auto‑request
C.Program channel 2 with higher priority
D.Use mask registers to disable channel 2 until channel 1 finishes ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Mask registers allow the programmer to temporarily disable a channel. By keeping channel 2 masked while channel 1 is active, the controller will not grant bus control to channel 2 until the mask is cleared after channel 1’s completion. Cascade mode and auto‑request relate to chaining devices, and assigning higher priority would cause channel 2 to start earlier, not later. Hence, option D is correct.

Q13. Why must the DMA controller be placed on the same bus width as the microprocessor?

A.To match voltage levels ✅
B.To ensure compatible address lines
C.To allow simultaneous data transfer without timing issues
D.To reduce power consumption
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: A DMA controller sharing the same bus width can drive the data lines at the same rate as the CPU, preventing timing mismatches that could corrupt data. Voltage level matching (A) is handled by power supplies, address line compatibility (B) is a separate concern, and power consumption (D) is not the primary reason. Therefore, simultaneous transfer without timing problems (C) explains the requirement.

Q14. What advantage does a 16‑bit address register provide over an 8‑bit register in the 8257?

A.Faster transfer speed
B.Ability to address larger memory space ✅
C.Reduced pin count
D.Simpler programming
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A 16‑bit address register can point to any location within a 64 KB address space, whereas an 8‑bit register can only address 256 locations. This expanded range is essential for modern memory sizes. Transfer speed (A) depends on bus timing, pin count (C) actually increases with wider registers, and programming complexity (D) is not an advantage. Thus, option B correctly identifies the benefit.

Q15. A designer wants to use the 8257 to transfer a block of data from memory to a UART. The UART requires data to be sent MSB first. Which feature of the DMA controller must be configured to match this requirement?

A.Transfer mode
B.Address increment direction
C.Data bus polarity
D.None; the UART handles bit order ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The DMA controller moves whole bytes; it does not control the order of bits inside a byte. Bit ordering (MSB‑first or LSB‑first) is managed by the UART hardware or its configuration registers. Therefore, no DMA setting needs to be changed, making option D the correct answer.

Q16. In a system with 8085 CPU, the 8257 DMA controller, and two peripherals, a bug causes the CPU to hang after a DMA transfer. Investigation shows that the HLDA line is never released. Which of the following is the most probable cause?

A.The CPU did not receive the HOLD signal
B.The DMA controller failed to assert the Acknowledge
C.The CPU's HOLD line is held low due to faulty wiring ✅
D.The peripheral did not de‑assert its DRQ
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: If HLDA (Hold Acknowledge) remains asserted, the CPU believes it must keep the bus under DMA control. The most common reason is that the HOLD line, which the CPU monitors, is stuck low because of a wiring fault, preventing the CPU from clearing HLDA. Options A and B describe opposite directions of control, and D concerns the peripheral, not the CPU’s bus‑release logic. Hence, C is the most plausible cause.

Q17. Consider a scenario where a DMA transfer is interrupted by an unexpected high‑priority interrupt. How should the system restore the DMA operation after the interrupt service routine completes?

A.Restart the transfer from the beginning
B.Resume using the saved address and count registers ✅
C.Increment the address register manually
D.Disable DMA and use programmed I/O
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The 8257 automatically saves the current address and count values when an interrupt occurs, allowing the transfer to resume from the exact point of interruption. Restarting (A) would waste time, manual increment (C) is error‑prone, and disabling DMA (D) defeats the purpose of using DMA. Consequently, the correct approach is to resume using the saved registers, option B.

Q18. Explain why the 8257 uses separate address and count registers for each channel instead of a single combined register.

A.To simplify hardware design
B.To allow independent control of source address and transfer length ✅
C.To reduce power consumption
D.To enable compatibility with older CPUs
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Separating the address and count registers lets the controller keep track of where data is located (address) and how many bytes remain (count) independently for each channel. This independence enables overlapping transfers and flexible programming. A single combined register would couple address and length, making it impossible to change one without affecting the other. Options A, C, and D do not capture the primary functional benefit, so B is correct.

Q19. How does the DMA controller interact with the CPU's interrupt system when a transfer completes, and why is this interaction important for system stability?

A.It generates a non‑maskable interrupt ✅
B.It raises the INTA line
C.It asserts the terminal count (TC) interrupt
D.It resets the CPU
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the count register reaches zero, the 8257 asserts the terminal count (TC) interrupt, signaling the CPU that the DMA operation has finished. This allows the CPU to service any post‑transfer tasks or to start another operation. Generating a non‑maskable interrupt (A) would be too severe, raising INTA (B) is part of normal interrupt acknowledgement, and resetting the CPU (D) would disrupt operation. Therefore, C correctly describes the interaction.

Q20. A designer needs to transfer 5000 bytes using the 8257, which can only count up to 65535. However, the count register is only 14 bits for the byte count. How should the designer configure the registers to accomplish the transfer?

A.Use two successive DMA transfers ✅
B.Program count as 5000 and ignore overflow
C.Use auto‑reload mode
D.Increase the address register by 5000 each time
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Because the 14‑bit count field can represent up to \2^{14}\ = 16384, a single 5000‑byte transfer fits comfortably; however, if the design required more than the maximum, the usual technique is to break the block into multiple DMA operations. Using two successive transfers ensures each segment stays within the count limit and allows the controller to handle the full 5000‑byte block reliably. Options B, C, and D do not correctly address the limitation, making A the appropriate solution.

Q21. During a high‑speed data acquisition, the DMA controller must operate in a mode where the address increments after each byte transferred. Which mode setting in the 8257 must be selected to achieve this behavior?

A.Fixed address mode ✅
B.Increment address mode
C.Decrement address mode
D.Page mode
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The 8257 provides an increment‑address mode where the internal address register automatically adds one after each byte, allowing sequential memory access. Fixed address mode (A) would keep the address constant, decrement mode (C) would move backwards, and page mode (D) deals with high‑order address bits only. Therefore, selecting increment address mode (B) correctly implements the required behavior.

🔗 Related Topics (MCQs)