Administrivia Any new students?

Slides:



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

Sahar Mosleh PageCalifornia State University San Marcos 1 Introductory Concepts This section of the course introduces the concept of digital circuits and.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Logic: From Greeks to philosophers to circuits. COS 116: 3/11/2008 Sanjeev Arora.
Module 7 Hardware. Introduction Switches are the basic blocks of computer hardware. We build increasingly complex hardware from these simple switches.
Administrivia New students? No class Thursday 9/27 Lab Problem Set Favorite browser and why Favorite search engine and why Questions??
Midterm Review October 23, 2001.
Chapter 10-Arithmetic-logic units
Section 10.3 Logic Gates.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Lecture 3. Boolean Algebra, Logic Gates
Digital Design Copyright © 2006 Frank Vahid 1 Digital Design Slides to accompany the textbook Digital Design, First Edition, by Frank Vahid, John Wiley.
Let’s Go Buy a Computer. So What’s in a Computer? Processor brains Memory scratch paper Disk long term memory I/O communication (senses) Software reconfigurability.
Propositional Calculus Math Foundations of Computer Science.
3. DIGITAL ELECTRONICS..
1 Computer Logic, Logic Gates, and Building Circuits Image: Intel Museum.
Logic: From Greeks to philosophers to circuits. COS 116, Spring 2012 Adam Finkelstein.
Boolean Logic By: Arthur Brooks February 25, 2003 Think, Speak, and Write Computer Science.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Chapter 4 Gates and Circuits. Integrated Circuits aka CHIPS What’s in this thing???? 4–2.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Logic gates & Boolean Algebra. Introduction Certain components (called logic elements) of the computer combine electric pulses using a set of rules. Electric.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Elementary Digital Logic Apps O/S Arch  Arch Logic Digital Analog.
At the bottom, all data is binary
Logic Gates How Boolean logic is implemented. Transistors used as switches to implement Boolean logic: ANDOR Logic with Transistors.
CS1Q Computer Systems Lecture 8
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds.
Digital Logic Computer Organization 1 © McQuain Logic Design Goal:to become literate in most common concepts and terminology of digital.
Homework - Write Truth Tables for toy car. You will design a simple digital circuit to make a toy car follow a flashlight. The car has three light sensors.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
D75P 34R - HNC Computer Architecture Week 6 Boolean Logic © C Nyssen/Aberdeen College 2004 All images © C Nyssen /Aberdeen College unless otherwise stated.
CSC 107 – Programming For Science. George Boole  Mathematician from English middle-class  Lived from 1815 – 1864  Started work at age 16 as a teaching.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Computing via boolean logic. COS 116: 3/8/2011 Sanjeev Arora.
Gates & Logic Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Logic Design Goal:to become literate in most common concepts.
Arithmetic-logic units1 An arithmetic-logic unit, or ALU, performs many different arithmetic and logic operations. The ALU is the “heart” of a processor—you.
Minute Paper 4/4/04 Z=50+j86.7=100
Winter 2016CISC101 - Prof. McLeod1 Today Take some of the “MAGIC” out of how computers work: How did the technology get to where it is today? –ENIAC movie.
Abstraction. Not real, not concrete A view that is removed from the reality Definitely has a "base" in reality – the "base" may be non-intuitive and not.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
Logic gates.
EGR 2131 Unit 4 Combinational Circuits: Analysis & Design
GCSE OCR Computing A451 Binary logic Computing hardware 6.
CSIS-110 Introduction to Computer Science
Digital Logic.
Morgan Kaufmann Publishers
Logic Gates and Boolean Algebra
Computer Science 210 Computer Organization
Boolean algebra Last time we talked about Boolean functions, Boolean expressions, and truth tables. Today we’ll learn how to how use Boolean algebra to.
Fundamentals & Ethics of Information Systems IS 201
How Boolean logic is implemented
Computer Science 210 Computer Organization
Propositional Calculus: Boolean Algebra and Simplification
Some basic electronics and truth tables
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.
GCSE Computer Science – Logic Gates & Boolean Expressions
Dr. Clincy Professor of CS
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Some basic electronics and truth tables
Truth tables Mrs. Palmer.
Design of Digital Circuits Lab 1 Supplement: Drawing Basic Circuits
CPSC 121: Models of Computation
Introductory Concepts
Basic circuit analysis and design
Copyright © Cengage Learning. All rights reserved.
CPSC 121: Models of Computation
ECE 352 Digital System Fundamentals
Presentation transcript:

Administrivia Any new students? Has everyone been to the course web site? First assignment ready – pick it up on web Labs to begin Monday Location 007 Friend Details Pick up lab on web, read it, do it Laptops or desktops? Questions??

Building a computer

Why build a computer? Curiosity What really happens when I hit a key? Necessity Prerequisite to parts of the course Breadth Should understand what’s changing the world

Why NOT build a computer? Computers seem really complicated ! Pentium III has over 28 MILLION components How can we hope to understand them ?

Questions in building a house What are the basic components 2”x4”’s, I-beams, plasterboard, .. Light fixtures, plumbing, … What is glue for combining them Nails, screws, bolts, pipes, … How do we model the process Architectural drawings, building codes, …

Questions in building a computer What are the basic components Logic gates What is glue for combining them Wires to build circuits How do we model the process Architectural drawings, design rules, … Mathematical formulation

Details Wires are made of silicon or chemicals Crossing wires make transistors Electrons either do or don’t flow in wires Think of light switches turning current on or off Wire thickness currently about .135 micron 1 micron = 10-6 meters Can fit 28 million transistors in less than 1”x1” Design must follow fabrication rules Non-crossing wires can’t get too close Mathematical abstraction – Boolean algebra

What is Abstraction? Ignoring / Hiding details to capture essential common features Example for us: We’ll ignore whether we’re talking about: A Pentium II or a Pentium III A Mac or a PC Instead, we’ll focus on what really makes a computer a computer.

Abstraction (cont.) Real Life Example: “Brush your teeth” Here, we ignore: What kind of toothbrush What kind of toothpaste What you’re wearing etc. These things aren’t important! Often called hand waving

Abstraction (cont.) Abstraction allows us to understand things in a Modular fashion. If we had to spell out everything we did, our lives would seem really complicated. Same is true for computers. To understand them, we use abstraction. Working bottom up.

Layers of Abstraction Build more and more powerful tools out of simpler ones. Really Simple Stuff Computers

Layers of Abstraction (cont.) Really Simple Stuff Computers Each layer corresponds to a beautiful Big Idea of computer science. These ideas are the foundation for the “digital revolution” that everyone talks about.

Layers of Abstraction (cont.) Really Simple Stuff Computers For Computers, What is the “Really Simple Stuff”? Answer: “ 0’s and 1’s ”

The secret lives of 0’s and 1’s

A Simple Logic Puzzle Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Alice and Bob decide to go, but Carol stays home. Will Frank go to the party?

A Simple Logic Puzzle Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Alice and Bob decide to go, but Carol stays home. Will Frank go to the party? Answer: YES

Using 0’s and 1’s 0 = False 1 = True What do 0’s and 1’s mean? For now, we’ll take “Natural meanings:” For example, if we have a variable Alice for whether Alice goes to the party, If Alice goes, we write Alice = 1 If Alice doesn’t, we write Alice = 0 0 = False 1 = True

Logic Gates Computers are circuits made of Logic Gates. Logic gates manipulate 0’s and 1’s (False and True) by letting electrons flow or not. We’ll look at three types of Logic Gates: AND are all inputs true? OR is one input true? NOT flip the truth value

AND Gate AND “Truth Table” “Zac will go to the party if Xena AND Yanni go.” X AND Z Y X Y Z F F F F T F T F F T T T “Truth Table”

AND Gate (cont.) AND Truth Table “Zac will go to the party if Xena AND Yanni go.” X AND Z Y X Y Z 0 0 0 0 1 0 1 0 0 1 1 1 Truth Table

AND Gate (cont.) AND Gate is a circuit that allows output current to flow if both inputs are flowing.

AND Gate (cont.) AND W Y Z X is shorthand for: W AND X AND Z Y

AND Gate (cont.) AND W Z W X Y Z X 0 0 0 ? 0 0 1 ? Y 0 1 0 ? 0 1 1 ? 0 0 0 ? 0 0 1 ? 0 1 0 ? 0 1 1 ? 1 0 0 ? 1 0 1 ? 1 1 0 ? 1 1 1 ?

AND Gate (cont.) AND W Z W X Y Z X 0 0 0 0 0 0 1 0 Y 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

OR Gate OR Truth Table “Zac will go to the party if Xena OR Yanni go.” X Y Z F F F F T T T F T T T T Truth Table

OR Gate (cont.) OR Truth Table “Zac will go to the party if Xena OR Yanni go.” X OR Z Y X Y Z 0 0 0 0 1 1 1 0 1 1 1 1 Truth Table

OR Gate (cont.) OR Gate is a circuit that allows output current to flow if either input is flowing.

OR Gate (cont.) W OR Z X Y is shorthand for: W OR X OR Z Y

OR Gate (cont.) OR W Z W X Y Z X 0 0 0 ? 0 0 1 ? Y 0 1 0 ? 0 1 1 ? 0 0 0 ? 0 0 1 ? 0 1 0 ? 0 1 1 ? 1 0 0 ? 1 0 1 ? 1 1 0 ? 1 1 1 ? X Y

OR Gate (cont.) OR W Z W X Y Z X 0 0 0 0 0 0 1 1 Y 0 1 0 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 X Y

NOT Gate Shorthand: Truth Table “Yanni will go to the party if Xena does NOT go.” X NOT Y Shorthand: X Y X Y 0 1 1 0 Truth Table

NOT Gate (cont.) NOT Gate is a circuit that reverse the sense of a flow. Logical complement.

A Simple Logic Puzzle Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Alice and Bob decide to go, but Carol stays home. Will Frank go to the party?

Logic Puzzle Circuit AND Ed Frank Dan NOT Frank will go to the party if Ed goes AND Dan does NOT.

