1 / 8

Computer SCIENCE

Data Representation and Machine Concepts. Computer SCIENCE. Section 2.4. Instructor: Lin Chen. Sept 2013. 2 Data Manipulation. 2.4 Arithmetic/Logic Instructions. Logic Operations Rotation and Shift Operations. http://www.cs.kzoo.edu/cs108/lectures/machine-assembly.pdf.

neo
Download Presentation

Computer SCIENCE

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. Data Representation and Machine Concepts Computer SCIENCE Section 2.4 Instructor: Lin Chen Sept 2013

  2. 2 Data Manipulation 2.4 Arithmetic/Logic Instructions Logic Operations Rotation and Shift Operations http://www.cs.kzoo.edu/cs108/lectures/machine-assembly.pdf

  3. 2.4 Arithmetic/Logic Instructions Logic Operations AND 10011010 11001001 Force a 0 in some bit AND 10001000 0 AND 0 0 0 AND 1 0 1 AND 0 0 1 AND 1 1

  4. 2.4 Arithmetic/Logic Instructions Logic Operations AND Suppose we have 8 lights in the room, each one is represented with 1 bit want to check if third light is on Yellow ON Blue OFF Expressed as 00101010 Set up a mask 00100000 AND 00100000 Equals to 0, third light is off Not equals to 0, third light is on

  5. 2.4 Arithmetic/Logic Instructions Logic Operations OR 10011010 11001001 Force a 1 in some bit OR 11011011 0 OR 0 0 0 OR 1 1 1 OR 0 1 1 OR 1 1

  6. 2.4 Arithmetic/Logic Instructions Logic Operations XOR 10011010 11001001 Form the complement of a bit XOR 01010011 0 OR 0 0 0 OR 1 1 1 OR 0 1 1 OR 1 0

  7. 2.4 Arithmetic/Logic Instructions Rotation and Shift Operations Rotation 01100101 Right Rotation 10110010 01100101 Left Rotation 11001010 http://www.cs.kzoo.edu/cs108/lectures/machine-assembly.pdf

  8. 2.4 Arithmetic/Logic Instructions Rotation and Shift Operations Shift Fill with 0 at the leftmost position 01100101 Right Shift 00110010 Fill with 0 at the rightmost position 01100101 Left Rotation 11001010 http://www.cs.kzoo.edu/cs108/lectures/machine-assembly.pdf

More Related