Professional Documents
Culture Documents
CS2600: Computer Organization and Architecture I Specifies the functionality of the processor
Instruction Set Architecture1
I Provides the interface between the compilers and hardware
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 2/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 3/18
Endianness Alignment
I An access to an object of size s bytes at byte address A is aligned if A
I Big Endian: The most significant byte is stored in the smallest address
mod s = 0
I Little Endian: The least significant byte is stored in the smallest address I Example showing the addresses at which an access is aligned (indicated
I 80x86 – Little Endian; Motorola 6800 – Big Endian; ARM – switchable with "Y") or misaligned (indicated with "N")
endianness Width
of
object
1
byte
0
Y
1
Y
2
Y
3
Y
4
Y
5
Y
6
Y
7
Y
Byte Byte 2
bytes
Y
Y
Y
Y
11
12
13
14
11
12
13
14
address address 2
bytes
N
N
N
N
struct{ 00 00
01
02
03
04
05
06
07
07
06
05
04
03
02
01
00
00
4
bytes
Y
Y
int a; // 0x11121314 21
22
23
24
25
26
27
28
21
22
23
24
25
26
27
28
4
bytes
N
N
int b; 08 08
09
0A
0B
0C
0D
0E
0F
0F
0E
0D
0C
0B
0A
09
08
08 4
bytes
N
N
double c; // 0x21222324252627
char* d; //0x31323334 31
32
33
34
‘A’
‘B’
‘C’
‘D’
‘D’
‘C’
‘B’
‘A’
31
32
33
34
4
bytes
N
N
char e[7]; //‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’ 10 10
11
12
13
14
15
16
17
17
16
15
14
13
12
11
10
10 8
bytes
Y
short f; //0x5152 ‘E’
‘F’
‘G’
51
52
51
52
‘G’
‘F’
‘E’
8
bytes
N
} 18 18
19
1A
1B
1C
1D
1E
1F
1F
1E
1D
1C
1B
1A
19
18
18 8
bytes
N
8
bytes
N
Big Endian Address Mapping Little Endian Address Mapping
8
bytes
N
I Endianness does not affect the ordering of data items within a structure2
8
bytes
N
8
bytes
N
8
bytes
N
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 4/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 5/18
Registers Addressing Modes
I Special-purpose registers I Specify the way in which operands of an instruction are stored
I Program counter, stack pointer, etc.
Instruction Instruction
I Some special-purpose registers available in kernal mode (used only by the Instruction A
A
OS) to control caches, memory, I/O, etc. Operand
Register Register
I General-purpose registers Register
File Memory
File Memory File Memory
space references
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 6/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 7/18
Operand
I Base-Register addressing
(d) Register Addressing
I Reference register contains a memory address
(e) Register Indirect
ADD R1, R ADD R1, (R)
(f) Displacement I Address field contains a displacement from the memory address
ADD R1, A(R) I Used for implementing segmentation
I Used for values I Used for pointer
I direct + register I Indexed addressing
stored in registers manipulations
indirect addressing I Address field contains a memory address
I No memory I Large address I Reference register contains a displacement from the memory address
I Flexibility
reference space I Used for performing iterative operations
I Complex
I Limited address I One memory
implementation
space reference
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 8/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 9/18
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 10/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 11/18
A−B
Machine Instruction Characteristics (Contd) Program to Execute Y = C+(D×E)
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 12/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 13/18
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 14/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 15/18
I The number of registers and the number of addressing modes have an I Complex Instruction Set Computer (CISC) Architecture uses multi-word
instructions
impact on the size of instructions
I The primary goal is to complete a task in as few lines of assembly as
I Fixed Length Encoding: possible
Opera&on
Address
Address
Address
I supporting the operations and data structures used by the high-level
field
1
field
2
field
3
language
I Supporting a large variety of memory addressing modes
I The operation and the addressing mode are encoded into the opcode I Results in variable length instructions
I Instruction decoding is simple I Example ISA: x86
I Example ISA: ARM
I Reduced Instruction Set Computer (RISC) Architecture uses one-word
I Variable Length Encoding: instructions
Opera&on
and
Address
Address
Address
Address
I Uses processor registers extensively
no.
of
operands
specifier
1
field
1
specifier
n
field
n
I Operands must be from registers only
I Load-store architecture
I Separate address specifier is needed for each operand I Register-based addressing is used
I Takes less space I Memory addressing modes are used only for loads/stores
I Example ISA: 80x86 I Example ISA: ARM
Madhu Mutyam (IIT Madras) Jan 23-29, 2019 16/18 Madhu Mutyam (IIT Madras) Jan 23-29, 2019 17/18
Thank You