Textbook
The Intel Microprocessors by Berry b Brey 8th Edition
Reference Book
Assembly Language for x86 Processors By KIP R. Irvine, 7th
Edition(Reference Book)
8051 by Scott Mackenzi
Software
Keil (Platform for 8051)
Grading
Assignments – 10% (2-3)-CEP
Quizzes – 10% (3-4)
OHTs – 30%
Final Exam – 50%
CLOs
At the end of the semester students must be able to :-
Ser/ Course Learning Outcomes PLO BT
No
1 Describe the basic architecture/components of
1 C2
Microprocessor / Microcontroller
2 Discuss the basic concepts of working of an
embedded system with 2 C2
microcontroller/microprocessor
3 Analyze and design programs for
Microcontroller/Microprocessor in assembly 3 C3
language and its interfacing
4 Design and program the embedded systems with
5 P3
microcontroller/microprocessor using modern tools
5 Demonstrate ability to work effectively as an
9 A3
individual or in a team.
Course Outline
Introduction, Evolution of Microcontrollers
Microprocessors / General Introduction
Concepts Features/Pin Description
Architecture of 80x86 Addressing Modes
8x86Hardware Specs Programming
Memory Banking Data Movement Inst
Pipelining Timers
Pin description Counters
Read/Write Cycles Serial Communications
Interrupt Processing Ex Interfacing Techniques
DMA Interfacing
Basic Concepts of Microprocessors
• Differences between:
– Microcomputer – a computer with a
microprocessor as its CPU. Includes memory, I/O
etc.
– Microprocessor – silicon chip which includes
ALU, register circuits & control circuits
– Microcontroller – silicon chip which includes
microprocessor, memory & I/O in a single
package.
What is a Microprocessor?
• The word comes from the combination micro and
processor.
– Processor means a device that processes data
Micro
• Micro:
– In the late 1960’s, processors were built using discrete
elements.
– In the early 1970’s the microchip was invented.
– All of the components that made up the processor
were now placed on a single piece of silicon.
– The size became several thousand times smaller and
the speed became several hundred times faster. The
“Micro”Processor was born.
Definition of the Microprocessor
The microprocessor is a programmable device
that takes in numbers, performs on them
arithmetic or logical operations according to the
program stored in memory and then produces
other numbers as a result.
Definition (Contd.)
– Programmable device: The microprocessor can perform
different sets of operations on the data it receives depending
on the sequence of instructions supplied in the given
program.
By changing the program, the microprocessor manipulates
the data in different ways.
– Instructions: Each microprocessor is designed to execute a
specific group of operations. This group of operations is
called an instruction set. This instruction set defines what the
microprocessor can and cannot do.
Definition (Contd.)
– Takes in: The data that the microprocessor
manipulates must come from :
• It comes from what is called “input devices”.
• These are devices that bring data into the system
from the outside world.
• These represent devices such as a keyboard, a
mouse, switches, and the like.
Definition (Contd.)
– Numbers: It only understands binary numbers.
A binary digit is called a bit (which comes from binary digit).
The microprocessor recognizes and processes a group of bits
together. This group of bits is called a “word”.
The number of bits in a Microprocessor’s word, is a measure of its
“abilities”.
Definition (Contd.)
– Words, Bytes, etc.
• The earliest microprocessor (the Intel 8085 and Motorola’s
6800) recognized 8-bit words.
– They processed information 8-bits at a time. That’s why they are
called “8-bit processors”. They can handle large numbers, but in
order to process these numbers, they broke them into 8-bit pieces
and processed each group of 8-bits separately.
• Later microprocessors (8086 ) were designed with 16-bit
words.
– A group of 8-bits were referred to as a “half-word” or “byte”.
– A group of 4 bits is called a “nibble”.
– Also, 32 bit groups were given the name “long word”.
• Today, all processors manipulate at least 32 bits at a time and
there exists microprocessors that can process 64 bits
Definition (Contd.)
– Arithmetic and Logic Operations:
• 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.
Definition (Contd.)
– Stored in memory :
– Memory is the location where information is kept
– Memory is a collection of storage devices. Usually, each
storage device holds one bit. Also, in most kinds of
memory, these storage devices are grouped into groups of
8. These 8 storage locations can only be accessed
together. So, one can only read or write in terms of bytes
to and form memory.
– Memory is usually measured by the number of bytes it can
hold.
It is measured in Kilos, Megas and lately Gigas. A Kilo
in computer language is 210 =1024. So, a KB
(KiloByte) is 1024 bytes. Mega is 1024 Kilos and
Giga is 1024 Mega.
Definition (Contd.)
– Stored in memory:
• When a program is entered into a computer, it is
stored in memory. Then as the microprocessor starts
to execute the instructions, it brings the instructions
from memory one at a time.
• Memory is also used to hold the data.
– The microprocessor reads (brings in) the data from
memory when it needs it and writes (stores) the results
into memory when it is done.
Definition (Contd.)
– Produces: For the user to see the result of the
execution of the program, the results must be
presented in a human readable form.
• The results must be presented on an output device.
• This can be the monitor, a paper from the printer, a
simple LED or many other forms.
A Microprocessor-based system
Input Output
Memory
Inside The Microprocessor
• Internally, the microprocessor is made up of
3 main units.
– The Arithmetic/Logic Unit (ALU)
– The Control Unit.
– An array of registers for holding data while it is
being manipulated.
Organization of a microprocessor- based
system
• Let’s expand the picture a bit.
I/O
Input / Output
Register
ALU
Array
System Bus
Control Memory
ROM RAM
Clock speed
Also called clock rate, the clock speed is the speed
at which a microprocessor executes instructions.
Every computer contains an internal clock that
regulates the rate at which instructions are executed
and synchronizes all the various computer
components.
The faster the clock, the more instructions the microprocessor
can execute per second.
The microprocessor requires a fixed number of clock ticks (or
clock cycles) to execute each instruction.
Clock speed is stated in either MHz or GHz.
1 MHz =1 million cycles per second,
1 GHz = 1 billion cycles per second.
Some microprocessors are superscalar, which means that
they can execute more than one instruction per clock cycle.
CPU Performance Evaluation
A program consists of instructions
• # of instructions
• On average an instruction takes x
number of clock cycles to be executed(CPI)
• Clock cycle time of the CPU (1/f)
So the CPU execution time consists of
# of instructions x CPI x clock cycle time
Example
A program consists of 10M instructions
Average CPI=2.5 cycles/instructions
CPU clock rate=200MHz
CPU clock cycle =1/200M=5x10-9 sec/cycle
CPU Execution time =10 x106 x 2.5 x 5x10-9
125 msec
Calculation of CPI (Cycles Per
Instruction) For the multi-cycle MIPS
Load 5 cycles
Store 4 cycles
R-type 4 cycles
Branch 3 cycles
Jump 3 cycles
If a program has
50% R-type instructions
10% load instructions
20% store instructions
18% branch instructions
2% jump instructions then what is the CPI?
CPI = (4x50 + 5x10 + 4x20 + 3x18 + 3x2)/100 = 3.9
Example
A program consists of 1 billion instructions
Clock Speed is 2 GHz.
Suppose also
50% of the instructions execute in 3 clock cycles,
30% execute in 4 clock cycles, and
20% execute in 5 clock cycles.
What is the execution time for the program or task?
instruction count: 109 instructions.
Clock time = 0.5×10-9 seconds.
CPI= (3x50 + 4x30 +5x20)/100=3.7
Execution time = 1.0×109 × 3.7 × 0.5×10-9 sec = 1.85 sec.
Registers
Register is a small high speed named memory.
Data is usually loaded from the memory to the
registers
Its size determines the speed of the CPU
In a 32 bit processor all of its registers are 32 bit wide
Instruction Set
The possible operations a microprocessor can
performs is based on its instruction set.
Programs are written for a microprocessor based on
its instruction set.
For example, a computer understands 10 instructions,
and any program written for it uses those ten instructions
in various ways to accomplish some complicated tasks.
Cache
Memory cache is a high speed storage mechanism
that holds recently read data and instructions from
main memory, which eliminates the processor from
having to constantly access main memory.
The program first checks the cache to see if the
desired information is already present there.
95% of the time the processor is working, it is
accessing information from cache.
Levels of Cache:-
L1 cache (also called primary cache) is built directly into the microprocessor, a
location referred to as "on-die".
Size varies from 2KB-64KB
L2cache (also called secondary cache) is not usually built into microprocessor.
Size varies 256KB-512KB
L3 Cache:- The L3 cache is larger in size but also slower in speed than L1 and L2,it's
size is between 1MB to 8MB.
In Multicore processors, each core may have separate L1 and L2,but all core
share a common L3 cache.
BUS SYSTEM
Data BUS
Address BUS
Control BUS
Internal structure and basic
operation of microprocessor
Address bus
ALU Register
Section
Data bus
Control and timing
section Control bus
Block diagram of a microprocessor
32
Data bus
The data bus is 'bi-directional'
data or instruction codes from memory or
input/output are transferred into the
microprocessor
the result of an operation or computation is sent out
from the microprocessor to the memory or
input/output.
Depending on the particular microprocessor,
the data bus can handle 8 bit or 16 bit data.
33
Address bus
The address bus is 'unidirectional', over which
the microprocessor sends an address code to the
memory or input/output.
The size (width) of the address bus is specified by
the number of bits it can handle.
The more bits there are in the address bus, the
more memory locations a microprocessor can
access.
A 16 bit address bus is capable of addressing
65,536 (64K) addresses.
34
Control bus
The control bus is used by the microprocessor to
send out timing and control signals in order to
coordinate and regulate its operation and to
communicate with other devices, i.e. memory or
input/output.
35
Bus Speed
The processor communicates with other devices via
the data bus, sometimes called the front side bus.
Bus speed is measured in MHz, the same unit used
to measure clock speed. While a processor might be
working at up to 3 GHz, quite often the performance
of the computer is hampered by a slower data bus
speed.
Block diagram of micro computer
Intel 4004
* Year of introduction 1971
* Clock speed : 740 KHz
* Number of transistors:2300
* 45 Instructions
* 4-bit register and 4-bit data bus.
*4K main memory
The first programmable device used in calculator
The world first microprocessor
Intel 8008
* 1972
* Clock speed : 500 KHz – 800 KHz
* Number of transistor:3500
* 8-bit register and 8-bit data bus.
*48 Instructions
*16 KB main memory
Intel 8080
* Introduced in the year1973
* Clock speed : 2 MHz
* Number of transistor: 4500
• 8-bit register and data bus.
• 64 KB main memory
• 2 microseconds clock cycle
• 5x105 instructions/sec
• 10 times faster than 8008
• Micro computers were designed in mid 1970’s using
8080 microprocessor
Intel 8085
Introduced in the Year 1975
8 bit microprocessor - an upgraded version of 8080
64KB main memory
1.3 microseconds clock cycle
246 instructions
Intel 8086
* 1978
* Clock speed : 4.47 MHz
* Number of transistors:29000
• 16-bit register and data bus.
• 4-6 byte Instruction Queue
Intel 8088
* 1981
* Clock speed : 4,47 MHz
• Number of transistors:29000
• 4 byte instruction cache
• 16-bit register and data bus.
• 1MB main memory
The worlds first PC ran on an Intel 8088 microprocessor
Intel 286
* 1982
* Clock speed: 12 MHz
* Number of transistor:134000
• 16-bit register and data bus.
• 16 MB main memory
• Concentrates on features needed to implement
Multitasking
• Two modes of memory
• Real Mode
• Protected Mode
Intel 386
*1985
Intel’s first practical 32 bit microprocessor
* Clock speed: 16 MHz
* Number of transistors:275000
• 32-bit register and data bus.
• 4GB main memory
• 3 Modes of Memory
• Real Mode
• Protected Mode
• Virtual Mode
Intel 486
* 1989
* Clock speed: 50 MHz
* Number of transistor:
1,200,000
• 32-bit register and data bus.
• Incorporate a floating point unit in the CPU Core
• 8KB on chip cache
Intel Pentium pro
* 1995
* Clock speed: 200 MHz
* Number of transistor:
5,500,000
• 32-bit register and data bus.
• Introduced MMX
Intel Pentium ||
* 1997
* Clock speed: 300 MHz
* Number of transistor:
7,500,000
* 32-bit register and data bus.
Intel Pentium |||
* 1999
* Clock speed: 500 MHz
* Number of transistor:
9,500,000
* 32-bit register and data bus.
Intel Pentium 4
* 2000
* Clock speed: 1 GHz
* Number of transistor:
15,500,000
* 64-bit register and data bus.
Intel Pentium D
* 2005
* Clock speed: 3.6 GHz
* Number of transistor:
47,500,000
* 32-bit register and data bus.
Intel Core 2 Quad
* 2006/2007
* Clock speed: 3.6 GHz
* Number of transistor:
214,500,000
* 32-bit register and data bus.
Core i3
* The first Core i3 processors were launched on January 7, 2010
* Variants530 – 2.93 GHz Hyper-Threading
- 540 – 3.06 GHz Hyper-Threading
- 550 – 3.2 GHz Hyper-Threading
- 560 – 3.33 GHz Hyper-Threading
64 Kb L1 cache
512 Kb L2 cache
4 MB L3 cache
Core i5
* The first Core i5 was introduced on September 8, 2009
4 cores and 4 Threads
Upto 6MB cache
Core i7
Introduce 2008
4.7GHz
Hyper threading and multithreading
Upto 8 MB cache
4 cores and 8 threads