일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
- Codility
- 백준
- c++
- react
- 알고리즘
- 강화학습
- grid
- SK바이오사이언스
- stl
- c
- Photoshop
- skt membership
- 포토샵
- 통신사할인
- CSS
- pandas
- 미디어 쿼리
- REM
- Gap
- JSX
- 소수
- transform
- 상태
- spring
- 확률
- float
- 반응형 웹
- box-sizing
- 수학
- Javascript
- Today
- Total
목록CS/컴퓨터 구조 (18)
sliver__
Conditional branch register1, 2가 같으면 Label L1으로 이동해라. beq register1, register2, L1 register1, 2가 같지 않으면 Label L1으로 이동해라. bne register1, register2, L1 Quiz) 아래 수식을 assembly language로 바꾸면? if (i == j) f = g + h; else f = g – h; ==> bne $s3,$s4,Else # go to Else if i ≠ j add $s0,$s1,$s2 # f = g + h (skipped if i ≠ j) j Exit # go to Exit Else:sub $s0,$s1,$s2 # f = g – h (skipped if i = j) Exit: Unco..

Shift left logical format은 아래와 같다. sll $t2,$s0,4 op, fucnt : 0, rs는 사용하지 않으므로 0, rt는 destination, rd : source operand, shamt은 shift되는 bits 수 추가적인 논리 연산자 MIPS instruction 형식은 아래와 같다. and $t0,$t1,$t2 or $t0,$t1,$t2 nor $t0,$t1,$t3

MIPS register는 $s0 ~ $s7은 16 ~ 23번, $t0 ~ $t7은 8 ~ 15번이다. Quiz) 아래 식을 decimal represtation으로 표현하면? add $t0, $s1, $s2 첫 번째(0), 마지막(32) 필드는 이 명령어가 수행된다는 의미 두 번째(17) 필드는 operand 첫 번째, 세 번째(18) 필드는 operand 두 번째, 네 번째(8) 필드는 $t0, 다섯번째 필드는 사용하지 않아서 0으로 표현. 위를 machine language라 부름 MIPS Fields 문제는 위 필드보다 더 큰 숫자를 필요로 할 때 발생 Design Principle 3: Good design demands good compromises. 길이는 똑같이 유지하되 필요에 따라 데이터..

computer의 모든 정보는 binary digits(or bits)으로 구성됨 i번째 digit d는 $ d \times Base^{i} $ 로 표현 (i = 0, ...) least significant bit : 가장 오른쪽 bit (0번 째 bit) most significant bit : 가장 왼쪽 bit (31번 째 bit) !! 컴퓨터는 왜 2진법 기준일까? Computer의 signal은 on/off 처럼 2가지 형태로 구성이 되어있다. 초장기 컴퓨터는 10진법 기준으로 표현했지만 여러 bit가 사용되고 비효율적이여서 2진법을 사용하게 되었다. 잘 발생되지 않는 input/output event에서나 사용된다. 위에서 보는 것처럼 32bits 표현이지만 숫자는 무한대로 표현될 수 있고 이..

Register Design Priciple 2 : Smaller is faster. 제한된 개수로 특별한 위치의 hardware에 존재 MIPS에서 32bits. MIPS architecture에서 word 라고 부름 ( word : group of 32bits ) register와 variable의 차이? => register는 MIPS에서 32개만 존재 C에서 register를 $s0, $s1 ... $s31로 표현 Quiz) 아래 수식을 assembly language로 표현하면? f = (g+h) - (i+j); //차례대로 $s0, ..., $s4 ==> add $t0, $s1, $s2 add $t1, $s3, $s4 sub $s0, $t0, $t1 Memory operand data stru..

MIPS notation => add a, b, c : b와 c를 더해 a에 저장해라 그러면 a = b + c + d + e 는? add a, b, c add a, a, d add a, a, e 한 줄에 하나의 명령어를 가질 수 있다. 주석도 한 줄에 끝나야 한다. 피 연산자는 항상 3개. Design Principle 1 : Simplicity favors regulariry Quiz 1) C language로 표현된 아래 수식을 MIPS assembly로 바꿔봐 a = b + c d = a - e ==> add a, b, c sub d, a, e Quiz2) 아래 수식을 C Compiler는 어떻게 처리할까? f = ( g + h ) - ( i + j ); add t0, g, h add t1, i, ..