Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.

Slides:



Advertisements
Similar presentations
Computer Science 210 Computer Organization Introduction to Logic Circuits.
Advertisements

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Invitation to Computer Science, C++ Version, Third Edition
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third & Fourth Edition Spring 2008:
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Chapter 1 Data Storage. 2 Chapter 1: Data Storage 1.1 Bits and Their Storage 1.2 Main Memory 1.3 Mass Storage 1.4 Representing Information as Bit Patterns.
Introduction to Management Information Systems Chapter 3 Computer Basics HTM 304 Spring 06.
I am an L&S CS major. Why do I have to take this class? So you don’t look stupid when you get to your job. To prepare you for hands-on courses like CS.
Bits and Data Storage. Basic Hardware Units of a Computer.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Binary System and Logical Gates
CPSC 171 Introduction to Computer Science Boolean Logic, Gates, & Circuits.
CS 1308 – Computer Literacy and the Internet. It’s Not Magic  The goal of the next series of lectures is to show you exactly how a computer works. 
Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part.
Think about the following expression If the number entered is greater than 15 but less than 25 or the number is 100 and the letter chosen is after p but.
BUILDING COMPUTER CIRCUITS prepared by Burak Galip ASLAN September, 2006 BOOLEAN LOGIC AND GATES CONTROL CIRCUITS.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Chapter 2: Binary Logic.
Chapter 4 The Building Blocks: Binary Numbers, Boolean Logic, and Gates.
CSCI-235 Micro-Computers in Science Hardware Design Part I.
Digital Electronics. Introduction to Number Systems & Codes Digital & Analog systems, Numerical representation, Digital number systems, Binary to Decimal.
Invitation to Computer Science 5th Edition
Introduction to Digital Logic and Circuits EE 101, Fall 2015 University of Kentucky.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Logical Circuit Design Week 2,3: Fundamental Concepts in Computer Science, Binary Logic, Number Systems Mentor Hamiti, MSc Office: ,
Invitation to Computer Science 6th Edition Chapter 4 The Building Blocks: Binary Numbers, Boolean Logic, and Gates.
Compsci Today’s topics l Binary Numbers  Brookshear l Slides from Prof. Marti Hearst of UC Berkeley SIMS l Upcoming  Networks Interactive.
Islamic University Of Gaza, Nael Aburas Data Storage Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
CSCI-100 Introduction to Computing Hardware Design Part I.
Chapter 1 Data Storage © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science,
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
CS 1308 – Computer Literacy and the Internet Building the CPU.
CPSC 171 Introduction to Computer Science Binary.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Lecture 1 Gunjeet kaur Dronacharya group of institutions.
1 Section 1.3 Binary Number Systems Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Computer Science: An Overview Eleventh Edition
3 – Boolean Logic and Logic Gates 4 – Binary Numbers
Computer Architecture & Operations I
Invitation to Computer Science, C++ Version, Fourth Edition
GCSE OCR Computing A451 Binary logic Computing hardware 6.
Hardware (Part A) Reading Materials: OUTLINE
Chapter 3 - Binary Numbering System
Everything is a number Everything in a computer memory and on storages is a number. Number  Number Characters  Number by ASCII code Sounds  Number.
Logic Gates.
Computer Science 210 Computer Organization
EKT 124 / 3 DIGITAL ELEKTRONIC 1
CSIS-110 Introduction to Computer Science
Digital Electronics Jess 2008.
ECE 331 – Digital System Design
CSCI-100 Introduction to Computing
Chapter 2.3 Binary Logic.
Fundamentals & Ethics of Information Systems IS 201
Invitation to Computer Science, Java Version, Third Edition
Invitation to Computer Science, C++ Version, Third Edition
Chapter 1 Data Storage.
Computer Science 210 Computer Organization
Agenda – 2/12/18 Questions? Readings: CSI 4, P
The Building Blocks: Binary Numbers, Boolean Logic, and Gates
Invitation to Computer Science 6th Edition
Chapter 2 Data Representation.
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
Presentation transcript:

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition

Invitation to Computer Science, C++ Version, Fourth Edition 2 Objectives In this chapter, you will learn about The binary numbering system Boolean logic and gates Building computer circuits

Invitation to Computer Science, C++ Version, Fourth Edition 3

Learn 3 basic circuit symbols to design simple circuits. bols.html bols.html Invitation to Computer Science, C++ Version, Fourth Edition 4

You should be able to design this. Invitation to Computer Science, C++ Version, Fourth Edition 5

