Execute Stage (EX)

_images/toast_EX_simple.jpg

The Execute Stage (rtl/toast_EX_stage) is comprised of the ALU and Branch Gen unit. It is responsible for muxing the correct operands into the ALU as well as determining whether a conditional branch is taken or not.

ALU:

The ALU (rtl/toast_alu) is implemented using combinatorial logic and is capable of executing 11 different operations on two operands.

  • Arithmetic/Logical: add, subtract, AND, OR, XOR

  • Shifts: Shift Left Logical, Shift Right Logical, Shift Right Arithmetic

  • Tests: Set Equal, Set Less Than, Set Less Than Unsigned

Branch Gen:

The Branch Gen unit (toast_branchgen) is implemeted using combinatorial logic and computes either a PC-relative target or register-offset target based on the control signal generated by the decoder.