You are on page 1of 26

The Fundamentals

of Microprocessor
Learning Packet 3.1
Types of computer:

1. Main-frame computers
• A large, room-sized machines requiring special rooms with air-conditioning.

• These tasks continue to be performed in this way with perhaps one computer
serving a variety of needs within one business.
2. Minicomputers
• The size of a large filing cabinet, and which had slightly less computing
power and data storage than main-frames, but were much cheaper and could
be operated in ordinary rooms.
• In this way, small businesses could operate their own computer, and larger
firms could have several minicomputers operating in different departments.
Types of computer:

3. Microcomputer
• The advent of the microprocessor in 1971 soon led to the construction of
microcomputers which are small, general purpose processing board which
could be used in other applications.

4. Personal computer
• A general-purpose computer equipped with a microprocessor and designed
to run especially commercial software (such as a word processor,
Internet browser, gaming, video/ photo editing, etc.) for an individual user.
The Birth of Microprocessor

• Before computers were widely available, automatic control of machines was achieved using logic circuitry of the TTL
family and its predecessors.
• Sequential operations were implemented using flip-flops and counters.
• Process conditions were detected using combinational logic.
• The overall process was described in hardware and was not easy to change.
• It was the introduction of the minicomputer that allowed machines and industrial processes to become computer
controlled.
• Before this, it was impracticable for a mainframe computer to be used in this way.
• In 1971, an electronics engineer realized that the functions of the device for which he was designing logic hardware
could be described in terms of a computer program.
• It occurred to him that logic could be designed so that the circuit sequences were stored as a program.
• The circuit was further developed and incorporated into a chip set which became known as a microprocessor.
• This usage, where the microprocessor is used as a logic replacement, is the second main area of microprocessor
applications.
FUNDAMENTALS

Definitions:
• ALU - The ALU comprises circuitry to perform arithmetic and
logical operations, such as ADD, SUBTRACT, AND, OR, SHIFT.
• REGISTERS -A register is a temporary (internal) storage element.
This will typically hold an 8 or 16-bit operand.
• BUS - A bus is a parallel set of wires (metallization or conductive
silicon internally to a chip) that carries information.
Diagram of the Basic ALU section of
Microprocessor
Example of an ALU

• found in the 74 series logic family. For example, the 74HC181, is a 4 + 4


bits ALU with 32 programmable functions.

• In order to make this ALU into a processor, a means must be provided for
presenting the data words at the inputs, storing the output word and
applying the appropriate function code at the select inputs for each
instruction.
• Such hardware is incorporated into a microprocessor and the logical
sequences for each instruction need not be known by the programmer.
GENERAL MICROPROCESSOR MODEL

Definition:
• An 8-bit microprocessor is designed to operate
with 8-bit operands predominantly.
• This does not preclude it from dealing with 16 or
32-bit numbers, or more, but it will handle these
larger words in 8-bit chunks.
Typical Microprocessor Model
Typical Microprocessor Model

• Since there will be a large number of external memory locations, we need


to specify which one is to be used for transferring data to or from the
microprocessor.
Typical Microprocessor Model
• This is achieved by the address bus.
• The address bus carries a 16-bit code which uniquely identifies the
external memory location we require.
• Each memory location will only respond to its own code (called its
address) and, according to the setting of the R/W line, will take data from
the data bus or place data on the data bus.
• The address bus is unidirectional since it only makes sense for the
microprocessor to generate addresses as it is the system controller.
REGISTERS

Data Registers
• These are registers where data can be manipulated by the arithmetic
and logical instructions.
• Operations which are carried out on these registers are usually fast
because they do not require reference to data held in external
memory registers.
• The 6809 has only two of these which are called Accumulator A and
Accumulator B. Since the 6809 can only perform arithmetic operations
on 8 bits at one time (it has an 8 bit ALU) these registers can only
store 8 bits.
• All memory registers also store 8 bit data. More recent processors have
many more data registers, for example the 6800 has 16.
REGISTERS

Address Registers
• These hold addresses for use in data movement instructions.
Addresses in these registers can also be manipulated e.g. one
added to them so that a table can be stepped through.
• The 6809 has two of these called Index Register X and Index
Register Y. In order to enable a reasonable amount of memory to
be addressed all addresses are 16 bits.
• It follows that these address registers must be 16 bits.
• The 6800 has 16 address registers.
REGISTERS

