Microprocessor
Download
Report
Transcript Microprocessor
Microprocessor
Dr. Rabie A. Ramadan
Al-Azhar University
Lecture 1
Class Materials
Text book
• Ramesh S. Gaonkar, The Z80 Microprocessor
architecture , Interfacing, Programming, and
Design,.
• Term paper/Project
• Select your topic or your project (HW) as early as
possible
• Group of max. 2 students
2
Schedule and Arrangement
2 Classes Weekly
1 Tutorial Weekly
We may substitute one of the lectures by a
tutorial according to the class requirements.
3
Participation
You are expected to attend all of the
lectures
• Exams will be based on the class materials
Group Activities
• Very Important
4
Assignments and Quizzes
Must be submitted on time
Late assignments will be accepted within one
week with substantial penalties
One Quiz (15 minutes ) Every Week . Please
come ready
5
Learning is a treasure whose keys are
questions. So do not be afraid to ask.
I have no problem saying, I made a
mistake and the right thing is … or I do
not know and I have to look it up
6
Lets Get Started
7
Computing Evolution
We Have Come a Long Way!!
The Electronic Numerical Integrator and Computer (ENIAC) begins in 1938
Home computer as imagined more than 50 years ago
The Computer
Evolution
Moore’s Law
1965 prediction by Intel
cofounder Gordon Moore:
The number of transistors
that can be built on the same
size piece of silicon will
double every 18 months
log (people per
computer)
Bell’s Law: New computing
class every 10 years
Streaming Data
to/from the
Physical World
year
Excerpted from ‘The Mote Revolution: Low Power Wireless Sensor Network’, UCB, 2004.
Ubiquitous Computing: A
Vision Ahead of his Time
The most profound
technologies are those
that disappear. They
weave themselves into
the fabric of everyday life
until they are
indistinguishable from it.
Mark Weiser, 1991
Where is the Microprocessor ?
It is inside of every device that we have
such as computer , printers , mobile ,
etc..
16
What is the Microprocessor?
Multipurpose , programmable logic device.
Reads Instructions from the Memory
Accepts binary input data
Process the data according to the instructions
Produces Output
17
A typical Programmable
Machine/System
Microprocessor , Memory, and I/O
Memory
Microproces
sor
I/O
18
The System Components
Hardware Physical Devices
Program a group of instructions
preformed by the microprocessor
Software a group of programs
Memory
Micropro
cessor
I/O
19
Microprocessor vs. Microcontroller
A microcontroller contains a processor core, memory, and programmable
input/output peripherals.
Microcontrollers include an integrated CPU, memory (a small amount of
RAM, program memory, or both) and peripherals capable of input and output.
Microprocessor only contains a CPU (the kind used in a PC). In addition to
the usual arithmetic and logic elements of a general purpose microprocessor,
The microcontroller includes all of the required components on one chip.
The microprocessor includes some of the components on a chip and other
components are used as peripherals.
20
What numbering System a
Microprocessor Uses?
Binary System
A Bit is 0 or 1
The processor processes a group of bits called
Word.
The word size could be:
8-bit, 16-bit, 32-bit, or 64-bits
Therefore, the processor is named after the word
size. e.g. We say “ 8-bit Microprocessor”
21
A Microprocessor as a
Programmable Device
The piano is a programmable
machine
• With its key , we can generate notes
The Microprocessor has
different instructions :
• Can be combined in different ways to
•
generate different programs.
Instructions are stored in a Memory
22
The Memory
23
Word Addressing
Given M words , how many bits l are required to address
them?
l log 2 M
Example: to address 64 MB, we need
l log 2 (64 * 220 ) 26 bits
24
Memory Organization
Viewed as a large, single-dimension array, with an address
A memory address is an index into the array
"Byte addressing" means that successive addresses are one byte apart
0
8 bits of data
1
8 bits of data
2
8 bits of data
3
8 bits of data
4
8 bits of data
5
8 bits of data
6
8 bits of data
...
Types of Memory
Cache Memory
•
•
Serves as a buffer for frequently accessed data
Small High Cost
RAM (Main Memory)
•
•
•
Stores programs and data that the computer needs when executing
a program
Dynamic RAM (DRAM)
•
•
Uses Tiny Capacitors
Needs to be recharged every few milliseconds to keep the stored data
Static RAM (SRAM)
•
•
Holds its data as long as the power is on
D Flip Flop
Types of Memory (Cont.)
ROM
•
•
Stores critical information necessary to operate the system.
Hardwired can not be programmed
Programmable Read Only Memory (PROM)
•
Can be programmed once using appropriate equipment
Erasable PROM (EPROM)
•
•
Can be programmed with special tool
It has to be totally erased to be reprogrammed
Electrical Erasable PROM (EEPROM)
•
•
No special tools required
Can erase a portion
Memory Hierarchy
The idea
•
•
Hide the slower memory behind the fast memory
Cost and performance play major roles in selecting the memory.
Hit Vs. Miss
Hit
•
The requested data resides in a given level of memory.
Miss
•
The requested data is not found in the given level of memory
Hit rate
•
The percentage of memory accesses found in a given level of
memory.
Miss rate
•
The percentage of memory accesses not found in a given level of
memory.
Input / Output
Input Devices
Output Devices:
The processor reads the instructions from the
memory , data from the input devices,
processes them, produces the output
• Switches , Keyboard , ….
• Seven Segments (LEDs) , printer , Monitor ,..
30
Microprocessor as CPU
-The CPU includes ALU, control
Units , and Various Registers
-Known as Microprocessor
31
The Von Neumann Model
It uses von Neumann
execution cycle
(also called the fetchdecode-execute cycle)
The Von Neumann Model (Cont.)
A cycle could be as follows:
1.
The control unit fetches the next program
instruction from the memory, using the program
counter to determine where the instruction is
located.
2.
The instruction is decoded into a language the
ALU can understand.
3.
Any data operands required to execute the
instruction are fetched from memory and placed
into registers within the CPU.
4.
The ALU executes the instruction and places the
results in registers or memory.
Instruction Processing
Von Neumann execution cycle
Fetch instruction from memory
Decode instruction
Evaluate address
Fetch operands from memory
Execute operation
Store result
The Modified Von Neumann Model
The data bus:
Moves data from main memory
to the CPU registers (and vice versa).
The address bus:
Holds the address of the data that
the data bus is currently accessing.
The control bus:
Carries the necessary control signals that specify how the
information transfer is to take place.
Advances in Semiconductor
Technology
IC- Integrated Circuits few transistors and diodes on
one chip
SSI –small scale Integration few gates on one chip
MSI- Medium scale Integration- 100 gates on a chip
LSI – Large Scale Integration – 1000 gates on a chip
VLSI – Very large scale Integration
SLSI – Super Large Scale Integration
Borders between VLSI and SLSI are not strict.
36
Microprocessor Programming
Machine language
Assembly language
High level Language
• Instruction written in binary format
• Text based format Add A , B
Source Code
Compiler /
Interpreter
Object Code
37
Z80 Instructions and
Alphanumeric Codes
8-bit word length
158 instructions
ASCII – American Standard Code for Information
InterchangeEach character has its equivalent binary format in a 7-bit
code
EBCDIC – Extended Binary Coded Decimal Interchange
Code – 8-bit code
38
Reading Assignment
Please read Chapter 1 in the textbook
39