본문 바로가기
Computer Architecture/컴퓨터구조[05]

[CA] Lecture #17

by leziwn.cs 2023. 11. 7.
1. IF: Instruction Fetch

1. IF: Instruction Fetch

  • Instruction memory
  • Program counter (PC)

: PC가 가리키는 메모리 주소에 저장된 instruction이 수행되고, PC값이 (PC+4)로 증가한다.

 

R-Format: ALU Operations

R-Format: ALU Operations

R-format의 ALU operation에서는 ALU 단계에서, Register File에 어떤 일이 일어날까?

예) add x2, x1, x0     // x2 = x1 + x0

  • Read Register 1: rs (첫 번째 source) --> Read Data 1: 첫 번째 source의 register 값
  • Read Register 2: rt (두 번째 source) --> Read Data 2: 두 번째 source의 register 값
  • Write Register: rd (destination) --> Write Data: 결과 값이 쓰인다.

 

Load/Store Instructions

Load/Store Instructions

Load/Store instruction에서는 MEM 단계에서, Data Memory와 Immediate Generation에 어떤 일이 일어날까?

예) lw x1, offset_value(x2)    // (x2 + offset)의 메모리 위치에 있는 값을 레지스터 x1에 저장(load)한다.

예) sw x1, offset_value(x2)   // 레지스터 x1의 값을 (x2 + offset)의 메모리 위치에 저장(store)한다.

 

▶ Data Memory

  • lw: Data Memory에서 (x2 + offset)의 메모리 위치에 있는 값을 읽는다. (MemRead = 1)
  • sw: Data Memory에서 (x2 + offset)의 메모리 위치에 값을 쓴다. (MemWrite = 1)

▶ Immediate Generation

 

 

 

 

 

출처: 이화여자대학교 윤명국교수님 컴퓨터구조

'Computer Architecture > 컴퓨터구조[05]' 카테고리의 다른 글

[CA] Lecture #19  (0) 2023.11.09
[CA] Lecture #18  (0) 2023.11.08
[CA] Lecture #16 - Ch4: The Processor  (0) 2023.11.05
[CA] Lecture #12  (0) 2023.10.24
[CA] Lecture #11  (0) 2023.10.07