You are on page 1of 54

BAMC2003 Microcontroller and

Microprocessors Systems
By: Bun Seng
Main Menu
Unit 1: Introduction to Computer and Microprocessor Click Here
Unit 2: 80386 Microprocessor Architecture Click Here
Unit 3: Assembly Language Programming Click Here
Unit 4: 80386 Real Mode Programming Click Here
Unit 5: Advanced 80386 Real Mode Programming Click Here
Unit 6: Computer Systems and Memory Click Here
Unit 7: Central Processing Unit (CPU) Click Here
Unit 8: Microprocessor Design Click Here
Click Here
Click Here
Click Here
Click Here
Unit 1A:
Computer Classification

Objectives
 Introduce the types of computers available and briefly discuss
their features
 Highlight the major events in history of computers

Computer Classification
 Computer Classified into THREE (3) board categories
1) Mainframe
2) Minicomputer
3) Microcomputer

Main Menu
Unit 1A:
Computer Classification

Mainframe
 An industry term for a large computer for the commercial
applications of large-scale computing purposes.
 Main features :
1) Very large in size
2) Large capacity memory
3) Work with large data words (64 bits or more)
4) Very Expensive
5) May have more than one CPU
 Most powerful mainframe know as Supercomputer

Main Menu
Unit 1A:
Computer Classification

Minicomputer
 Developed in middle 1960
 Provide computing power for medium scale companies and
laboratories usage purpose.
 Main features:
1) Smaller size compare to mainframe
2) Work with smaller data words (typically 32 bits)
3) Cheaper than mainframe
4) Smaller memory than mainframe
5) May have one or more microprocessors

Main Menu
Unit 1A:
Computer Classification

Microcomputer
 Known as Personal Computers (PC)
 Developed in the middle 1970 to serve the computing needs of
small office and home office
 Main features:
1) Range from hand held devices to desktop devices
2) Memory capacity range from kB to MB
3) Cheaper than minicomputers
4) Works with data words ranging from 8 to 64 bits
5) Mainly has a single microprocessor

Main Menu
Unit 1B:
Computer Architecture

Objectives
 Describe the main hardware components of a computer
 Introduction the software component of a computer

Fundamentals

Main Components of
Computer

Hardware Software
Unit 1B:
Computer Architecture

Hardware
 Physical components of a computer
 6 major components to form a computer
 Components interconnect by electrical wires (buses)

Input Output
I/O Ports
Devices Devices
Address
Control
Data
Primary Secondary
Storage Storage
Central Processing
Unit
Unit 1B:
Computer Architecture

 Primary Storage
1) Used to stored programs that currently running
2) Stored the data required by those running programs.

Primary
Storage

Non-Volatile
Volatile
Example:
Example: Read Only Memory (ROM),
Random Access Memory (RAM) Programmable Read Only Memory
(PROM), etc.
Unit 1B:
Computer Architecture

 Secondary Storage
1) Permanent storage of programs and data
2) i.e. Fixed Disk (Hard Disk), Removable Disk (Floppy Disk),
Compact disc-read only memory (CD-ROM), Magnetic
tape.

 Central Processing Unit


1) Heart of computer systems
2) Performs ALU functions, Peripherals devices operation
controller
Unit 1B:
Computer Architecture

 Input/ Output Port


1) Allow input/ output devices connected to computer
2) Provides communication between CPU and I/O devices.

 Input Devices
1) Allow user communicate with computer (fed data to
computer)
2) Keyboard, mouse, joystick, etc.

 Output Devices
1) Allow computer displaying information to user (send data
to “outside world”
2) Monitor, printers, speakers, etc.
Unit 1B:
Computer Architecture

Software
Application System
Software
Software Software

Program that are


Program used by the needed for the proper
computer user to operation of the
perform a given task computer hardware
Unit 1B:
Computer Architecture

System Software

Software Usage

Operating Systems - Controls the operation of the hardware


- Allows the user to interacts with the hardware
- Controls how the execution of application programs
Network Operating - Allows computers to communicate with each other
Systems over local and wide area networks

Device Drivers - Small, specialized programs supplied by device


