Datapath Elements


A datapath element is a unit used to operate on or hold data within a processor. The elements include:
Instruction Memory
The instruction memory, a state element, need only provide read access because the datapath does not write instructions. (We will need to write the instruction memory when we load the program.)

Since the instruction memory only reads, we treat it as combinational logic: the output at any time reflects the contents of the location specified by the address input, and no read control signal is needed.

Data Memory
The memory unit, a state element, is for reading from or writing to. It includes inputs for the address and the write data, and a single output for the read result.

There are separate read and write controls, although only one of these may be asserted on any given clock. The memory unit needs a read signal, since, unlike the register file, reading the value of an invalid address can cause problems. The control lines, memory read and memory write in this case, are in blue color.

Program Counter
The program counter is a 32-bit register that holds the address of the current instruction. It is written at the end of every clock cycle and thus does not need a write control signal.



      “Simple can be harder than complex:    
      You have to work hard to get your thinking clean to make it simple.    
      But it’s worth it in the end because once you get there,    
      you can move mountains.”    
      ― Steve Jobs