0% found this document useful (0 votes)
23 views46 pages

Dpco - Addressing Modes

The document outlines the fundamental components of computer systems, focusing on the manufacturing process of silicon chips, the role of transistors, and the structure of integrated circuits. It also delves into MIPS assembly language operations, detailing how high-level programming constructs are compiled into lower-level instructions, including the use of registers and various addressing modes. Additionally, it discusses the importance of efficient data transfer between memory and registers to optimize performance.

Uploaded by

manashanandhini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views46 pages

Dpco - Addressing Modes

The document outlines the fundamental components of computer systems, focusing on the manufacturing process of silicon chips, the role of transistors, and the structure of integrated circuits. It also delves into MIPS assembly language operations, detailing how high-level programming constructs are compiled into lower-level instructions, including the use of registers and various addressing modes. Additionally, it discusses the importance of efficient data transfer between memory and registers to optimize performance.

Uploaded by

manashanandhini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Fundamental components of

Computer System
• Transistor-On/Off chip controlled by
electricity.
• Dozens to hundred transistors-IC
• Hundreds to million transistor-VLSI
• Manufacturing Chip-Begins with silicon which
is a substance found in sand.
• It is a semiconductor and doesn’t produce
electricity well.
• By doping process, some chemicals are added
to the silicon.
• Excellent Conductor-Microscopic copper
• Excellent insulator-Plastic sheathing or glass
• Areas that can conduct or insulate under
special condition(as switch)
• Ex:Transistor
• Silicon Ingot-8-12 inches in diameter and
12-24 inches long.
• Process starts with a silicon ingot that looks
like a giant sausage.
• Ingot is finely slice into wafers of 0.1inches
thick.
• Wafers undergo 20-40 steps during which
patterns of chemicals are placed on a wafer
creating Transistors, conductors and
insulators.
• IC contains only one layer of transistor but
have 2 to 8 levels of metal conductor
separated by layers of insulators.
• A single microscopic flaw or dozens of itself in
wafer can result in wafer failing.
• These defects make it virtually impossible to
manufacture a perfect wafer.
• Simplest way to cope with imperfections is to
place many independent components on a
single wafer.
• Patterned wafer is chopped up and divided into 3
components i.e insulator, conductor,
Semiconductor called dies(informally called chips)
• Dicing enables to discard only those dies that
were unlucky to contain the flaws rather than
whole wafer.
• Cost rises quickly as the die size increases due to
lower yield and smaller number of dies that fit on
wafer.
• Next generation process shrinks a large die to
convert it to transistors and wires
• It improves yield and wafer count
• 32 nanometer process was typical in 2012 i.e
smaller feature size on die is 32nm.
• Good dies are connected to input/output pins
of a package.
• These packaged parts are tested a final time
and can shipped to customers.
Cores: Referred to as processors and
microprocessors called Multi-core
microprocessor.
• Quad core Microprocessor: A chip has 4
processors or 4 cores.
• Programmers rely on innovations in hardware
to double the performance of their programs
every 18 months without changing the line of
code.
• Parallel programming is called as performance
programming that increase the difficulty of
programming.
• Overhead of scheduling and co-ordination
does not fritter away the potential
performance.
Operation and Operands
Operations of Computer Hardware:
Every Computer is able to perform arithmetic
operation.
MIPS assembly language notation:
add a,b,c
• It adds b,c and saves it in a
• If 3 variables need to be added =>like b,c,d,e
add a,a d
add a,a,e
• It needs 3 instructions to add 4 variables
• It follows the principle:1.Simplicity favours Regularity

Compiling Two C Assignment statements in MIPS:


Representation of programs written in higher level programming
languages to programs in their more primitive notation.
Let Five Variables a,b,c,d and e
a=b+c;
d=a-e;
A MIPS instruction operates on two source operands and places the
result in one destination operand.

