logical.pdf - COMP-273 Logical and Shift Operations Kaleem...

Info icon This preview shows pages 1–8. Sign up to view the full content.

Slides From Patterson’s 61C 1 COMP-273 COMP-273 Logical and Shift Operations Kaleem Siddiqi
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Slides From Patterson’s 61C 2 COMP-273 Overview ° Logical Instructions ° Shifts
Image of page 2
Slides From Patterson’s 61C 3 COMP-273 Bitwise Operations (1/2) ° Up until now, we’ve done arithmetic ( add , sub,addi ), memory access ( lw and sw ), and branches and jumps. ° All of these instructions view contents of register as a single quantity (such as a signed or unsigned integer) ° New Perspective : View contents of register as 32 bits rather than as a single 32-bit number
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Slides From Patterson’s 61C 4 COMP-273 Bitwise Operations (2/2) ° Since registers are composed of 32 bits, we may want to access individual bits (or groups of bits) rather than the whole. ° Introduce two new classes of instructions: Logical Operators Shift Instructions (we’ve seen sll already)
Image of page 4
Slides From Patterson’s 61C 5 COMP-273 Logical Operators (1/4) ° Two basic logical operators: AND: outputs 1 only if both inputs are 1 OR: outputs 1 if at least one input is 1 ° In general, can define them to accept >2 inputs, but in the case of MIPS assembly, both of these accept exactly 2 inputs and produce 1 output Again, rigid syntax, simpler hardware
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Slides From Patterson’s 61C 6 COMP-273 Logical Operators (2/4) ° Truth Table: standard table listing all possible combinations of inputs and resultant output for each ° Truth Table for AND and OR A B AND OR 0 0 0 1 1 0 1 1 0 1 1 1 0 0 0 1
Image of page 6
Slides From Patterson’s 61C 7 COMP-273 Logical Operators (3/4) ° Logical Instruction Syntax: 1 2,3,4 where
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

Image of page 8
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '09
  • Vybihal

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern