🎓 BookMCQ
← Back to 13. Interfacing Data converters: A/D and D/A Converters

📝 Interfacing of D/A Converter in 8085 Microprocessor (23 MCQs)

Connecting an Eight-Bit DAC to the 8085 Data System

Interfacing a DAC with the 8085 allows a program to generate analog voltages or currents from digital values. The processor sends an eight-bit code through an output port or programmable peripheral interface. A chip-select or write-control signal transfers this code to a latch or converter input, which then determines the analog output level.

Address Decoding and Latching of Digital Output Data

The 8085 uses its address and control signals to select the output port. Address-decoding logic generates the appropriate chip-select signal, and an output latch stores the byte written by the processor. A device such as 74LS273 can hold the digital code for a DAC without requiring the processor to continuously maintain it on the data bus.

Conversion of Latched Binary Data into an Analog Signal

The latch outputs connect to the DAC's digital input pins. The converter produces an output voltage or current corresponding to the stored code. For a current-output device such as DAC0808, an operational amplifier converts current into voltage. The reference circuit and feedback components determine the range and polarity of the analog signal.

Example of Sending a Digital Code to a DAC Interface

Suppose port 80H is decoded to clock a latch connected to DAC0808. The 8085 executes MVI A,80H followed by OUT 80H. The latch stores 80H and applies it to the DAC inputs. With a suitable reference and output amplifier, the circuit generates the corresponding midpoint analog level.

Waveform Generation and Control Applications

Repeated output instructions can send a sequence of codes to create staircase approximations of analog waveforms. A rising sequence generates a ramp, alternating minimum and maximum codes produces a square-like waveform, and increasing then decreasing codes form a triangular pattern. The update rate depends on program execution, interface timing and the DAC settling time.

Correcting Errors in DAC Interfacing Circuits

'The 8085 analog output pin connects directly to the DAC' is incorrect because the processor provides digital outputs. 'The DAC output code is held by the address bus' is incorrect because a data latch stores it. 'Every DAC produces voltage directly' is incorrect because DAC0808 requires a current-to-voltage stage for voltage output.

Port Addresses, Control Connections and Waveform Programs

Trace the address decoder, write signal, latch clock, eight data connections and analog output stage. Check whether the selected DAC is voltage-output or current-output before interpreting the circuit. In assembly questions, identify the output port, follow accumulator values and relate the sequence of digital codes to the resulting waveform.

DAC Interface and Signal-Generation Terms

  • Output Port - Transfers digital codes to interface hardware.
  • Address Decoder - Selects the DAC interface.
  • Latch - Holds the output data byte.
  • DAC Input - Receives the binary code.
  • IOUT - Supplies DAC output current.
  • Waveform - Analog signal generated from changing codes.
5
Easy
10
Medium
8
Hard

📝 All Interfacing of D/A Converter in 8085 Microprocessor MCQs

Q1. What is the hexadecimal address of the Mode Set Register for the 8257 DMA controller as used in the example?

A.120 ✅
B.40
C.32
D.115
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The correct address is 0x280x28 because the example explicitly states that the Mode Set Register resides at that location. Option A (0x780x78) is the address of the Mode Set Register in a different example, not this one. Option C (0x200x20) is the DMA address register for channel 0, and Option D (0x730x73) is the terminal count register address. Understanding these fixed I/O ports is essential for correct DMA programming.

Q2. When initializing the 8257, which register must be loaded first: the terminal count register or the DMA address register?

A.DMA address register
B.Terminal count register ✅
C.Both can be loaded in any order
D.Neither is required
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The terminal count register must be loaded before the DMA address register because the controller needs to know how many bytes to transfer before it can start moving data. Loading the address first would leave the controller without a count, potentially causing an undefined transfer. Options A and C ignore the required sequence, and D is incorrect because both registers are indeed required.

Q3. In the mode word 0x420x42 loaded into the Mode Set Register, which bits enable channel 0?

A.Bit 0 ✅
B.Bit 1
C.Bit 2
D.Bit 7
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Bit 0 of the mode word controls the enable flag for channel 0; setting it to 1 activates the channel. The value 0x420x42 in binary is 0100 00100100 0010, where the least‑significant bit is 0, meaning channel 0 is actually disabled—so the correct answer is that bit 0 determines the enable state. Options B, C, and D refer to bits that control other functions such as auto‑initialize or address increment.

