1 / 6

Designing ALU Operations for MIPS Datapath

Learn how to tailor the ALU to support arithmetic instructions like set-on-less-than (slt) in the MIPS datapath. Implement operations for subtraction, equality tests, and more to enhance your understanding of ALU design.

uriel
Download Presentation

Designing ALU Operations for MIPS Datapath

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Our ultimate goal: building the datapath

  2. Arithmetic Logic Unit (ALU) • ALU operation: • 000 = and001 = or010 = add110 = subtract111 = slt

  3. What about subtraction (a – b) ? • Two's complement approach: just negate b and add. • How do we negate? • The solution:

  4. Tailoring the ALU to the MIPS datapath • Need to support the set-on-less-than instruction slt rd, rs, rt • slt is an arithmetic instruction • produces a 1 if rs < rt and 0 otherwise • use subtraction: (a-b) < 0 implies a < b • Need to support test for equality (beq $t5, $t6, label) • use subtraction: (a-b) = 0 implies a = b

  5. Supporting slt

  6. Test for equality and complete ALU • ALU operation: • 000 = and001 = or010 = add110 = subtract111 = slt Control linesBnegate Operation Insturction0 00 and0 01 or0 10 add1 10 sub1 11 slt • Note: zero is a 1 when the result is zero!

More Related