µP's interface to the external world through their pins or terminals which carry:
Typically, 8-bit µPs have one ground pin and one voltage pin (reference to the ground). Some 16-bit and 32-bit µPs have two or more ground pins and an equal number of voltage pins.
Like the CPUs of most computers, µPs are synchronous machines which depend on clock pulses to synchronize their operations. Both the activation and deactivation of control signals (inside and at the external interface) relate to the edges of the clock. Usually, the clock pulses are supplied from an external source through the Clock Line.
This set of signal lines identifies the location that is to be accessed by the CPU during a read or write operation. Such a location can be a Memory Location or and I/O Location, which stores one byte of data. The set of different addresses we can specify over the address bus constitutes the Direct Address Space of a µP.
If we assume N address lines, then the Address Space is equal to 2n byte locations, wherein:
External CPU interface
In 16-bit µCs, byte locations are usually paired into 16-bit word locations wherein:
Words are usually addressed by using the address of the upper byte and a control signal indicating that it is a word, not a byte address.
In 32-bit µCs, byte locations may be grouped four at a time to form 32-bit word locations.
Example:
A particular 16-bit µP has 23 address lines. Determine its memory address space in Megabytes (MB). Up to how many 16-bit words can we possibly store in its memory?
2n = 223 = 8388608 bytes = 8 MB
8388608 bytes X 16 bits / 2 bytes X 1 word / 16 bits = 524288 words
Some CPUs have a single Address Space for both memory and I/O locations. Others have two separate address spaces: a Memory Address Space and an I/O address Space. In such cases, the Memory Address Space is again 2n byte locations, while the I/O Address Space is much smaller, so only the Low-order Address Lines are used to transmit I/O Addresses.
Division of Memory into Bytes and Words
Example:
The Address Bus of a 16-bit µP consists of 23 lines. However, when addressing I/O locations, it employs only the 16 Low-order Address Lines. Calculate the I/O Address Space of this CPU. What is the highest I/O Address?
These lines carry the data to be written or read from the location identified through the Address Lines. Unlike Address Lines, which are undirectional, Data Lines may transmit information in either direction. The number of Data Lines determines the maximum amount of information we can transfer during a single read or write operation. In fact, it constitutes the bases for the categorization of CPUs.
Example:
If the Data Bus is 8-bit wide, then the CPU is considered to be an 8-bit µP.
All information is communicated by means of the Data Transfer Control Lines. In the case of our Hypothetical µP; it uses six signals for this purpose. Three of these signals are meaningful whether in their true state or false state. The other three are only meaningful in their true state.
Steps of a Read Sequence (Assuming that the CPU is about to read one byte of data from memory)
Some I/O devices are capable of transferring data to/from memory on their own (as we will see later). To do so however, they must gain temporary control of the Address Bus, the Data Bus, and some of the Data Transfer Control Lines. Thus we need some means of transferring bus control from the CPU to the I/O devices and back to the CPU. Our CPU has three lines for this purpose, namely: