| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 
                            Tags
                            
                        
                          
                          - ChatGPT
 - Machine Learning
 - deep learning
 - 티스토리챌린지
 - PCA
 - LG Aimers
 - OpenAI
 - supervised learning
 - 분류
 - LG
 - gpt
 - 지도학습
 - LLM
 - 해커톤
 - Classification
 - AI
 - 오블완
 - 머신러닝
 - 딥러닝
 - GPT-4
 - regression
 - 회귀
 - LG Aimers 4th
 
                            Archives
                            
                        
                          
                          - Today
 
- Total
 
SYDev
[컴퓨터 구조] Lecture 12: The Processor 본문
경희대학교 김정욱 교수님의 컴퓨터 구조 강의 내용을 기반으로 한 정리글
Processor: 컴퓨터를 실행하는 연산을 수행하는 intergrated electronic circuit

Datapath of the Processor
- Fetch stage, Decode stage, Execut stage로 나뉨 -> stage들은 반복된다.
 

Fetch stage
- Fetch -> 꺼낸다는 의미
 - 다음 명령어 -> 메모리 어드레스로부터 꺼내짐
 - fetch operation의 끝에서 -> program counter는 다음 명령어(다음 cycle에서 읽힐 명령어)를 가리킨다.
 

Decode stage
- 인코딩된 명령어는 디코더에 의해 해석된다.
 

Execute stage
- 명령어가 무엇인지에 따라 -> 명령어가 요구하는 action을 수행
 

- Branch Instruction: PC를 pc + 4가 아니라 branch로 변경
 - R format Instruction: read1과 read2를 피연산자로 인식하여 ALU에서 연산처리한 output을 그대로 data로 저장
 - I format Instruction(sw, lw): register 3개를 한 번에 const로 인식하여 ALU에 전달 -> ALU에서는 base address(첫 번째 피연산자)와 const의 연산 결과(데이터가 저장된 주소)를 data memory에 전달 -> data memory에서는 해당 주소에 저장된 데이터를 다시 register에 전달(lw), 혹은 해당 주소에 전달받은 데이터를 저장(sw)
 
Problem-Two different sources can meet -> sloution: Multiplexor(Controller)

Logic Design Basics
Datapath는 다음 두 가지 타입의 logic elements를 가진다.
- Combinational element: 현재의 inputs에 의해서만 ouput 결정-> 입력이 주어지면 바로 아웃풋
 - ex) AND gate, Adder, Multiplexer, ALU, etc.
 - State element: 데이터를 저장하기 위해 사용. inputs와 internal state의 contents에 의해서 output 결정
 

-> 클락 시그널이 라이징 엣지일 때의 D값 받아서 Q에 저장. 새로운 Rising edge가 나올 때까지 Q값 유지
Clocking Methodology
- Clocking Methodology: 언제 신호를 쓰고 읽을 수 있을지 결정
 - Edge-triggered clocking: clock이 0에서 1로(rising edge) -> Update
 

Building Datapath (R-format)
Datapath elements
- Instruction memory: address가 주어지면, 프로그램의 instruction을 저장하고(instruction은 바로 다음 명령어로 갱신되기 때문) instructions를 제공하는 역할
 - Program counter(PC): 현재 실행되고있는 프로그램의 명령어를 포함하는 레지스터
 - Adder
 

Instruction Fetch
- Instruction을 꺼내고, pc를 증가시키는 역할
 

Register file
Input
- 2 read ports, 1 write port, 1 data
 
ouput
- read register에 따른 32bits contents 레지스터
 
Regwrite
- clock edge에서 데이터를 write(edge-triggered)
 

ALU
Input
- two 32-bit inputs
 
ouput
- 1-bit signal -> if result is zero
 - 레지스터의 write data(32bits)
 
ALU operation(4-bits)
- 16 operations -> 16가지의 operations
 

Building Datapath (I-format) - Load/Store
Data memory
Input
- Address & Write data
 
Output
- Address에 위치한 read data
 
Read & Write controls는 별개
- Register file과 달리 datamemory는 read signal이 필요 -> 유효하지 않은 주소의 reading value는 문제를 일으킬 수 있음
 

Sign extension unit
- 16bits의 인풋(signed offset)과 32bit-base register를 더하기 위해 필요한 과정
 - 16bits의 offset을 32bit로 변환 -> ex) 1111 -> 0000 1111(X) -> 1111 1111(O)
 

Building Datapath (I-format) - Branch(beq)
beq $t1, $t2, offset
- ALU: branch condition을 평가하기 위해 사용됨
 - Adder: ouput -> branch target
 - Branch 변위: (PC + 4) + 320bits (16bits에서 sign extend된 상태) + sll 2-bits
 

728x90
    
    
  반응형
    
    
    
  '3학년 1학기 전공 > 컴퓨터 구조' 카테고리의 다른 글
| [컴퓨터 구조] Lecture 14: The Processor - Part3 (0) | 2024.05.20 | 
|---|---|
| [컴퓨터 구조] Lecture 13: The Processor - Part2 (0) | 2024.05.20 | 
| [컴퓨터 구조] Lecture 11: Arithmetic for Computers (0) | 2024.04.21 | 
| [컴퓨터 구조] Lecture 10: Arithmetic for Computers (0) | 2024.04.19 | 
| [컴퓨터 구조] Lecture 09: Arithmetic for Computers (0) | 2024.04.13 |