manufacturers to allow the operating systems to
make proper use of the device.
Unit 1C:
Buses Architecture

Objectives
 Describe the microcomputer bus architectures

Fundamental

Computer System Bus

- Is a collection of wires that carry similar


information

- Carrying information between components


Unit 1C:
Buses Architecture

Type of Buses
BUSES

Address Bus Data Bus Control bus

- Used to send or receive


- Used to select memory data from memory
- Used to send or receive
location or port address location or I/O port
control signals between
to read or write data - Bidirectional
CPU and other peripheral
- Unidirectional - Width of the bus
devices.
- Addressable space of determine the word size,
- Bidirectional
computer is 2N Date bus width, N =
Word width
Unit 1C:
Buses Architecture

Bus Architecture
Common Bus Architectures used in IBM and compatible PCs
- Industry Standard Architecture (ISA)
- Enhanced Industry Standard Architecture (EISA)
- Video Electronic Standard Association (VESA)
- Peripheral Components Interconnect (PCI)
Unit 1D:
Microprocessors

Objectives
 Briefly describe the RISC and CISC microprocessor
architectures
 Highlight the major events in the history of microprocessor

Fundamental
 CPU on Single Integrated Circuit  Microprocessor
 CPU divided into several small units  ALU, Control unit, etc.
 Each unit designed to perform specific function
Unit 1D:
Microprocessors

Architecture
Microprocessor

Architecture Application

Reduced Instruction Set


General Purpose
Computing
(Used in computer)
(RISC)

Complex Instruction Set Special Purpose


Computing (Used in embedded
(CISC) systems)
Unit 1D:
Microprocessors

RISC
1) Uniform instruction encoding which allows faster
decoding
2) A homogenous register set, allowing any register to be
used in any context and simplifying compiler design
3) Simple addressing modes with more complex modes
replaced by sequences of simple arithmetic instructions
CISC
1) Complex instruction sets that support high level language
semantic
2) Complex addressing modes that allow data structure and
array accesses to be compiled into a single instruction
Unit 1D:
Microprocessors

General Purpose Microprocessor


o Used mainly in microcomputers

Special Purpose Microprocessor


o Used as event controller or as data controller (Embedded
systems)
Unit 1E:
History of Computer and Microprocessors

First Generation Computer (Mainframe)


 Vacuum tubes were used – basic arithmetic operations took
few milliseconds
 Bulky
 Consume more power with limited performance
 High cost
 Uses assembly language – to prepare programs. These were
translated into machine level language for execution.
 Mercury delay line memories and Electrostatic memories
were used
 Fixed point arithmetic was used
 100 to 1000 fold increase in speed relative to the earlier
mechanical and relay based electromechanical technology
Unit 1E:
History of Computer and Microprocessors

 Punched cards and paper tape were invented to feed


programs and data and to get results.
 Magnetic tape / magnetic drum were used as secondary
memory
 Mainly used for scientific computations.

1st Gen Computer (IBM 701) Vacuum Tubes Transistor


Unit 1E:
History of Computer and Microprocessors

Second Generation Computer (Mainframe)


 Transistors were used in place of vacuum tubes. (invented at
AT&T Bell lab in 1947) .
 Small in size Lesser power consumption and better
performance.
 Lower cost
 Magnetic ferrite core memories were used as main memory
which is a random-access nonvolatile memory Magnetic tapes
and magnetic disks were used as secondary
memory Hardware for floating point arithmetic operations
was developed.
 Index registers were introduced which increased flexibility of
programming.
Unit 1E:
History of Computer and Microprocessors

 High level languages such as FORTRAN, COBOL etc were


used - Compilers were developed to translate the high-level
program into corresponding assembly language program
which was then translated into machine language.
 Separate input-output processors were developed that
could operate in parallel with CPU.
 Punched cards continued during this period also.
 1000 fold increase in speed.
 Increasingly used in business, industry and commercial
organizations for preparation of payroll, inventory control,
marketing, production planning, research, scientific &
engineering analysis and design etc.
Unit 1E:
History of Computer and Microprocessors

