CS/컴퓨터구조

Control Unit Operation

young_3060 2022. 6. 2. 20:17
728x90

 

Fetch - 4 Registers


MAR (Memory Address Register)

address bus와 연결되어있고 명령어 read/write할 주소를 명시함

 

MBR (Memory Buffer Register)

data bus와 연결되어있고 write할 데이터나 읽은 데이터를 가진다

 

PC (Program Counter)

fetch될 다음 명령어의 주소를 가진다

 

IR (Instruction Register)

fetch된 명령어를 가진다

 

[Fetch Sequence]

  1. PC에 다음 명령어의 주소가 있으므로 MAR에 PC의 내용이 복사된다.
  2. MAR은 address bus와 연결되어있으므로 address bus에 주소가 존재되고
  3. Control Unit이 READ 명령 수행, 그 결과는 data bus로 간다.
  4. data bus의 data는 MBR로 복사되고
  5. PC는 I(Instruction length)만큼 증가, 병렬적으로 data가 memory로부터 fetch된다.
  6. data(Instruction)가 MBR에서 IR로 이동, MBR은 이제 새로운 data fetch가 가능해진다.

 

time sequence로 나타내보면

t1 MAR <- (PC) 또는 t1 MAR <- (PC)
t2 MBR <- Memory
PC <- PC + 1
t2 MBR <- Memory
t3 IR <- (MBR) t3 PC <- (PC) + 1
IR <- (MBR)

()는 Content를 나타낸다

 

Clock Cycle Grouping할때는 충돌을 피해야한다!

즉, 동시에 같은 register을 read&write할 수 없다

 

+PC증가에대해

1. ALU 사용 : 추가적인 micro-operations가 필요함

2. 자체적 PC증가 (incremental circuit)

 

 

Indirect Cycle


Assume one-address instruction format

 

 

Execute Cycle


[ADD]

ex) ADD R1, X : location X의 content를 Register 1과 더하고 결과값을 R1에 저장한다는 뜻

t1  MAR <- (IR(Address)) : X의 address
t2 MBR <- Memory
t3 R1 <- (R1) + (MBR)

 

[ISZ]

ex) ISZ X : zero일 경우 increment & skip

t1 MAR <- (IR(Address)) t1 ~ t3가 increment 명령
X <- X + 1
t2 MBR <- Memory
t3 MBR <- (MBR) + 1
t4 Memory <- (MBR)
If (MBR) == 0 then PC <- (PC) + 1
PC <- (PC) + 1가 skip 명령

+ "IF"는 single micro-operation이다

+ Micro-operations는 t4에서 이뤄짐

+ X는 memory location이며 명시적으로 micro-OP에서 사용되지않는다

 

[BSA]

ex) BSA X : Branch and save address 즉, BSA의 instruction 주소가 X에 저장됨

+ X는 memory location, return 주소를 여기에 저장함

+ Execution은 X + I 로 계속됨

t1 MAR <- (IR(Address))
MBR <- (PC)
// MAR에 X 주소 저장
// MBR에 명령어 주소 저장
t2 PC <- (IR(Address))
Memory <- (MBR)
// PC <- X
// X의 명령어 주소 저장
t3 PC <- (PC) + I // PC <- X + I

 

 

 

728x90

'CS > 컴퓨터구조' 카테고리의 다른 글

Internal Memory  (0) 2022.04.22
External Memory  (0) 2022.04.21
Chapter 1 ) Basic Concepts and Computer Evolution  (0) 2022.03.23