본문 바로가기

카테고리 338

3. Computer Arithmetic Computer Arithmetic 1950년대의 computer design은 더빠른 컴퓨터를 만들기 위해서 faster ALU을 위한 algorithm과 implementation에 초점을 두었다. Computer Arithmetic은 1960년대 거의 완성되었고, 그로부터 조금씩 발전되는 형태이다. 과거에는 ALU을 직접 개발해서 사용하였지만, 오늘날에는 ALU을 지적재산처럼 구매해서 사용한다. Computer arithmetic은 크게 3가지로 구분할 수 있다. Integer arithmetic Floating-point arithmetic Multimedia arithmetic 2021. 5. 16.
2. Compile, Link, Run Compile 프로그램 개발 Program은 여러 source file들로 구성되어 있다. Develop : 각 모듈로 나눠서 개발을 진행한 후 Compile : 각 모듈은 compile을 object file을 생성한다. Linking : 만들어진 object file들을 합쳐서 하나의 executable file을 생성한다. Compile 과정과 linking 과정을 합쳐서 compile이라고도 한다. Compile Compiler는 program(source code)을 machine instruction으로 변환한다. 만들어진 object file에는 다음과 같은 정보가 담겨있다. Header object module의 내용을 담고 있다. 이름, text size, data size 등 Text .. 2021. 5. 9.
2. MIPS : Runtime Environment Runtime Environment Program execution model을 구현한 것이다. 프로그램 실행을 위해서 register와 memory를 어떻게 사용하는가를 말한다. 이는 processor designer가 독자적으로 결정할 수 있는 것이 아니다. CPU, OS, compiler, 주요 application designer(programmer)들의 협의에 결정된다. 즉, 많은 HW-SW interaction을 다룬다. Register Register의 이름은 대부분 프로그램 실행, procedure call/return과 관련되어 붙어진 것이다. Memory 각 프로세스는 아래와 같은 2GB의 process virtual address space을 가진다. Stack Automatic st.. 2021. 5. 9.
2. MIPS : Non-Leaf Procedure Non-Leaf Procedure 자신도 어떤 함수에서 call되는 callee이며, return 되기 전에 다른 함수를 호출한다. => Nested call을 수행한다. => callee이면서 caller인 procedure 다른 procedure을 call하기 전에 자신의 caller에게 받았던 $a, $ra을 stack에 저장하고, call이 끝나면 다시 복원해야 한다. $a, $ra $a, $ra, $s, local variables의 각 개수는 컴파일러가 알고 있다. Caller (선택) $a : argument register 저장 → 자신에게 넘어온 것만 저장 (필수) $ra : return address 저장 → 무조건 저장 Callee (선택) $s : saved register 저장 →.. 2021. 5. 9.
2. MIPS : Program Execution Program Execution 프로그램의 실행은 abstraction level의 관점에서 크게 2가지로 분류할 수 있다. Abstraction Level Abstraction level은 HLL과 ISA로 나뉜다. HLL(High-Level Language) 생산성을 높이기 위한 interface machine language의 interface ISA HW/SW interface Program Execution Abstraction level에 따라 아래처럼 나뉠 수 있다. 결국 HLL의 관점에서 프로그램의 실행은 procedure call-return의 반복으로 볼 수 있다. HLL 관점 statement, function이 하나씩 실행되는 과정 * statement, function : HLL의.. 2021. 4. 22.