Part of the circuit board for 2nd Gen Computer 2nd Gen Computer
Unit 1E:
History of Computer and Microprocessors

Third Generation Computer (Minicomputers)


 ICs were used
 Small Scale Integration and Medium Scale Integration
technology were implemented in CPU, I/O processors etc.
 Smaller & better performance
 Comparatively lesser cost
 Faster processors
 In the beginning magnetic core memories were used. Later
they were replaced by semiconductor memories (RAM &
ROM)
 Operating system software were introduced (efficient sharing
of a computer system by several user programs)
Unit 1E:
History of Computer and Microprocessors

 Cache and virtual memories were introduced (Cache memory


makes the main memory appear faster than it really is. Virtual
memory makes it appear larger)
 High level languages were standardized by ANSI eg. ANSI
FORTRAN, ANSI COBOL etc.
 Database management, multi-user application, online systems
like closed loop process control, airline reservation,
interactive query systems, automatic industrial control etc
emerged during this period
PDP-8
minicomputer,
manufactured
in 1965
Unit 1E:
History of Computer and Microprocessors

Forth Generation Computer (Microcomputers)


 Microprocessors were introduced as CPU– Complete
processors and large section of main memory could be
implemented in a single chip
 Tens of thousands of transistors can be placed in a single chip
(VLSI design implemented)
 CRT screen, laser & ink jet printers, scanners etc were
developed.
 Semiconductor memory chips were used as the main
memory.
 Secondary memory was composed of hard disks – Floppy
disks & magnetic tapes were used for backup memory
Unit 1E:
History of Computer and Microprocessors

 Parallelism, pipelining cache memory and virtual memory


were applied in a better way
 LAN and WANS were developed (where desktop work
stations interconnected)
 Introduced C language, Unix OS and Graphical User Interface
 Less power consumption
 High performance, lower cost and very compact.
 Much increase in the speed of operation
Personal
Computer in
middle 1970

INTEL 8088 Microchip


Unit 1E:
History of Computer and Microprocessors

Fifth Generation Computer (Microcomputers)


 Generation number beyond IV, have been used occasionally to
describe some current computer system that have a dominant
organizational or application driven feature.
 Computers based on artificial intelligence are available
 Computers use extensive parallel processing, multiple
pipelines, multiple processors etc
 Massive parallel machines and extensively distributed system
connected by communication networks fall in this category.
 Introduced ULSI (Ultra Large Scale Integration) technology –
Intel’s Pentium 4 microprocessor contains 55 million
transistors millions of components on a single IC chip.
Unit 1E:
History of Computer and Microprocessors

 Superscalar processors, Vector processors, SIMD processors,


32 bit micro controllers and embedded processors, Digital
Signal Processors (DSP) etc have been developed.
 Memory chips up to 1 GB, hard disk drives up to 180 GB and
optical disks up to 27 GB are available (still the capacity is
increasing)
Object oriented language like JAVA suitable for internet
programming has been developed.
 Portable note book computers introduced
 Storage technology advanced – large main memory and disk
storage available
 Introduced World Wide Web. (and other existing applications
like e-mail, e Commerce, Virtual libraries/Classrooms,
multimedia applications etc.)
New operating systems developed – Windows 95/98/XP/…,
LINUX, etc.
Main Menu
Unit 1E:
History of Computer and Microprocessors

 Got hot pluggable features – which enable a failed component


to be replaced with a new one without the need to shutdown
the system, allowing the uptime of the system to be very high.
 The recent development in the application of internet is the
Grid technology which is still in its upcoming stage.
 Quantum mechanism and nanotechnology will radically