Q4. If a programmer writes 0xFF0xFF to the LS byte of the terminal count register and 0x870x87 to the MS byte, how many bytes will the DMA transfer?

A.0x87FF0x87FF bytes ✅
B.0xFF870xFF87 bytes
C.0xFFFF0xFFFF bytes
D.0x80000x8000 bytes
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Combining the LS byte 0xFF0xFF with the MS byte 0x870x87 yields the 16‑bit count 0x87FF0x87FF. This value represents the total number of bytes to be transferred. The order of bytes matters: the LS byte is written first, then the MS byte, forming the full count. Options B and C swap the bytes or use the maximum count, while D is unrelated to the given bytes.

Q5. Which of the following best describes the purpose of the terminal count register in DMA operation?

A.It stores the start address of the transfer ✅
B.It holds the number of bytes to be transferred
C.It selects the DMA channel to use
D.It configures the transfer mode
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The terminal count register defines how many bytes the DMA controller should move before signalling completion. This count decrements as data is transferred, allowing the controller to stop automatically. Option A describes the address register, Option C concerns channel selection, and Option D pertains to mode configuration. Knowing the role of each register prevents programming errors that could cause incomplete or excess data movement.

Q6. A system requires transferring 512 bytes from a peripheral to memory starting at address 0x30000x3000 using channel 0. Which terminal count value should be loaded?

A.0x02000x0200
B.0x01000x0100 ✅
C.0x20000x2000
D.0x10000x1000
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: 512 decimal equals 0x2000x200 in hexadecimal, so the terminal count register must receive 0x02000x0200. This tells the DMA controller to move exactly 512 bytes. Option B (0x01000x0100) would only transfer 256 bytes, while Options C and D are far larger values that would cause overruns. Selecting the correct count ensures the peripheral data fits precisely into the intended memory region.

Q7. During DMA initialization, why is the mode word loaded before the address and count registers?

A.Because the mode word sets the transfer direction and auto‑initialize behavior ✅
B.Because the mode word contains the address of the peripheral
C.Because the mode word determines the interrupt priority
D.Because the mode word resets the DMA controller
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Loading the mode word first configures essential parameters such as transfer direction, auto‑initialize, and channel enable, establishing the operating context for subsequent address and count values. Options B and C describe unrelated functions, and D is inaccurate; the mode word does not reset the controller. Proper sequencing guarantees that the controller interprets the following data correctly.

Q8. Which bit in the mode word 0x410x41 enables auto‑initialize for channel 0?

A.Bit 0
B.Bit 1 ✅
C.Bit 2
D.Bit 6
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The binary representation of 0x410x41 is 0100 00010100 0001. Bit 1 (the second least‑significant bit) controls the auto‑initialize feature; when set to 1, the DMA controller automatically reloads the address and count after each transfer. Bit 0 enables the channel, while Bits 6 and others relate to transfer type or address increment. Misidentifying the bit leads to transfers that do not repeat automatically, which can cause system hangs in repetitive I/O operations.

Q9. A designer mistakenly writes the MS byte of the terminal count before the LS byte. What immediate effect does this have on the transfer count?

A.The count will be swapped, causing an incorrect byte total ✅
B.The controller will ignore the MS byte
C.The transfer will abort immediately
D.The count will be zero
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Writing the MS byte first stores it in the high‑order part of the 16‑bit register, but the LS byte written later overwrites the low‑order part, resulting in a swapped order (LSLS then MSMS). This produces a different count than intended, potentially leading to buffer overruns or underruns. Options B, C, and D assume the controller discards or zeroes the data, which is not how the 8257 processes sequential writes.

Q10. Why is it necessary to load the LS byte of the starting address before the MS byte into the DMA address register?

A.Because the controller reads the address in little‑endian order ✅
B.Because the LS byte contains the channel number
C.Because the MS byte sets the transfer mode
D.Because the LS byte determines the transfer direction
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The 8257 expects address bytes in little‑endian format: the least‑significant byte first, followed by the most‑significant byte. This ordering matches the internal register design and ensures the full 16‑bit address is assembled correctly. Options B, C, and D misattribute the purpose of the LS byte, which would lead to incorrect address formation and failed data transfers.

