1 Sec (2.4) Arithmetic / logic instruction:. 2 Logical operations: Ex: 10011010 XOR 11001001 01010011 10011010 OR 11001001 11011011 10011010 AND 11001001.

Slides:



Advertisements
Similar presentations
Chapter 7 Henry Hexmoor Registers and RTL
Advertisements

7-5 Microoperation An elementary operations performed on data stored in registers or in memory. Transfer Arithmetic Logic: perform bit manipulation on.
COMP3221 lec9-logical-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 9: C/Assembler Logical and Shift - I
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
Binary Logic (review) Basic logical operators: (Chapter 7 expanded)
1 Arithmetic and Logical Operations - Part I. Boolean Operations A boolean variable can only have one of the two values, i.e, can either be 1 or 0. Given.
Computer Organization & Assembly Language
Logical, Shift, and Rotate Operations CS208. Logical, Shift and Rotate Operations  A particular bit, or set of bits, within the byte can be set to 1.
Logical and Shift operations A particular bit, or set of bits, within the byte is set to 1 or 0 depending on conditions encountered during the execution.
Chapter 4 Operations on Bits
Data Manipulation Computer System consists of the following parts:
Logical & shift ops (1) Fall 2007 Lecture 05: Logical Operations.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
A bit can have one of two values: 0 or 1. The C language provides four operators that can be used to perform bitwise operations on the individual bits.
Binary Operations Math/Logical. Binary Math Decimal Addition Example ) Add = 15 Write down 5, carry ) Add 3 +
Ch. 7 Logic, Shift and Rotate instr.
MICRO OPERATIONS Department of Computer Engineering, M.S.P.V.L. Polytechnic College, Pavoorchatram.
1 Programming in Machine Language SCSC 311 Spring 2011.
Dr. José M. Reyes Álamo 1.  Review: ◦ Statement Labels ◦ Unconditional Jumps ◦ Conditional Jumps.
Operations on Bits Arithmetic Operations Logic Operations
Microprocessors Monday, Apr. 13 Dr. Asmaa Farouk Faculty of Engineering, Electrical Department, Assiut University.
BITWISE OPERATIONS – Microprocessor Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Computer Organization and Assembly Language Bitwise Operators.
REGISTER TRANSFER LANGUAGE MICROOPERATIONS. TODAY OUTLINES Logic Microoperations Shift Microoperations.
Bitwise Operators in C. Bitwise operators are used to manipulate one or more bits from integral operands like char, int, short, long.
Micro Operation. MICROOPERATIONS Computer system microoperations are of four types: - Register transfer microoperations - Arithmetic microoperations -
1 Logic, Shift, and Rotate Instructions Read Sections 6.2, 7.2 and 7.3 of textbook.
Data Manipulation, part two Introduction to computer, 2 nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Arithmetic Operations
Assembly 05. Outline Bit mapping Boolean logic (review) Bitwise logic Bit masking Bit shifting Lookup table 1.
CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS.
Arithmetic and Logic Chapter 5
Exam1 Review Dr. Bernard Chen Ph.D. University of Central Arkansas.
Chapter 7 Bit Manipulation. 7.1 Logical Operations.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Variation Functions Section 5.1. Direct Variation.
Microprocessor & Assembly Language
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 Manipulating Information (1). 2 Outline Bit-level operations Suggested reading –2.1.7~
Binary Logic (review) Basic logical operators:(Chapter 7 expanded) NOT AND – outputs 1 only if both inputs are 1 OR – outputs 1 if at lest one input is.
© 2015 Pearson Education Limited 2015 Quiz in last 15 minutes Midterm 1 is next Sunday Assignment 1 due today at 4pm Assignment 2 will be up today; due.
Chapter 4 Operations on Bits.
Programming in Machine Language
Boolean Algebra, Bitwise Operations
Overview Register Transfer Language Register Transfer
Logic Bitwise Instructions
REGISTER TRANSFER LANGUAGE
Computer Architecture & Operations I
The University of Adelaide, School of Computer Science
Computer Organization and Design
Bitwise Operators CS163 Fall 2018.
Shift & Rotate Instructions)
Logical Operations In some applications it is necessary to manipulate other sizes of data, or perhaps only individual bits. There are instructions that.
Shift & Rotate Instructions)
CS 206D Computer Organization
Logical instructions And rd rs rt Nor rd rs rt Or rd rs rt
ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS
Microprocessor and Assembly Language
Logical Instructions And rd rs rt Nor rd rs rt Or rd rs rt
CHAPTER-3 REGISTER TRANSFER LANGUAGE AND MICROOPERATIONS
Instruction execution and ALU
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Bit Manipulations CS212.
1.6) Storing Integer: 1.7) storing fraction:
CS 111 – Sept. 16 Machine language examples Instruction execution
Computer Block Diagram
Presentation transcript:

1 Sec (2.4) Arithmetic / logic instruction:

2 Logical operations: Ex: XOR OR AND

3 Mask: Suppose we have this byte we need to find a mask that being given the inverse for all digits? Sol.: XOR

4 Mask: So, note that: 1. X AND X AND 1 X 3. X OR 0 X 4. X OR X XOR 0 X 6. X XOR 1 X

5 Rotation and shift operations: The operation in the class of rotation and shift operations provide a means for moving bits within a register and are often used in solving alignment problems. These operation are classified by the direction of motion (right or left) and whether the process is circular. Within these classification guidelines are numerous variations with mixed terminology. 1. circular shift (rotation) 2. logical shift 3. arithmetic shift

6 circular shift (rotation) Ex: Rotating the bit pattern A3 one bit to the right

7 logical shift: another technique is to discard the bit that falls of the edge and always fill the hole with a 0. Ex: +437 / 8 = 437 / 23 it means that shift 3 bits to right

8 logical shift:

9 arithmetic shift: in either shift, care must be taken to preserve the sign bit when using certain notational system we often find right shifts that always fill the hole with its original value shifts that leave the sign bit unchanged Ex: +50 * 16 = 50 * 24 it means that shift 4 bits to left

10 arithmetic shift: