본문 바로가기
[컴퓨터구조] #6. MIPS 명령어(6) Lec 6. MIPS Instructions_6 (Language of the Computer) - Why Branch? : non-sequential flow, condition에 따른 decision 가능, 함수 호출/리턴 가능, loop (if-else, case, for, while) -> 조건에 따라, 순차적으로 갈 지/분기할 지 결정할 수 있음. 명령어의 길이가 4byte 이므로, 순차적으로 진행할 때는 PC값이 4씩 증가함. 하지만 branch를 하면 PC가 skip over sections of code 하거나 go back to repeat the previous code 함. - Branch 의 종류 Conditional branch : branch only if the test is .. 2022. 3. 26.
[컴퓨터구조] #5. MIPS 명령어(5) Lec 5. MIPS Instructions_5 (Language of the Computer) - MIPS Logical Instructions : 논리 연산 명령어 and, andi, or, ori, xor, nor 등등 source 전체가 몇 bit이든 간에 논리연산은 1bit끼리 연산함. - and : useful for masking bits 마스킹 - or : useful for combining bit fields 결합 - nor : useful for inverting bits 반전 - and, or, nor : R-format instruction and(or, nor) rd, rs, rt - andi, ori : I-format instruction andi(ori) rt, rs, im.. 2022. 3. 23.
[컴퓨터구조] #4. MIPS 명령어(4) Lec 4. MIPS Instructions_4 (Language of the Computer) - Constant Zero : MIPS register 0 ($zero) is the constant 0 CPU가 메인 메모리에 접근(읽기/쓰기)해서 프로그램 실행함. 즉, Instruction read 와 Data read/write 를 위해 CPU가 메인 메모리에 접근함. (용량제한 때문에 데이터를 전부 CPU내부 레지스터에 담을 수 없기 때문) - Instruction Access (Read) Program Counter (PC) : 실행중인 명령어의 메모리 주소값을 담고있는 특별 레지스터(32개의 일반 레지스터랑 별개의 레지스터). 모든 CPU는 special register를 가짐. PC는 컴퓨터가.. 2022. 3. 19.
[컴퓨터구조] #3. MIPS 명령어(3) Lec 3. MIPS Instructions_3 (Language of the Computer) - Data Transfer Instructions : CPU는 제한된 수의 레지스터를 가지고 있음. (MIPS는 일반 레지스터 32개) 그래서 CPU는 레지스터에 적은 양의 데이터만 보관 가능. -> 데이터를 메모리에 담아두자! -> transfer data between memory and registers 하는 명령어 필요함!! => 그러한 명령어를 data transfer instructions 라고 부름. 레지스터는 32개밖에 없기때문에 각 레지스터마다 register name이 있어서 구분 가능, 메모리는 훨씬 크기때문에 각각의 name은 없고 memory address로 접근해야함. - Memor.. 2022. 3. 17.
[컴퓨터구조] #2. MIPS 명령어(2) Lec 2. MIPS Instructions_2 (Language of the Computer) - MIPS Arithmetic Instructions : add, sub, addi, addiu, mult, div - Levels of Program Code High-level language : productivity, protability(이식성 : 타깃 하드웨어의 instruction set을 신경 쓸 필요 x ) Assembly language : textual, symbolic Machine code (object code or binary) : binary bits of instructions and data - High-Level Code is Portable : 어떤 CPU에서 어떻게 돌아.. 2022. 3. 11.
[컴퓨터구조] #0~1. 소개, MIPS 명령어(1) Lec 0. Course_Intro - Abstraction 추상화 : Hardware -> Instruction Set -> Operationg System -> Programming - Computer System : CPU, Main Memory, Disk, Chip Set - Goal 수업 목표 : Understand How Your Computer Works Really! MIPS라는 CPU에 대해 배울 예정. - programability : 한가지 하드웨어로 여러 가지 애플리케이션 실행 가능한 CPU Lec 1. MIPS Instructions_1 (Language of the Computer) - Instructions 명령어 - Instruction Set Architecture (ISA.. 2022. 3. 5.