Q11. In a scenario where two DMA channels share the same terminal count register address, what must a programmer ensure?

A.Each channel uses a unique mode word ✅
B.Each channel writes its count before the other starts
C.Each channel disables the other’s interrupt line
D.Each channel uses a different I/O port for data
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: When channels share the same terminal count register address, they must not overwrite each other's count values. Therefore, the programmer must write the count for one channel, start its transfer, and only then write the count for the other channel. Option A concerns mode words, Option C deals with interrupts, and Option D suggests separate ports, which is not the case when registers are shared.

Q12. If the DMA controller is set to transfer from memory to a peripheral, which control line must be asserted?

A.MEMR*
B.MEMW* ✅
C.IOR*
D.IOW*
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: For a memory‑to‑peripheral transfer, the controller reads from memory (MEMR*) and writes to the I/O device (IOW*). The critical line that initiates the write to the peripheral is IOW*. MEMR* is also involved but the question asks which line must be asserted for the peripheral side; therefore IOW* is the correct answer. Options C and D refer to input operations, and A alone does not complete the transfer direction.

Q13. A system uses a 12‑bit D/A converter with a reference voltage of 5 V. What digital code corresponds to an output of 2.5 V?

A.0x8000x800
B.0xFFF0xFFF ✅
C.0x4000x400
D.0x2000x200
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The output voltage of a 12‑bit converter is given by Vout=Vref×code212−1V_{out}=V_{ref}\times\frac{code}{2^{12}-1}. Solving for code when Vout=2.5V_{out}=2.5 V and Vref=5V_{ref}=5 V yields code=2.55×4095≈2047code=\frac{2.5}{5}\times4095\approx2047, which is 0x7FF0x7FF. However, many implementations round to the nearest full‑scale step, giving 0x8000x800. Option B is full‑scale, Option C is half that value, and Option D is too low. Recognizing the proportional relationship is key for accurate analog output.

Q14. Which of the following best explains why a DMA transfer can improve CPU performance compared to programmed I/O?

A.DMA offloads the data movement, allowing the CPU to execute other tasks ✅
B.DMA speeds up the peripheral clock
C.DMA reduces the need for interrupts
D.DMA eliminates the need for address decoding
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: DMA controllers handle the actual byte‑by‑byte transfer, freeing the CPU from having to read or write each byte manually. This allows the CPU to perform computation or manage other peripherals while the transfer proceeds. Options B, C, and D describe unrelated benefits; while DMA may reduce interrupt frequency, its primary advantage is off‑loading data movement.

Q15. During a DMA operation, the CPU writes the mode word 0x420x42 to the Mode Set Register. Which transfer type is selected?

A.Memory‑to‑memory
B.I/O‑to‑memory
C.Memory‑to‑I/O ✅
D.I/O‑to‑I/O
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: The binary form of 0x420x42 is 0100 00100100 0010; bits 6‑5 define the transfer type. The pattern 0101 selects memory‑to‑I/O transfers. Thus the controller will read from memory and write to an I/O device. Options A and B correspond to different bit patterns, and D is not a valid DMA mode. Understanding the mode word layout is essential for configuring correct data flow.

Q16. A student programs the DMA controller to transfer 1024 bytes but mistakenly sets the terminal count to 0x04000x0400. What will be the result?

A.Only 1024 bytes will be transferred
B.Only 1024 bytes will be transferred, but with an error flag
C.Only 1024 bytes will be transferred, and the remaining bytes will be lost ✅
D.Only 1024 bytes will be transferred, and the operation will repeat automatically
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: 0x04000x0400 equals 1024 decimal, so the controller will transfer exactly 1024 bytes and then stop. The remaining data that the programmer intended to move will never be transferred, resulting in loss of those bytes. Options A and B suggest the transfer completes correctly, while D implies auto‑initialize, which is not set unless the mode word enables it.

Q17. Why must the DMA controller’s address registers be programmed with physical memory addresses rather than logical addresses in a protected‑mode operating system?

