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

📝 Control Logic of 8257 (18 MCQs)

Sequencing and Address Generation During DMA Operation

The 8257 control logic coordinates bus acquisition, memory address generation and the sequence of DMA transfer operations. It works with the selected channel's address and terminal count registers, controls the transfer signals and updates the address and count after each cycle. Its associated signals connect the controller with the 8085A, memory and requesting peripheral.

HRQ and HLDA Handshake for System Bus Control

When an enabled channel receives a valid request, control logic raises HRQ, normally connected to the 8085A HOLD input. The processor completes its current bus operation and responds with HLDA after releasing the system buses. The 8257 then operates as bus master until the required DMA activity ends.

Address Strobing and Isolation of Normal Bus Devices

The controller outputs the low address byte on A0–A7 and presents the high byte on D0–D7 for capture by an external latch. ADSTB is an active-high pulse used for this capture. AEN isolates or disables normal bus selection so that other devices do not respond to the DMA address.

Example of a DMA Cycle with a Slow Peripheral

Suppose a peripheral requests a transfer while its READY signal is low. The 8257 inserts wait states until READY becomes high, allowing the device sufficient access time. Control logic then completes the transfer, updates the channel address and count, and continues or releases the bus according to the pending requests.

Terminal Count, Modulo Mark and Transfer Completion

The active-high TC output indicates the last DMA cycle of the programmed block when the selected count reaches zero. MARK provides a separate modulo-128 indication to the peripheral after the specified number of DMA cycles. The mode set register can enable TC STOP, which disables a channel after terminal count.

Misunderstandings About DMA Bus Control Signals

'HLDA is generated by the 8257' is incorrect because it is an acknowledgement input from the processor. 'ADSTB performs the same job as HOLD' is incorrect because it latches the high address byte. 'TC means the entire processor has stopped' is incorrect because it signals completion of the selected DMA block.

Handshake and Timing Signals to Trace in Examinations

Trace the sequence DRQ, HRQ, HLDA, DACK and the memory/I/O control signals. Identify ADSTB as the high-address latch strobe and AEN as a bus-isolation control. Explain how READY inserts wait states, how the address advances, and how TC and MARK communicate transfer progress to external devices.

DMA Sequencing and Handshake Terms

  • HRQ - Requests system bus ownership.
  • HLDA - Confirms bus release.
  • READY - Controls insertion of wait states.
  • AEN - Disables normal bus selection.
  • ADSTB - Latches the high address byte.
  • TC - Indicates the final DMA cycle.
  • MARK - Signals modulo-128 transfer progress.
3
Easy
9
Medium
6
Hard

📝 All Control Logic of 8257 MCQs

Q1. What is the primary function of the Intel 8257 DMA controller?

A.Generate interrupts ✅
B.Control the system clock
C.Transfer data between memory and I/O without CPU intervention
D.Decode instruction opcodes
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The 8257 is designed to move blocks of data directly between memory and peripheral devices, bypassing the central processor. This reduces CPU load and speeds up transfers. Option A is incorrect because while the 8257 can generate interrupt requests, that is not its main purpose. Option B describes a clock generator, which the 8257 does not provide. Option D refers to instruction decoding, a function of the CPU, not the DMA controller. The correct answer highlights the controller’s core role in off‑loading data movement.

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

A.Two ✅
B.Four
C.Eight
D.Six
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The 8257 contains four separate channels, each capable of handling its own address and byte‑count registers. This allows up to four peripherals to be serviced concurrently. Option A is half the correct number, while options C and D exceed the physical channel count of the device. Understanding the channel count is essential for system designers who need to allocate DMA resources among multiple I/O devices.

Q3. Why does using DMA improve data transfer speed compared to CPU‑mediated transfers?

A.DMA allows the CPU to execute instructions faster ✅
B.DMA eliminates the need for address decoding
C.DMA transfers data directly over the bus, freeing the CPU to perform other tasks
D.DMA uses a higher clock frequency than the CPU
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: When DMA is active, the controller takes control of the address and data buses, moving blocks of data without involving the CPU for each byte. This eliminates the overhead of fetching data into the accumulator and then writing it out, dramatically increasing throughput. Option A misstates the effect; the CPU does not become faster. Option B is unrelated to speed, and option D is false because the DMA controller operates at the same bus speed as the CPU.

Q4. How does the 8257's address register interact with memory during a DMA cycle?

A.It holds the address of the next byte to be read or written ✅
B.It stores the base address of the program counter
C.It contains the address of the interrupt vector table
D.It keeps the address of the stack pointer
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: During each DMA transfer, the address register supplies the exact memory location for the next read or write operation. After the transfer, the register is automatically incremented (or decremented) according to the mode, preparing for the subsequent byte. Options B, C, and D describe registers used by the CPU, not by the DMA controller, and therefore do not describe the address register’s role in DMA operations.

