Computing via boolean logic. COS 116: 3/8/2011 Sanjeev Arora

Similar documents
From Greek philosophers to circuits: An introduction to boolean logic. COS 116, Spring 2011 Sanjeev Arora

Self-reproducing programs. And Introduction to logic. COS 116, Spring 2012 Adam Finkelstein

Binary addition example worked out

20. Combinational Circuits

Computer Science. 19. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section 6.1.

UC Berkeley College of Engineering, EECS Department CS61C: Representations of Combinational Logic Circuits

EEE130 Digital Electronics I Lecture #4

Boolean Algebra & Digital Logic

CS61c: Representations of Combinational Logic Circuits

Intro To Digital Logic

2. Associative Law: A binary operator * on a set S is said to be associated whenever (A*B)*C = A*(B*C) for all A,B,C S.

Applications. Smartphone, tablet, game controller, antilock brakes, microprocessor, Wires

Switches: basic element of physical implementations

Computer Science. 20. Combinational Circuits. Computer Science COMPUTER SCIENCE. Section

CprE 281: Digital Logic

Unit 2 Boolean Algebra

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

CSE 20 DISCRETE MATH. Fall

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Combinational Logic. By : Ali Mustafa

CHAPTER1: Digital Logic Circuits Combination Circuits

S C F F F T T F T T S C B F F F F F T F T F F T T T F F T F T T T F T T T

Review for B33DV2-Digital Design. Digital Design

INTRODUCTION TO INFORMATION & COMMUNICATION TECHNOLOGY LECTURE 8 : WEEK 8 CSC-110-T

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Building a Computer Adder

THE LOGIC OF COMPOUND STATEMENTS

CS1800: Hex & Logic. Professor Kevin Gold

1.10 (a) Function of AND, OR, NOT, NAND & NOR Logic gates and their input/output.

Systems I: Computer Organization and Architecture

Adequate set of connectives, logic gates and circuits

ECE/CS 250 Computer Architecture

Digital Logic (2) Boolean Algebra

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Logic Synthesis and Verification

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

Digital electronics form a class of circuitry where the ability of the electronics to process data is the primary focus.

Every time has a value associated with it, not just some times. A variable can take on any value within a range

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Computer Organization: Boolean Logic

Boolean Algebra, Gates and Circuits

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Simple Neural Nets for Pattern Classification: McCulloch-Pitts Threshold Logic CS 5870

Chapter 2: Switching Algebra and Logic Circuits

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Boolean algebra. Values

Functions. Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways:

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

XOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.

CSC9R6 Computer Design. Practical Digital Logic

Logic and Boolean algebra

CMP 334: Seventh Class

CSE 311: Foundations of Computing. Lecture 2: More Logic, Equivalence & Digital Circuits

Chapter 4, Logic using Propositional Calculus Handout

Lecture 1. Notes. Notes. Notes. Introduction. Introduction digital logic February Bern University of Applied Sciences

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Philadelphia University Student Name: Student Number:

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Sample Marking Scheme

Computer organization

MODULE- 07 : FLUIDICS AND FLUID LOGIC

Topic 1: Propositional logic

MAT2345 Discrete Math

CS 226: Digital Logic Design

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

MA 3260 Lecture 10 - Boolean Algebras (cont.) Friday, October 19, 2018.

Discrete Mathematics. CS204: Spring, Jong C. Park Computer Science Department KAIST

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Floating Point Representation and Digital Logic. Lecture 11 CS301

Philadelphia University Student Name: Student Number:

ELCT201: DIGITAL LOGIC DESIGN

Circuits & Boolean algebra.

COMP2611: Computer Organization. Introduction to Digital Logic

Combinational Logic Design Principles

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev. Section 2: Boolean Algebra & Logic Gates

Boolean Algebra. The Building Blocks of Digital Logic Design. Section. Section Overview. Binary Operations and Their Representation.

CHAPTER 12 Boolean Algebra

CSC103 How Computers Work

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

CSCI3390-Lecture 18: Why is the P =?NP Problem Such a Big Deal?

The goal differs from prime factorization. Prime factorization would initialize all divisors to be prime numbers instead of integers*

A B OUT_0 OUT_1 OUT_2 OUT_

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

CSCI 2150 Intro to State Machines

Slide Set 3. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

to become literate in most common concepts and terminology of digital electronics

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

CIRCUITS AND ELECTRONICS. The Digital Abstraction

Lecture 22 Chapters 3 Logic Circuits Part 1

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

DIGITAL CIRCUIT LOGIC BOOLEAN ALGEBRA (CONT.)

E&CE 223 Digital Circuits & Systems. Lecture Transparencies (Boolean Algebra & Logic Gates) M. Sachdev

EECS150 - Digital Design Lecture 19 - Combinational Logic Circuits : A Deep Dive

Chapter 2 Boolean Algebra and Logic Gates

Bits. Chapter 1. Information can be learned through observation, experiment, or measurement.

Transcription:

Computing via boolean logic. COS 116: 3/8/2011 Sanjeev Arora

