- ShareStudies.com

Download Report

Transcript - ShareStudies.com

CHAPTER I
Generalities and definitions
Definition : microprocessor is digital integrated circuit
device that can be programmed with a series of
instructions to perform special functions on data.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
1
1-History
The First Computer
The Babbage
Difference Engine
(1832)
25,000 parts
cost: £17,470
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
2
1-History (Contd.)
ENIAC - The first electronic computer
(1946)
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
3
1-History (Contd.)
Intel 4004 Micro-Processor
o 1971
o 1000 transistors
o 1 MHz operation
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
4
1-History (Contd.)
Intel 8085 Microprocessor
o 1974
o 8-bit architecture
o Still used in some
microcontroller
applications !
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
5
1-History (Contd.)
Intel 8086 Microprocessor
o
o
o
o
o
Chapter I: Generalities and definitions
1979
29,000 transistors
33 mm2
Clock: 5 MHz
16 bit architecture:
length of data bus
Dr. Y. MOHANNA
6
1-History (Contd.)
Intel 80386 Microprocessor
o
o
o
o
o
Chapter I: Generalities and definitions
1985
275,000 transistors
43 mm2
Clock: 16 MHz
32 bit architecture
Dr. Y. MOHANNA
7
1-History (Contd.)
Intel 80486 Microprocessor
o
o
o
o
o
1989
1,200,000 transistors
81 mm2
Clock: 25 MHz
32 bit architecture
 1st pipelined
implementation of
IA32
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
8
1-History (Contd.)
Intel Pentium Microprocessor
 State
 Registers
 Memory
 Control ROM
REG
o
o
o
o
o
1993
3,100,000 tr.
296 mm2
Clock: 60 MHz
32 bit architecture
 Combinational
logic
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
9
1-History (Contd.)
Intel Pentium (III) Microprocessor
o
o
o
o
o
Chapter I: Generalities and definitions
1999
9,500,000 transistors
125 mm2
Clock: 450 MHz
32 bit architecture
Dr. Y. MOHANNA
10
1-History (Contd.)
Intel Pentium (IV) microprocessor
2002
42 000 000 transistors
2 Giga Hertz operation
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
11
1-History (Contd.)
Intel Pentium D
processor with two
processing cores
2005
~150 000 000 transistors
3.2 Giga Hertz operation
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
12
1-History (Contd.)
Intel Core 2 Duo
2006
~290 000 000 transistors
3.2 Giga Hertz operation
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
13
2-Moore’s Law
1,000,000
1 Billion
Transistors
K. Transistors
100,000
10,000
1,000
i486
i386
80286
100
10
Pentium® Core 2 Duo
Pentium® D
® IV
Pentium
®
Pentium III
Pentium® II
Pentium® Pro
Pentium®
8086
Source: Intel
1
1975 1980 1985 1990 1995 2000 2005 2010
Projected
Transistors on Lead Microprocessors double every 2 years
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
14
2-Moore’s Law
Frequency
Frequency (Mhz)
10000
Doubles every
2 years
1000
100
486
10
8085
1
0.1
1970
8086 286
P6
Pentium ® proc
386
8080
8008
4004
1980
1990
Year
2000
2010
Lead Microprocessors frequency doubles every 2 years
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
15
3-Basic bloc of a microprocessor
 The mulptiplexer like (ALU) is
the core of the microprocessor.
 The basic bloc and the main core
of a microprocessor is the
Central Processing Unit (CPU).
 The CPU, in its turn, consists of
