YYYEJI

[MIPS] Design Principles 본문

Computer architectures

[MIPS] Design Principles

YEJI ⍢ 2022. 9. 24. 22:57
728x90

 

 

Mips에서 컴퓨터 구조가 만들어질 때 사용된 4가지 원칙에 대해서 알아보아요.

$ - register

 

MPIS는

 

① Maximize performance (최대화된 기능)

② Minimize cose (최소화된 비용)
③ Reduce design time (디자인 시간 감소)

 

를  목표로 하고 있습니다.

 

 

 

이 목표에 따른 4가지 원칙이 있는데 같이 알아보아요.

 

 

① To be simple, it should be regular.

심플하기 위해서는, 규칙적이여야 한다.

(규칙적  심플, 심플  목표)

 

Ex) 3개의 Operand가 있고 destination이 앞으로 오도록 한다.

ADD  C,  A,  B

 

 

 

 

② Smaller is faster.

( MIPS - register addressing mode )

register가 많아지면 clock cycle time인 delay가 길어져서 느려진다.

즉, register의 갯수가 많을수록 좋은 게 아니다.

 

 

 

 

③ Make common case fast.

자주 사용되는 case들을 instruction set으로 지정해 둔다.

자주 사용되는 0, 1 또는 I.O device들을 특정 메모리에 할당해 둔다.

(단, 자주 사용되는 것들 !)

 

 

 

④ Good design demands a compromise.

기본적으로 instruction format은 아래와 같이 생겼습니다.

Note)  R-type 은 op code가 항상 0이기 때문에 function code를 보고 

instruction을 파악합니다.

op rs rt rd shamt funct
6 bits 5 bits 5 bits 5 bits 5 bits 6 bits

↑ R-type ↑ 

 

 

 

Ex)     ADD  $t0  $s1  $s2

0 17 18 8 0 32

✓  op code, 0은 R-type의 instruction format을 나타냅니다.

✓  rs, 17은 $r1을 나타냅니다.

✓  rt, 18은 $r2을 나타냅니다.

✓  rd, 8은 $t0를 나타냅니다.

✓  shamt, 0은 shift가 없음을 나타냅니다.

✓  func, 32는 ADD instruction임을 나타냅니다.

 

 

 

메모리에 1,000을 저장하고 싶어도 메모리가 부족해서 저장할 수 없게 됩니다.

그렇게 생긴 새로운 type의 instruction format(for immediate value)이 있습니다.

op rs rt constant or address
6 bits 5 bits 5 bits 16 bits

↑ I-type ↑ 

 

 

 

Ex)    ADDI  $s0  $s1  4

8 17 16 constant = 4

✓  op code, 8은 ADDI instruction임을 나타냅니다.

✓  rs, 17는 $r1을 나타냅니다.

✓  rt, 16은 $r0을 나타냅니다.

✓  constant or address, 4는 address를 나타냅니다.

 

 

 

Design principle 에는 만족하지 않는 내용이지만,

요구되는 조건에 따른 format을 사용하자는 것이 4번째 원칙입니다.

 

 

 

 

 ◡̈