Académique Documents
Professionnel Documents
Culture Documents
Lecture 1
Introduction to Microprocessors
Computer Codes, & Programming
Today the CPU circuitry has been reduced to ICs called the microprocessor,
the entire computer with the three parts is called a microcomputer
Several registers (e.g., flip-flops wired in series with each other)
Some are general purpose, the accumulator for example is reserved for
performing complex mathematical operations like multiply and divide, and all I/O
data has to go thru the accumulator
10
PC=1400
CPU
Inst Decoder
B0 decode
MEM
Read
B0
21
CPU General
Purpose
Microprocessor
RAM
ROM
I/O
Timer
Serial
COM
Port
Address bus
These general microprocessors contain no RAM, ROM, or I/O
ports on the chip itself
Ex. Intels x86 family (8088, 8086, 80386, 80386, 80486,
Pentium)
Motorolas 680x0 family (68000, 68010, 68020, etc)
22
Microcontrollers
Microcontroller
CPU
RAM
ROM
I/O
TIMER
Serial Com
Port
47
Memory Map
48
Program Support
BIOS: usually stored in ROM these routines provide access to the
hardware of the PC
Access to the BIOS is done through the software interrupt instruction
Int n
For example, the BIOS keyboard services are accessed using the
instruction INT 16h
In addition to BIOS services DOS also provides higher level
functions
INT 21h
More details later
49
Microprocessors
An Intel Pentium II
Early history
1969 - 70
1971
1973
1974
1977
1978
1979
Intel 8088
1980s
1980
Motorola 68000
1981
IBM PC with Intel 8088, running at 4.77 MHz with a 160K floppy
disk drive & MS-DOS 1.0/1.1
1982
Intel 80286
1984
1985
Intel 80386
1987
Macintosh II
1989
More recently
1990
1991
1992
1993
1995
Microsoft Windows 95
1995
1997
Intel Pentium II
1998
1999
2001
Intel Pentium IV
Clock Speed
(MHz)
0.108
MIPs
4004
No. of
transistors
2,300
8008
3,500
16 KBytes
0.2
0.06
8080
6,000
64 KBytes
2 3.1
0.64 1
8086
29 K
1 MBytes
5 10
0.33 0.75
8088
29 K
1 MBytes
5 10
0.33 0.68
80186
29 K
1 MBytes
8 12
1.2 1.66
80286
134 K
16 MBytes
8 12
1.2 1.66
80386SX
275 K
16 MBytes
16 33
2.5 5
80386DX
275 K
4 GBytes
16 33
6 12
80486DX
3,200 K
4 GBytes
25 100
20 80
Pentium
3,200 K
4 GBytes
60 133
100 200
Pentium Pro
5,500 K
64 GBytes
150 200
~ 250
Pentium II (Klamatch)
7,500 K
64 GBytes
233 500
???
9,500 K
64 GBytes
up to 1,200
???
???
???
???
???
Pentium IV
Revised on 2001/9/10 1:15 PM
0.06
Other processors
Intel-compatible:
AMD (e.g. K6, k7 series)
Cyrix
IDT
Special-purpose processors
Microcontroller: e.g. Intel 8051,
Digital Signal Processors: e.g. TMS320C series
For handheld products: Intel StrongArm
Revised on 2001/9/10 1:15 PM
Microprocessor-based computer
a set of connections
carry the same type of information
binary
1 bit
01
1 byte
0 255
2 bytes
0 65,535
4 bytes
0 4,294,967,295
111
10000100
110
01010010
101
10000000
100
00000000
011
11001011
010
11110001
001
01110100
000
11001111
Data in memory
10
or in hexadecimal
00000H FFFFFH
220 = 1 K 1 K = 1 M
Question: How many address bits are required to fully access the RAM
in your home computer ?
Revised on 2001/9/10 1:15 PM
11
I/O space
I/O space is organized and addressed in the same way as the memory
space. Each I/O address corresponds to an 8-bit I/O port.
For Intel 8088, 64K (65,536) I/O ports are addressed. This requires only
16 address lines.
For memory space addressing, all 20 address lines are used.
The I/O and memory share the same address bus. A separate control
signal is needed to indicate whether the bus is carrying I/O address or
memory address.
12
13
Microprocessor operation
There is little memory inside a microprocessor (
P). This internal
memory is referred as register.
The P has to load data and program from outside into its
internal registers
Both data and program are binary
Program is often stored in the memory
Program is divided into many tiny steps. Each step is performed
by an instruction
Typically an instruction is several bytes long
Data are either loaded from the memory or supplied by the I/O
14
Fetch-decode-execution cycle
Fetch
Decode
Execution
15
indicating
what to do
Operand
... ...
Operand
16
Machine language
Binary code
1st instruction
2nd instruction
Action
B8 23 01
05 25 00
8B D8
03 D8
8B CB
2B C8
2B C0
C3
[Return to system]
AX, BX, CX, etc. are the internal
registers in the P.
0123H means hexadecimal value 0123,
i.e. 0000 0001 0010 0011
17
Assembly language
Programming directly with machine codes is neither desirable nor
feasible. It is very difficult to debug.
Assembly language is represented by word-like terms that are
much more comprehensible than binary number.
B8 23 01
MOV AX,0123H
05 25 00
ADD AX,25H
8B D8
MOV BX,AX
03 D8
ADD BX,AX
8B CB
MOV CX,BX
2B C8
SUB CX,AX
2B C0
SUB AX,AX
C3
RET
[Return to system]
18
16 bit
data
bus
Bus
control
unit
19
Internal registers
8 bit
8 bit
8 bit
16 bit
Flag register
16 bit
16 bit
20
15
20-bit physical
address
15
11
15
11
+)
19
11
shift by 4 bit
21
Exercises:
CS = 2300H and IP = 1000H
22