Microprocessors Lecture 2

Revision/summary

The main components of a small computer system are:-

         MEMORY     - Stores the program and data required by the program

         INTERFACES - Communicate with the outside world

         PROCESSOR  - Carries out the program instructions one at a time

All data and instructions in any computer system are stored in binary. If they appear in any other form then a translation must have been carried out.

The meaning of a binary number depends entirely on how it is used, or on its context. E.g. 10000110 is clearly a binary number which can be translated into 86 in hexadecimal notation. If it is part of an 6809 program and is executed as an instruction then it would have the effect of 'Loading accumulator A using immediate addressing'. If it is used as data in unsigned arithmetic then it has the value 134 in decimal. If it is used in twos complement arithmetic, however, it has the value -122. Its negative because the most significant bit is a 1. If it sent to a vdu then it will be interpretted as an ASCII character and the letter N will be displayed. Alternatively it might be in the address part of an instruction and refer to a memory location. It might be sent to an interface connected to a pelican crossing and result in the green traffic lights being turned on, the red 'do not cross, signs being illuminated and the 'WAIT' signs being on.

This is a very important point which many people have difficulty in grasping - that a pattern of 1s and 0s has no intrinsic meaning it all depends on what you do with it.


MEMORY is a mass of registers where binary data can be stored. Some may be read-only; their contents cannot be changed, others may be read-write; what is stored can be changed whenever necessary. Every register has an address, which is also a binary number, by which it can be referenced to distinguish it from other memory registers. Surprisingly this address may not be unique. As we shall see later a memory register may have several different addresses. E.g. the register at address 0000 may also have address 4000 and 8000 and C000. What must not happen, and this is down to the system design, is that two memory registers have the same address otherwise when you read from that address you don't know which data you're getting.
INTERFACES - also appear as registers in memory but they are not simply passive memory locations where you always get back what was stored in them. They are connected to external devices so when you store a binary value in memory location FE00 for example, if that address is an interface to a set of LEDS, then the stored value will cause certain LEDs to be turned on and others to be turned off. When you read data from FE01, if that is an interface connected to a set of switches than the data is not what has been previously stored in that location but the setting on each of the switches. These days most interface devices are programmable which means they can perform a variety of functions. This makes the devices more flexible and means that the same interface device can be used in a wide range of applications. In order to customise the interface for one particular application it will frequently need to be set up by storing values in control registers. These again appear as memory registers.
The PROCESSOR - is obviously the most important part of the system and is where all the instructions are carried out. it takes the instructions one at a time, normally in the order in which they are stored in memory, and executes them. Generally speaking there are three groups of instructions -
Early computers stuck fairly rigidly to these three groups but more modern processors, like the 6809, blur the distinctions by having instructions which combine two operations into a single instruction like 'Add the contents of memory register 201A to accumulator B'. This is both data movement and arithmetic in one instruction.

Registers

In order to achieve this the processor has a number of internal registers -

User-programmable registers in the M6809


Buses

These are data paths which enable data to be transferred from one device to another in the system. In a computer system these are normally parallel in nature i.e. to transfer 8 bits of data we need 8 wires (or 8 tracks on a PCB) connected to each device. There are two such buses which are necessary.
| Back | Next |

ACKNOWLEDGMENT: Some of the above was taken from Dr A J Tollyfield's notes.