Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.2 KB

CPUstates.md

File metadata and controls

32 lines (23 loc) · 1.2 KB

CPU state documentation

  • halt: This is an error state in which the CPU will do nothing until reset

  • fetch: gets the next instruction from memory

    • modifies: PC incremented, stores loaded instruction in IB
    • nextstate: usually fetch_a, others for fome special instructions (IAG, RFI, HWN)
  • fetch_a: fetches the value for the a argument

    • modifies: internal a argument register, NW (NextWord, internal) or SP for some instructions
    • nextstate: fetch_b for most, nextword_a if NW is required, others for special instructions
  • nextword_a: takes care of the extra memory access using the nextword argument

    • modifies: internal a argument register
    • nextstate: whatever state fetch_a would have gon to instead of nextword_a
  • fetch_b:pretty much the same as fetch_a

  • nextword_b: pretty much the same as nextword_a

  • set_write: writes from the src to the dest

    • modifies: dest location
    • nextstate: fetch for SET, inc_ij for STI, dec_ij for STD
  • arith_write: writed the value returned by the ALU to dest

    • modifies: dest location
    • nextstate: fetch
  • inc_ij: increases I- and J-Registers by one

    • modifies: I and J (GP[6] & GP[7])
    • nextstate: fetch