본문 바로가기
csapp

4.2.5 Memory and Clocking

by 정구지개발자 2023. 5. 4.
728x90
  • In hardware, a register is directly connected to the rest of the circuit by its input and output wires.

  • In machine-level programming, the registers represent a small collection of addressable words in the CPU, where the addresses consist of register IDs.
  • A key point is that the registers serve as barriers between the combinational logic in different parts of the circuit.

 

  • This register file has two read ports, named A and B, and one write port, named W.
  • The register file is not a combinational circuit, since it has internal storage.
  • When dstW is set to the special ID value 0xF, no program register is written.

 

4.3 Sequential Y86-64 Implementations

4.3.1 Organizing Processing into Stages

1. Fetch :      The fetch stage reads the bytes of an instruction from memory, using the program counter (PC) as the memory address.

2. Decode  : Thedecodestagereadsuptotwooperandsfromtheregisterfile,giving values valA and/or valB.

3. Execute :  In the execute stage, the arithmetic/logic unit (ALU) either performs the operation specified by the instruction (according to the value of ifun), computes the effective address of a memory reference, or increments or decrements the stack pointer.

4. Memory : The memory stage may write data to memory, or it may read data from memory.

5. Write back :  The write-back stage writes up to two results to the register file.

6. PC update :  The PC is set to the address of the next instruction.

728x90

댓글