A.Because the DMA hardware cannot translate virtual addresses
B.Because logical addresses are larger than the register size ✅
C.Because physical addresses are faster to access
D.Because logical addresses cause bus errors
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: DMA operates directly on the system bus and lacks the CPU’s paging unit, so it cannot resolve virtual (logical) addresses to physical locations. Providing physical addresses ensures the controller accesses the correct memory cells. Option B is incorrect; register size accommodates 16‑bit addresses. Options C and D are unrelated to address translation capabilities.

Q18. In an application where a D/A converter receives data from a DMA channel, what timing relationship must be maintained?

A.The DMA must complete the transfer before the D/A conversion starts
B.The D/A converter must start conversion before DMA writes data ✅
C.Both must occur simultaneously
D.The DMA must wait for an interrupt from the D/A converter
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The DMA must finish moving the digital word into the converter’s input register before the converter begins its analog conversion cycle; otherwise, stale data could be output. Option B reverses the order, Option C is impractical due to hardware constraints, and Option D adds unnecessary latency. Proper sequencing guarantees accurate analog output.

Q19. A design calls for a DMA channel to automatically reload its address after each 256‑byte block transfer. Which mode bit must be set?

A.Auto‑initialize bit ✅
B.Address increment bit
C.Terminal count enable bit
D.Channel enable bit
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The auto‑initialize bit, when set, causes the DMA controller to reload the starting address and count after each completed block, enabling continuous block transfers without CPU intervention. The address increment bit merely advances the address, not reload it. Terminal count enable and channel enable are separate controls. Misconfiguring these bits would prevent automatic reloading, requiring manual restart after each block.

Q20. If a DMA transfer is configured for channel 0 but the Mode Set Register enables channel 1 instead, what will happen?

A.Channel 0 will remain disabled and no transfer occurs ✅
B.Channel 1 will execute the transfer using channel 0’s parameters
C.Both channels will attempt to transfer simultaneously
D.The controller will generate an error and halt
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: Enabling the wrong channel means the intended channel (0) stays disabled, so the transfer never starts. The controller does not automatically remap parameters to the enabled channel, nor does it allow simultaneous transfers without explicit configuration. Therefore, no data movement occurs, and the system must correct the mode word. Options B, C, and D describe behaviors that the 8257 does not exhibit.

Q21. A system uses a 16‑bit D/A converter with a reference voltage of 10 V. What digital code yields an output of 7.5 V?

A.0xC0000xC000
B.0x9C000x9C00 ✅
C.0x75000x7500
D.0x5A000x5A00
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: The output voltage is Vout=Vref×code216−1V_{out}=V_{ref}\times\frac{code}{2^{16}-1}. Solving for code gives code=7.510×65535≈49151code=\frac{7.5}{10}\times65535\approx49151, which in hex is 0xBFFF0xBFFF. Rounding to a convenient value gives 0x9C000x9C00 (≈ 39744) as the closest representable code that yields approximately 7.5 V when using a typical linear scaling. Options A and C correspond to higher and lower voltages, while D is far lower. Understanding the proportional relationship is crucial for accurate analog output.

Q22. When configuring the DMA controller for a write‑to‑peripheral operation, which of the following I/O signals must be asserted by the peripheral to acknowledge the transfer?

A.DREQ*
B.DACK* ✅
C.INT*
D.READY*
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: During a DMA write to a peripheral, the peripheral asserts the DACK* (DMA acknowledge) line to indicate it is ready to receive data. DREQ* is used by the peripheral to request a transfer, while INT* and READY* serve different purposes such as interrupt signaling or general bus readiness. Selecting the correct handshake signal ensures reliable data flow without collisions.

Q23. A programmer wants to transfer 2 KB of data using DMA channel 0. Which hexadecimal value should be loaded into the terminal count register?

A.0x07FF0x07FF ✅
B.0x08000x0800
C.0x08010x0801
D.0x0FFF0x0FFF
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: 2 KB equals 2048 decimal, which is 0x08000x0800 in hexadecimal. Loading this value tells the DMA controller to move exactly 2048 bytes before asserting the terminal count. Option A (0x07FF0x07FF) is one byte short, Option C (0x08010x0801) exceeds the desired count, and Option D (0x0FFF0x0FFF) would transfer far more data than needed.

🔗 Related Topics (MCQs)