two main blocs: Control unit &
Arithmetic and logic unit.
Output = C1’. C0’.I0 + C1’. C0 .I1 + C1 . C0’.I2 + C1 . C0 .I3
a
b
output
0
0
I0
0
1
I1
1
0
I2
1
1
I3
{Output=a'.b'.I0+a'.b.I1+a.b'.I2+a.b.I3}
Examples:
If we send at the input 0000output = 0clear function.
If we send at the input 1000 output = a'.b' Nor gate.
If we send at the input 0001 output = a.bAnd gate.
If we send at the input 0110 output = a'.b+a.b' = a xor b  XOR gate
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
16
3-The ALU
The control unit: it is "in charge" of the processing of
instructions.
The ALU: It is directed by the control unit to perform
arithmetic operations such as addition, subtraction
and logic operations such as NOT, AND, OR and
exclusive-OR.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
17
3-ALU
o Arithmetic and Logic Operations ALU:
 Every microprocessor has arithmetic operations
such as add and subtract as part of its instruction
set.
• Most microprocessors will have operations such as multiply
and divide.
• Some of the newer ones will have complex operations such
as square root.
 In addition, microprocessors have logic operations
as well. Such as AND, OR, XOR, shift left, shift right,
etc.
 Again, the number and types of operations define
the microprocessor’s instruction set and depends on
the specific microprocessor.
3-The principle function of ALU
CCC
the principle of generating
Program
Data In
functions of an
ALU is similar to that of a
Data In
multiplexer. It is a device
Control
Data out
unit
ALU
that allows digital
ALU
information from several
(figure.2)
sources to be routed onto a single line
for transmission over that line to common destination .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
19
3-The complete microprocessor system
A complete microprocessor system consists of the
CPU, memory elements (RAM, EPROM…), and what
we call peripherals.
we have different types of memories : RAM and
ROM.
Output
Input
Memory
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
20
3-The RAM
It is a type of memory in which all addreses are
accessible in an equal amount of time and can be
selected in any order for a read or write operation . All
RAM share both read and write capability . Because
RAMs lose stored DATA when the power is turned off
, they are volatile memories .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
21
3-The RAM Family
 STATIC RAM (SRAM)
 DYNAMIC RAM (DRAM)
SRAM :It uses a flip flop as storage elements and can therefore
store data indefinitely as long as the DC POWER is applied .
DRAM : It uses capacitors as storage elements and can't retain
data very long without the capacitor being recharged by a
process called refreshing . It uses DMA DIRECT MEMORY
ACCESS for refreshing.
Both will lose data when DC POWER IS removed
 Data can be read much faster from SRAM than from DRAM
 DRAM can store much more data than SRAM for the same
dimension (since it is simpler)
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
22
3-The ROM
 It contains permanently or semi-permanently stored
data which can be read from the memory ,but either
can't be changed with specialized equipment .
 ROM stores data that are used repetitively in system
applications ,such as tables ,conversions ,or
programmed instructions for system initialization and
operation .
 ROM retain stored data when the power is off and are
therefore non volatile memories .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
23
3- The ROM Family
PROM or OTPROM : ( Programmable ROM) The data are
electrically stored by the user with the aid of specialized
equipment ( programmer) .once the data are stored they
cant be changed that is the PROM can't be programmed
again.
UVEPROM : Same as prom but it could be programmed
again it can be erased by ultraviolet light.
EPROM : Erasable PROM .It is electrically programmed by
the user using programmer but the stored data can be
erased by exposure to ultraviolet rays for a period of several
minutes .
EEPROM : (ELECTRICALLY ERASABLE PROM ) same as
EPROM but the data are erased electrically in a few
milliseconds .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
24
Peripherals
- I/O (input-output)
device: for exchanging
information with the
outside environment
(mouse, keyboard,
screen, sensors...)
-Timers.
-Interrupts.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
25
Types of microprocessors :
 The microprocessor and the microcontroller
 DSP Systems: Digital Signal Processing.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
26
The microprocessor and the microcontroller
p
ALU
I/O
Input / Output
Register
Array
System Bus
Control
Memory
ROM RAM
 The microcontroller is a microprocessor such that all the peripherals
and the CPU are put in a unique system (IC) called microcontroller.
 Each microcontroller has its own application (like in cellular system),
so the microcontrollers don't have the same architecture.
 The systems which have only one application are called embedded
