Lecture Notes Week 1 Introduction To Microprocessor
Lecture Notes Week 1 Introduction To Microprocessor
MICROPROCESSOR DEE2170
BY: MARINA GETRIE
Agenda
Overview & History
What is a microprocessor?
Microprocessor versus microcontroller
Evolution of Microprocessor
Types of Microprocessor
Microprocessor Structure
Basic of computer structure
Components of microprocessor
Microprocessor Operation
What are instructions?
What are instructions set architecture?
Contains miniaturized transistors and other circuit elements on a single semiconductor integrated
circuit (IC)
Examining the
Microprocesso
r Chip
Microprocessor versus Microcontroller
MICROPROCESSOR MICROCONTROLLER
General
General Purpose
Purpose Application
Application Specific
Specific
Processors
Processors (GPP)
(GPP) Processor
Processor (ASP)
(ASP)
Digital
Digital Signal
Signal Processor
Processor
(DSP)
(DSP) ASIC
ASIC (Application
(Application Specific
Specific
GPP
GPP Proper
Proper :: General
General Microcontrollers:
Microcontrollers: Programmable
Programmable Integrated
Integrated Circuit)
Circuit)
Purpose
Purpose Applications
Applications Industrial
Industrial Applications
Applications microprocessor
microprocessor for
for Algorithm
Algorithm completely
completely
extensive
extensive numerical
numerical real
real implemented
implemented inin Hardware
Hardware
time
time computations
computations
General Purpose
Processors(GPP)
Processor not designed for any specialized purpose.
Programmable processor and can be used in variety of
applications.
Features
Program Memory
General datapath with large register file and general
ALU
User benefits
Low time-to-market and NRE costs
High flexibility
Application Specific
Processor (ASP)
Processor designed for specific applications only.
Features
Program memory
Optimized datapath
Special functional units
User Benefits
Dedicated and specialized tasks/instructions
Good performance in size and power
Microprocessor Structure
Basic Architecture of a Computer
A computer, large or small, can be represented functionally as below:-
Microprocessor/Central Processing Unit
(CPU)
-Performs necessary arithmetic and logic
operations
-Controls the timing and general
operation of the complete system
Input/Output(I/O) Devices
-Used for feeding data into the CPU
-Examples: Keyboards, USB storage,
printers.
-This allows the computer to
communicate with the outside world.
Memory
-Stores both instructions to be executed.
-Usually consists of RAMs (random-access
memories) and ROMs(read-only
memories)
Microprocessor / CPU
◦ the portion of a computer system that carries out the instructions of a
computer program
◦ the primary element carrying out the computer's functions. It is the unit
that reads and executes program instructions.
◦ The data in the instruction tells the processor what to do.
21
Memory
◦ physical devices used to store data or programs (sequences of instructions) on a
temporary or permanent basis for use in an electronic digital computer.
◦ Computer main memory comes in two principal varieties: random-access memory (RAM)
and read-only memory (ROM).
◦ RAM can be read and written to anytime the CPU commands it, but ROM is pre-loaded
with data and software that never changes, so the CPU can only read from it.
◦ ROM is typically used to store the computer's initial start-up instructions.
◦ The contents of RAM are erased when the power to the computer is turned off, but ROM
retains its data indefinitely.
◦ In a PC, the ROM contains a specialized program called the BIOS that orchestrates loading
the computer's operating system from the hard disk drive into RAM whenever the
computer is turned on or reset.
22
Input/Output (I/O)
◦ Input/output (I/O), refers to the communication between an information processing
system (such as a computer), and the outside world possibly a human, or another
information processing system.
◦ Inputs: the signals or data received by the CPU
◦ Outputs: the signals or data sent from the CPU
◦ Devices that provide input or output to the computer are called peripherals
◦ On a typical personal computer, peripherals include input devices like the keyboard and
mouse, and output devices such as the display and printer. Hard disk drives, USB storage
drives and optical disc drives serve as both input and output devices.
23
Basic Architecture of
Microprocessor/CPU
The CPU/microprocessor contains:
-Control Unit
-Arithmetic Logic Unit
-Register Array
25
Arithmetic Logic Unit
(ALU)
A combinational network that performs arithmetic and
logical operations on the data.
The most important components in a microprocessor, and is
typically the part of the processor that is designed first.
Able to perform the basic logical operations (AND, OR),
including the addition operation.
Register Array
Used for temporary storage of data, instructions and addresses during execution of a program
until they are send to the ALU, control section or memory.
Registers are normally measured by the number of bits they can hold, for example, an "8-bit
register" or a "32-bit register".
There are a few types of register array as below:-
Accumulator(ACC) or Result Register: To store temporary result after arithmetic and logical operations
have been performed.
General Purpose Registers or Scratch Pad Memory : To be used for variety of purposes.
Instruction Register (IR) :Stores the next instructions to be executed.
Program Counter: Holds the address of the next instruction that has to be fetched
Stack Pointer(SP) : 16-bit register and is used by the programmer to maintain a stack in the memory
Status Register or Condition Flags : Used to provide indication of certain conditions that arise during
arithmetic and logical operations.
Busses
Can be viewed as data highways.
Allow exchange of words between the functional blocks.
Has a wire or line for each bit and allows exchange of all
bits in a parallel (Simultaneous processing)
Address Bus: μP transmits the address of I/O device or
memory locations which it desires to access. It is
unidirectional.
Data Bus: μP send and receive data to and from different
devices (I/O and memory) including instructions stored in
memory. It is bi-directional.
Control Bus: for transmitting and receiving timing and
control signals between the μP and various devices in the
system to regulate its operation and to communicate with
other devices.
Microprocessor Clock
Also called clock rate. This is the speed at which a microprocessor executes instructions.
The CPU requires a fixed number of clock ticks (or clock cycles) to execute each instruction. The
faster the clock, the more instructions the CPU can execute per second. Clock speeds are
expressed in megahertz (MHz) or gigahertz ((GHz).
the CPU clock speed and the bus clock speed should be the same so that neither component
slows down the other.
What is microprocessor clock made of?
Crystal
Microprocessor Operation
What are instructions?
• Instructions are the most basic actions the processor can take:
– ADD AX, BX — Add value AX to BX and store in AX
– CMP AX, 5 — Compare value in AX to 5
– JE 16 — Jump ahead 16 bytes if comparison was equal
• High level programming languages (C, C++, Java) allow many processor instructions to be
written simply:
– if (A + B = 5) then… — Jump if sum of A and B is 5
• Every program must be converted to the processor instructions of the computer it will be run
on
What are instructions set architecture?
Computer architecture is defined by the instructions a processor can execute
Programs written for one processor can run on any other processor of the
same architecture
Current architectures include:
◦ IA32 (x86)
◦ IA64
◦ ARM
◦ PowerPC
◦ SPARC
What is microarchitecture?
Microarchitecture is the detailed steps processor takes to execute a particular set of
instructions
Processors of the same architecture have the same instructions but may carry them out in
different ways
Microarchitecture Features:
– Cache memory
– Pipelining
– Out-of-Order Execution
– Superscalar Issue
Simplified Microarchitecture
Fetch Unit gets the next instructions from the cache.
Decode Unit determines type of instruction.
Instruction and data sent to the Execution Unit.
Write Unit stores result.
Sequential Processing
39
Fetching an instruction
Step 1: Instruction pointer (program counter) hold the address
of the next instruction to be fetch.
40
FETCHING AN INSTRUCTION
Step 2: Contents of the program counter are passed across the Address
Bus
41
FETCHING AN INSTRUCTION (cont.)
Step 3: The address moves over the address bus to the Memory Access
Register.
42
FETCHING AN INSTRUCTION (cont.)
43
FETCHING AN INSTRUCTION (cont.)
Step 5:
The
contents
of the
memory at
the given
location
are moved
across the
data bus.
44
FETCHING AN INSTRUCTION (cont.)
Step 6: The
contents of
the memory
at the given
location are
moved from
the data bus
to the
instruction
register.
45
Microprocessor Software
&
Program Languages
Programming Language
Program : A sequence of instructions designed to perform a particular task in a
computer.
Software : A set of programs written for a computer-based system.
Programming Language
50
Intel 8086
16-bit microprocessor chip
Development work on the 8086 design started
in the spring of 1976 .
It was introduced to the market in the summer
of 1978.
The Intel 8088, released in 1979, was a slightly
modified chip with an external 8-bit data bus.
51