We will learn binary numbering system. Why does the computer use binary digit (0 and 1)? Homework assignment: Read the book to find out why (Section 4.2.3). Invitation to Computer Science, C++ Version, Fourth Edition 6

7 How to convert a decimal to a binary number? 5 10 = = 111 2

Invitation to Computer Science, C++ Version, Fourth Edition 8 Quiz 9 10 = ______ = _____ = _____ 2

Invitation to Computer Science, C++ Version, Fourth Edition 9 How to convert a binary to a decimal number? = ans: 1* * * * 20 = = 10

Invitation to Computer Science, C++ Version, Fourth Edition = ans: 1* * * * 20 = = 14

Invitation to Computer Science, C++ Version, Fourth Edition 11 Quiz = _______________ = ___________ = ___________ 10

Invitation to Computer Science, C++ Version, Fourth Edition 12 Binary Addition   

Invitation to Computer Science, C++ Version, Fourth Edition 13 ASCII Table: 8-bit Decimal Octal Hex Binary Value A B C D E F G H I What is the binary representation of the character string “BAD”?

Book Exercises P Do  3a  3b.  4a.  4b.  7.  9a Invitation to Computer Science, C++ Version, Fourth Edition 14

Invitation to Computer Science, C++ Version, Fourth Edition 15 AND Truth Table  T AND T is T  T AND F is F  F AND F is F  F AND T is F _____(T/F) Assume that a=1, b=2, and c=3. The value of the following Boolean expression is TRUE. (a > 1) AND ( b > c)

Invitation to Computer Science, C++ Version, Fourth Edition 16 Quiz _____(T/F) Assume that a=1, b=2, and c=3. The value of the following Boolean expression is TRUE. (a c) _____(T/F) Assume that a=1, b=2, and c=3. The value of the following Boolean expression is TRUE. (a > 1) AND ( b < c)

Invitation to Computer Science, C++ Version, Fourth Edition 17 Circuit Symbol AND gate. If A is True and B is False, then what is output? ________

Invitation to Computer Science, C++ Version, Fourth Edition 18 If A is False and B is False, then what is output of C? ________

Invitation to Computer Science, C++ Version, Fourth Edition 19 OR truth table  T OR T is T  T OR F is T  F OR F is F  F OR T is T  Assume that a=2, b=3, and c=5. What is the value of each of the following Boolean expressions?______ (a> 1) OR (b = 3)

Invitation to Computer Science, C++ Version, Fourth Edition 20 Circuit Symbol OR gate. Apply the OR truth table What is the output of C if A is True and B is false? _____

Invitation to Computer Science, C++ Version, Fourth Edition 21 What is the output of C if A is True and B is false? _____

Invitation to Computer Science, C++ Version, Fourth Edition 22 NOT truth table  NOT T is F  NOT F is T 1. Assume that a=2, b=3, and c=5. What is the value of each of the following Boolean expressions? 2. NOT (a > 1)

Invitation to Computer Science, C++ Version, Fourth Edition Assume that a=2, b=3, and c=5. What is the value of each of the following Boolean expressions? 2. NOT [(a > 1) AND (b < 3)] 3. (a > 1) AND [NOT (b < 3)]

Invitation to Computer Science, C++ Version, Fourth Edition 24 What is the output of C if A is False and B is False?______

Book Exercises. P.184. Do 15a, 15b, 15c, 15d 17. Invitation to Computer Science, C++ Version, Fourth Edition 25

Invitation to Computer Science, C++ Version, Fourth Edition 26 How to use sum-of-product algorithm to design a combinational circuit for a given truth table? Step 1. Given Mysterious Truth Table:  AB Output  110  000  101  011 Step 2. Write a sum-of-product Boolean Expression _ _ A.B + A. B _ Note: The ‘.’ of the expression A. B means A and B. _ The bar A means A is fed to a gate with a false value, The ‘+’ of the expression X + Y means X and Y are fed to the OR Gate

Invitation to Computer Science, C++ Version, Fourth Edition 27 step 3: Draw a combinational circuit.

Invitation to Computer Science, C++ Version, Fourth Edition 28 Quiz: Given Mysterious Truth Table: AB Output Write the sum-of-product Boolean expression: Draw the combinational circuit diagram:

Invitation to Computer Science, C++ Version, Fourth Edition 29 Characters are mapped onto binary numbers  ASCII code set 8 bits per character; 256 character codes  UNICODE code set 16 bits per character; 65,536 character codes Text strings are sequences of characters in some encoding Binary Representation of Numeric and Textual Information (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 30 Binary Representation of Sound and Images Multimedia data is sampled to store a digital form with or without detectable differences Representing sound data  Sound data must be digitized for storage in a computer  Digitizing means periodic sampling of amplitude values

Invitation to Computer Science, C++ Version, Fourth Edition 31 Binary Representation of Sound and Images (continued)  From samples, original sound can be approximated  To improve the approximation Sample more frequently Use more bits for each sample value

Invitation to Computer Science, C++ Version, Fourth Edition 32 Figure 4.5 Digitization of an Analog Signal (a) Sampling the Original Signal (b) Recreating the Signal from the Sampled Values

Invitation to Computer Science, C++ Version, Fourth Edition 33 Representing image data  Images are sampled by reading color and intensity values at even intervals across the image  Each sampled point is a pixel  Image quality depends on number of bits at each pixel Binary Representation of Sound and Images (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 34 The Reliability of Binary Representation Electronic devices are most reliable in a bistable environment Bistable environment  Distinguishing only two electronic states Current flowing or not Direction of flow Computers are bistable: binary representations

Invitation to Computer Science, C++ Version, Fourth Edition 35 Magnetic core  Historic device for computer memory  Tiny magnetized rings; flow of current sets the direction of magnetic field  Binary values 0 and 1 are represented using the direction of the magnetic field Binary Storage Devices

Invitation to Computer Science, C++ Version, Fourth Edition 36 Figure 4.9 Using Magnetic Cores to Represent Binary Values

Invitation to Computer Science, C++ Version, Fourth Edition 37 Transistors  Solid-state switches; either permit or block current flow  A control input causes state change  Constructed from semiconductors Binary Storage Devices (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 38 Figure 4.11 Simplified Model of a Transistor

Invitation to Computer Science, C++ Version, Fourth Edition 39 Boolean Logic and Gates: Boolean Logic Boolean logic describes operations on true/false values True/false maps easily onto bistable environment Boolean logic operations on electronic signals can be built out of transistors and other electronic devices

Invitation to Computer Science, C++ Version, Fourth Edition 40 Boolean Logic (continued) Boolean operations  a AND b True only when a is true and b is true  a OR b True when a is true, b is true, or both are true  NOT a True when a is false and vice versa

Invitation to Computer Science, C++ Version, Fourth Edition 41 Boolean expressions  Constructed by combining together Boolean operations Example: (a AND b) OR ((NOT b) AND (NOT a)) Truth tables capture the output/value of a Boolean expression  A column for each input plus the output  A row for each combination of input values Boolean Logic (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 42 abValue Example: (a AND b) OR ((NOT b) and (NOT a)) Boolean Logic (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 43 Gates  Hardware devices built from transistors to mimic Boolean logic AND gate  Two input lines, one output line  Outputs a 1 when both inputs are 1

Invitation to Computer Science, C++ Version, Fourth Edition 44 Gates (continued) OR gate  Two input lines, one output line  Outputs a 1 when either input is 1 NOT gate  One input line, one output line  Outputs a 1 when input is 0 and vice versa

Invitation to Computer Science, C++ Version, Fourth Edition 45 Figure 4.15 The Three Basic Gates and Their Symbols

Invitation to Computer Science, C++ Version, Fourth Edition 46 Abstraction in hardware design  Map hardware devices to Boolean logic  Design more complex devices in terms of logic, not electronics  Conversion from logic to hardware design can be automated Gates (continued)

Invitation to Computer Science, C++ Version, Fourth Edition 47 Building Computer Circuits: Introduction A circuit is a collection of logic gates  Transforms a set of binary inputs into a set of binary outputs  Values of the outputs depend only on the current values of the inputs Combinational circuits have no cycles in them (no outputs feed back into their own inputs)

Invitation to Computer Science, C++ Version, Fourth Edition 48 Figure 4.19 Diagram of a Typical Computer Circuit

Invitation to Computer Science, C++ Version, Fourth Edition 49 A Circuit Construction Algorithm Sum-of-products algorithm is one way to design circuits  Truth table to Boolean expression to gate layout

Invitation to Computer Science, C++ Version, Fourth Edition 50 Figure 4.21 The Sum-of-Products Circuit Construction Algorithm

Invitation to Computer Science, C++ Version, Fourth Edition 51 Sum-of-products algorithm  Truth table captures every input/output possible for circuit  Repeat process for each output line Build a Boolean expression using AND and NOT for each 1 of the output line Combine together all the expressions with ORs Build circuit from whole Boolean expression A Circuit Construction Algorithm (continued)