Vous êtes sur la page 1sur 36

8/7/2013

INTRODUCTION TO
MICROPROCESSOR
Chapter 1

STUDENT LEARNING OUTCOMES


Upon completion of this topic, you should be able to:
 Explain basic components of a computer system using block
diagram.
 Describe evolution of microprocessor.
 Define the meaning of the term Nibble, Byte, Word, Long
Word.
 Explain fetching and execution cycles.
 Explain internal structure and basic operation of a
microprocessor.
 Explain bus system.
 Explain microprocessor clock system.
 Identify the examples of microprocessor

8/7/2013

BASIC COMPONENTS OF A
COMPUTER SYSTEM
 CPU

Secondary Memory

Main Memory

 Memory
 I/O

unit
Central Processing Unit
(CPU)

Input Unit

Output Unit

DEFINITIONS
Central Processing Unit (CPU)


The hardware within a computer system which carries out the


instructions of a program by performing the basic
arithmetical, logical and I/O operations of the system.

On large machines CPUs require one or more printed circuit


boards. On personal computers and small workstations, the
CPU is housed in a single silicon chip called a microprocessor.

8/7/2013

DEFINITIONS

(CONT)

Central Processing Unit (CPU)

In the past, CPUs were mechanical, electromechanical or


transistor circuit based. Since the 1970s, technology allowed
the CPU to be implemented in a single IC package, called the
microprocessor.

The term CPU and microprocessor has often been mixed up


today. However, the CPU actually refers the core of the
microprocessor.

WHAT IS A MICROPROCESSOR


It is a multipurpose, programmable device that accepts


digital data as input, processes it according to instructions
stored in its memory, and provides results as output.

A microprocessor is an electronic device that consists of


millions (or billions) of transistors packed into one IC.

Its function is to execute instructions in the form of


programs, calculate and store its results.

Microprocessors are used widely in our everyday lives.

8/7/2013

Everyday items that use microprocessors

MORE ABOUT THE MICROPROCESSOR




P is a complex, powerful device:


 Able to process huge amounts of data.
 Built using transistors etched on silicon die.
 Needs external components to support operation.

Microcomputer system support P operations.

The microprocessor can be used to perform complex


operations by giving it instructions.

These instructions are called programs.

Programs are loaded into memory, and are executed line-by


line by the microprocessor.

8/7/2013

COMPUTING SYSTEMS
Rapid pace of information technology is
due to introduction of new
microprocessors.
 Most of us think of desktop computers
 PC
 Laptop
 Mainframe
 Server
 Maybe at most handheld computer (PDA).
 In this course, we will look at another type
of computing system which is far more
common that you ever imagined


CLASSIFICATION OF COMPUTERS


