Abstraction
- A digital circuit inside CPU that is responsible to carry arithmetic operation like addition and multiplication etc
- ALU takes in operand_1 and operand_2 that are required to carry out the arithmetic operation and it also takes in Opcode which tells the ALU what arithmetic operation to carry out
- Besides outputting the result of the arithmetic operation, the ALU also outputs a status bit, known as a flag, to summarise the operation, such as indicating overflow
MIPS ALU
Non-branch Instruction
- 4 bits are used for
ALUcontrol
Branch Instruction
PCSrc
is0
for not taking a branch and1
for taking a branch.isZero?
flag is also used to determine the value ofPCSrc
.isZero?
is1
when a branch should take place
ALUSrc
is0
, even though branch instruction is an I-type instruction.The branch target address isn’t calculated by the ALU!