CLASS PRESENTATION
UNIT-1
Mohammad Asif Iqbal
Assistant Professor,
Deptt of ECE,
JETGI, Barabanki
CLASS TEST
Q1:-HOW CAN YOU DROP A RAW
EGG ONTO A CONCRETE SURFACE
WITHOUT CRACKING IT.
WHAT WE WILL STUDY IN THIS CLASS….
1 General Register Organization
2 Stack Organization
General Register
Organization
REGISTERS
Small units of memory to hold
data/instructions temporally
during execution.
There are 2 kind of register in
the CPU.
1. Special purpose register
2. General purpose register
SPECIAL PURPOSE REGISTER
These are used for the specific purpose by the control
hardware
PROGRAM CONTROL (PC): used to remember the location
in memory of the instructions currently being executed.
INSTRUCTION REGISTER (IR): Used to remember that
instruction.
PROCESSOR STATUS REGISTER: used to remember status
information about current state of processor, e.g. whether
an arithmetic overflow has occurred.
GENERAL PURPOSE REGISTER
Available for use by the programmer
Useful for remembering the useful data
Why is it a good idea to do this?
WHY USE GENERAL PURPOSE REGISTERS?
There is a large speed disparity between the processor and the
memory where instructions and data are stored
Consider a 1 GHz processor
oThis frequency corresponds to a 1 nanosecond time scale.
oMilli (10-3), micro (10-6) nano (10-9)
oG (giga) 230 for memory ; 109 for frequency, disk size.
Memory : 100 nanosecond time scale
Aside: More on nanosecond
ospeed of light: 300,000km/sec or 0.3 m/nsec
GENERAL PURPOSE REGISTER
Available for use by the programmer
Useful for remembering the useful data
A typical processor today has 32 GPRs, say R0, R1,….R31
The operands to an instruction could come either from
registers or from main memory.
Stack
Organization
PART TWO
STACK ORGANIZATION
Stack or LIFO(Last-In, First-Out)
oA storage device that stores information
•The item stored last is the first item retrieved = a stack of tray
oStack Pointer (SP)
•The register that holds the address for the stack
•SP always points at the top item in the stack
oTwo Operations of a stack : Insertion and Deletion of Items
•PUSH : Push-Down = Insertion
•POP : Pop-Up = Deletion
TYPES OF STACK
1) Register Stack (Stack Depth: LIMITED)
oA finite number of memory words or
register(stand alone)
2) Memory Stack (Stack Depth: FLEXIBLE)
oA portion of a large memory
REGISTER STACK
0
)1()0(
][
1




EMTY
FULLthenSPIf
DRSPM
SPSP Increment SP
: Write to the stack
: Check if stack is full
: Mark not empty
Push Operation
The first item is stored at address 1, and the last item is stored at address 0
Pop Operation
0
)1()0(
1
][




FULL
EMTYthenSPIf
SPSP
SPMDR : Read item from the of stack
: Decrement Stack Pointer
: Check if stack is empty
: Mark not full
EXAMPLE OF PUSH& POP OPERATION.
D
A
00
10
DR
FULL EMTY PUSH A
01
PUSH B
10
PUSH C
11
1 0
FULL EMTY
PUSH D
POP D
D
DR
MEMORY STACK
Push Operation
The first item is stored at address 4000
Pop Operation
DRSPM
SPSP


][
1
1
][


SPSP
SPMDR
Program
(instructions)
Data
(operands)
Stack
SP
PC
AR
DR
1000
2000
4001
3000
4000
3999
3998
3997
Address
Memory unit
Start Here
RPN (Reverse Polish Notation)
The common mathematical method of writing arithmetic
expressions imposes difficulties when evaluated by a
computer
A stack organization is very effective for evaluating
arithmetic expressions
A * B + C * D  AB * CD * +
( 3 * 4 ) + ( 5 * 6 )  34 * 56 * +
3 12
6
5
42
30
12
5
1212
4
3
43 +*65*
HERE IS YOUR ANSWER….
ANY WAY YOU WANT, BECAUSE A
CONCRETE FLOOR IS VARY HARD TO
CRACK.
THANK YOU!

Register organization, stack

  • 1.
    CLASS PRESENTATION UNIT-1 Mohammad AsifIqbal Assistant Professor, Deptt of ECE, JETGI, Barabanki
  • 2.
  • 3.
    Q1:-HOW CAN YOUDROP A RAW EGG ONTO A CONCRETE SURFACE WITHOUT CRACKING IT.
  • 4.
    WHAT WE WILLSTUDY IN THIS CLASS…. 1 General Register Organization 2 Stack Organization
  • 5.
  • 6.
    REGISTERS Small units ofmemory to hold data/instructions temporally during execution. There are 2 kind of register in the CPU. 1. Special purpose register 2. General purpose register
  • 7.
    SPECIAL PURPOSE REGISTER Theseare used for the specific purpose by the control hardware PROGRAM CONTROL (PC): used to remember the location in memory of the instructions currently being executed. INSTRUCTION REGISTER (IR): Used to remember that instruction. PROCESSOR STATUS REGISTER: used to remember status information about current state of processor, e.g. whether an arithmetic overflow has occurred.
  • 8.
    GENERAL PURPOSE REGISTER Availablefor use by the programmer Useful for remembering the useful data Why is it a good idea to do this?
  • 9.
    WHY USE GENERALPURPOSE REGISTERS? There is a large speed disparity between the processor and the memory where instructions and data are stored Consider a 1 GHz processor oThis frequency corresponds to a 1 nanosecond time scale. oMilli (10-3), micro (10-6) nano (10-9) oG (giga) 230 for memory ; 109 for frequency, disk size. Memory : 100 nanosecond time scale Aside: More on nanosecond ospeed of light: 300,000km/sec or 0.3 m/nsec
  • 10.
    GENERAL PURPOSE REGISTER Availablefor use by the programmer Useful for remembering the useful data A typical processor today has 32 GPRs, say R0, R1,….R31 The operands to an instruction could come either from registers or from main memory.
  • 11.
  • 12.
    STACK ORGANIZATION Stack orLIFO(Last-In, First-Out) oA storage device that stores information •The item stored last is the first item retrieved = a stack of tray oStack Pointer (SP) •The register that holds the address for the stack •SP always points at the top item in the stack oTwo Operations of a stack : Insertion and Deletion of Items •PUSH : Push-Down = Insertion •POP : Pop-Up = Deletion
  • 13.
    TYPES OF STACK 1)Register Stack (Stack Depth: LIMITED) oA finite number of memory words or register(stand alone) 2) Memory Stack (Stack Depth: FLEXIBLE) oA portion of a large memory
  • 14.
    REGISTER STACK 0 )1()0( ][ 1     EMTY FULLthenSPIf DRSPM SPSP IncrementSP : Write to the stack : Check if stack is full : Mark not empty Push Operation The first item is stored at address 1, and the last item is stored at address 0 Pop Operation 0 )1()0( 1 ][     FULL EMTYthenSPIf SPSP SPMDR : Read item from the of stack : Decrement Stack Pointer : Check if stack is empty : Mark not full
  • 15.
    EXAMPLE OF PUSH&POP OPERATION. D A 00 10 DR FULL EMTY PUSH A 01 PUSH B 10 PUSH C 11 1 0 FULL EMTY PUSH D POP D D DR
  • 16.
    MEMORY STACK Push Operation Thefirst item is stored at address 4000 Pop Operation DRSPM SPSP   ][ 1 1 ][   SPSP SPMDR Program (instructions) Data (operands) Stack SP PC AR DR 1000 2000 4001 3000 4000 3999 3998 3997 Address Memory unit Start Here
  • 17.
    RPN (Reverse PolishNotation) The common mathematical method of writing arithmetic expressions imposes difficulties when evaluated by a computer A stack organization is very effective for evaluating arithmetic expressions A * B + C * D  AB * CD * + ( 3 * 4 ) + ( 5 * 6 )  34 * 56 * + 3 12 6 5 42 30 12 5 1212 4 3 43 +*65*
  • 18.
    HERE IS YOURANSWER…. ANY WAY YOU WANT, BECAUSE A CONCRETE FLOOR IS VARY HARD TO CRACK.
  • 19.