Recap: Boolean Logic Example Ed goes to the party if Dan does not and Stella does. Choose Boolean variables for 3 events: { Each E: Ed goes to party D: Dan goes to party S: Stella goes to party } E = S AND (NOT D) Alternately: E = S AND D is either TRUE or FALSE

Three Equivalent Representations Boolean Expression E = S AND D Boolean Circuit D S E Truth table: Value of E for every possible D, S. TRUE=1; FALSE= 0. 1 0 0 D 0 0 1 S 0 1 1 E 0 1 0

Boolean algebra A AND B written as A B A OR B written as A + B 0 0 = 0 0 1 = 0 1 1 = 1 0 + 0 = 0 1 + 0 = 1 1 + 1 = 1 Will provide readings on this Funny arithmetic

Boolean gates High voltage = 1 Low voltage = 0 Shannon (1939) x y x y Output voltage is high if both of the input voltages are high; otherwise output voltage low. x y x + y Output voltage is high if either of the input voltages are high; otherwise output voltage low. x x Output voltage is high if the input voltage is low; otherwise output voltage low. (implicit extra wires for power)

Claude Shannon (1916-2001) Founder of many fields (circuits, information theory, artificial intelligence ) A Symbolic Analysis of Relay and Switching Circuits, [1938] With Theseus mouse

Combinational circuit Boolean gates connected by wires Wires: transmit voltage (and hence value) Important: no cycles allowed

Examples 4-way AND (Sometimes we use this for shorthand) More complicated example Crossed wires that are not connected are sometimes drawn like this.

Combinational circuits and control If data has arrived and packet has not been sent, send a signal D Data arrived? S Send signal P Packet sent? S = D AND (NOT P)

Circuits compute functions Every combinational circuit computes a Boolean function of its inputs Inputs Outputs

Ben Revisited Ben only rides to class if he overslept, but even then if it is raining he ll walk and show up late (he hates to bike in the rain). But if there s an exam that day he ll bike if he overslept, even in the rain. B: Ben Bikes R: It is raining E: There is an exam today O: Ben overslept How to write a boolean expression for B in terms of R, E, O?

Truth table Boolean expression Use OR of all input combinations that lead to TRUE B = O R E + O R E + O R E O R E B 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1 Note: AND, OR, and NOT gates suffice to implement every Boolean function!

Expression simplification Some simple rules: x + x = 1 x 1 = x x 0 = 0 x + 0 = x x + 1 = 1 x + x = x x = x x (y + z) = x y + x z x + (y z) = (x+y) (x+z) x y + x y = x (y + y) = x 1 = x De Morgan s Laws: x y = x + y x + y = x y In groups of three try to simplify: O R E + O R E + O R E

Simplifying Ben s circuit

Boole s reworking of Clarke s proof of existence of God (see handout) General idea: Try to prove that Boolean expressions E 1, E 2,, E k cannot simultaneously be true Method: Show E 1 E 2 E k = 0 What exactly does Clarke s proof prove? How convincing is such a proof to you? Also: Do Google search for Proof of God s Existence.

The Kalam argument for god s existence (arose in many world traditions) Whatever that begins to exist has a cause. The universe began to exist. If there is no original cause (i.e., God) then there must be an infinite chain of causal events, which is impossible. Does this remind you of other issues studied in the course?

Sizes of representations For k variables: A B X k 10 20 30 2 k 1024 1048576 1073741824 For an arbitrary function, expect roughly half of X s to be 1 (for 30 inputs roughly 1/2 billion!) Tools for reducing size: (a) circuit optimization (b) modular design 2 k 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 k + 1

Combinational circuit for binary addition? 25 11001 +29 11101 54 110110 Want to design a circuit to add any two N- bit integers (say N =64). Is the truth table method useful? Ideas?

Modular design Have small number of basic components. Put them together to achieve desired functionality Basic principle of modern industrial design; recurring theme in next few lectures.

1-bit adder a k b k c k+1 1-ADD c k (Carry from previous adder) Carry bit for next adder. s k Hand in on Mar 22: Truth table, circuit for 1-bit adder.

Modular Design for boolean circuits An N-bit adder using N 1-bit adders (will do Mar 22)

Something to think about: How hard is Circuit Verification? Given a circuit, decide if it is trivial (no matter the input, it either always outputs 1 or always outputs 0) Alternative statement: Decide if there is any setting of the inputs that makes the circuit evaluate to 1. Time required?

Beyond combinational circuits Need 2-way communication (must allow cycles!) Need memory (scratchpad) CPU Will study next time. Ethernet card

(1) A waveform is sampled at a rate of 4 Hz and 4-bit samples. The following is the sequence of samples. Draw the waveform (hand it in). Is your answer unique? If not, Draw another waveform consistent with the samples. 10, 11, 11, 11, 5, 0, 8, 11, 11, 11, 15. (2) Suppose variable i has value 4 and j has the value 8. What values do they have after the following instruction is executed: i j/i? (3)Your computer runs at 3Ghz. How may operations per sec (roughly) does it do?