systems.
 The PC's are multi-application systems.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
27
DSP Systems: Digital Signal
Processing.
 The general function is A.B + C.
∑X( i ).A( i ) = x(1).A(1) + x(2).A(2) + ………..
 So at each stage we have a multiplication and addition
with the previous result obtained which it calls from
the memory.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
28
RISC and CISC microprocessors
- CISC ( Complex Instruction Set
Computer )
RISC ( Reduced Instruction Set
Computer ) :
Emphasis on hardware.
Emphasis on software.
Includes Multi-clock complex
instructions.
Single -clock reduced instructions
only.
Memory -to -memory :
Register -to - Register :
“load” and “store” incorporated in “load” and “store” are independent
instructions.
instructions.
Small code sizes,
high cycles per second
large code sizes,
low cycles per second
Transistors used for strong complex
instructions.
Spends more transistors on memory
registers.
Our RISC DSPIC has about 70 base instructions.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
29
APPLICATIONS OF
MICROPROCESSORS
 Audio signal processing
 Telecommunications
 Car industry
 Medical applications
 Vocal synthesis
 Speech recognition
 Military applications
 Multimedia applications
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
30
Choice of Microprocessors
 Application : the choice of microprocessor must be





suitable with the kind and level of the task to be
carried out.
Learning period: the period of time needed to learn
the microprocessor I want to use must not be long.
Price of simulator and emulator.
Price of microprocessor.
Availability of Microprocessor.
Different manufacturers .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
31
Microprocessors Architectures
 VON-Neumann architecture.
 Harvard architecture .
 Principle of pipeline.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
32
VON-Neumann
architecture
•Data goes from CPU to RAM of
EPROM and not to both at same
time; and vice versa . So we have one
work at time.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
33
•Each of the EPROM & RAM has its own buses to and from
Harvard architecture
the CPU => both the EPROM & RAM can control and be
accessed at same time. So we have two works at time.
•Two different buses=>reads and executes at same time.
Same bus for Address and Data => executes or reads at a
time.
An understanding of the dsPIC DSC begins with its
memory architecture, since it is one of those elements
specifically designed to address the data-throughput
requirements of a digital signal processing system. The
dsPIC DSC employs a modified Harvard architecture that
has separate program memory and data memory busses,
allowing the processor to simultaneously fetch both an
instruction and the dataupon which that instruction will
operate.
In a pure Harvard architecture, these two busses are
completely separate, with no way to pass data between
them. Although an entirely logical approach, the pure
Harvard architecture is inadequate for the needs of many
digital signal processing applications because it means
that only a single data value can be retrieved in one cycle.
Frequently, what’s really required are two data values, the
sampled data and a coefficient by which it will be
multiplied, and in the pure Harvard architecture this
requires two separate instruction cycles. To surmount this
constraint, the modified Harvard architecture actually
supports three busses: one to fetch the instructions (the
program memory bus) and two to fetch associated data
values (often referred
to in the literature as the X- and the Y-memory busses).
This allows true single cycle operation, effectively doubling
system throughput when compared to a pure Harvard
architecture running at the same speed. Figures 3.1a and
3.1b illustrate the difference between a pure Harvard
memory architecture and a modified Harvard
Chapter I: Generalities and definitions
architecture.
Dr. Y. MOHANNA
34
Principle of pipeline
 For having a good performance of the speed of
accessing data and instructions the DSP uses the
technique of parallelism or what we call "pipeline".
 In dspic30f we have 2 levels
 The execution of the instruction is divided into several