change the phase of computers.
Forth Generation Computer (INTEL’s 8088,
80286, 80386, 80486…, Motorola’s 68000,
Fifth Generation Computer (Pentium 1/2/3/4, Dual Core, 68030, 68040 … , Apple II, etc.)
Quad Core, Work Station and etc. 1975-1989
1989 - NOW

First Generation Computer (EDSAC, Second Generation Computer (IBM 7030) Third Generation Computer (System
EDVAC, UNIVAC [IBM701]) 1955-1965 360, PDP-8 minicomputer)
1945-1955 1965-1975
Unit 1F:
Summary

 Computer can be classified into 3:


 Mainframe: Very large computer used by big organization
 Minicomputer: Smaller version of mainframe, replaced by
powerful microcomputer called server
 Microcomputer: A single microprocessor – based computer
used by small companies and single user

 Computer divided into 2 parts


 Hardware
 Software

Main Menu
Unit 1F:
Summary

 Hardware
o Primary Storage: Used for temporary storage of programs
and data
o Secondary Storage: Used for permanent storage of
programs and data
o CPU: The heart of the computer where all processing take
place
o I/O Port: Provide the communication link between the
CPU and I/O devices
o Input Devices: Allow the user to feeds instructions and
data to the computer
o Output Devices: Used to display information from
computer
Unit 1F:
Summary

 Software
o Systems Software: Used to control the operation of the
computer hardware
o Application Software: Used to perform tasks required by
the user in his daily work
Unit 1F:
Summary

 Computer Buses – “wires” that connect the CPU to other


peripheral devices.
 Data Bus: Bi-directional bus that carry data between the
CPU and other devices
 Address Bus: Unidirectional bus that select a given device
communicate the CPU
 Control Bus: Bi-directional bus that carries control signal
between the CPU and other devices
Unit 1F:
Summary

 Buses classified into 4 architectures:


 ISA: The first PC bus architecture, designed for 8 and 16 bit
data transfer, support a 16 Megabyte memory and run at
8MHz
 EISA: Expand the ISA architecture to 32 bit
 VESA: Enhance the ISA speed to 33MHz
 PCI: A microprocessor-independent bus that runs at 33-
100 MHz and support 32 and 64 bit data transfer
Unit 1F:
Summary

 Microprocessor classified into two architectures:


 RISC
1) Uniform instruction encoding which allows faster
decoding
2) A homogenous register set, allowing any register to be
used in any context and simplifying compiler design
3) Simple addressing modes with more complex modes
replaced by sequences of simple arithmetic instructions
 CISC
1) Complex instruction sets that support high level language
semantic
2) Complex addressing modes that allow data structure and
array accesses to be compiled into a single instruction
Unit 1F:
Summary

 Microprocessor classified into two type of applications:


 General Purpose Microprocessor: Used mainly in
microcomputers

 Special Purpose Microprocessor: Used as event controller


or as data controller (Embedded systems)
Unit 1G:
Preview Chapter 2

Introduce the 80386 microprocessor family


Overview of 80386 microprocessor Software
Functions of the 80386 registers and flags
Understand the flat, segment addressing techniques, real
mode addressing scheme, and I/O space
Application of 80386 microprocessor
1) List the three (3) main computer buses and briefly
describe it.

2) List three (3) non-volatile memory.

3) Briefly describe the microprocessors architectures.

Please write your name and matric number on your


answer sheet. Submit the answer before you leave.
Unit 2A:
Software View of 80386 Microprocessor
Objectives
 Introduce the 80386 microprocessor family
 Give an overview of the software view of the 80386
microprocessor
 Describe the functions of the 80386 registers
 Describe the usage of the 80386 flags

80386 Microprocessor Family


80386 DX 80386 SX
32 – bit data bus 16 – bit data bus
32 – bit address bus 24 – bit address bus
132 pin package 100 pin package
Address up to 4GB Address up to 16MB
32 – bit data transfer 16 – bit data transfer
The table gives a brief description of some features of DX and SX 80386
Unit 2A:
Software View of 80386 Microprocessor
Operating
Modes of
80386
Microprocessor

Real Mode Protected Mode

Can address Can access


only 1MB entire memory
Unit 2A:
Software View of 80386 Microprocessor
31 1615 0
 Real Mode Model 15 0
AX Segment Register
o Software View of real mode model of 80386 microprocessor
Click for Animation CS
EAX AH AL DS
EAX BH BL SS
ECX CH CL ES
EDX DH DL FS

GS
EDX

ESP SP IP
EBP BP
Flags
ESI SI
CR0
EDI DI
Unit 2A:
Software View of 80386 Microprocessor
Registers

Registers

