Hardware Reference
In-Depth Information
to read the executable ISA-level program, which consists of a byte stream. All
other registers that contain addresses use word addresses, like MAR .
In the actual physical implementation, there is only one real memory and it is
byte oriented. Allowing MAR to count in words (needed due to the way JVM is de-
fined) while the physical memory counts in bytes is handled by a simple trick.
When MAR is placed on the address bus, its 32 bits do not map onto the 32 address
lines, 0-31, directly. Instead MAR bit 0 is wired to address bus line 2, MAR bit1to
address bus line 3, and so on. The upper 2 bits of MAR are discarded since they are
needed only for word addresses above 2 32 , none of which are legal for our 4-GB
machine. Using this mapping, when MAR is 1, address 4 is put onto the bus; when
MAR is 2, address 8 is put onto the bus, and so forth. This trick is illustrated in
Fig. 4-4.
32-Bit MAR (counts in words)
Discarded
00
32-Bit address bus (counts in bytes)
Figure 4-4. Mapping of the bits in MAR to the address bus.
As mentioned above, data read from memory through the 8-bit memory port
are returned in MBR , an 8-bit register. MBR can be gated (i.e., copied) onto the B
bus in one of two ways: unsigned or signed. When the unsigned value is needed,
the 32-bit word put onto the B bus contains the MBR value in the low-order 8 bits
and zeros in the upper 24 bits. Unsigned values are useful for indexing into a ta-
ble, or when a 16-bit integer has to be assembled from 2 consecutive (unsigned)
bytes in the instruction stream.
The other option for converting the 8-bit MBR to a 32-bit word is to treat it as a
signed value between
128 and +127 and use this value to generate a 32-bit word
with the same numerical value. This conversion is done by duplicating the MBR
sign bit (leftmost bit) into the upper 24 bit positions of the B bus, a process known
as sign extension . When this option is chosen, the upper 24 bits will either be all
0s or all 1s, depending on whether the leftmost bit of the 8-bit MBR isa0ora1.
The choice of whether the 8-bit MBR is converted to an unsigned or a signed
32-bit value on the B bus is determined by which of the two control signals (open
arrows below MBR in Fig. 4-1) is asserted. The need for these two options is why
two arrows are present. The ability to have the 8-bit MBR act like a 32-bit source to
the B bus is indicated by the dashed box to the left of MBR in the figure.
 
Search WWH ::




Custom Search