Professional Documents
Culture Documents
Coa Co2
Coa Co2
•Segment pointer
•Index registers
•Stack pointer
Four registers are essential to instruction execution:
1. Program Counter (PC)
2. Instruction Register (IR)
3. Memory Address Register (MAR)
4. Memory Buffer Register (MBR)
© 2016 KL University – The contents of this presentation are an intellectual and
10
copyrighted property of KL University. ALL RIGHTS RESERVED
Processor Status
Word
1. Sign
2. Zero
3. Carry
4. Equal
5. Overflow
6. Interrupt enable/disable
7. Supervisor
© 2016 KL University – The contents of this presentation are an intellectual and
11
copyrighted property of KL University. ALL RIGHTS RESERVED
Concept of Program Execution
1. Fetch the contents of the memory location pointed at by the PC. The
contents of this location are interpreted as an instruction to be executed.
Hence, they are stored in the instruction register (IR). Symbolically this can be
written as:
IR = [ [PC] ]
PC = [PC] + 1
3. Carry out the actions specified by the instruction stored in the IR.
© 2016 KL University – The contents of this presentation are an intellectual and
12
copyrighted property of KL University. ALL RIGHTS RESERVED
Single bus organization of the data path
inside the CPU
•Processor-memory
•Processor-I/O
•Data processing
•Control
© 2016 KL University – The contents of this presentation are an intellectual and
14
copyrighted property of KL University. ALL RIGHTS RESERVED
Instruction cycle
1. Fetch the contents of a given memory location and load them into a CPU
register.
2. Store a word of data from a CPU register into a given memory location.
3. Transfer a word of data from one CPU register to another or to the ALU.
4. Perform an arithmetic or logic operation, and store the result in a CPU register
© 2016 KL University – The contents of this presentation are an intellectual and
16
copyrighted property of KL University. ALL RIGHTS RESERVED
8086 ARCHITECTURE
OPERAND = A
Instruction
Opcode Operand
e.g. ADD A
•
Instruction
Address A
Memory
Operand
EA = (A)
Look in A, find address (A) and look there for operand
•
Address A
Memory
Pointer to operand
Operand
EA = R
•
No memory access
•
Direct addressing
Register Address R
Registers
Operand
Indirect addressing
•
EA = (R)
•
Instruction
Registers
EA = A + (R)
•
or vice versa
•
Relative Addressing
•
Base-Register Addressing
•
Indexing
auto-indexing
•
auto-incrementing
•
EA = A + (R)
•
R = (R) + 1
•
EA = A + (R)
•
R = (R) – 1
•
e.g.
ADD Pop top two items from stack and add
•
Data Transfer
•
Arithmetic
•
Logical
•
Conversion
•
System Control
•
Transfer Control
© 2016Pop -------------------------Transfer
KL University word fromaretop
– The contents of this presentation an of stack toand
intellectual destination
39
copyrighted property of KL University. ALL RIGHTS RESERVED
B. Arithmetic
Add --------------Compute sum of two operands
Branch
Skip
Procedure call.
© 2016 KL University – The contents of this presentation are an intellectual and
44
copyrighted property of KL University. ALL RIGHTS RESERVED
BRP X ----Branch to location X if result is positive
BRN X ---- Branch to location X if result is negative
BRZ X----- Branch to location X is result is zero
BRO X----- Branch to location X if overflow occurs
© 2016 KLAllocate
Universityand de-allocate
– The contents of space for localare
this presentation variables
an intellectual and
51
copyrighted property of KL University. ALL RIGHTS RESERVED
© 2016 KL University – The contents of this presentation are an intellectual and
52
copyrighted property of KL University. ALL RIGHTS RESERVED
Common Micro-Ops
There are 4 types of Micro-Ops:
To transfer data using a bus: connect the output of the source register to the bus; connect
the input of the target register to the bus; when the clock pulse arrives, the transfer occurs
AR <- address
DR <- M[AR]
RTL expressions for a write operation, assuming use of a data register:
AR <- address
DR <- value
M[AR] <- DR
Micro-instruction Format
3 3 3 2 2 7
F1 F2 F3 CD BR AD
F1, F2, F3: Microoperation fields
CD: Condition for branching
BR: Branch field
AD: Address field
© 2016 KL University – The contents of this presentation are an intellectual and
59
copyrighted property of KL University. ALL RIGHTS RESERVED
Sample machine instructions
Symbol Opcode Description
11 AC = 0 Z Zero value in AC
BR Symbol Function
00 JMP CAR AD if condition = 1
CAR CAR + 1 if condition = 0
01 CALL CAR AD, SBR CAR + 1 if condition = 1
CAR CAR + 1 if condition = 0
10 RET CAR SBR (Return from subroutine)
11 MAP CAR(2-5) DR(11-14), CAR(0,1,6) 0
© 2016 KL University – The contents of this presentation are an intellectual and
62
copyrighted property of KL University. ALL RIGHTS RESERVED
DESIGN OF CONTROL UNIT
DECODING ALU CONTROL INFORMATION -
microoperation fields
F1 F2 F3
AND
ADD Arithmetic AC
DRTAC logic and
shift unit DR
PCTAR
DRTAR
From From
PC DR(0-10) Load
AC
Select 0 1
Multiplexers
Load AR Clock
Non-Volatile
Read-Write Memory Read-Write Read-Only Memory
Memory
DRAM LIFO
Shift Register
Content
Addressable
Memory (CAM)
Volatile data
•
DRAM
•
Low Cost
•
High Density
•
Medium Speed
•
SRAM
•
High Speed
•
Ease of use
•
Medium Cost
© 2016 KL University – The contents of this presentation are an intellectual and
68
copyrighted property of KL University. ALL RIGHTS RESERVED
ROM
•
Non-volatile Data
•
Mask ROM
Data written during chip fabrication
•
PROM
Fuse ROM: Non-rewritable
•
EPROM:
•
Extension of EEPROM
•
Fast erase
•
Large blocks of memory erased at once, rather than one word at a time
•
Entire block must be read, word updated, then entire block written back
•
Used with embedded microcomputer systems storing large data items in nonvolatile
memory
•
Holds the programs and data that the processor is actively working
with.
If the MDR is n-bit long, then the n bit of data is transferred in one
memory cycle.
SRAM
© 2016 KL University – The contents of this presentation are an intellectual and
77
copyrighted property of KL University. ALL RIGHTS RESERVED
DRAM
SRAM & DRAM both are volatile
Operating System
Uni-Program:
Uni-Program
© 2016 KL University – The contents of this presentation are an intellectual and
82
copyrighted property of KL University. ALL RIGHTS RESERVED
Memory Management
Memory
Multi-Program:
Operating System
Multi-Program
The memory is partitioned into equal fixed size chunks that are relatively
small. This chunk of memory is known as frames or page frames.
Each process is also divided into small fixed chunks of same size. The
chunks of a program is known as pages.
At a given point of time some of the frames in memory are in use and some
are free. The list of free frame is maintained by the operating system.
The faster memory that is inserted between CPU and Main Memory is
termed as Cache memory.
Main
CPU Memory
Cache (Slow)
(Fast) Mem
Hit Cache
1. Direct mapping
2. Associative mapping
3. Block-set-associative mapping
It is not flexible