Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates

Similar documents
Asst. Prof. Thavatchai Tayjasanant, PhD. Power System Research Lab 12 th Floor, Building 4 Tel: (02)

Gates and Circuits 1

DIGITAL ELECTRONICS QUESTION BANK

CS302 - Digital Logic Design Glossary By

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #1 Oct 18, 2006

Lecture 02: Digital Logic Review

Unit 1.1: Information representation

Gates and and Circuits

UNIT-IV Combinational Logic

Chapter 1: Digital logic

Byte = More common: 8 bits = 1 byte Abbreviation:

Number system: the system used to count discrete units is called number. Decimal system: the number system that contains 10 distinguished

QUIZ. What do these bits represent?

Logic Circuit Design

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

(CSC-3501) Lecture 6 (31 Jan 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Chapter 8. Representing Multimedia Digitally

DESIGN OF 4 BIT BINARY ARITHMETIC CIRCUIT USING 1 S COMPLEMENT METHOD

Chapter 3 Digital Logic Structures

Introduction (concepts and definitions)

Logic diagram: a graphical representation of a circuit

UNIT III. Designing Combinatorial Circuits. Adders

Combinational Logic Circuits. Combinational Logic

Name: Class: Date: 1. As more electronic systems have been designed using digital technology, devices have become smaller and less powerful.

Chapter 3 Digital Logic Structures

Digital Applications (CETT 1415) Credit: 4 semester credit hours (3 hours lecture, 4 hours lab) Prerequisite: CETT 1403 & CETT 1405

Module 3 Greedy Strategy

Positive and Negative Logic

Fundamentals of Data and Signals

Chapter 3 Describing Logic Circuits Dr. Xu

DIGITAL CIRCUITS AND SYSTEMS ASSIGNMENTS 1 SOLUTIONS

INTRODUCTION TO DIGITAL CONCEPT

Digitizing Color. Place Value in a Decimal Number. Place Value in a Binary Number. Chapter 11: Light, Sound, Magic: Representing Multimedia Digitally

Digital Logic Circuits

5/17/2009. Digitizing Color. Place Value in a Binary Number. Place Value in a Decimal Number. Place Value in a Binary Number

2 Logic Gates THE INVERTER. A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs.

Digital Electronics 8. Multiplexer & Demultiplexer

Computer Architecture and Organization:

COMPUTER ARCHITECTURE AND ORGANIZATION

Lecture 2. Digital Basics

Data output signals May or may not be same a input signals


Odd-Prime Number Detector The table of minterms is represented. Table 13.1

BCD Adder. Lecture 21 1

Unit level 4 Credit value 15. Introduction. Learning Outcomes

Chapter 1 Binary Systems

Lecture 2: Data Representation

Lab Report: Digital Logic

How is Information Stored

LOGIC GATES AND LOGIC CIRCUITS A logic gate is an elementary building block of a Digital Circuit. Most logic gates have two inputs and one output.

Electronics. Digital Electronics

Lecture #1. Course Overview

A New High Speed Low Power Performance of 8- Bit Parallel Multiplier-Accumulator Using Modified Radix-2 Booth Encoded Algorithm

IES Digital Mock Test

EE292: Fundamentals of ECE

Digital Applications (CETT 1415) Credit: 4 semester credit hours (3 hours lecture, 4 hours lab) Prerequisite: CETT 1403 & CETT 1405

Digital Integrated CircuitDesign

Multiple input gates. The AND gate

Chapter 3. H/w s/w interface. hardware software Vijaykumar ECE495K Lecture Notes: Chapter 3 1

4:Combinational logic circuits. 3 July

CHAPTER 2 - DIGITAL DATA REPRESENTATION AND NUMBERING SYSTEMS

This Figure here illustrates the operation for a 2-input OR gate for all four possible input combinations.

Unit 3. Logic Design

Abstract. 1. Introduction. Department of Electronics and Communication Engineering Coimbatore Institute of Engineering and Technology

Spec. Instructor: Center

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

Grade 6 Math Circles March 8-9, Modular Arithmetic

Approximate Hybrid Equivalent Circuits. Again, the impedance looking into the output terminals is infinite so that. conductance is zero.

IJCSIET--International Journal of Computer Science information and Engg., Technologies ISSN

Introduction. BME208 Logic Circuits Yalçın İŞLER

Fan in: The number of inputs of a logic gate can handle.

Combinational Circuits DC-IV (Part I) Notes

Digital Logic Design ELCT 201

EEE 301 Digital Electronics

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Logic Design I (17.341) Fall Lecture Outline

Final Exam, Math 6105

Grade 7/8 Math Circles February 9-10, Modular Arithmetic

Objective Questions. (a) Light (b) Temperature (c) Sound (d) all of these

EECS 150 Homework 4 Solutions Fall 2008

Encoders. Lecture 23 5

Chapter 10 Error Detection and Correction 10.1

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

EXPERIMENT NO 1 TRUTH TABLE (1)

Module 4: Design and Analysis of Combinational Circuits 1. Module-4. Design and Analysis of Combinational Circuits

Veer Narmad South Gujarat University, Surat

Function Table of an Odd-Parity Generator Circuit

Digital Systems Principles and Applications TWELFTH EDITION. 3-3 OR Operation With OR Gates. 3-4 AND Operations with AND gates

Subject: Analog and Digital Electronics Code:15CS32

CHAPTER 5 DESIGN OF COMBINATIONAL LOGIC CIRCUITS IN QCA

R.B.V.R.R. WOMEN S COLLEGE (AUTONOMOUS) Narayanaguda, Hyderabad. ELECTRONIC PRINCIPLES AND APPLICATIONS

Digital Imaging Rochester Institute of Technology

Subtractor Logic Schematic

CS Lecture 10:

Syllabus for: Electronics for F Y B Sc (Electronics) Semester- 1 (With effect from June 2014) PAPER I: Basic Electrical Circuits

Compression and Image Formats

Mahendra Engineering College, Namakkal, Tamilnadu, India.

Combinational Circuits: Multiplexers, Decoders, Programmable Logic Devices

Government of Karnataka Department of Technical Education Board of Technical Examinations, Bengaluru

Worksheet 1 - Analogue vs digital 3. Worksheet 2 - The NOT function 5. Worksheet 3 - The AND function 7. Worksheet 4 - The OR function 9

Transcription:

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates

Objectives In this chapter, you will learn about The binary numbering system Boolean logic and gates Building computer circuits Control circuits

Introduction Chapter 4 focuses on hardware design (also called logic design) How to represent and store information inside a computer How to use the principles of symbolic logic to design gates How to use gates to construct circuits that perform operations such as adding and comparing numbers, and fetching instructions

The Binary Numbering System A computer s internal storage techniques are different from the way people represent information in daily lives Information inside a digital computer is stored as a collection of binary data Two types of information representation External representation Internal representation

Figure 4.1 Distinction Between External and Internal Representation of Information

Binary Representation of Numeric and Textual Information Binary numbering system Base-2 positional numbering system Built from ones and zeros Each position is a power of 2 1101 = 1 x 2 3 + 1 x 2 2 + 0 x 2 1 + 1 x 20 Decimal numbering system Base-10 Each position is a power of 10 3052 = 3 x 10 3 + 0 x 10 2 + 5 x 10 1 + 2 x 10 0

Binary Representation of Numeric and Textual Information. Binary-to-decimal algorithm Whenever there is a 1 in a column, add the positional value of that column to a running sum Whenever there is a 0 in a column, add nothing The final sum is the decimal value of this binary number Example 10011 = 1 2 4 +0+0+1 2 1 +1 20 = 16+0+0+2+1=19

. Figure 4.2 Binary-to-Decimal Conversion Table Invitation to Computer Science, 5th Edition 8

Binary Representation of Numeric and Textual Information. Decimal-to-binary algorithm Convert the value 19 to binary 19 2 quotient = 9 remainder = 1 9 2 quotient = 4 remainder = 1 4 2 quotient = 2 remainder = 0 2 2 quotient = 1 remainder = 0 1 2 quotient = 0 remainder = 1 The result is 10011 Order for reading the remainder digits Invitation to Computer Science, 5th Edition 9

Binary Representation of Numeric and Textual Information (continued) Representing integers Decimal integers are converted to binary integers Maximum number of binary digits that can be used to store an integer: 16, 32, or 64 bits Given k bits, the largest unsigned integer is 2 k - 1 Given 16 bits, the largest is 2 16-1 = 65535 Arithmetic overflow

Binary Representation of Numeric and Textual Information Representing signed integers Sign/magnitude notation One of a number of different techniques for representing positive and negative whole numbers Not used often in real computer systems Two s complement representation Total number of values that can be represented with n bits is 2 n

Binary Representation of Numeric and Textual Information (continued) Representing real numbers Real numbers can be put into binary scientific notation: a x 2 b Example: 101.11 x 2 0 Number then normalized so that first significant digit is immediately to the right of the binary point Example:.10111 x 2 3 Mantissa and exponent then stored

Binary Representation of Numeric and Textual Information (continued) 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

Figure 4.3 ASCII Conversion Table

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

Figure 4.5 Digitization of an Analog Signal (a) Sampling the Original Signal (b) Recreating the Signal from the Sampled Values

Binary Representation of Sound and Images (continued) From samples, original sound can be approximated To improve the approximation Sample more frequently (sampling rate) Use more bits for each sample value (bit depth)

Binary Representation of Sound and Images (continued) Representing image data Images are sampled by measuring the intensity values of distinct points located at regular intervals across the image s surface (scanning) Each sampled point is a pixel Image quality depends on number of bits at each pixel

Binary Representation of Sound and Images (continued) Image encoding schemes RGB encoding scheme Most common format for storing color images True Color 24-bit color-encoding scheme

Binary Representation of Sound and Images (continued) Data compression Data compression algorithms Attempt to represent information in ways that preserve accuracy while using significantly less space Run-length encoding Replaces a sequence of identical values v1, v2,..., vn by a pair of values (v, n) Compression ratio Measures how much compression schemes reduce storage requirements of data Variable length code sets Often used to compress text Can also be used with other forms of data

Figure 4.8 Using Variable Length Code Sets (a) Fixed Length (b) Variable Length

Binary Representation of Sound and Images (continued) Lossless compression schemes No information is lost in the compression It is possible to exactly reproduce the original data Lossy compression schemes Do not guarantee that all of the information in the original data can be fully and completely recreated

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

Binary Storage Devices 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 (continued) Transistors Solid-state switches; either permit or block current flow A control input causes state change Constructed from semiconductors Can be printed photographically on a wafer of silicon to produce a device known as an integrated circuit

Figure 4.11 Simplified Model of a Transistor

Binary Storage Devices (continued) Circuit board Interconnects all the different chips needed to run a computer system

Figure 4.10 Relationships Among Transistors, Chips, and Circuit Boards

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

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

Boolean Logic (continued) 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

(a) (c) (a) Figure 4.12 Truth Table for the AND Operation (b) Figure 4.13 Truth Table for the OR Operation (c) Figure 4.14 Truth Table for the NOT Operation (b )

Boolean Logic (continued) Example: (a AND b) OR ((NOT b) and (NOT a)) a b Value 0 0 1 0 1 0 1 0 0 1 1 1

Gates Gates Hardware devices built from transistors to mimic Boolean logic Transforms a set of (0,1) input values into a single (0,1) output value AND gate Two input lines, one output line Outputs a 1 when both inputs are 1

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

Figure 4.16 Construction of a NOT Gate

Figure 4.17 Construction of NAND and AND Gates (a) A Two-transistor NAND Gate (b) A Three-transistor AND Gate

Figure 4.18 Construction of NOR and OR Gates (a) A Two-transistor NOR Gate (b) A Three-transistor OR Gate

Figure 4.15 The Three Basic Gates and Their Symbols

Gates (continued) 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

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)

Figure 4.19 Diagram of a Typical Computer Circuit

A Circuit Construction Algorithm Sum-of-products algorithm is one way to design circuits Truth table to Boolean expression to gate layout

A Circuit Construction Algorithm (continued) Step 1: Truth Table Construction Determine how the circuit should behave under all possible circumstances If a circuit has N input lines and if each input line can be either a 0 or a 1, then: There are 2N combinations of input values, and the truth table has 2N rows

A Truth Table for a Circuit with 8 Input Combinations

A Circuit Construction Algorithm (continued) Step 2: Subexpression Construction Using AND and NOT Gates Choose any one output column of the truth table built in step 1, and scan down that column Every place that you find a 1 in that output column, you build a Boolean subexpression that produces the value 1 for exactly that combination of input values and no other

Output Column Labeled Output-1 from the Previous Truth Table

A Circuit Construction Algorithm (continued) Step 3: Subexpression Combination Using OR Gates Take each of the subexpressions produced in step 2 and combine them, two at a time, using OR gates Step 4: Circuit Diagram Production Construct the final circuit diagram

Figure 4.20 Circuit Diagram for the Output Labeled Output-1

A Circuit Construction Algorithm (continued) Algorithms for circuit optimization Reduce the number of gates needed to implement a circuit

Figure 4.21 The Sum-of-Products Circuit Construction Algorithm

A Circuit Construction Algorithm (continued) 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

Examples of Circuit Design and Construction Compare-for-equality circuit Addition circuit Both circuits can be built using the sum-ofproducts algorithm

A Compare-for-Equality Circuit Compare-for-equality circuit CE compares two unsigned binary integers for equality Built by combining together 1-bit comparison circuits (1-CE) Integers are equal if corresponding bits are equal (AND together 1-CD circuits for each pair of bits)

A Compare-for-Equality Circuit (continued) 1-CE circuit truth table a b Output 0 0 1 0 1 0 1 0 0 1 1 1

Figure 4.22 One-Bit Compare-for-Equality Circuit

A Compare-for-Equality Circuit (continued) 1-CE Boolean expression First case: (NOT a) AND (NOT b) Second case: a AND b Combined: ((NOT a) AND (NOT b)) OR (a AND b)

Figure 4.23 N-Bit Compare for Equality Circuit

An Addition Circuit Addition circuit Performs addition on two unsigned binary integers Built from 1-bit adders (1-ADD) Starting with rightmost bits, each pair produces A value for that order A carry bit for next place to the left

An Addition Circuit (continued) 1-ADD truth table Input One bit from each input integer One carry bit (always zero for rightmost bit) Output One bit for output place value One carry bit

Figure 4.24 The 1-ADD Circuit and Truth Table

Figure 4.25 Sum Output for the 1-ADD Circuit

Figure 4.26 Complete 1-ADD Circuit for 1-Bit Binary Addition

Figure 4.27 The Complete Full Adder ADD Circuit

Control Circuits Do not perform computations Choose order of operations or select among data values Major types of controls circuits Multiplexors Select one of inputs to send to output Decoders Sends a 1 on one output line based on what input line indicates

Control Circuits (continued) Multiplexor form 2N regular input lines N selector input lines 1 output line Multiplexor purpose Given a code number for some input, selects that input to pass along to its output Used to choose the right input value to send to a computational circuit

Figure 4.28 A Two-Input Multiplexor Circuit Invitation to Computer Science, 5th Edition 67

Control Circuits (continued) Decoder Form N input lines 2N output lines N input lines indicate a binary number, which is used to select one of the output lines Selected output sends a 1, all others send 0

Control Circuits (continued) Decoder purpose Given a number code for some operation, trigger just that operation to take place Numbers might be codes for arithmetic (add, subtract, and so on) Decoder signals which operation takes place next

Figure 4.29 A 2-to-4 Decoder Circuit

Figure 4.30 Example of the Use of a Decoder Circuit

Figure 4.31 Example of the Use of a Multiplexor Circuit 72

Summary Digital computers use binary representations of data: numbers, text, multimedia Binary values create a bistable environment, making computers reliable Boolean logic maps easily onto electronic hardware Circuits are constructed using Boolean expressions as an abstraction Computational and control circuits can be built from Boolean gates