phases; in the TMS320C50 we have four phases:
-fetching: read the instruction from the EPROM.
- decoding: transform the instruction into machine
language.
- reading data from the RAM.
- executing the instruction
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
35
Pipeline mechanism
In the pipeline technique, there is a parallel accessing, i.e., when the MP is
in the stage of decoding an instruction it makes fetching for the next
instruction and so on……..
Dspic pipeline: 2 levels
tms320c54 pipeline:
4 levels
Instruction
T
t+1
t+2
t+3
n
FETCH(1)
Decode(1)
READ(1)
Execute(1)
FETCH(2)
Decode(2)
READ(2)
Execute(2)
FETCH(3)
Decode(3)
READ(3)
Execute(3)
FETCH(4)
Decode(4)
READ(4)
n+1
n+2
n+3
Chapter I: Generalities and definitions
t+4
t+5
Dr. Y. MOHANNA
t+6
Execute(4)
36
Microprocessor Development
All MPs work with a basic instruction set, formulated by
the designers of the processor.
 To perform the task of writing instructions for a MP,
assembly language was devised. Assembly language is
classified as a low-level language because the Englishlike instructions contained in a given assembly
language can be directly translated into binary
instructions.
 We have 4 features concerning programming a MP:
High level language
Source code
Compiler
Assembler
Chapter I: Generalities and definitions
Machine language
Object code
Dr. Y. MOHANNA
37
Assembler
 An assembler is a program that converts the English-like
instructions in the assembly language into the machine
language( binary patterns) used by the microprocessor.
 Assembly language and the corresponding machine
language are specific to the type of the microprocessor or
the microprocessor family, so it is a specific-purpose
language.
Flowchart
DSPIC30F Manual
Microprocessor Lookup
Hex.
Code
Monitor Binary
Program Code
To
Memory
For Storage
Manual Assembly Process
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
38
DEBUGGING: SIMULATOR
To find and correct bugs in microprocessors, a simulator
is required. It simulates all of the functionality of a
microprocessor program on a PC, but without testing
the hardware.
This is a useful tool for evaluating the feasibility of a
design before testing its hardware .
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
39
DEBUGGING:
EMULATORS
An emulator behaves the
same as a real DSP . It can
interact with any hardware
to which it is attached , but
it allows the user to control
and see the results of
instructions being executed
. This is an invaluable tool
for development engineers ,
since they can actually see
what is happening and
change the actions , rather
than just guess what is
happening . Modern
emulators do not replace
the DSP chip on the board ,
but instead exert their
control through a serial
Chapter I: Generalities and definitions
scan path .
Dr. Y. MOHANNA
40
programmer
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
41
MICROPROCESSOR PERFORMANCE:
• To differentiate between computers, we use the formula :
T=(N*S)/R
T: execution time
N: number of machine cycles
S: average step
R: clock rate in cycle/sec.
• SPEC RATING
It is a standard to differentiate between computers performances in both
hardware and software. Every about 5 years, a computer is chosen as reference
and testing of different kinds of software are tested.
Spec rating=(running time of reference computer)/(running time of computer
under test)
Sr= (nπi=1 speci )1/n
So you choose the computer according to the spec you want.




MIPS: Million Instructions Per Second.
BIPS: Billion Instructions Per Second.
MFLOPS: Million FLOating Point instructions Per Second.
BFLOPS: Billion FLOating Point instructions Per Second.
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
42
DEFINITIONS
 8- BIT MICROPROCESSORS : DATA BUS = 8 BITS
 16- BIT MICROPROCESSORS : DATA BUS = 16 BITS
 32- BIT MICROPROCESSORS : DATA BUS = 32 BITS
 16-32 BITS MICROPROCESSORS : EXTERNAL DATA BUS =
16 BITS, : INTERNAL DATA BUS = 32 BITS.
 Programmable logic vs Cabled logic
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
43
Types of COMPUTERS :
Computer types arranged in increasing order of power:
 Personal computers.
 Enterprise systems and servers
 Main frames
 Super computers
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
44
The Operating System
o The interaction of the user with the computer is
through the operating system.
 When the user invokes a program, the operating system
starts the process and makes the program start executing.
The program is executed on top of the operating system.
Application
Application Programs
Operating
Operating System
Hardware
Hardware
System
Programs
Chapter I: Generalities and definitions
Dr. Y. MOHANNA
45