Memory Interfacing with the 8088/8086/80286 Processor — Part 4 (A System Design Example)

Anubhav Elhence
5 min readApr 12, 2024

The intricacies of interfacing memory with 8086 or 80286 processors reveal the nuanced challenges and solutions in microprocessor-based system design. These processors, with their 16-bit data buses, necessitate a division of memory into even and odd banks to manage data flow efficiently. This detailed example elucidates a strategy for interfacing 1MB of SRAM using 256K chips, showcasing the methodical approach needed for optimal system performance.

Overview of Memory Interfacing in 16-bit Processors

The fundamental premise of interfacing memory with 8086 or 80286 processors hinges on the division of memory into even and odd banks. This division facilitates the accommodation of the processors’ 16-bit data buses, allowing for simultaneous access to two bytes of data from consecutive memory addresses. The even bank hosts all even addresses and is accessed via the lower half of the data bus (D0-D7), while the odd bank, containing odd addresses, interfaces with the upper half (D8-D15). The Bus High Enable (BHE‾BHE) signal serves as the enabler for the odd bank, with the A0‾A0 signal enabling the even bank.

Example: 1MB SRAM Interfacing with 8086

In this example, we embark on designing a memory interface for 1MB of SRAM using 8086, equipped only with 256K chips. The design journey begins with segmenting the 1MB memory into two principal halves of 512K each, subsequently divided into 256K even and 256K odd sections. This segmentation aligns with the 8086’s addressing capabilities and optimizes the utilization of the 16-bit data bus for memory access.

Memory Mapping and Bank Division

The memory’s address space is meticulously mapped to accommodate the even and odd banks, with the first 512K spanning from 0000H to 7FFFH, and the subsequent 512K from 8000H to FFFFH. This mapping is reflected in the binary representation of the address lines, with the A19 line distinguishing between the two 512K segments. Utilizing the A19 line is pivotal for decoding and selecting the appropriate memory bank during operations.

Implementing the Decoding Logic

The decoding logic, fundamental to differentiating between even and odd banks, employs two decoders. Each decoder is activated based on the address’s parity: one for even addresses (A0‾A0) and another for odd addresses (BHE‾BHE). This setup ensures that both memory banks can be accessed independently or simultaneously, depending on the operation’s requirements, thus maintaining flexibility and efficiency in memory access.

Practical Operation Example

Consider a scenario where the DS register holds the value 900H, and we aim to move the hexadecimal data 1234H into memory location 9500H. Given the 16-bit structure, the data byte 34H is directed to the even bank (D0-D7), and 12H to the odd bank (D8-D15), facilitated by the dual decoder setup. This example underscores the synchronous activation of decoders and the strategic routing of data bytes to their respective memory banks.

Summary

The approach to interfacing 1MB of SRAM with the 8086 processor, leveraging 256K chips, exemplifies the strategic considerations and detailed planning inherent in system design with advanced microprocessors. By dividing memory into even and odd banks and employing a nuanced decoding mechanism, this example provides a blueprint for efficiently managing memory resources in alignment with the processor’s capabilities. This methodology not only ensures data integrity and system reliability but also optimizes the processor’s performance, showcasing the nuanced complexity and elegance of microprocessor system design.

Example 2

In our exploration of memory interfacing techniques with the 8086 processor, we’ve encountered various strategies to address the unique challenges posed by the processor’s 16-bit data bus. This session introduces another sophisticated method for differentiating between even and odd memory banks, crucial for efficiently interfacing memory with the 8086 processor. Let’s delve into an insightful example that illuminates this method, demonstrating the interfacing of 16KB of RAM starting from address 0000, utilizing both 2KB and 4KB memory chips.

Scenario Overview

The task is to interface 16KB of RAM to an 8086 processor, a challenge compounded by the availability of 2KB and 4KB memory chips. Given the processor’s architecture, it’s essential to organize these chips in a manner that accounts for the even and odd memory banks, ensuring compatibility with the 16-bit data bus. The available resources are 42KB chips and 24KB chips, which must be arranged to achieve the desired 16KB memory capacity.

Memory Mapping Strategy

The first step in our strategy involves memory mapping. The 4KB chips are designated to start from address 0000, with the address space extending to 0FFF. This space is evenly divided between even and odd addresses, ensuring that data can be accessed in alignment with the processor’s data bus. Similarly, 2KB chips are arranged to follow, starting from address 1000 and extending to 1FFF, with an identical division between even and odd addresses. This meticulous mapping is crucial for the seamless operation of the memory interface.

Address Decoding and Bank Selection

Address decoding is central to differentiating between even and odd banks. In this example, we explore a method that does not rely solely on separate decoders or logical gates but instead employs a single decoder augmented with strategic control signal management. This approach hinges on leveraging the processor’s control signals ( A0` for even banks and BHE` for odd banks) to activate the appropriate memory bank based on the operation’s requirements.

Implementing the Decoding Logic

The decoding logic employs a single decoder with inputs from the memory/I/O control signal and address lines, specifically focusing on A12 and A13 for bank selection. This setup enables the selection of memory banks with precision, aligning with the mapped address spaces for each chip. To manage the even and odd bank activations, the system utilizes control signals that conditionally activate based on the nature of the memory address (even or odd) and the operation (read or write).

Practical Example: Writing to Memory

Consider the operation of writing the contents of the AH register to memory location 1201H, with the DS register holding the value 900H. This operation illustrates the system’s ability to correctly interface with the specified memory location within the 2KB chip, leveraging the control signals to ensure that data is written to the correct bank (odd, in this case) and at the correct address. The example underscores the system’s flexibility and the effectiveness of the control signal-based approach to bank selection.

Conclusion

This session’s example of interfacing 16KB of RAM to the 8086 processor using both 2KB and 4KB chips demonstrates a sophisticated method that enhances the traditional even-odd bank differentiation technique. By employing a single decoder and strategically managing control signals, the system achieves efficient memory interfacing that fully utilizes the processor’s capabilities. This method not only simplifies the interfacing process but also offers insights into the adaptability required in system design to meet specific architectural needs.

--

--

Anubhav Elhence

We seamlessly integrate cutting-edge AI, IoT, or Blockchain technologies, or a synergistic combination thereof, into businesses, institutions, and organizations