170 likes | 295 Views
Directed Activity 11-Computing. Logical Instructions (also known as: Logical Units) Presented by James Rudge. Lesson Objectives. Look at logical instructions in order to: Understand what they are Understand how they are used Consider the term ‘bit’
E N D
Directed Activity 11-Computing Logical Instructions (also known as: Logical Units) Presented by James Rudge
Lesson Objectives • Look at logical instructions in order to: • Understand what they are • Understand how they are used • Consider the term ‘bit’ • Learn how logical instructions and ‘bits’ are used together
Let’s consider the first three… Logical Instructions How many logical instructions are there? Four: • NOT • AND • OR • ?
The Definition of Logical Instructions • What are they used for? ? • To manipulate bits • What are they known as? • Bit-wise operations • So what are bits?
1 or 0 Defining Bits • Short for: Binary Digit • The term was first used in 1946 by John Tukey • Smallest number of information on a machine • A single bit can hold one of two values…
Functionality of Bits • So what does 1 and 0 mean? • A bit is "set" if its value is 1 (true) • A bit is "reset" or "clear" if its value is 0 (false) • Now we understand bits, we can implement them into our logical instructions…
Important Note • The NOT instruction operates on a single binary value 0 or 1 1 or 0 0 and/or 0 0 and/or 1 1 and/or 0 1 and/or 1 • The AND and OR instructions each operate on a pair of binary values
Result of NOT The Logical Unit: NOT • Remember: the NOT instruction operates on a single binary value: • The value 1 changes to 0 • The value 0 changes to 1 This can be described by a truth table: Input
The ‘NOT’ Person Name: Notty Personality • Ill-tempered • Impossible to please
Result of AND The Logical Unit: AND • Remember: the AND instruction operates on pair of binary values: • It produces a 1 if both the bits are 1 • It produces a 0 in every other case This can be described by a truth table: Input 1 Input 2
The ‘AND’ Person Name: Andrea Personality • Demanding • Inflexible
Result of OR The Logical Unit: OR • Remember: the OR instruction operates on pair of binary values: • It produces a 1 if either the bits are 1 This can be described by a truth table: Input 1 Input 2
The ‘OR’ Person Name: Oreo Personality • Very Easy-Going • Very Flexible
Logical Units & X-Bit Values • What is an X-bit value? • It is a number that is limited to X-digit length • Example: an 4-bit value 1010 • Logical Units are used to manipulate these values… NOT AND OR 0110 0110 101010101010 Gives: 0101 0010 1110
Activity Questions: NOT 10001110 AND 11001011 01100110 OR 11001011 01100110 Answers: NOT 01110001 AND 01000010 OR 11101111
A Common Use of Logical Units • What do you think logical units are used for? • Software applications: • Internet search engines • Websites • Office Software (Especially for more ‘advanced/specific’ searches)
Bibliography • Letts Educational ’01, Revise A2 Computing p.29-30. (Pages 160.) • FOLDOC (Free On-line Dictionary of Computing), http://wombat.doc.ic.ac.uk, 4/10/03 • Webopedia, On-line Dictionary for Computer and Internet Terms, www.webopedia.com , 4/10/03