1 / 7

Logical Instructions

Logical Instructions. And rd rs rt Nor rd rs rt Or rd rs rt Xor rd rs rt Andi rt rs Imm Ori rt rs Imm Xori rt rs Imm Careful: Immediate variants Zero-extend. Logic Truth Tables. How to Invert Each Bit?. Nor fuction A B C 0 0 1 0 1 0 1 0 0 1 1 0. (One's complement)

nysa
Download Presentation

Logical Instructions

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. Logical Instructions • Andrd rs rt • Norrd rs rt • Orrd rs rt • Xorrd rs rt • Andirt rs Imm • Orirt rs Imm • Xorirt rs Imm • Careful: Immediate variants Zero-extend

  2. Logic Truth Tables

  3. How to Invert Each Bit? Nor fuction A B C 0 0 1 0 1 0 1 0 0 1 1 0 (One's complement) • Nor rd rs $0 • This is not! A 1 C=A' B=0

  4. Shift Instructions Logical shift left Logical shift right A B C D A B C D lost 0 lost 0 B C D 0 0 A B C

  5. Shift Instructions • Arithmetic shift right A B C D lost A A B C

  6. Shift Instructions • Sllrd rt expr Srard rt expr Srlrd rt expr • rd := rt shifted by expr (0..31) • Sllvrd rt rs Sravrd rt rs Srlvrd rt rs • rd := rt shifted by rs (variable)

  7. Rotate Instructions Rotate left Rotate right A B C D A B C D B C D A D A B C

More Related