Professional Documents
Culture Documents
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
The basic timing of the computer is controlled by a square wave oscillator or a clock generator circuit.
Synchronization Determines how fast the program can be fetched from memory and executed
The memory units address selector/decoder circuit examines the binary number on the address line and selects the proper memory location to be accessed.
In this example, CPU is reading from memory, it activates its MEMORY READ control signal This causes the selected data byte in memory to be placed onto the data lines and routed to the instruction register in the CPU
PC=1400 CPU
Inst Decoder B0 decode
B0
3- B0 is decoded internally it now knows it needs to fetch the next byte!. It brings 21h from 1401. The program counter automatically increments itself to the next location to fetch the next data/instruction.
21
RAM
ROM
I/O
Timer
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
A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports on one single chip; this makes them ideal for applications in which cost and space are critical Example: a TV remote control does not need the computing 23 power of a 486
47
Memory Map
48
49
Microprocessors
An Intel Pentium II
Heart of a computer Central Processing Unit Small integrated circuit with many transistors Programmable Be able to compute (arithmetic, logic, etc.) Work with I/O peripherals & memory
Revised on 2001/9/10 1:15 PM ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 1
Early history
1969 - 70 1971 1973 1974 1977 1978 1979 Intel 4004, the first microprocessor, 4-bit Intel 4040, faster then 4004 Intel 8008, a 8-bit version of 4004 Intel 8080, 10 times faster than 8008 (Similar products: Motorola MC6800, Zilog Z80) MITS Altair 8800, the first microcomputer programmed with BASIC developed by Bill Gates and Paul Allen Apple II, the first popular home computer Intel 8085, the last 8-bit microprocessor Intel 8086, 16-bit microprocessor, much faster Intel 8088
1980s
1980 1981 1982 1984 1985 1987 1989 Motorola 68000 IBM PC with Intel 8088, running at 4.77 MHz with a 160K floppy disk drive & MS-DOS 1.0/1.1 Intel 80286 Apple Macintosh, with Motorola 68000 Intel 80386 Macintosh II Intel 80486 at 25 MHz or higher speed
More recently
1990 1991 1992 1993 1995 1995 1997 1998 1999 2001 Microsoft Windows 3.0 released Motorola 68040 developed Apple and IBM formed a partnership to investigate RISC Microsoft Windows 3.1 became the standard for PCs. Intel Pentium (80586) released, MMX technology provided later Microsoft Windows 95 Intel Pentium Pro (P6) Intel Pentium II Intel Pentium II Xeon Intel Pentium III Intel Pentium IV
ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 4
4004 8008 8080 8086 8088 80186 80286 80386SX 80386DX 80486DX Pentium Pentium Pro Pentium II (Klamatch) Pentium III (Katmai) Pentium IV
Revised on 2001/9/10 1:15 PM
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 ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 6
Microprocessor-based computer
Memory: ICs that store programs & data I/O: Input/output devices via which the microprocessor communicates with outside world
Data in memory
or in hexadecimal
00000H FFFFFH
The number of memory locations is 220 = 1,048,576 210 = 1,024 = 1 K 230 = 1 K 1 M = 1 G 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 ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 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
load an instruction from memory into an internal register
Decode
Execution
execute the instruction e.g. read/write data, arithmetic computation on loaded data
During the fetch-decode-execution cycle, the P may receive an interrupt signal via the control bus Upon the interrupt request, the P will finish the execution of current instruction and then responds to the interrupt
Revised on 2001/9/10 1:15 PM ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 15
indicating what to do
16
Machine language
Binary code 1st instruction 2nd instruction
B8 23 01 05 25 00 8B D8 03 D8 8B CB 2B C8 2B C0 C3
Action
[Move the value 0123H to AX] [Add the value 0025H to AX] [Move the content of AX to BX] [Add the content of AX to BX] [Move the content of BX to CX] [Subtract the content of AX from CX] [Subtract the content of AX from AX] [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 05 25 00 8B D8 03 D8 8B CB 2B C8 2B C0 C3
Revised on 2001/9/10 1:15 PM
MOV AX,0123H ADD AX,25H MOV BX,AX ADD BX,AX MOV CX,BX SUB CX,AX SUB AX,AX RET
[Move the value 0123H to AX] [Add the value 0025H to AX] [Move the content of AX to BX] [Add the content of AX to BX] [Move the content of BX to CX] [Subtract the content of AX from CX] [Subtract the content of AX from AX] [Return to system]
18
Registers: small, fast memory that store data or addresses temporarily. In a 8086/8088, there are ten 16-bit EU registers and another four 16-bit segment registers.
19
Internal registers
8 bit
8 bit
8 bit
Flag register
16 bit 16 bit
16 bit
20
15
+)
19 15
11
11
The offset address can specify up to 216 = 64 KBytes of memory. The segment address gives the beginning of such a 64 K block.
Revised on 2001/9/10 1:15 PM ELE3230A Microprocessor & Computer Systems Lecture on 10 September 2001 21
Exercises: CS = 2300H and IP = 1000H CS = 1A00H and IP = B000H 23000H + 01000H = 24000H 1A000H + 0B000H = 25000H
22