120 Computer Architecture and Organization
Therefore, to summarize, data would be transacted from even bank through D0 β D7, if A0 is low (0)
and a valid address is available through A1 β A19. Similarly, odd bankβs data transaction would take
place using D8 β D15 if BHE is low (0) and A1 β A19 provides a valid address. After this transaction, let
us see how the communication would take place.
We have already discussed that as per the requirements, data might have to be transacted either as
a byte or as a word (double byte). Intel 8086βs instruction set provides different opcodes for byte and
word transactions. As there are two banks, four different situations may occur. These four conditions are
presented in the left-most column of the Table in Figure 5.23 (b). Let us discuss all these four cases one
by one. In the following discussions, we would take up the example of reading data from the external
memory device. However, all points would be equally valid for a data write operation, too.
Let us assume that we need a byte from location 00004H. This address is in even bank. The processor
places the address 00004H (note that A0 is 0 in this case) on the address bus and BHE is kept high by
the processor. As A0 is low and BHE is high, only even bank would be selected. Within one memory
read cycle, the data byte located in memory address 00004H would be available within 8086 through
D0 β D7 lines.
The next assumption is to get a word (16-bits) starting from address 00004H. In other words, the
processor needs two consecutive bytes, one from location 00004H (belonging to even bank) and another
from 00005H (belonging to odd bank). The processor places the rst address 00004H on the address bus
(note that A0 = 0) and BHE is maintained low ( this is the trick! ). As A0 and BHE both are simultane-
ously low, at the same time both even and odd banks would be selected. Thereafter, 16-bits of data from
these two locations would move to the processor using all 16 data lines, D0 β D15 in one cycle. Note that
in this case the processor need not place the address 00005H on the address bus at any time and can still
obtain its data. The reader may verify the fact that condition of A1 β A19 and BHE are suf cient to target
the location 00005H. Condition of A0 remains irrelevant in this case. We should also note that condition
of A1 β A19 remain identical to target both 00004H and 00005H at the same time.
Our third assumption is to get one byte from the odd location 00005H, available at the odd bank. To com-
plete the task, this address, 00005H is placed on the address bus by the processor (note that A0 = 1 in this
case) and BHE is pulled down to logic low. As A0 is 1 and BHE is 0, only the odd bank would be selected.
One byte of data would then move from location 00005H to the processor using D8 β D15 data lines.
As the fourth and last case, we assume that the processor needs 16-bits of data (a word or double
byte) starting from location 00005H. In other words, the processor assumes that the lower byte is avail-
able within the address 00005H and the higher byte is available within the address 00006H. In this case,
the processor needs two cycles of memory read operation. In the rst cycle, the processor places the
lower address 00005H on the address bus (A0 = 1) and keeps BHE low to get a byte through data lines
D8 β D15. In the next cycle, the processor places the next address 00006H on the address bus (A0 = 0)
and maintains BHE as high, to get the byte from location 00006H through the data lines D0 β D7. Why
two cycles are necessary in this case? This is because, unlike our second case, condition of A1 β A19
cannot remain identical to target both 00005H as well as 00006H at the same time. The reader may
verify this fact by expanding both addresses in their binary forms.
A question may arise here (for the fourth case described) that the processor would receive a swapped
set of bytes as the lower byte is brought in through the data lines D8 β D15, while the higher byte is
brought through data lines D0 β D7. The question is correct. However, in such a situation 8086 automati-
cally places the lower byte (obtained through D8 β D15) at lower position of its internal register and the
higher byte (obtained through D0 β D7) at the higher position of the same register. The programmer is
to specify only the starting address in all four cases and the rest of the operation and control (BHE, A0
and so on) are taken care of by the processor itself.
M05_GHOS1557_01_SE_C05.indd 120M05_GHOS1557_01_SE_C05.indd 120 4/29/11 5:07 PM4/29/11 5:07 PM