CISSP Common Body of Knowledge Review by Alfred Ouyang is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Slides:



Advertisements
Similar presentations
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
Advertisements

Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
©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 Operations on Bits
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)
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.
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.
1 CSC103: Introduction to Computer and Programming Lecture No 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.
Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Islamic University Of Gaza, Nael Aburas Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas
Linear Algebra. Circuits The circuits in computers and other input devices have inputs, each of which is either a 0 or 1, the output is also 0s and 1s.
Logic Gates. The Inverter The inverter (NOT circuit) performs the operation called inversion or complementation. Standard logic symbols: 1 1 input output.
Finite State Machines This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this.
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
CS1Q Computer Systems Lecture 6 Simon Gay. Lecture 6CS1Q Computer Systems - Simon Gay2 Algebraic Notation Writing AND, OR, NOT etc. is long-winded and.
COMPUTER ARCHITECTURE TRUTH TABLES AND LOGIC GATES.
Boolean Functions and Boolean Algebra Laxmikant Kale.
Chapter 4 Operations on Bits. Apply arithmetic operations on bits when the integer is represented in two’s complement. Apply logical operations on bits.
CISSP Common Body of Knowledge Review by Alfred Ouyang is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Appendix B: Digital Logic
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Logic Simplification-Using Boolean Laws Logic Design Laboratory EE 2121 Lectures By Manesh T EE2121-In Charge
DIGITAL ELECTRONICS. Everything in digital world is based on binary system. Numerically it involves only two symbols 0 or 1. –0 = False = No –1 = True.
Microprocessor & Assembly Language
MECH 1500 Chapter 4. MECH 1500 The Binary Concept 4.1.
Logic Gates and Boolean Algebra Introduction to Logic II.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Materials on the Exam Introduction Data Representation in Computer Systems Boolean Algebra Digital Logic MARIE: An Introduction to a Simple Computer Until.
Digital Logic. Boolean Algebra to Logic Gates Logic circuits are built from components called logic gates. The logic gates correspond to Boolean operations.
Logic Gates Review. Logic Gates OR gate – 1 if either input is 1 – 0 if they both are 0.
Dr. ClincyLecture Slide 1 CS6020- Chapter 3 (3A and ) Dr. Clincy Professor of CS First Exam - Tuesday, September 6th Coverage: All subjects up to.
Boolean Algebra & Logic Gates
CPS120 Introduction to Computer Science
Digital Logic.
Morgan Kaufmann Publishers
Chapter 4 Operations on Bits.
Overview Register Transfer Language Register Transfer
Dr. Clincy Professor of CS
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.
Instructor: Alexander Stoytchev
Boolean Algebra & Logic Circuits
Dr. Clincy Professor of CS
Chapter 14 Bitwise Operators Objectives
Week 7: Gates and Circuits: PART II
CS Chapter 3 (3A and ) Part 3 of 8
Digital Logic.
Boolean Logic Boolean Logic is considered to be the basic of digital electronics. We know that a computer’s most basic operation is based on digital electronics.
A-level Computer Science
13 Digital Logic Circuits.
CS Chapter 3 (3A and ) – Part 2 of 5
GCSE Computer Science – Logic Gates & Boolean Expressions
Digital Logic.
ECB2212-Digital Electronics Boolean algebra
Dr. Clincy Professor of CS
Binary Logic.
XOR Function Logic Symbol  Description  Truth Table 
Truth tables Mrs. Palmer.
Digital Circuits.
Half & Full Subtractor Half Subtractor Full Subtractor.
Half & Full Subtractor Half Subtractor Full Subtractor.
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Presentation transcript:

CISSP Common Body of Knowledge Review by Alfred Ouyang is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. Bit Manipulation to Monitor and Control Devices

4.2 Logic operations at bit level A bit can take one of the two values: 0 or 1. If we interpret 0 as the value false and 1 as the value true, we can apply the operations defined in Boolean algebra to manipulate bits. Boolean algebra, named in honor of George Boole, belongs to a special field of mathematics called logic. Boolean algebra and its application to building logic circuits in computers are briefly discussed in Appendix E. In this section, we show briefly four bit-level operations that are used to manipulate bits: NOT, AND, OR, and XOR. Boolean algebra and logic circuits are discussed in Appendix E. i

4.3 Figure 4.1 Logic operations at the bit level

4.4 NOT The NOT operator is a unary operator: it takes only one input. The output bit is the complement of the input. The AND operator is a binary operator: it takes two inputs. The output bit is 1 if both inputs are 1s and the output is 0 in the other three cases. AND For x = 0 or 1 x AND 0 → 0 0 AND x → 0 i

4.5 OR The OR operator is a binary operator: it takes two inputs. The output bit is 0 if both inputs are 0s and the output is 1 in other three cases. The XOR operator is a binary operator like the OR operator, with only one difference: the output is 0 if both inputs are 1s. XOR For x = 0 or 1 x OR 1 → 1 1 OR x → 1 i For x = 0 or 1 1 XOR x → NOT x x XOR 1 → NOT x i

4.6 Example 4.1 In English we use the conjunction “or” sometimes to mean an inclusive-or, and sometimes to means an exclusive-or. a.The sentence “I would like to have a car or a house” uses “or” in the inclusive sense—I would like to have a car, a house or both. b.The sentence “Today is either Monday or Tuesday” uses “or” in the exclusive sense—today is either Monday or Tuesday, but it cannot be both.

4.7 Example 4.2 The XOR operator is not actually a new operator. We can always simulate it using the other three operators. The following two expressions are equivalent x XOR y ↔ [x AND (NOT y)] OR [(NOT x) AND y] The equivalence can be proved if we make the truth table for both.

4.8 Logic operations at pattern level The same four operators (NOT, AND, OR, and XOR) can be applied to an n-bit pattern. The effect is the same as applying each operator to each individual bit for NOT and to each corresponding pair of bits for the other three operators. Figure 4.2 shows these four operators with input and output patterns. Figure 4.2 Logic operators applied to bit patterns

4.9 Example 4.3 Use the NOT operator on the bit pattern Solution The solution is shown below. Note that the NOT operator changes every 0 to 1 and every 1 to 0.

4.10 Example 4.4 Use the AND operator on the bit patterns and Solution The solution is shown below. Note that only one bit in the output is 1, where both corresponding inputs are 1s.

4.11 Example 4.5 Use the OR operator on the bit patterns and Solution The solution is shown below. Note that only one bit in the output is 0, where both corresponding inputs are 0s.

4.12 Example 4.6 Use the XOR operator on the bit patterns and Solution The solution is shown below. Compare the output in this example with the one in Example 4.5. The only difference is that when the two inputs are 1s, the result is 0 (the effect of exclusion).

4.13 Applications The four logic operations can be used to modify a bit pattern.  Complementing (NOT)  Unsetting (AND)  Setting (OR)  Flipping (XOR)

4.14 Example 4.7 Use a mask to unset (clear) the five leftmost bits of a pattern. Test the mask with the pattern Solution The mask is The result of applying the mask is:

4.15 Example 4.8 Use a mask to set the five leftmost bits of a pattern. Test the mask with the pattern Solution The mask is The result of applying the mask is:

4.16 Example 4.9 Use a mask to flip the five leftmost bits of a pattern. Test the mask with the pattern Solution The mask is The result of applying the mask is:

Vending Machine Example Bit 0: tea Bit 1: coffee Bit 2: chocolate Bit 3: milk Bit4: sugar Lets Start

Thank You