chapter 1 introduction to microprocessors
DESCRIPTION
fggjdTRANSCRIPT
-
8/7/2013
1
INTRODUCTION TO
MICROPROCESSORChapter 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
2
CPU
Memory
I/O unit
Central Processing Unit
(CPU)
Input Unit Output Unit
Main MemorySecondary Memory
BASIC COMPONENTS OF A COMPUTER SYSTEM
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.
DEFINITIONS
-
8/7/2013
3
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.
DEFINITIONS (CONT)
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.
WHAT IS A MICROPROCESSOR
-
8/7/2013
4
Everyday items that use microprocessors
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.
MORE ABOUT THE MICROPROCESSOR
-
8/7/2013
5
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
COMPUTING SYSTEMS
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
CLASSIFICATION OF COMPUTERS
-
8/7/2013
6
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.
EMBEDDED SYSTEMS
-
8/7/2013
7
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
PROCESSFrom Sand to Silicone
-
8/7/2013
8
MANUFACTURING PROCESS
MANUFACTURING PROCESS
-
8/7/2013
9
MANUFACTURING PROCESS
http://www.nikon.com/products/precision/soc
iety/story0202/index.htm
MANUFACTURING PROCESS
-
8/7/2013
10
Has undergone significant improvements:
4 generations until now.
Tied to development of electronics, semiconductors.
Vacuum
Tube
Transistor ICBetter IC
technology
G1 G2 G3 G4
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).
HISTORY OF COMPUTERS
-
8/7/2013
11
Electronic Numerical Integrator and Computer (ENIAC)
Vacuum Tubes
FIRST GENERATION COMPUTERS
Second Generation (1956-1963):
After invention of transistors.
Smaller, faster, cheaper.
Limited to military and business use.
HISTORY OF COMPUTERS
-
8/7/2013
12
Transistor circuit
Vacuum tube circuit
SECOND GENERATION COMPUTERS
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
HISTORY OF MICROPROCESSORS
-
8/7/2013
13
EARLY INTEL MICROPROCESSORS
Laptop
PC
THIRD GENERATION COMPUTERS
-
8/7/2013
14
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.
HISTORY OF COMPUTERS
FOURTH GENERATION COMPUTERS
-
8/7/2013
15
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
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.
MICROPROCESSOR SYSTEMS
-
8/7/2013
16
MICROPROCESSOR SYSTEMS - PC
ROM
Keyboard Mouse HDD
Floppy RAM
CD-ROMSupporting
CircuitryCPU
MICROPROCESSOR SYSTEMS -CALCULATOR
Keypad
Memory
Power Supply LCD DisplayCPU
-
8/7/2013
17
In general, a computer system consist of the following
elements:
COMPUTER SYSTEM-SIMPLIFIED VIEW
Unidirectional:
Signals flow in
one direction.
Bidirectional:
Signals flow in
both direction
(one at a time).
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.
SYSTEM BUS
-
8/7/2013
18
Bidirectional (2 ways) bus.
Transfer data to/from the CPU
SYSTEM BUS DATA BUS
CPU
R/WControl
signal is
READ
Input
(from
Memory or
I/O devices)
Data bus
CPU
R/WControl
signal is
WRITE
Output
(to Memory
or I/O
devices)
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.
SYSTEM BUS DATA BUS
-
8/7/2013
19
Single direction (unidirectional / 1 way) bus
Transfer the address data code to memory or devices.
SYSTEM BUS ADDRESS BUS
CPU
Memory
I/O Devices
CPU to other
elementsADDRESS 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.
SYSTEM BUS ADDRESS BUS
-
8/7/2013
20
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.
8-bit address bus
Address bus labeled
A0, A1,..A7
Memory location
28 = 256
Address
00h to FFh
Size of the memory
28 = 256 byte
EXAMPLE 1
-
8/7/2013
21
32-bit address bus
Address bus labeled
A0, A1,..A31
Memory location
232 = 4,294,967,296
Address
00000000h to FFFFFFFFh
Size of the memory
232 = 22 . 230 = 4GB
EXAMPLE 2
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.
SYSTEM BUS CONTROL BUS
-
8/7/2013
22
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.
THE CPU
-
8/7/2013
23
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)
CPU REGISTERS
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 4 740kHz 1971-1981 General Computing
HP Saturn 4 640kHz 1980s Calculator
Intel 8008 8 0.5-0.8MHz 1972-1983 General Computing
Zilog Z80 8 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
MICROPROCESSOR IN BITS
-
8/7/2013
24
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 IN BITS
MICROPROCESSOR
VS
MICROCONTROLLER
-
8/7/2013
25
THE MICROPROCESSOR SYSTEM
THE MICROCONTROLLER SYSTEM
-
8/7/2013
26
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
SUMMARY : MPU VS MCU
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.
NUMBERING SYSTEMS IN COMPUTERS
-
8/7/2013
27
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.
DATA SIZE IN COMPUTING
-
8/7/2013
28
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
DATA SIZE IN COMPUTING
-
8/7/2013
29
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
EXAMPLE
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
FETCH AND EXECUTE CYCLE
-
8/7/2013
30
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.
CPE EXECUTION CYCLE
Reset
Fetch
Decode
Execute
FETCH, DECODE, EXECUTE
-
8/7/2013
31
Instruction #1
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
CPU Memory
Program Counter
$1000
Control
Instruction Register
Data Registers
CPU gets
instruction address
from PC
FETCH STEP 1
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1000
Control
CPU Memory
Instruction Register
Data Registers
CPU outputs
instruction address
through Address Bus
$1000
Address Bus
FETCH STEP 2
-
8/7/2013
32
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1000
Control
CPU Memory
Instruction Register
Data Registers
Memory gets the
instruction and
sends in to CPU
using Data Bus.
Instruction #1
Data Bus
FETCH STEP 3
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1000
Control
CPU Memory
Instruction #1
Instruction Register
Data Registers
CPU stores
instruction in
Instruction Register
FETCH STEP 4
-
8/7/2013
33
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1002
Control
CPU Memory
Instruction #1
Instruction Register
Data Registers
After instruction has
been loaded, CPU
updates Program
Counter.
FETCH STEP 5
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1002
Control
CPU Memory
Instruction #1
Instruction Register
Data Registers
CPU analyzes
instructions before
executing it.
Type of instruction.
Does the instruction require any data to perform calculations?
Where are the data located?
DECODE STEP 1
-
8/7/2013
34
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1002
Control
CPU Memory
Instruction #1
Data #1
Instruction Register
Data Registers
CPU puts data inside
internal data
registers and execute
instructions.
EXECUTE STEP 2
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Empty
Empty
Data #1
Data #2
Data #3
$1002
Control
CPU Memory
Instruction #1
Data #1
Result #1
Instruction Register
Data Registers
If instruction wants to
write data to memory,
CPU puts its data and
address on the bus.
$1005
Address Bus
Result #1
Data Bus
EXECUTE STEP 3
-
8/7/2013
35
Program Counter
Instruction #1
$1001
$1009
$1008
$1007
$1006
$1005
$1004
$1003
$1002
$1000
Instruction #1
Instruction #2
Instruction #2
Empty
Result #1
Empty
Data #1
Data #2
Data #3
$1002
Control
CPU Memory
Instruction #1
Data #1
Result #1
Instruction Register
Data Registers
Memory receives
instructions and puts
data in the location.
EXECUTE STEP 4
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.
FETCH AND EXECUTE IN SUMMARY
-
8/7/2013
36
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.
TUTORIAL QUESTION