add a,b,c
Sub d,a,e
Compiling a complex C Assignment into MIPS:
Let 5 variables are f,g,h,i and j.
F=(g+h)-(i+j)
Working of C compiler
The Compiler must break this statement into several
assembly instructions since only one operation is
performed per MIPS instruction.
First MIPS instruction calculates the sum odf g and
h.The result is stored in temporary variable called
t0.
add t0,g,h
add t1,i,j
• The Subtract instruction subtracts the second sum from first
and places the difference in variable f, completing the code
.
• Sub f,t0,t1;
OPERANDS:
• Operands of arithmetic instructions are taken in limited
numbers from registers.
• Registers are primitives and used in hardware.
• Size of registers in MIPS architecture is 32 bits.
• Group of 32 bits occur frequently and is called as ‘words’.
• Principle-2: Smaller is Faster
A large number of registers may increase the clock cycle
because it takes electronic signals longer when they must
travel faster.
• The designer must balance the craving of
programs for more registers with the
designer’s desire to keep the clock cycle fast.
• MIPS convention is to use 2 character names
following a dollar sin to represent a register.
• Use $s0,$s1,…..For registers that correspond
to variables in C and java.
• Use $t0,$t1…for temporary registers in MIPS
langauage.
Compiling a C program using Registers
• f=(g+h)-(i+j)
• In MIPS notation
• add $to,$s1,$s2 (#register $t0 contains g+h)
• add $t1,$s3,$s4 (#register $t1 contains i+j)
• Sub $s0,$t0,$t1 (f gets $t0-$t1)
Operands of computer:
Three Types
• Memory Operands
• Constant or Immediate Operands
Memory Operands:
More complex data structures are used apart
from simple variables with single data
elements.
Like arrays and data structures.
• These complex data structures can contain
many data elements than the registers.
• Data Structures like arrays and structures are
kept in memory.
• Arithmetic operations occur only on registers
in MIPS instructions.
• MIPS must include instructions that transfer
data between memory and registers. Such
instructions are called Data transfer
instructions.
• Memory is just a large single dimensional
array with the address acting as the index to
that array starting at 0.
• To access word in memory, instruction must
supply the memory address.
• Ex: From below diagram
• The address of the third data element is 2 and
the value of memory[2] is 10.
• The data transfer instruction that copies data
from memory to a register is called Load.
• Format for load :
lw $s1,20($s2) (i.e $s1=Memory[$s2+20]
Here, the sum of constant portion of the
instruction and the contents of second
register forms the memory address.
lw stands for load word that moves word from
memory to register.
• Instruction complimentary to load is called
Store,it copies data from a register to memory.
• To achieve highest performance and conserve
energy,an ISA must have a sufficient number of
registers and compilers must use registers
efficiently
Format for store :
Sw 4s1,20($s2)
Similar to load,store instruction represents register
to be stored,then offset to select the array
element and finally the base register.
Compiling Using load and store
instruction
A[12]=h+A[8]
MIPS instruction
lw $t0,32[$s3]
add $t0,$S2,$t0
Sw $t0,48($s3)
The process of putting less commonly used
variables into memory is called splitting
register.
Constant or immediate operands
• Many times a program will use a constant in an
operation
• Adding constants to operation will work efficiently
and use less energy.
• Ex: Incrementing an index to point to the next
element of an array.
lw $t0,addrconstant 4($s1)
add $s3,$s3,$t0
Assumption:$s1+addrconstant4 is the memory
address of constant 4
Addressing Modes
• Multiple forms of addressing are generally called
as Addressing modes.
Definition:
• The addressing modes specifies a rule for
interpreting or modifying the address field of the
instruction before the operand is actually
referenced
• An address computed by the processor when
executing the next instruction is known as
Effective address.
An effective address is computed by 3
elements namely
The base,
Index and
Displacement
An addressing mode specifies “how to
calculate the effective operand” by using
an effective information held in register.
Types
Immediate Addressing Mode:
In this addressing mode, the operand is a
constant within the instruction itself.
It does not requrie any extra memory to fetch
the operand. Thus it executes faster.
But the operand is limited to 16 bit in size.
Ex: mov A,#20
Register Addressing Mode:
The name of the register is used to specify the operand.It
is the simpest addressing mode.
Ex:
Mov R1,R2
The instruction copies the content of register R2 to
register R1
Base or Displacement addressing mode:
This addressing mode combines the capabilities of direct
addressing and register in direct addressing.
It has two address fields
1.Value 2.Referenced register.
PC Relative Addressing:
It is a sum of program counter and the address
part of instruction..
From Figure,
Where EA =PC +Address part of the instruction.
Ex:beq $s3,$s4,l1
Program counter=Register+Branch address.
This allows the program to be large as 2^32 and
to conditional branches,This form of branch
addressing is called PC relative addressing.
Pseudo direct addressing:
The memory address is mostly embedded in the
instruction.
The effective address is calculated by taking the
upper 4 bits of the program counter
concatenated to the 26 bit immediate value
and the lower 2 bit are 00.
Absolute or Direct addressing;
The operand is in memory location where the
address of instruction is given explicitly in
instruction.
Ex: Mov A,2000
The instruction copies the content of memory
location 2000 to register A.
Indirect Addressing mode:
The instruction contains the address of memory
which refers the address of the operand.
Index addressing mode:
The indexing is the technique that allows
programmer to point the data(operand)
stored in sequential memory locations one by
one.
It is an efficient mechanism for performing
iterative operation.
• Auto Increment Addressing mode:
• The effective address of the operand is the
content of register in the instruction.
• After accessing the operand, the contents of
register will increment automatically.
Auto Decrement Addressing mode
Stack addressing mode

You might also like