General Special
purpose purpose
Registers Registers

Segment Instruction
Registers Pointer
Flags
Registers
Data Registers Index and Pointer Control
Registers Registers
Unit 2A:
Software View of 80386 Microprocessor
GENERAL PURPOSE REGISTER
 Data Registers
 4 Data Registers
 Used to store temporary data during execution
 Can be used as destination or source for any data movement
 Can be used as
 8-bit (AL @ AH)  can execute on 80386 Real Mode
 16-bit (AX)  allow 80286 codes to run by 80386
 32-bit operations (EAX)
 Certain operations only available on given register
Unit 2A:
Software View of 80386 Microprocessor
Abbreviation
Register
Usage
Name
8 8 16 32

- Arithmetic operations like +, -, ×, ,


data conversion between byte, word,
Accumulator AL AH AX EAX double word, and quadruple word.
- Input/output operations and memory
addressing

Base Index BL BH BX EBX - Memory addressing

- Looping and repeating string


Count CL CH CX ECX operations
- Reading and writing data to disk files
- input/ output operations with external
devices, multiplication and division
Data DL DH DX EDX
operations (in conjunction with
accumulator), and string operations.
Unit 2A:
Software View of 80386 Microprocessor
 Index and Pointer Registers
 4 registers set
 Can be used either 16-bit or 32-bit registers
 Used to hold the offset of the address of data in memory

Abbreviation
Register Name Usage
16 32

- To hold the offset address of the stack as


Base Pointer BP EBP
well as memory
Destination - To hold the offset address of a destination
DI EDI
Index operand
- To hold the offset address of a source
Source Index SI ESI
operand

Stack Pointer SP ESP - To hold the offset address of the stack


Unit 2A:
Software View of 80386 Microprocessor
SPECIAL PURPOSE REGISTERS
 Segment Registers
 16-bit register
 Each segment registers hold the base memory address of
64-k memory segment

Register Name Abbreviation Usage

Stack Segment SS - Hold the base address of the stack memory

Code Segment CS - Hold the base address of the code memory

Data Segment DS - Hold the base address of the data memory

Extra Segment ES - Hold the base address of extra memory

Additional - Hold the base address for two additional


GS & FS
Segment segments of memory
Unit 2A:
Software View of 80386 Microprocessor
 Flags
 80386 has 32 bit flag register (EFLAGS)
 First nine bits are use in real mode

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ……

Status Flags Control Flags

 Status Flags  States (Set @ Reset) change as a result of


executing certain instruction
 Control Flags  Control Operations of the 80386
Unit 2A:
Software View of 80386 Microprocessor

Abbre-
Name Usage
viation
The flag is SET (1)  is a carryout or a borrow;
Carry C
Otherwise is RESET (0)
If the result of an instruction has an even number of 1’s (even
Parity P
parity) then the flag is set. Otherwise is reset
The Flag is SET (1)  a carryout from the low nibble to high
Auxiliary
A nibble or borrow from high nibble to low nibble during BCD
Carry
addition and subtraction. Otherwise is reset.
The flag is SET (1)  when an instruction is 0
Zero Z
Otherwise is reset.
The flag is SET (1)  when the result of logic or arithmetic is
Sign S negative
Otherwise is reset.
The flag is SET (1)  when overflow occurs during signed
Overflow O number arithmetic
Otherwise is reset.
Unit 2A:
Software View of 80386 Microprocessor

Abbre-
Name Usage
viation
Used to enable trapping errors during program debugging
Trap T
The Flag is SET (1)  single step mode of 80386 enabled
If the Flag is SET (1)  Interrupt enable
Interrupt I
Otherwise is reset
The Flag is SET (1)  DI and SI registers are automatically
Direction D decremented
Otherwise is incremented
Unit 2A:
Software View of 80386 Microprocessor
 Instruction Pointer
 16-bit register
 Used with code segment register (CS) to hold the address of
the next instruction to be fetched from the code segment of
the memory

 Control Register
 Several control registers in 80386
 Only ONE control register zero is active in Real Mode
 This bit is called the protection enable
 Used to switch between real mode and protected mode

You might also like