Program Counter
This register keeps track of where the processor is in a program.
It stores the address of the next instruction which is to be
executed. Normally this is stepped up by one automatically as each
instruction is carried out.
An instruction which causes a jump to a different part of the
program obviously modifies this process and operates directly on
the program counter.
Since this register stores an address it must be a 16 bit register in
the 6809.
REGISTERS

Program Counter
This register keeps track of where the processor is in a program.
It stores the address of the next instruction which is to be
executed. Normally this is stepped up by one automatically as each
instruction is carried out.
An instruction which causes a jump to a different part of the
program obviously modifies this process and operates directly on
the program counter.
Since this register stores an address it must be a 16 bit register in
the 6809.
REGISTERS

Instruction Register
• This holds the binary instruction word while it is being executed
in the processor.
• Therefore, the first stage in carrying out an instruction is to move
the instruction from the appropriate memory register (the PC
says which one) into the instruction register.
• Different parts of this instruction word then indicate different
actions.
• For example, in an arithmetic instruction four bits control the
ALU to set it into the correct mode for add, subtract, shift etc.
REGISTERS

Temporary registers
- In addition the processor requires various temporary registers
to hold transitory data while an instruction is being carried
out.
A temporary register is used for that purpose. An instruction
which exchanges the contents of accumulators A and B also
needs to store the value in one of the accumulators so that it is
not lost in the exchange.
(A) -> (temp)
(B) -> (A)
(temp) -> (B)
REGISTERS

Other registers -
We will see in due
course that other
registers are
necessary to make
the processor
more versatile. We
will deal with
them as we come
to them.
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.
Buses

Address Bus
• Connects the processor to memory devices and
interfaces.
• It is used by the processor to indicate which
memory register (or interface register) is the
source or destination for data. In 6809 it has to
be 16 bits.
Buses

Data Bus
• This is used to transfer data between the processor and memory
registers and interface registers.
• The source of data may be the processor or it may be a memory
register or an interface register: To avoid damaging the devices or
scrambling data only one device may place data on the bus at a time.
• This will be either the processor or the device addressed by the binary
pattern currently on the address bus.
• Normal logic gates have only two output states high (1) or low (0).
• Gates connected to a bus of this type must have a third high-
impedance state when they are effectively not outputting anything but
allowing another device to output data.
• The data bus in a 6809 system has 8 bits.
Memory Mapping Format
of a Microprocessor
Learning Packet 3.2
Introduction

• microprocessor has a number of address lines


that can be used to access RAM or ROM or other
devices within the system.
• the total memory addressable by a
microprocessor is found by the formula 2n where
n is the number of address lines.
• For example, an 8-bit microprocessor generally
has 16 address lines and can access 216 or would
have 65536 bits or 64 bytes of memory.
two major types of byte ordering:

• Endian refers to the order in which bytes are stored.


1. Little-Endian
• If the hardware is built so that the lowest, least significant byte of
a multi-byte scalar is stored "first", at the lowest memory address,
then the hardware is said to be "little-endian";
• the "little" end of the integer gets stored first, and the next bytes
get stored in higher (increasing) memory locations.
• Little-Endian byte order is "littlest end goes first (to the littlest
address)".
Machines such as the Intel/AMD x86, Digital VAX, and Digital Alpha,
handle scalars in Little-Endian form.
two major types of byte ordering:

2. Big-Endian
• If the hardware is built so that the highest, most significant
byte of a multi-byte scalar is stored "first", at the lowest
memory address, then the hardware is said to be "big-endian";
• the "big" end of the integer gets stored first, and the next
bytes get stored in higher (increasing) memory locations. Big-
Endian byte order is "biggest end goes first (to the lowest
address)".
• Machines such as IBM mainframes, the Motorola 680x0, Sun
SPARC, PowerPC, and most RISC machines, handle scalars in
Big-Endian form.
Four-byte Integer Example

• Consider the four-byte integer 0x44332211.


• The "little" end byte, the lowest or least significant
byte, is 0x11, and the "big" end byte, the highest or
most significant byte, is 0x44.
• The two memory storage patterns for the four bytes
are:
Four-byte Integer Example

Four-Byte Integer: 0x44332211


Memory Big-Endian Little-Endian
address byte value byte value
104 11 44
103 22 33
102 33 22
101 44 11

You might also like