Computer Architecture75 [컴퓨터구조] 2. Instructions: Language of the Computer (4) Representing Instructions ▶ Instructions are encodede in binary. (machine code) ▶ MIPS instructions: Encoded as 32-bit instruction words. ▶ Register numbers : Each register has its unique number. --> Binary number --> Hexadecimal number MIPS R-format Instructions add rd, rs, rt sub rd, rs, rt rs: source 1, rt: source 2, rd: destination shamt: shift amount op: operation code (opcode), funct: func.. 2023. 9. 25. [CA] Lecture #08 Unsigned Numbers 2s-Complement Signed Integers Signed Negation 숫자 뒤집기 +1 부호 붙이기 Sign Extension + --> 0 - --> 1 Representing Instructions : Assembly language --> Binary number RISC-V instructions: Encoded as 32-bit instruction words. Hexadecimal RISC-V R-format Instructions add destination, source 1, source 2 sub destination, source 1, source 2 ▶ function 7, function 3, opcode: Instruction 결정 ▶ r.. 2023. 9. 25. [컴퓨터구조] 2. Instructions: Language of the Computer (3) Data Directives (명령어) Q. malloc (memory allocation)? malloc은 C 및 C++ 프로그래밍 언어에서 메모리를 동적으로 할당하는 함수입니다. "malloc"은 "memory allocation"의 줄임말로, 프로그램 실행 중에 필요한 메모리 공간을 할당하는 데 사용됩니다. 메모리 할당은 데이터 구조를 생성하거나 가변 크기의 데이터를 저장하기 위해 매우 유용합니다. malloc 함수는 특정 크기의 메모리 블록을 할당하고 그 블록의 시작 주소를 반환합니다. 이 할당된 메모리 블록은 프로그램이 사용되는 동안 유지되며, 사용이 끝나면 해제해야 합니다. 메모리 누수를 방지하기 위해 free 함수를 사용하여 할당된 메모리를 해제할 수 있습니다. malloc 함수의 기본 원형.. 2023. 9. 25. [CA] Lecture #07 Instruction : The words of a computer's language. - Instruction Set: vocabulary Different computers have different instruction sets. Early computers had very simple instruction sets. Many modern computers also have simple instruction sets. We will study RISC-V instruction set in this course. The RISC-V Instruction Set Stored-Program Concept Arithmetic Operations : Add and subtract, three operand.. 2023. 9. 25. [CA] Lecture #06 CPU Clocking Clock period: Duration of a clock cycle. Clock frequency (rate): Cycles per second. Order of Magnitude (규모) CPU Time (CPU Performance) CPU Time = CPU Clock Cycles x Clock Cycle Time CPU Time = CPU Clock Cycles / Clock Rate --> Performance is improved by: CPU Clock Cycles 수 ↓ Clock Rate ↑ (= Clock Frequency ↑) 예) 3Ghz --> 4Ghz CPU Performance - Example Instruction Count & CPI Clock C.. 2023. 9. 19. [컴퓨터구조] 2. Instructions: Language of the Computer (2) MIPS RISC vs. CISC RISC: Reduced Instruction Set Computer CISC: Complex Instruction Set Computer MIPS R2000 CPU and FPU CPU Two coprocessors: Coprocessor 0, Coprocessor 1 CPU (Central Processing Unit) ALU(Arithmetic Logic Unit): Performs arithmetic and logic operations. Control unit: Extracts instructions from memory and decodes and executes them, calling on the ALU when necessary. Registers ▶ M.. 2023. 9. 18. [CA] Lecture #05 Inside the Processor (CPU) Datapath: Performs operations on data. Control: Sequences datapath, memory, and more. Cache memory: Small fast SRAM memory for immediate access to data. Abstractions Abstraction (추상화) --> Abstraction helps us deal with complexity. ISA(Instruction Set Architecture): HW/SW interface ABI(Application Binary Interface): ISA + system software interface Implementation: instru.. 2023. 9. 16. [CA] Lecture #04 Chapter 1: Computer Abstractions and Technology Classes of Computers Personal computers (PCs) Server computers (Network Based) Super computers (Type of Server) Embedded computers All The Common Size Terms What You Will Learn? How programs are translated into the machine language? The hardware/software interface. (ISA) What determines program performance? How hardware designers improve performanc.. 2023. 9. 13. [컴퓨터구조] 2. Instructions: Language of the Computer (1) Compiler - Assembler - Linker - Loader Compiler: C program --> Assembly language program **Assembly language: A symbolic form of what the machine understand. Assembler: Assembly language program --> Object file **Object file: A combination of machine language instructions, data and information needed to place instructions properly in memory. Linker: Independently assembled machine language --> E.. 2023. 9. 13. 이전 1 ··· 3 4 5 6 7 8 9 다음