Servers:
 Big, expensive, available 24x7 (read 24 by 7 or 24 hours
a day, 7 days a week. Mainframes are old servers made by
IBM.

Desktops:
 computers on your desk

Laptops:
 computers you carry in your bag

PDA (personal digital assistants):


 computers you carry in your pocket

Embedded systems:
 computers that dont look like computers!

An embedded system is a type of computer

8/7/2013

EMBEDDED SYSTEMS


Account for >99% of new


microprocessors
 Consumer electronics
 Vehicle control systems
 Medical equipment
 Sensor networks

Desktop processors (Intel Pentium,


AMD Athlon, PowerPC, etc)
combined is only 1%.

EMBEDDED SYSTEMS


Simple definition: Computing systems embedded within


electronic devices.

Nearly any computing system other than a desktop


computer.

Designed to perform a specific function.

Billions of units produced yearly, versus millions of desktop


units.

Take advantage of application characteristics to optimize the


design.

As electrical or electronics engineers, you may be required


to design an embedded system.

But you BUY (not design) a general purpose computer.

8/7/2013

GENERAL PURPOSE COMPUTING VS


EMBEDDED SYSTEMS
GENERAL PURPOSE

EMBEDDED

Intended to run a fully general set


of applications

Runs a few applications often


known at design time

End-user programmable

Not end-user programmable

Faster is always better

Operates in fixed run-time


constraints, additional performance
may not be useful/valuable

Differentiating features:
Speed (need not be fully
predictable)
Software compatibility
Cost (eg RM3k vs RM5k per
laptop)

Differentiating features:
Power
Cost (eg RM2 vs RM2.50)
Speed (must be predictable)

IC MANUFACTURING
PROCESS
From Sand to Silicone

8/7/2013

MANUFACTURING PROCESS

MANUFACTURING PROCESS

8/7/2013

MANUFACTURING PROCESS

MANUFACTURING PROCESS

http://www.nikon.com/products/precision/soc
iety/story0202/index.htm

8/7/2013

HISTORY OF COMPUTERS


Has undergone significant improvements:


 4 generations until now.
 Tied to development of electronics, semiconductors.
G1

Vacuum
Tube

G2

Transistor

G3

IC

G4

Better IC
technology

HISTORY OF COMPUTERS
 First Generation (1954-1956):






Vacuum Tubes as switches.


Magnetic drums as memory.
Very big, unreliable, slow.
Examples:
 ENIAC (Electronic Numerical Integrator &
Computer),
 UNIVAC (UNIVersal Automatic Computer).

10

8/7/2013

FIRST GENERATION COMPUTERS

Vacuum Tubes

Electronic Numerical Integrator and Computer (ENIAC)

HISTORY OF COMPUTERS
 Second





Generation (1956-1963):
After invention of transistors.
Smaller, faster, cheaper.
Limited to military and business use.

11

8/7/2013

SECOND GENERATION COMPUTERS


Vacuum tube circuit

Transistor circuit

HISTORY OF MICROPROCESSORS


Third Generation (1964-1971):


 After invention of Integrated Circuits (IC).
 Many transistors can be packed into IC birth of
microprocessors.
 Early microprocessors: Intel 8008, Intel 4004.
 Medium Scale Integration (MSI) and Large Scale Integration
(LSI) devices.

Description of SSI,
MSI, LSI, VLSI

12

8/7/2013

EARLY INTEL MICROPROCESSORS

THIRD GENERATION COMPUTERS


PC

Laptop

13

8/7/2013

HISTORY OF COMPUTERS
 Fourth








Generation (1971-now):
Improvements in IC technology, P design.
More transistors  more processing power.
Very Large Scale Integration (VLSI).
- Intel Montecito Itanium: 1 bln. transistors.
Reduced Instruction Set Computers (RISC).
32, 64-Bit microprocessors.

FOURTH GENERATION COMPUTERS

14

8/7/2013

COMPARISON BETWEEN COMPUTER


GENERATIONS
Computer

Speed

Memory

Cost

UNIVAC
(1st Gen.)

1.3 kHz

1 MB

$1.6 million

IBM 1401
(2nd Gen.)

2.2 kHz

1.4 kB

$47,900

DEC PDP-8
(3nd Gen.)

1 MHz

6 kB

$20,000

Pentium III
(4th Gen.)

500 MHz

128 MB

$700

MICROPROCESSOR SYSTEMS


Definition: A complete electronic system built around the


microprocessor to support the microprocessor operation.

May consist of CPU, memory, I/O (disk drives, keyboard,


mouse), system bus, and supporting circuitry.

CPU as the brain controls actions of all components.

15

8/7/2013

MICROPROCESSOR SYSTEMS - PC

ROM

Floppy

RAM

CD-ROM

CPU

Supporting
Circuitry

Keyboard

Mouse

HDD

MICROPROCESSOR SYSTEMS CALCULATOR

Memory

Power Supply

CPU

LCD Display

Keypad

16

8/7/2013

COMPUTER SYSTEM-SIMPLIFIED VIEW




In general, a computer system consist of the following


elements:

Unidirectional:
Signals flow in
one direction.

Bidirectional:
Signals flow in
both direction
(one at a time).

SYSTEM BUS
A P-based system consists of many components:
 CPU.
 Memory.
 I/O: disk drives, keyboard, mouse.
 System Bus.
 All components communicate using System Bus.
 Communication highway for all components.
 A group of wires is called bus.
 Contains:
 Data bus.
 Address bus.
 Control bus.


17

8/7/2013

SYSTEM BUS DATA BUS


Bidirectional (2 ways) bus.
 Transfer data to/from the CPU


Data bus

CPU

Control
signal is
READ

R/W

Data bus

Input
(from
Memory or
I/O devices)

CPU
Control
signal is
WRITE

R/W

Output
(to Memory
or I/O
devices)

SYSTEM BUS DATA BUS




Example:
 Motorolla 68000 microprocessor has 8 bits data bus,
thus:
 Data size n = 8 bits,
 Data lines/bus are labelled Dn : D0, D1, .. D6, D7
 The size of data bus is determined by the number of lines

(bits) which is also called data size.

18

8/7/2013

SYSTEM BUS ADDRESS BUS


Single direction (unidirectional / 1 way) bus
 Transfer the address data code to memory or devices.


ADDRESS BUS

CPU to other
elements

CPU

I/O Devices
Memory

SYSTEM BUS ADDRESS BUS




Example:
 Motorolla 68000 has 16 bits of address bus:
 n = 16 bits (Size of address bus)


Address bus is labelled An : A0, A1, .. A14, A15


 216 = 65536
 CPU can handle or address 65536 single cells (each
cell has 8 bits data size) of memory.

19

8/7/2013

In other words, 16 bit


address lines can represent
65536 memory location

0 to 65535 locations,
addressed as 0000h to
FFFFh

16 address lines, then the


size of the memory is equal
to 216 = 64Kbyte.

EXAMPLE 1


8-bit address bus




Address bus labeled




Memory location


28 = 256

Address


A0, A1,..A7

00h to FFh

Size of the memory




28 = 256 byte

20

8/7/2013

EXAMPLE 2


32-bit address bus




Address bus labeled




Memory location


232 = 4,294,967,296

Address


A0, A1,..A31

00000000h to FFFFFFFFh

Size of the memory




232 = 22 . 230 = 4GB

SYSTEM BUS CONTROL BUS


Control all the activities of the elements.
 Regulate information transfer, interrupts, error signals.
 Ensures that only one IC is active at a time to avoid a bus
conflict caused by two ICs writing different data to the
same bus.


21

8/7/2013

THE CPU

Master of all components.


 Silicon chip that works as heart of the system.
 Job:
 Get instructions from memory.
 Execute instructions.
 Perform calculations (may use math co-processor).
 Control bus operations.


THE CPU


CPU consists of:


 ALU (Arithmetic/Logic Unit):
 Performs arithmetic/ logic computations.
 The number of bits is a most important factor
 Determining the capabilities of the processor
 Typical sizes:
 4 bits (very small microcontroller: remote controllers)
 8 bits (microcontrollers: 68HC05, 8051, PIC)
 16 bits (low-end microprocessors: Intel 8086)
 32 bits (most popular size today: Pentium, PowerPC, 68000,
ARM, MIPS)
 64 bits (servers: IBM POWER & PowerPC G5, AMD Opteron,
Intel Itanium


CU (Control Unit):
 Responsible to retrieve instructions, analyze, then execute.

22

8/7/2013

CPU REGISTERS


Data Register
 Temporarily stores data for immediate processing

Address Register
 Temporarily stores address of data in memory

Instruction Register
 Stores the instruction currently being executed or decoded
 Includes ALU operation and address of operand

Program Counter
 Keeps track of program execution
 Address of next instruction to read from memory
 May have auto-increment feature or use ALU
 Some manufacturers call this register the Instruction Pointer (IP)

Status Register
 Stores the result of the current data manipulation (negative,
zero etc)

MICROPROCESSOR IN BITS
The number of bits of a microprocessor dictates the maximum
data width of the memory address and data units.
 For example a 4-bit microprocessor can only address up to 16
memory cells and process a maximum data size of 4 bits width.


Microprocessor Bits Clock Speed

Year

Application

Intel 4004

740kHz

1971-1981

General Computing

HP Saturn

640kHz

1980s

Intel 8008

0.5-0.8MHz

1972-1983

Zilog Z80

2.5MHz

1976-present Desktop computers,


industrial, consumer
electronics

Motorola
68000

16

8-20MHz

1979-present Multi-user computers,


General computing,
arcade games, embedded
controller

Calculator
General Computing

23

8/7/2013

MICROPROCESSOR IN BITS
Microprocessor

Bits

Clock Speed

Year

Application

Intel 80286

16

6Mhz-25Mhz

1982-1990s

General computing,
embedded systems

Intel Pentium

32

Varies

1993-present

General computing,
embedded systems

MIPS R3000

32

33MHz

1988

General computing,
embedded systems
Sony Playstation

AMD Athlon 64

64

1.0GHz
3.2GHz

2003

General Computing

Intel Core 2

64

1.06GHz
3.33GHz

2006 present

General Computing

MICROPROCESSOR
VS
MICROCONTROLLER

24

8/7/2013

THE MICROPROCESSOR SYSTEM

THE MICROCONTROLLER SYSTEM

25

8/7/2013

SUMMARY : MPU VS MCU


Microprocessor

Microcontroller

A chip that contains only the


processor

A chip that contains all the


components of a computer
processor components of a
computer processor, memory and
input/output

Need other chips to make a


working system

Less flexibility

More flexible

Less component count in system

Can have very few I/O or many I/O


devices using the same
processor chip

Less powerful

NUMBERING SYSTEMS IN COMPUTERS




Computers are binary machines which can only accept inputs of 1s


or 0s.

Data is also stored in streams of 1s and 0s.

Binary (base 2)
 0000, 0001, 0010, 0011

Octal (base 8)
 0, 1, 2, 3, 4, 5, 6, 7, 10, 11 ,12 16, 17, 20

Hexadecimal (base 16)


 0, 1, 2, 3, 8, 9, A, B, C, D, E, F, 10, 11, 12, 1E, 1F, 20

Decimal (base 10)


 1, 2, 3, 4, 5, 8, 9, 10, 11

In computing, the microprocessor uses binary data and normally


relate the data to human interface in hexadecimal form. For display
and printing purposes, hexadecimal is much more practical.

26

8/7/2013

DATA SIZE IN COMPUTING




The capacity of a microprocessor is normally referred to how


many bits of data can be handled at one time, or what is the
memory size .

A bit is used to describe the data of a signal, it could be 1 or


0. In other words, each bit has two states.

Data size is a mean of measure to determine how much data


can be stored in a single cell of memory.

Data type :
 Bit (B)
 Nibble
 Word (W)
 Longword (L)

DATA SIZE IN COMPUTING




There is a standardization of data sizes.


 Bit (basic unit)


Nibble (or half byte)


 One nibble is 4 bits long. Range from 0000 1111. (0 15)
 Eg. 0010, 0001, 1100, 1111

Byte
 One byte is 8 bits long.
 Range from 00000000 11111111 (0 255)
 Eg. 00000011, 00001111, 11100011

Word
 One word is two bytes long.

Longword
 One longword is two bytes long.

27

8/7/2013

DATA SIZE IN COMPUTING




Words and longwords are normally used to describe instruction size,


from a microprocessor perspective as opposed to disk storage
system which uses megabytes and gigabytes.

DATA SIZE IN COMPUTING

28

8/7/2013

EXAMPLE


A single cell sized 1 bit can store either logic-0 or logic-1. In


other word, two different situations can be stored or
represented. Thus the range of data is 0 1.
 Data size: n = 1
 Data capacity : 2n = 21 = 2
 Range : 0 1

A single cell sized 4 bit (Nibble) can store 16 possible situations.


 Data size: n = 4
 Data capacity : 2n = 24 = 16
 Range : 0 - 15

FETCH AND EXECUTE CYCLE




The processor executes instructions one-by-one according to the


sequence found in memory

Everything is controlled by, what else, the control unit in the CPU.

To execute an instruction, the processor must fetch it from memory.

The complete steps the processor takes to execute one instruction is


the instruction cycle or the fetch-execute instruction is the
instruction cycle or the fetch execute cycle

29

8/7/2013

CPE EXECUTION CYCLE




CPU executes instructions in endless fetch, decode, execute


cycles.

It only knows how to do three things:


 Fetch instructions from somewhere.
 Analyze instruction, get more data if necessary.
 Execute instruction.

Keeps track of instruction using Program Counter (PC):


 Tells CPU location of next instruction.

FETCH, DECODE, EXECUTE


Reset

Fetch

Decode

Execute

30

8/7/2013

FETCH STEP 1
CPU

Memory

Control
Instruction Register

Data Registers

Program Counter

$1000

$1000

Instruction #1

$1001

Instruction #1

$1002

Instruction #2

$1003

Instruction #2

$1004

Empty

$1005

Empty

$1006

Empty

$1007

Data #1

$1008

Data #2

$1009

Data #3

CPU gets
instruction address
from PC

FETCH STEP 2
CPU

Memory
Address Bus

Control

$1000

Instruction Register

Data Registers

CPU outputs
instruction address
through Address Bus
Program Counter

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

$1000

31

8/7/2013

FETCH STEP 3
CPU

Memory
Data Bus

Control

Instruction #1

Instruction Register

Data Registers

Memory gets the


instruction and
sends in to CPU
using Data Bus.
Program Counter

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

$1000

FETCH STEP 4
CPU

Memory

Control
Instruction Register

Instruction #1
Data Registers

CPU stores
instruction in
Instruction Register
Program Counter

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

$1000

32

8/7/2013

FETCH STEP 5
CPU

Memory

Control
Instruction Register

Instruction #1
Data Registers

After instruction has


been loaded, CPU
updates Program
Counter.
Program Counter

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

$1002

DECODE STEP 1
CPU

Memory

Control
Instruction Register

Instruction #1
Data Registers

CPU analyzes
instructions before
executing it.
Program Counter

$1002

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

Type of instruction.
Does the instruction require any data to perform calculations?
Where are the data located?

33

8/7/2013

EXECUTE STEP 2
CPU

Memory

Control
Instruction Register

Instruction #1
Data Registers

Data #1

CPU puts data inside


internal data
registers and execute
instructions.

Program Counter

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

$1002

EXECUTE STEP 3
CPU

Memory
Address Bus

Control

$1005

Instruction Register

Instruction #1
Data Bus
Data Registers

Data #1
Result #1

Program Counter

$1002

Result #1

If instruction wants to
write data to memory,
CPU puts its data and
address on the bus.

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3

34

8/7/2013

EXECUTE STEP 4
CPU

Memory

Control
Instruction Register

Instruction #1
Data Registers

Data #1
Result #1

Program Counter

Memory receives
instructions and puts
data in the location.

$1000
$1001
$1002
$1003
$1004
$1005
$1006
$1007
$1008
$1009

Instruction #1
Instruction #1
Instruction #2
Instruction #2
Empty
Result #1
Empty
Data #1
Data #2
Data #3

$1002

FETCH AND EXECUTE IN SUMMARY




On program start:
0. Load the program counter (PC) with the address of the first
instruction

Fetch phase:
2. Read the instruction and put it into the instruction register (IR)
3. Control unit decodes the instruction; updates the PC for the next
instruction
Execute phase:
3. Find the data required by the instruction.
4. Perform the required operation.
5. Store the results.
6. Repeat from Step 1.

35

8/7/2013

TUTORIAL QUESTION


Name the 4 computer generations and the technological


breakthroughs that caused them to happen.

Draw the microprocessor system and explain the functions


of each component in the system.

36

Vous aimerez peut-être aussi