일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- python
- DATAPATH
- control
- mysql
- DS
- MIPS
- web
- architecture
- XML
- DoM
- html
- function
- react
- Java
- instruction
- Algorithm
- Linux
- javascript
- CSS
- computer
- DB
- Pipelining
- system
- for
- github
- MacOS
- while
- data structure
- php
- Class
- Today
- Total
목록control (13)
YYYEJI

Swith문이란? 변수 값과 일치하는 case 값이 실행되는 조건 판단문입니다. 예제를 살펴보겠습니다. switch (variable) { case something1 : action1 break; case something2 : action2 break; case something3 : action3 break; default : action4 } variable 값에 일치하는 case가 action을 취하게 됩니다. 일치하는 something이 없다면 default로 넘어가고 switch문이 종료됩니다. public static void main(String[] args) { int month = 4; String m = ""; switch (month) { case 1 : m = "January";..

If문이란? If의 뜻은 '만약에'입니다. 이처럼 if문은 조건문에 따라 결과가 다르게 작동합니다. ① If문 if(Boolean_Expression) Action; // execute only if true public static void main(String[] args) { int num = 10; if(num == 10) System.out.println("The number is 10."); num++; } If문의 조건문(Boolean_Expression)이 참이면 if문 안에 있는 code가 실행됩니다. ② If-else문 if(Boolean_Expression){ Action1 // execute only if true } else { Action2 // execute only if fa..

Flow of Control이란? Program의 instruction이 실행되는 순서입니다. (Instruction - machine language에서의 코드 한 줄을 의미) ① Sequence 다음 instruction(code)로 그냥 넘어갑니다. Program의 defualt 값 입니다. ② Branching or Selection 두 선택지 중에 하나를 선택하게 됩니다. - 다음 instruction(code)로 넘어갈지, - 다른 instruction으로 jump할지 선택합니다. Ex) if, if-else, switch etc. https://yyyeji.tistory.com/323 [JAVA] If 문이란? If문이란? If의 뜻은 '만약에'입니다. 이처럼 if문은 조건문에 따라 결과가 ..

Pipelining 5 Step IF ID EX MEM WB Pipelining에서는 control signal을 ID step에서 모두 발생시킵니다. 각각의 Step에서 쓰이는 control signal들만 쓰이고, 안 쓰인 control signal은 forwarding 시킵니다. IF - Instruction fetch ID - Instruction decode EX - Exectue MEM - Memory access WB - Write back ◡̈

↓↓↓ BEQ Control unit ↓↓↓ • RegDst(Register Destination) - X beq instruction format은 register에 값이 저장되지 않기 때문에 어떤 값이 들어오든 상관 없습니다. • RegWrtie(Register Write) - 0 Register에 값이 저장할 필요가 없기 때문에 MUX의 값을 0으로 발생시켜야 됩니다. • ALUSrc(ALU Source) - 0 ALU에서 필요한 두 번째 source가 register에서 읽어진 값이기 때문에 MUX의 값을 0으로 발생시켜야 됩니다. • ALUop(ALU operation) - sub 첫 번째 source와 두 번째 source을 빼야되기 때문에 ALUop를 sub 값으로 발생시킵니다. • MemW..

↓↓↓ SW Control unit ↓↓↓ • RegDst(Register Destination) - X sw instruction format은 register에 값이 저장되지 않기 때문에 어떤 값이 들어오든 상관 없습니다. • RegWrtie(Register Write) - 0 Register에 값이 저장할 필요가 없기 때문에 MUX의 값을 0으로 발생시켜야 됩니다. • ALUSrc(ALU Source) - 1 ALU에서 필요한 두 번째 source가 SignExt을 지나와야 되기 때문에 MUX의 값을 1로 발생시켜야 됩니다. • ALUop(ALU operation) - add 두 번째 source와 immediate 값을 더해야되기 때문에 ALUop를 add의 값으로 발생시킵니다. (주소값 계산) ..

↓↓↓ LW Control unit ↓↓↓ • RegDst(Register Destination) - 0 lw instruction format은 destination이 [20:16] bit에 존재합니다. 그렇기 때문에 MUX의 값을 0로 발생시켜야 됩니다. • RegWrtie(Register Write) - 1 Data memory에서 fetch한 값을 Register에 저장해야 되기 때문에 MUX의 값을 1로 발생시켜야 됩니다. • ALUSrc(ALU Source) - 1 ALU에서 필요한 두 번째 source가 SignExt을 지나와야 되기 때문에 MUX의 값을 1로 발생시켜야 됩니다. • ALUop(ALU operation) - add 두 번째 source와 immediate 값을 더해야되기 때문..

↓↓↓ R-type Control unit ↓↓↓ • RegDst(Register Destination) - 1 R-type instruction format은 destination이 [15:11] bit에 존재합니다. 그렇기 때문에 MUX의 값을 1로 발생시켜야 됩니다. • RegWrtie(Register Write) - 1 ALU에서 계산된 값을 Register에 저장해야 되기 때문에 MUX의 값을 1로 발생시켜야 됩니다. • ALUSrc(ALU Source) - 0 ALU에서 필요한 두 번째 값이 register에서 읽어진 값이기 때문에 MUX의 값을0으로 발생시켜야 됩니다. • ALUop(ALU operation) - Dependent on operation • add - OP(and) • sub..