Accessing odd address memory locations in 8086

Word-wide memory is addressed with a single address bus. When a word is read from an odd address, one byte is in one word, the other byte in another. You cannot address both bytes at the same time. Even if the memory had a separate address bus for each byte, the processor does not have the pins to address both address busses at the same time.


The book is slightly wrong, but let's try to clear it up. The thing is, you can put 125 on the address bus. But you cannot read addresses 125 and 126 in a single clock by doing so. Basically this is because the numbers 125 and 126 differ in bits other than the last bit.

The 8086 has 20 address lines (A19:A0) and 16 data lines (D15:D0). Actually the 16 data lines and the lower 16 address lines are the same pins, also called AD15:AD0. They function as address lines for the first part of the clock cycle, and data lines for the later part. Also important for addressing is a pin called BHE, "bus high enable". A0 also functions as an "enable" pin, as we'll see in a moment.

If the 8086 wants to read the word at addresses 124-125, It puts 124 on A19:A0, and sets BHE to low. Both banks of memory see the address on A19:A1, and since A0 and BHE are both active-low signals, both banks will be active. The upper bank will put data on D15:D8, and the lower bank will put data on D7:D0, and the CPU gets a full word.

If the 8086 wants to read a single byte at address 124, it puts 124 on A19:A0, and sets BHE high. Because A0 is low (active), the lower bank will put data on D7:D0, but with BHE high, the upper bank does nothing.

If the 8086 wants to read a single byte at address 125, it puts 125 on A19:A0, and sets BHE low. Because A0 is high, the lower bank is inactive, and because BHE is low, the upper bank will put data on D15:D8.

And those are the three cases that are possible (A1 high and BHE high doesn't enable any banks, so it doesn't do anything). Note that the lines A19:A1 are the same in all three cases, and they don't change throughout a clock cycle. If the 8086 wants to read a word at addresses 125-126, it can't get it this way, because those two addresses have different bits on A19:A1. It needs to make two reads, as the book describes.

Your book is considering only A19:A1 as being part of "the address", and A0 as being strictly an enable line, which means it always considers bus addresses to be even. This is basically the truth, since the even and odd bytes of a word are addressed as a unit, but it doesn't really agree with the Intel-approved terminology.


In fact the 8086 does it exactly the latter way you describe, and it has to use two memory cycles to do it.

To access word from address 125, the CPU puts 125 on the address bus. Since it is an odd address and only high byte is needed from this address, address A0 bit will be 1 and BHE is active, so only high byte of memory responds. Next, the address 126 is put on the bus, and since it is an even address, and only low byte is requested, A0 will be low and BHE inactive, so only low byte of memory responds. Now a full word has been read from two concecutive addresses, because it could not be read as a 16-bit access from single even address, where A0 bit would be 0 and BHE active so both low and high bytes are returned.