Logic Puzzle Circuit (cont.) Ed AND Frank Dan Frank will go to the party if Ed goes AND Dan does NOT.

Logic Puzzle Circuit (cont.) Alice AND Ed AND Frank Bob Dan Ed will go to the party if Alice AND Bob go.

Logic Puzzle Circuit (cont.) Alice AND Ed AND Frank Bob OR Dan Carole Dan will go if Bob does NOT go OR if Carole goes.

Logic Puzzle Circuit (cont.) 1 Alice AND Ed 1 AND Frank Bob OR Dan Carole Alice and Bob decide to go, but Carol stays home.

Logic Puzzle Circuit (cont.) 1 1 Alice AND Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

Logic Puzzle Circuit (cont.) 1 1 Alice AND 1 Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

Logic Puzzle Circuit (cont.) 1 1 Alice AND 1 Ed 1 1 AND Frank Bob OR Dan Carole Evaluation…

Logic Puzzle Circuit (cont.) 1 1 Alice AND 1 Ed 1 1 1 AND Frank Bob 1 OR Dan Carole Evaluation…

Logic Puzzle Circuit (cont.) 1 1 Alice AND 1 Ed 1 1 1 AND 1 Frank Bob 1 OR Dan Carole Evaluation Complete! Answer: Frank goes to the party.

Logic Puzzle Circuit (cont.) 1 Alice AND Ed 1 AND Frank Bob OR Dan 1 Carole What if: Alice, Bob, and Carol all go to the party?

Logic Puzzle Circuit (cont.) 1 1 Alice AND 1 Ed 1 1 1 AND Frank Bob OR 1 Dan 1 1 Carole What if: Alice, Bob, and Carol all go to the party? Answer: Frank does NOT go to the party!

Intermission Is it all clear? Should/Could we do another such problem? Light controllers Light fixture has 3 switches Light is on if an odd number of the switches are on

Building Circuits Suppose someone gives us an arbitrary Truth Table. Can we build a circuit which satisfies exactly that Truth Table?

Our Logic Puzzle Suppose we made the truth table for this puzzle. Frank will go to the party if Ed goes AND Dan does NOT. Dan will go if Bob does NOT go OR if Carole goes. Ed will go to the party if Alice AND Bob go. Suppose we made the truth table for this puzzle.

Logic Puzzle Circuit AND AND OR Alice Ed Frank Bob Dan Carole The full circuit for the Logic Puzzle.

Logic Puzzle Circuit (cont.) Alice Bob Carole Frank 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 Note: Frank goes only if A=B=1 and C=0 Truth Table for Logic Puzzle

Recall: AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

Modified AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C

Modified AND Gate AND A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C Note: Frank goes only if A=B=1 and C=0. The modified AND also solves the Logic Puzzle!

Modified AND Gate AND ? A F A B C F B 0 0 0 0 0 0 1 0 C 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C ?

Sure … A AND F A B C F 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 B C

Similarly… A AND F A B C F 0 0 0 0 0 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 0 B C Similarly, we can make a circuit for any Truth Table with only a single 1 in its output.

Given Any Truth Table… First, make circuits for each row in Truth Table with a 1 in the output. A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0

Any Truth Table (cont.) AND AND AND A A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 B C A AND B C A AND B C

Any Truth Table (cont.) Finally, combine them with an OR gate. AND F

Any Truth Table (cont.) AND F AND OR The only way for F=1 is if at least ONE of AND gates outputs 1. But each AND gate corresponds to a row in the Truth Table with a 1 in the output! A AND B C

Any Truth Table (cont.) A B C F 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0

Another Example First, make circuits for each row in Truth Table with a 1 in the output. A B C X 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

Another Example (cont.) AND A B C X 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 B C A AND B C

Another Example (cont.) AND Finally, combine them with an OR gate. B C OR X A AND B C

Another Example A B C X 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1

Universality Note same idea works no matter how many input variables. So for ANY Truth Table we can write down, we can make a circuit for it using only 3 Logic Gates: AND, OR, NOT This gives us a very powerful tool ! Our first technical use of abstraction: “Make a circuit for that Truth Table.” is something we can abstract and understand.

Further Issues Some issues to think about on your own We know that AND,OR, and NOT are “universal” – we can make a circuit for any Truth Table using just these gates ! What else is universal? Surprising answer: There is a single gate called “NAND” which is universal all by itself !

NAND Gate NAND AND Truth Table X Z Y X Z Y X Y Z 0 0 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1 1 1 0 Truth Table

NOT from NAND Gate NAND Fix Y at 1 NAND Truth Table Truth Table X Z Y X Y Z 0 0 1 0 1 1 1 0 1 1 1 0 1 X Y Z 0 1 1 1 1 0 Truth Table Truth Table

Further Issues (cont.) Some issues to think about on your own (if you want): We saw two circuits for the Logic Puzzle that both worked – but one (the modified AND) was much simpler than the other. Can you come up with methods for simplifying circuits? This is important for efficiency when you are dealing with very very large Truth Tables (which we will be in the future).

Why are 0’s and 1’s all we need? Next Time: Why are 0’s and 1’s all we need?