MPMC-1
MPMC-1
MPMC-1
1
Historical Background
• The Mechanical Age
• The Electrical Age
• The Microprocessor Age
• The Intel Age – The Modern Microprocessor
– 1970s
– 1980s
– 1990s
– 2000s
The Mechanical Age
4
The mathematician Blaise Pascal invented a calculator in 1642
that was constructed of gears and wheels
5
In the early 1870s, Bomar introduced the first small hand –held electronic calculator.
In 1889, Herman Hollerith developed the punched card for storing data.
In 1896, Hellerith formed a company called the Tabulating Machine Company, which
developed a line of machines that was used punched cards for tabulation.
After a number of mergers, the Tabulating Machine Company was formed into
International Business machines Corporation, now it is referred more commonly as
IBM.
The punched cards used in computer systems are often called Hollerith cards.
6
• The first Electronic calculating machine was invented by Konrad Zuse
(German) in 1941. It has recently been discovered that the first electronic
computer was placed into operation in 1943.This first electronic
computing system, which used Vacuum tubes, was invented by Alan
Turing .It was a fixed program computer system, today which is often
called a special- purpose compute
7
8
The Electrical Age
•First electronic (digital ) computer- ENIAC-(Electronic numerical integrator
calculator)
• contained over 18,000 vacuum tubes, weighed more than 30 tons, and
required 1500 square feet of floor space and over 500 miles of wires
• Designers then chose “off the shelf” logic components —typically 7400
family integrated circuits—to implement these equations in hardware.
• If the design specifications changed, the process was repeated and the
hardware was modified or rebuilt.
The Microprocessor Age cotd..
Fourth Generation
During 1980s
Low power version of HMOS technology
(HCMOS)
Third Generation 32 bit processors
During 1978 Physical memory space 224 bytes = 16 Mb
HMOS technology Faster speed, Higher Virtual memory space 240 bytes = 1 Tb
packing density Floating point hardware
16 bit processors 40/ 48/ 64 pins Supports increased number of addressing
Easier to program modes
Dynamically relatable programs
Processor has multiply/ divide arithmetic Intel 80386
hardware
More powerful interrupt handling
capabilities Second Generation
Flexible I/O port addressing During 1973
NMOS technology Faster speed, Higher
Intel 8086 (16 bit processor) density, Compatible with TTL
4 / 8/ 16 bit processors 40 pins
First Generation Ability to address large memory spaces
Between 1971 – 1973 and I/O ports
PMOS technology, non compatible with TTL Greater number of levels of subroutine
4 bit processors 16 pins nesting
8 and 16 bit processors 40 pins Better interrupt handling capabilities
Due to limitations of pins, signals are 12
multiplexed Intel 8085 (8 bit processor)
After development of Transistors in 1948 at Bell Labs and
invention of the Integrated Circuits in 1958 by Jack Kilby of
Texas Instruments.
13
Intel 4004- 4 bit
• World’s First microprocessor released in 1971
• Could execute 45 instructions
• 4096 location addressable (4 Kbytes) (212)
• Weighed much less than one ounce 28gms.
• Initial clock speed: 108KHz
• Transistors: 2,300
Intel 4040- 4 bit
• Introduced in 1972
• Could execute 16kbytes of memory and
48 instructions.
• Initial clock speed-2 MHz
• Transistors-4500
•Limitations:
• small memory size, slow speed, limited
instruction set
• To overcome the limitations, Intel released 8080,Ist
modern 8bit microprocessor-1973
• About 6 months later Motorola released MC6800,
other companies began to release their own versions
of 8 bit microprocessor.
Block diagram of Simple micro
computer
17
Block diagram of Microprocessor based computer system
18
Microprocessor Functional blocks
20
8086
Microprocessor Overview
21
Types of Architecture
●What is architecture?
● Types
Harvard Architecture- Separate Program memory
and data memory
22
Von Neumann and Harvard Architecture
23
Comparison between Von Neumann and
Harvard architecture
Aspect Von Neumann Architecture Harvard Architecture
27
28
Reduced Instruction Set Architecture (RISC)
Characteristics of RISC
•Simpler instruction, hence simple instruction decoding.
•Instruction comes undersize of one word.
•Instruction takes a single clock cycle to get executed.
•More general-purpose registers.
•Simple Addressing Modes.
•Fewer Data types.
•A pipeline can be achieved
29
Reduced Instruction Set Architecture (RISC)
Advantages of RISC
•Simpler instructions: RISC processors use a smaller set of simple
instructions, which makes them easier to decode and execute quickly.
This results in faster processing times.
•Faster execution: Because RISC processors have a simpler instruction
set, they can execute instructions faster than CISC processors.
•Lower power consumption: RISC processors consume less power than
CISC processors, making them ideal for portable devices.
Disadvantages of RISC
•More instructions required: RISC processors require more instructions
to perform complex tasks than CISC processors.
•Increased memory usage: RISC processors require more memory to
store the additional instructions needed to perform complex tasks.
•Higher cost: Developing and manufacturing RISC processors can be
more expensive than CISC processors.
30
Complex Instruction Set Architecture (CISC)
Characteristics of CISC
•Complex instruction, hence complex instruction decoding.
•Instructions are larger than one-word size.
•Instruction may take more than a single clock cycle to get
executed.
•Less number of general-purpose registers as operations get
performed in memory itself.
•Complex Addressing Modes.
•More Data types.
31
Complex Instruction Set Architecture (CISC)
Advantages of CISC
•Reduced code size: CISC processors use complex instructions that
can perform multiple operations, reducing the amount of code
needed to perform a task.
•More memory efficient: Because CISC instructions are more
complex, they require fewer instructions to perform complex tasks,
which can result in more memory-efficient code.
•Widely used: CISC processors have been in use for a longer time
than RISC processors, so they have a larger user base and more
available software.
Disadvantages of CISC
•Slower execution: CISC processors take longer to execute
instructions because they have more complex instructions and need
more time to decode them.
•More complex design: CISC processors have more complex
instruction sets, which makes them more difficult to design and
manufacture.
•Higher power consumption: CISC processors consume more
32
power than RISC processors because of their more complex
Pins and signals
8086
Microprocessor Pins and Signals Common signals
AD0-AD15 (Bidirectional)
Address/Data bus
34
8086
Microprocessor Pins and Signals Common signals
MN/ MX
MINIMUM / MAXIMUM
TEST
READY
RESET (Input)
CLK
38
8086
Microprocessor Pins and Signals Minimum mode signals
Pins 24 -31
Pins 24 -31
40
8086
Microprocessor Pins and Signals Maximum mode signals
41
8086
Microprocessor Pins and Signals Maximum mode signals
42
8086
Microprocessor Pins and Signals Maximum mode signals
43
Architecture
8086
Microprocessor Architecture
Dedicated Adder to
generate 20 bit address
Segment
Registers
47
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
48
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
49
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
50
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
51
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
52
8086
Architecture Bus Interface Unit (BIU)
Microprocessor
Instruction queue
A group of First-In-First-
Out (FIFO) in which up to
6 bytes of instruction
code are pre fetched
from the memory ahead
of time.
53
8086
Architecture Execution Unit (EU)
Microprocessor
EU decodes and
executes instructions.
A decoder in the EU
control system
translates instructions.
and
Some of the 16 bit registers can be
Index registers (Source used as two 8 bit registers as :
Index, Destination Index)
each of 16-bits AX can be used as AH and AL
BX can be used as BH and BL
CX can be used as CH and CL 54
DX can be used as DH and DL
8086
Architecture Execution Unit (EU)
Microprocessor
55
8086
Architecture Execution Unit (EU)
Microprocessor
56
8086
Architecture Execution Unit (EU)
Microprocessor
Example:
57
8086
Architecture Execution Unit (EU)
Microprocessor
58
8086
Architecture Execution Unit (EU)
Microprocessor
59
8086
Architecture Execution Unit (EU)
Microprocessor
60
8086
Architecture Execution Unit (EU)
Microprocessor
61
8086
Architecture Execution Unit (EU)
Microprocessor
Auxiliary Carry Flag
Carry Flag
Flag Register This is set, if there is a carry from the
This flag is set, when there is
lowest nibble, i.e, bit three during
addition, or borrow for the lowest a carry out of MSB in case of
nibble, i.e, bit three, during addition or a borrow in case of
subtraction. subtraction.
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation the computation or comparison byte of the result contains even
is negative performed by an instruction is number of 1’s ; for odd number
zero of 1’s set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Tarp Flag
Over flow Flag If this flag is set, the processor
This flag is set, if an overflow occurs, i.e, if the result of a signed enters the single step execution
operation is large enough to accommodate in a destination
mode by generating internal
register. The result is of more than 7-bits in size in case of 8-bit
signed operation and more than 15-bits in size in case of 16-bit interrupts after the execution of
sign operations, then the overflow will be set. each instruction
8086 registers
categorized 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
into 4 groups OF DF IF TF SF ZF AF PF CF
Program
A set of instructions written to solve
a problem.
Instruction
Directions which a microprocessor
follows to execute a task or part of a
task.
Computer language
• Writing a program
68
Defining the problems
• Find out the problem.
For example:
Sensing temperature,
detecting fire,
detecting smock,
decoder-encoder,
Intelligent machine controller etc.
69
Representing program operations
71
Writing a program
• We need to do the following steps to write the program
effectively:
- INITIALIZATION INSTRUCTIONS: used to initialize various
parts of the program like segment registers, flags and
programmable port devices.
1. Register Addressing
Group I : Addressing modes for
2. Immediate Addressing register and immediate data
3. Direct Addressing
5. Based Addressing
Group II : Addressing modes for
6. Indexed Addressing memory data
7. Based Index Addressing
8. String Addressing
8. String Addressing
75
8086 Group I : Addressing modes for
Microprocessor Addressing Modes register and immediate data
1. Register Addressing
In immediate addressing mode, an 8-bit or 16-bit
2. Immediate Addressing data is specified as part of the instruction
3. Direct Addressing
Example:
4. Register Indirect Addressing
MOV DL, 08H
5. Based Addressing
The 8-bit data (08H) given in the instruction is
6. Indexed Addressing moved to DL
8. String Addressing
10. Indirect I/O port Addressing The 16-bit data (0A9FH) given in the instruction is
moved to AX register
11. Relative Addressing
(AX) 0A9FH
12. Implied Addressing
76
8086
Microprocessor Addressing Modes : Memory Access
1. Register Addressing
2. Immediate Addressing
Here, the effective address of the memory
3. Direct Addressing
location at which the data operand is stored is
4. Register Indirect Addressing given in the instruction.
12. Implied Addressing This addressing mode is called direct because the
displacement of the operand from the segment
base is specified directly in the instruction.
80
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
(CL) (MA)
(CH) (MA +1)
81
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
(AL) (MA) 82
(AH) (MA + 1)
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
(CL) (MA)
(CH) (MA + 1)
83
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
84
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
1. Register Addressing
2. Immediate Addressing
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
5. Based Addressing
6. Indexed Addressing
Instructions using this mode have no operands.
The instruction itself will specify the data to be
7. Based Index Addressing
operated by the instruction.
8. String Addressing
Example: CLC
9. Direct I/O port Addressing
This clears the carry flag to zero.
10. Indirect I/O port Addressing
88
INSTRUCTION SET
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
3. Logical Instructions
90
8086
Microprocessor Instruction Set
91
8086
Microprocessor Instruction Set
92
8086
Microprocessor Instruction Set
94
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADD A, data
95
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADDC A, data
96
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SUB A, data
97
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SBB A, data
98
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
99
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
100
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
101
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
102
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
103
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
104
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
CMP A, data
105
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
106
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
107
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
108
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
109
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
110
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
111
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
112
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
113
8086
Microprocessor Instruction Set
114
8086
Microprocessor Instruction Set
REP
115
8086
Microprocessor Instruction Set
MOVS
(MAE) (MA)
116
8086
Microprocessor Instruction Set
CMPS
117
8086
Microprocessor Instruction Set
SCASW
MAE = (ES) x 1610 + (DI)
Modify flags (AL) - (MAE)
LODS
119
8086
Microprocessor Instruction Set
STOS
120
8086
Microprocessor Instruction Set
CLC Clear CF 0
NOP No operation
Mnemonics Explanation
CALL reg/ mem/ disp16 Call subroutine
122
8086
Microprocessor Instruction Set
Checks flags
123
8086
Microprocessor Instruction Set
JC disp8 Jump if CF = 1
JP disp8 Jump if PF = 1
JO disp8 Jump if OF = 1
JS disp8 Jump if SF = 1
125
Assembler directives
8086
Microprocessor Assemble Directives
Used to :
› specify the start and end of a program
› attach value to variables
› allocate storage locations to input/ output data
› define start and end of segments, procedures, macros etc..
127
8086
Microprocessor Assemble Directives
DB Define Byte
PROC
FAR Example:
NEAR
LIST DB 7FH, 42H, 35H
ENDP
Three consecutive memory locations are reserved for
SHORT the variable LIST and each data specified in the
instruction are stored as initial value in the reserved
MACRO memory location
ENDM 128
8086
Microprocessor Assemble Directives
DB Define Word
PROC
FAR Example:
NEAR
ALIST DW 6512H, 0F251H, 0CDE2H
ENDP
Six consecutive memory locations are reserved for
SHORT the variable ALIST and each 16-bit data specified in
the instruction is stored in two consecutive memory
MACRO location.
ENDM 129
8086
Microprocessor Assemble Directives
ORG
END Segnam SEGMENT
EVEN
…
EQU … Program code
… or
PROC … Data Defining Statements
…
FAR …
NEAR
Segnam ENDS
ENDP
SHORT
ORG
User defined name of
END Segment Register
the segment
EVEN
EQU
PROC Example:
FAR
NEAR ASSUME CS: ACODE, DS:ADATA Tells the compiler that the
ENDP instructions of the program are
stored in the segment ACODE and
data are stored in the segment
SHORT ADATA
MACRO
ENDM 131
8086
Microprocessor Assemble Directives
General form
ASSUME
ORG
procname PROC[NEAR/ FAR]
END
EVEN …
Program statements of the
…
EQU … procedure
DB
Examples:
DW
RET
ORG ADD64 ENDP
END
EVEN
EQU CONVERT PROC FAR The subroutine/ procedure named CONVERT
is declared as FAR and so the assembler will
… code the CALL and RET instructions involved
PROC … in this procedure as far call and return
ENDP …
FAR RET
NEAR CONVERT ENDP
SHORT
MACRO
ENDM 134
8086
Microprocessor Assemble Directives
PROC
ENDP
FAR
NEAR
SHORT
MACRO
ENDM 135
8086
Microprocessor Assemble Directives
PROC
ENDP
FAR User defined name of
NEAR the macro
SHORT
MACRO
ENDM 136
137
Interfacing memory and i/o ports
8086
Microprocessor Memory
Processor Memory
Registers inside a microcomputer
Store data and results temporarily
No speed disparity
Cost
Secondary Memory
Storage media comprising of slow
devices such as magnetic tapes and
disks
Hold large data files and programs:
Operating system, compilers,
databases, permanent programs etc. 139
8086
Microprocessor Memory organization in 8086
8086 : 16-bit
Bank 0 : A0 = 0 Even
addressed memory bank
Bank 1 : = 0 Odd
addressed memory bank
140
8086
Microprocessor Memory organization in 8086
142
8086
Microprocessor Interfacing SRAM and EPROM
143
8086
Microprocessor Interfacing SRAM and EPROM
144
8086
Microprocessor Interfacing SRAM and EPROM
145
8086
Microprocessor Interfacing SRAM and EPROM
Monitor Programs
Initialization of stack
146
8086
Microprocessor Interfacing I/O and peripheral devices
I/O devices
Interrupt driven I/ O
I/O device interrupts the
processor and initiate data
transfer
Direct memory access
Data transfer is achieved by 147
bypassing the
8086
Microprocessor 8086 and 8088 comparison
The I/O ports or peripherals can be Only IN and OUT instructions can be
treated like memory locations and used for data transfer between I/O
so all instructions related to device and processor
memory can be used for data
transmission between I/O device
and processor
Data can be moved from any Data transfer takes place only
register to ports and vice versa between accumulator and ports
When memory mapping is used for Full memory space can be used for
I/O devices, full memory address addressing memory.
space cannot be used for
addressing memory. Suitable for systems which
require large memory capacity
Useful only for small systems
where memory requirement is less
For accessing the memory mapped For accessing the I/O mapped
devices, the processor executes devices, the processor executes I/O
memory read or write cycle. read or write cycle.
8086 8088
16-bit Data bus lines obtained by 8-bit Data bus lines obtained by
demultiplexing AD0 – AD15 demultiplexing AD0 – AD7
In MIN mode, pin 28 is assigned the In MIN mode, pin 28 is assigned the
signal M / signal IO /
152
8086
Microprocessor Co-processor – Intel 8087
153
8086
Microprocessor Co-processor – Intel 8087
154
8086
Microprocessor Co-processor – Intel 8087
BUSY
155
8086
Microprocessor Co-processor – Intel 8087
156
8086
Microprocessor Co-processor – Intel 8087
INT
157
8086
Microprocessor Co-processor – Intel 8087
-
Status
1 0 0 Unused
1 0 1 Read memory
1 1 0 Write memory
1 1 1 Passive
QS0 – QS1
158
8086
Microprocessor Co-processor – Intel 8087
Wake up the
coprocessor
Monitor
ESC 8086/
8088
Deactivate the
Execute the host’s TEST pin
8086 and execute
instructions the specific
operation
Activate
WAIT the TEST
pin
Wake up the
8086/ 8088
160
161