Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP 2610 1.

Slides:



Advertisements
Similar presentations
DAT2343 Basic Logic Gates © Alan T. Pinck / Algonquin College; 2003.
Advertisements

IN THE SUPERVISIONS OF: DR\KAMEL ALI ARRAM ENG\LAMIAA Computer Vision Course.
CDA 3100 Recitation Week 10.
©Brooks/Cole, 2003 Chapter 4 Operations on Bits. ©Brooks/Cole, 2003 Apply arithmetic operations on bits when the integer is represented in two’s complement.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Chapter 4 Gates and Circuits.
CSCI 3 Chapter 1 Data Storage. Bits  Today’s computer information is encoded as patterns of 0s and 1s.  These digits are called “bits” (binary digits)
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
Assignment 4 Sample problems. Convert the following decimal numbers to binary
Operations on data CHAPTER 4.
4 Operations On Data Foundations of Computer Science ã Cengage Learning.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
Computer Science 1000 Digital Circuits. Digital Information computers store and process information using binary as we’ve seen, binary affords us similar.
Chapter 4 Gates and Circuits. Integrated Circuits aka CHIPS What’s in this thing???? 4–2.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Directed Activity 11-Computing Logical Instructions (also known as: Logical Units) Presented by James Rudge.
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
NOCTI Review Lesson 4 Objectives:
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Basic Operators. What is an operator? using expression is equal to 9. Here, 4 and 5 are called operands and + is the operator Python language supports.
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
Islamic University Of Gaza, Nael Aburas Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas
Logic (continuation) Boolean Logic and Bit Operations.
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
CPS3340 Computer Architecture Fall Semester, 2013
Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP
13 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Logic Gates. A logic gate is an elementary building block of a digital circuit. Most logic gates have two inputs and one output. At any given moment,
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Chapter 4 Operations on Bits. Apply arithmetic operations on bits when the integer is represented in two’s complement. Apply logical operations on bits.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
CISSP Common Body of Knowledge Review by Alfred Ouyang is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Logic Gates Chapter 5 Subject: Digital System Year: 2009.
Chapter 4 Operations on Bits. Apply arithmetic operations on bits when the integer is represented in two’s complement. Apply logical operations on bits.
Microprocessor & Assembly Language
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
Logic Gates Review. Logic Gates OR gate – 1 if either input is 1 – 0 if they both are 0.
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Combinational Circuits
Logic Gates.
Chapter 4 Operations on Bits.
Computer Architecture & Operations I
Overview Register Transfer Language Register Transfer
4-1 LOGIC OPERATIONS In Chapter 3 we discussed the fact that data inside a computer is stored as patterns of bits. Logic operations refer to those operations.
Fundamentals & Ethics of Information Systems IS 201
Agenda – 2/12/18 Questions? Readings: CSI 4, P
Boolean Operations 1 and 1 = 1.
EEL 3705 / 3705L Digital Logic Design
CS-401 Computer Architecture & Assembly Language Programming
Digital Logic.
Logic Gates.
Bit-wise and bit-shift operators
GCSE Computer Science – Logic Gates & Boolean Expressions
COMS 361 Computer Organization
Introduction to Programming – 4 Operators
Chapter 4 Gates and Circuits.
Combinational Circuits
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
XOR Function Logic Symbol  Description  Truth Table 
CSE 370 – Winter Number syst.; Logic functions- 1
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Presentation transcript:

Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP

Operations on Bits So far, we have seen we can perform addition and subtraction on binary patterns Recall the meaning of ALU – arithmetic and logic unit The other set of operations is logical operations

Operations on Bits Recall that the name logical is historical in origin It refers to the fact that a bit has two values 0 and 1 These refer to false and true, respectively We consider several basic logical functions of the ALU

AND Function AND is a binary logical function It takes two source operands, and produces one result Each source is a logical values, either 0 or 1 The output of AND is 1 only if both the source values are 1 Otherwise the output is 0

AND Function A convenient way to represent the behavior of logical operation is the truth table A truth table has n+1 columns and 2 n rows The n columns refer to the source operands and the +1 refers to the output Each value has two possible values, so there are 2 n choices

AND Function ABAND

AND Function AND TrueFalse True False

AND Function We can also apply the AND operation to two bits patterns of m bits each We apply the AND function to each pair of bits in the two source operands This operation is called a bitwise AND

AND Function IF c=a AND b where a= and b= , what is c? a: b: c:

AND Function Suppose we have an 8 bit pattern called A in which only the two right-most bits are significant The computer will do one of four tasks depending on the value of these two bits How do we isolate these two bits?

AND Function We can use a bitmask to get this value The bitmask should be 1 for the bits you are interested in and 0 elsewhere So we would use the bitmask Then we apply the A AND bitmask

AND Function If A= , A: Bitmask: If A= , A: Bitmask:

OR Function OR is also a binary logical function It requires two source operand and produces one output The output of OR is only 0 if both inputs are 0 Otherwise, it is 1 We can apply the OR operation to m bits the same as the AND function

OR Function ABOR

OR Function OR ANDTrueFalse True FalseTrueFalse

OR Function Some times this is called the inclusive-OR function to differentiate it from the exclusive OR operator Let a= and b= What is c=a OR b?

OR Function a: b: c:

NOT Function NOT is a unary logical function That is, it only takes one source operand, and outputs one result This is also known as the complement operation We says the output is formed by inverting the bits

NOT Function ANOT 01 10

NOT Function We can apply the NOT function to a single m bit pattern the same way we apply it to two m bit patterns for AND and OR Let c=NOT a and a= a: c:

XOR Function The Exclusive-OR or XOR function is a binary logical function with two source operands and one result The output of XOR is 1 two sources are different Otherwise, the output is 0 We can apply this to m bit patterns as well

XOR Function ABXOR

XOR Function Let a= , b= , and find c=a XOR b a: b: c: We can use XOR to determine if two bit patterns are identical!