Q5. What is the role of the two most significant bits of the 8257 byte‑count register?

A.They select the DMA channel number
B.They indicate the transfer direction (read/write) ✅
C.They specify the type of operation, such as demand, block, or cascade mode
D.They determine the priority level of the channel
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The high‑order bits of the 14‑bit byte‑count register are used to define the transfer mode: demand (continuous), block (fixed‑size), or cascade (channel chaining). This setting tells the controller how to respond to request signals. Options A and D relate to channel selection and priority, which are handled by separate pins. Option B is about direction, which is controlled by other signals, not by these bits.

Q6. How does the acknowledge signal affect the CPU's control of the bus during a DMA request?

A.It forces the CPU to reset
B.It tells the CPU to pause its current bus cycle and release the bus
C.It instructs the CPU to increase its clock speed ✅
D.It causes the CPU to enter a low‑power state
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: When an I/O device asserts a DMA request, the controller sends an acknowledge (ACK) signal once it is ready to take over the bus. This signal instructs the CPU to complete any current operation and then relinquish control of the address and data lines, allowing the DMA controller to perform the transfer. Options A and D describe actions not related to bus arbitration, while option C incorrectly suggests a clock change.

Q7. In what way does the 8257 enable multiple I/O devices to operate without bus conflicts?

A.It provides separate physical buses for each device ✅
B.It assigns unique priority levels to each channel and arbitrates requests
C.It disables all devices except the one currently using the CPU
D.It uses time‑division multiplexing to share the bus among devices
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The 8257 includes priority pins and request/acknowledge lines that let it decide which device gains bus control when several request DMA simultaneously. By granting the highest‑priority channel first, the controller prevents two devices from driving the bus at the same time, avoiding contention. Option A is unrealistic because the controller uses a single shared bus. Option C would defeat the purpose of DMA, and option D describes a technique not implemented in the 8257.

Q8. Why is it important that the byte‑count register holds the total number of bytes to transfer?

A.It determines the length of the DMA burst and prevents overrunning memory or peripheral buffers
B.It sets the voltage level for the data bus
C.It configures the clock speed of the DMA controller
D.It selects which peripheral device will be used ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The byte‑count register tells the DMA controller exactly how many bytes to move before halting the transfer. This prevents the controller from reading beyond the intended data block, which could corrupt memory or overflow device buffers. Options B and C describe unrelated hardware characteristics, and option D confuses the register’s purpose with device selection.

Q9. How does the DMA controller handle bus arbitration when multiple devices request DMA at the same time?

A.It randomly selects a device ✅
B.It uses a fixed priority scheme defined by the channel order
C.It merges the data from all devices into a single stream
D.It delays all requests until the CPU initiates a new cycle
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The 8257 resolves simultaneous requests by consulting its priority hierarchy, typically Channel 0 highest down to Channel 3 lowest. The highest‑priority pending request receives the acknowledge signal first, ensuring orderly access and preventing bus contention. Random selection (option A) would lead to unpredictable behavior, merging data (option C) is not possible on a shared bus, and delaying all requests (option D) would defeat the purpose of DMA.

Q10. A system uses the 8257 with two devices: Device A needs to transfer 1024 bytes and Device B needs 256 bytes. Which channel configuration ensures both transfers complete without overflow?

A.Assign Device A to Channel 0 and Device B to Channel 1, both in block mode
B.Assign Device A to Channel 0 in cascade mode and Device B to Channel 2 in demand mode ✅
C.Assign Device A to Channel 3 and Device B to Channel 0, both in demand mode
D.Assign both devices to the same channel using time‑division multiplexing
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: By placing each device on a separate channel (0 and 1) and selecting block mode, the controller will allocate distinct address and byte‑count registers for each transfer, preventing overlap. Cascade mode (option B) would chain transfers incorrectly, demand mode (option C) may not guarantee the exact byte count, and sharing a single channel (option D) would cause contention and possible data loss.

Q11. If a DMA transfer is set up with a starting address of 0x20000x2000 and a byte count of 500, what will be the address of the last byte transferred?

A.0x21F30x21F3
B.0x21F40x21F4 ✅
C.0x21F50x21F5
D.0x22000x2200
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The last address equals the start address plus the count minus one: 0x2000+500−1=0x2000+0x1F3=0x21F30x2000 + 500 - 1 = 0x2000 + 0x1F3 = 0x21F3. However, because the count includes the first byte, the final address is 0x21F30x21F3. The correct answer is therefore option B, which reflects the proper calculation. Options A and C are off by one byte, and option D exceeds the range.

Q12. During a DMA operation, the CPU receives an interrupt after each block. How should the interrupt service routine be designed to resume CPU tasks efficiently?

A.It should reset the DMA controller and halt the CPU ✅
B.It should clear the interrupt flag, update any required pointers, and then return to the interrupted task
C.It should re‑initialize the entire system memory
D.It should disable all DMA channels permanently
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The ISR must acknowledge the interrupt, possibly adjust software pointers to reflect the transferred data, and then execute a return-from-interrupt instruction so the CPU can continue where it left off. Resetting the controller (option A) or re‑initializing memory (option C) would be unnecessary and disruptive. Permanently disabling DMA (option D) defeats the purpose of using DMA.

Q13. A designer wants to connect a high‑speed ADC to an 8085 using DMA. Which feature of the 8257 is most critical for maintaining data integrity?

A.Its ability to generate clock pulses ✅
B.Its demand‑transfer mode that responds instantly to ADC requests
C.Its cascade mode for chaining multiple DMA operations
D.Its built‑in error‑checking parity generator
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: High‑speed ADCs produce data continuously; the demand‑transfer mode allows the DMA controller to service the ADC’s request as soon as data is ready, preventing missed samples. Clock generation (option A) is not a function of the 8257, cascade mode (option C) is for chaining transfers, and the controller does not provide parity checking (option D).

Q14. Suppose two devices simultaneously request DMA. If the 8257 is programmed with priority order Channel 0 > 1 > 2 > 3, which device will be serviced first?

A.The device on Channel 2
B.The device on Channel 3
C.The device on Channel 0
D.The device on Channel 1 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Priority is determined by the channel number hierarchy; the lowest numbered channel has the highest priority. Therefore, a request on Channel 0 will be acknowledged before any others, regardless of simultaneous assertions. Options A and B refer to lower‑priority channels, while option D is higher than Channel 0 but still not the highest.

Q15. In a system where the DMA controller is disabled, what is the impact on data throughput when transferring 4 KB of data compared to when DMA is enabled?

A.Throughput remains the same because the CPU can handle the transfer equally fast ✅
B.Throughput is slightly lower, about 10 % reduction
C.Throughput is significantly lower, often by a factor of 4 to 5
D.Throughput increases because the CPU has direct control over the bus
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Without DMA, each byte must be moved by the CPU, involving fetch, decode, and store cycles, which dramatically reduces effective bandwidth. Empirical measurements show that DMA can be 4–5 times faster for block transfers of this size. Option A ignores the overhead, option B underestimates the loss, and option D is opposite to reality.

Q16. A programmer sets the byte‑count register to 0x3FFF0x3FFF. How many bytes will be transferred before the controller stops?

A.16,38316{,}383 bytes ✅
B.14,99914{,}999 bytes
C.15,99915{,}999 bytes
D.12,34512{,}345 bytes
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The byte‑count register holds a 14‑bit value for the number of bytes. 0x3FFF0x3FFF in binary is 0011 1111 1111 11110011\,1111\,1111\,1111, which equals 214−1=16,3832^{14}-1 = 16{,}383. Therefore the controller will move exactly 16 383 bytes before the count reaches zero. The other options represent incorrect conversions or miscounts.

Q17. If the address register is loaded with 0xFF000xFF00 and the byte‑count is 300, what happens when the address exceeds the memory limit of 0xFFFF0xFFFF?

A.The DMA controller wraps around to address 0x00000x0000 and continues ✅
B.The controller generates a bus error and halts the transfer
C.The controller ignores the overflow and writes to non‑existent memory
D.The controller automatically reduces the byte count to avoid overflow
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the address increment would surpass the highest valid memory location (0xFFFF0xFFFF), the 8257 signals an error condition, typically a bus error, and stops the transfer to prevent writing to undefined space. It does not wrap around (option A) nor silently ignore the issue (option C). Adjusting the byte count (option D) must be done by the programmer before the transfer begins.

Q18. During a DMA burst, the CPU attempts to write to the same memory location. How is bus contention resolved and which component ultimately controls the bus?

A.The CPU always wins because it has higher priority ✅
B.The DMA controller always wins because it holds the acknowledge line
C.Both devices share the bus simultaneously using time‑division multiplexing
D.The system generates a hardware fault and stops both operations
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When the DMA controller asserts the acknowledge signal, it gains exclusive control of the address and data buses, forcing the CPU to wait until the DMA cycle completes. Therefore, the DMA controller dictates bus usage during the burst. Option A is false because the CPU relinquishes the bus on acknowledgment. Option C does not occur in standard DMA operation, and option D describes an error condition that is not typical for properly designed systems.

🔗 Related Topics (MCQs)