일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- github
- MIPS
- while
- control
- data structure
- python
- function
- html
- DB
- DS
- DoM
- Linux
- CSS
- computer
- Class
- instruction
- Pipelining
- MacOS
- DATAPATH
- Java
- system
- javascript
- mysql
- web
- XML
- php
- react
- Algorithm
- for
- architecture
- Today
- Total
목록control (13)
YYYEJI

MIPS에는 여러 Instruction이 존재하는데, ALU control가 어떤 값이냐에 따라 실행되는 operation이 달라집니다. ✓ ALUcontrol에 4bits가 들어가는데 ① 2bits는 ALUop에서 발생시키고, ALUop는 어떤 instruction인지에 따라 결정됩니다. (즉, instruction의 op code를 보게 됩니다.) lw, sw - 00 beq - 01 R type - 10 ② 나머지 2bits는 instruction format에 따라서 2bits가 결정됩니다. R type의 경우 op code만 보고 instruction을 파악하기 힘들기 때문에, function code까지 확인해야 됩니다. ↓↓↓ 아래 결과에 따라 실행되는 instructio이 달라집니다 ↓↓↓..

Stored program concept에 의한 intruction 실행 순서 ① Instruction의 주소를 얻기 위해 PC(Program Counter)을 이용한다. ② Instruction을 주소로부터 가져온다. ③ Register로부터 값을 읽는다. ④ 정화기 무엇을 해야할지 정하기 위해 instruction을 이용한다. Fetch&Execute ①, ② - instruction fetch ③, ④ - instruction execute Note) Fetch&Execute는 stored program concept이다. ◡̈

① BEQ / BNE 16-bit Offset ② J 26-bit address ③ JR 32-bit address 많은 거리를 jump하고 싶을 땐 많은 address를 가지고 있는 ③을 이용해라. ↓↓↓ BEQ / BNE ↓↓↓ https://yyyeji.tistory.com/120 [CS] MIPS Conditional branch Instruction (BEQ, BNE) ① BEQ - Branch if Equal Ex) BEQ $s1, $s2, label # if($s1 == $s2) PC op = 4 rs = 17 rt = 18 offset (word count) $s1의 값과 $s2의 값이 같으면 label의 값이 계산되어서 PC에 들어갑니다. ② BNE - Br.. yyyeji.tistory..

BEQ와 BNE로 같다(==)와 다르다(!=)라는 수식을 사용할 수 있지만 작다() 등은 어떻게 표현할 수 있을까요 ? 그렇게 MIPS에서 특별하게 만들어진 새로운 instruction이 있습니다. 바로 slt instruction 입니다. (Set less than) Ex 1) slt $t0, $s1, $s2 # if $s1

① BEQ - Branch if Equal Ex) BEQ $s1, $s2, label # if($s1 == $s2) PC op = 4 rs = 17 rt = 18 offset (word count) $s1의 값과 $s2의 값이 같으면 label의 값이 계산되어서 PC에 들어갑니다. ② BNE - Branch if Not Equal Ex) BNE $s1, $s2, label # if($s1 != $s2) PC op = 5 rs = 17 rt = 18 offset (word count) $s1의 값과 $s2의 값이 다르면 label의 값이 계산되어서 PC에 들어갑니다. ◡̈