Ch3 The Processor
Ch3 The Processor
Introduction to COA
Computer architecture is concerned with the structure and
behavior of the computer as seen by the user.
It includes the information formats, the instruction set,
and techniques for addressing memory, I/O mechanisms,
number of bits used for data representation, etc...
Register Stack
Memory Stack
Register Stack
A standalone unit that consists of collection of finite number
of registers.
Stack Limits
Check for stack overflow (full) / underflow (empty)
Note that:
1. Always we use DR to pass word into stack
Note That:
SP← SP+1
M [SP] ← DR
DR← M [SP]
SP←SP - 1
The top item is read from the stack in to DR. The stack
pointer is then decremented to point at the next item in the
stack.
Example : ADD R1 , R2
• PUSH A TOS ← A
• PUSH B TOS ← B
• ADD TOS ← (A + B)
• PUSH C TOS ← C
• PUSH D TOS ← D
• ADD TOS ← (C + D)
• MUL TOS ← (C + D) ∗ (A + B)
• POP X M [X] ← TOS
of that instruction.
Increasing the power of the instruction set allows shorter and more
because shorter code reduces the number of memory fetches and also
occupies less memory.