일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Photoshop
- pandas
- c
- Javascript
- 알고리즘
- 상태
- Gap
- 통신사할인
- SK바이오사이언스
- CSS
- grid
- 강화학습
- 포토샵
- series
- 백준
- spring
- 에라토스테네스의 체
- skt membership
- 수학
- dataframe
- 확률
- stl
- Codility
- Design Pattern
- margin
- align-items
- 소수
- Flexbox
- Prefix Sums
- c++
- Today
- Total
목록CS/컴퓨터 구조 (18)
sliver__

A Division Algorithm and Hardware The 32-bit Quotient register set to 0. Each iteration of the algorithm needs to move the divisor to the right one digit, so we start with the divisor placed in the left half of the 64-bit Divisor register and shift it right 1 bit each step to align it with the dividend. The Remainder register is initialized with the dividend. Example) Using a 4-bit version of th..

The first operand is called the multiplicand and the second the multiplier. The final result is called the product. The 32-bit multiplicand starts in the right half of the Multiplicand register and is shifted left 1 bit on each step. The multiplier is shifted in the opposite direction at each step. The algorithm starts with the product initialized to 0. Control decides when to shift the Multipli..

Quiz) $ 6_{ten} $ 과 $ 7_{ten} $을 더하고 bits 뺀 결과는? Answer) 32- bits 기준 overflow는 두 개의 수를 더하거나 뺄 때, sign bit가 value로 필요할 때이다. Unsigned integer 경우 sign bit가 value로 사용되므로 overflow가 아니라는 것을 구분할 필요가 있다. add, addi, sub 는 overflow exception을 발생시킨다. addu, addiu, subu는 overflow exception을 발생시키지 않는다. MIPS C compiler는 arithmetic instructions을 unsigned version으로 진행한다. !! MIPS는 exception program counter(EPC) 레..

x86 Registers and Data Addressing Modes GPR : General Purpose register sets 8, 16, 32bits를 모두 지원하므로 default large size를 설정한다. 변수 중 가장 큰 사이즈로 설정하여 사용한다. x86 interger operation은 4가지로 분류됨 Data movement instructions, including move, push, and pop Arithmetic and logic instructions, including test, integer, and decimal arithmetic operations Control flow, including conditional branches, unconditional j..

Addressing Mode MIPS는 3개 Addressing mode를 지원 ARM은 9개 Addressing mode를 지원 Compare and Conditional Branch MIPS는 conditional branch를 위해 register를 사용한다. ARM은 word의 condition bits가 존재한다. (negative, zero, carry, overflow) CMP instruction은 한 operand에서 다른 operand를 빼서 확인한다. CMN(Compare negative)은 하나의 operand와 다른 operand를 더한 값으로 condition code를 설정한다. TST는 Logical AND. TEQ는 exclusive OR. ARM은 처음 4bits를 통해 ..
Array Version of Clear clear1(int array[], int size) { int i; for (i = 0; i < size; i += 1) array[i] = 0; } clear2(int *array, int size) { int *p; for (p = &array[0]; p < &array[size]; p = p + 1) *p = 0; } 를 assembly code로 바꾸면? # array : $a0, size : $a1, i : $t0 move $t0, $zero loop1 : sll $t1, $t0, 2 add $t2, $a0, $t1 sw $zero, 0($t2) addi $t0, $t0, 1 slt $t3, $t0, $a1 bne $t3, $zero, loop1 Poi..