YYYEJI

[CS] Instruction Set Completeness 본문

Computer architectures

[CS] Instruction Set Completeness

YEJI ⍢ 2022. 9. 22. 16:56
728x90

To be Completeness . . .

→ A computer should have a set of instructions so that the user can construct machine language programs to evaluate any function that is known to be computable.

 

① - Arithmetic / Logical

② - Data transfor (including I/O)

③ - Contorl Tranfer

 

 

① Arithmetic / Logical

→ Modify Data value

 

1) Integer arithmetic operations

+, -, *, %, ++, -- etc.

 

Note - 1) What are the essential elements?

(ADD, SUB, MUL, DIV)

 ADD and Compliment

(Sub, 1+(-1) 

Mul, 2+2+2

Div, use subtraction)

 

Note - 2) How to use floating point arithmetic operation

→ F.P. operations can be emulated by integer operations.

 

 

2) Logical operations

AND (&&)

True and Trud -> True

True and False -> False

False and True -> False

False and False -> False

 

OR (||)

True and Trud -> True

True and False -> True

False and True -> True

False and False -> False

 

Bitwise AND(&)

0001

0101

------------

0001

 

Bitwise OR (|)

0001

0101

------------

0101

 

Complement(')

0101

------------

1010

 

 

Note) Smallest set ?

case 1 - AND and NOT

case 2 - OR and NOT

 

 

3) Shift instructions

Logic shift, Arithmetic shift, Rotate

1010

↙↙↙↙     

----------

010 

 

Decide which bits to fill in the square.

 

Logic shift -> 0

Rotate -> overflow number

 

 

4) Floating point arithmetic operations

 

 

 

② Data transfor (including I/O)

→ Copy Data from one place to another

1) Load

Memory to register

 

2) Store

Resiter to memory

 

3) Move 

Copy from register to register

 

4) Special instructions 

Betwwen I/O Device and processor

 

 

 

Note) Memory mapped I/O

Instead of creating a new instruction, it allocates an address space in memory to the I/O device.

 

 

 

③ Contorl Tranfer

Jump or Branch

1) conditional branch instruction

Ex) BEQ   A,  B,  C

2) Unconditional branch instruction

Ex) Jump A

3) Subroutine calls and returns instructions

4) Software interrupt instructions

(Hardware interrupts)

5) Halt instructions to stop

Ex) int main() {  }

 

 

Note) Instruction Orthogonality - Instructions are orthogonal if they do not overlap, or perform same function

 

 

 

 

◡̈

 

 

'Computer architectures' 카테고리의 다른 글

[MIPS] Register Model - 1  (0) 2022.09.24
[CS] Memory Structure of ARM and MIPS  (0) 2022.09.24
[CS] CISC vs RISC  (0) 2022.09.22
[CS] Exercise for Addressing Modes  (0) 2022.09.22
[CS] Addressing Modes  (0) 2022.09.21