Jumps and Branches
- All Branches are performed with slt, beq, bne
- How?
- == and != are easy
- How about <
- Just slt, beq
- How about <=
- How about >, >=
- SLT
- How could we implement this operation?
- Where would we implement this operation?
- BEQ, BNE
- How could we test for equality?
- Where would we implement this?
- Branches are pc relative
- Look at the instruction, what is the possible addressable space?
- Remember, instructions must be on word aligned boundaries.
- So a 16 bit address becomes a 18 bit address padding with 00
- Where do the other bits for the address come from?
- Look at the picture on 263
- Why the shift left 2
- Why add to the pc?
- When is the value of PCSrc set?
- How do we decided if we are taking a branch?
- Look at the picture on the next page
- It is really easy to decide if an operation has produced all zeros
- Just or the 32 bits of the result.
- Jump
- Look at the picture on page 271
- How is jump implemented? (It is not where you think.)
- What are the limitations due to jumping this way?
- When would the JUMP control line be lit?
- Just for completeness
- Using the image on 264 (or any other)
- What is the value of the control lines for lw, sw, add, addi