Overview of Today s Lecture:

Similar documents
CS12N: The Coming Revolution in Computer Architecture Laboratory 2 Preparation

Combinational Logic. Precedence. Quick Quiz 25/9/12. Schematics à Boolean Expression. 3 Representations of Logic Functions. Dr. Hayden So.

Introduction to Electrical & Electronic Engineering ENGG1203

Boolean Algebra. Boolean Algebra

Boolean algebra.

expression simply by forming an OR of the ANDs of all input variables for which the output is

1 2 : 4 5. Why Digital Systems? Lesson 1: Introduction to Digital Logic Design. Numbering systems. Sample Problems 1 5 min. Lesson 1-b: Logic Gates

Fast Boolean Algebra

Good Review book ( ) ( ) ( )

Designing Information Devices and Systems I Discussion 8B

Control with binary code. William Sandqvist

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Fall Notes - Unit 1

Here we study square linear systems and properties of their coefficient matrices as they relate to the solution set of the linear system.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-378: Computer Hardware Design Winter Notes - Unit 1

Digital Control of Electric Drives

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

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

Fachgebiet Rechnersysteme1. 1. Boolean Algebra. 1. Boolean Algebra. Verification Technology. Content. 1.1 Boolean algebra basics (recap)

Things to Memorize: A Partial List. January 27, 2017

Boolean Algebra. Boolean Algebras

DATABASE DESIGN I - 1DL300

Lecture 6. Notes. Notes. Notes. Representations Z A B and A B R. BTE Electronics Fundamentals August Bern University of Applied Sciences

Unit Six AP Calculus Unit 6 Review Definite Integrals. Name Period Date NON-CALCULATOR SECTION

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

Pre-Session Review. Part 1: Basic Algebra; Linear Functions and Graphs

Elements of Computing Systems, Nisan & Schocken, MIT Press. Boolean Logic

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

EECS 141 Due 04/19/02, 5pm, in 558 Cory

INF1383 -Bancos de Dados

Bob Brown Math 251 Calculus 1 Chapter 5, Section 4 1 CCBC Dundalk

Linear Inequalities. Work Sheet 1

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

Matrix Algebra. Matrix Addition, Scalar Multiplication and Transposition. Linear Algebra I 24

BİL 354 Veritabanı Sistemleri. Relational Algebra (İlişkisel Cebir)

Review of Gaussian Quadrature method

Scientific notation is a way of expressing really big numbers or really small numbers.

Introduction To Matrices MCV 4UI Assignment #1

STRAND J: TRANSFORMATIONS, VECTORS and MATRICES

4 7x =250; 5 3x =500; Read section 3.3, 3.4 Announcements: Bell Ringer: Use your calculator to solve

Lecture Solution of a System of Linear Equation

and that at t = 0 the object is at position 5. Find the position of the object at t = 2.

Learning Goals. Relational Query Languages. Formal Relational Query Languages. Formal Query Languages: Relational Algebra and Relational Calculus

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

Bridging the gap: GCSE AS Level

IST 4 Information and Logic

CS 330 Formal Methods and Models

Quadratic Forms. Quadratic Forms

Jim Lambers MAT 169 Fall Semester Lecture 4 Notes

Multiplying integers EXERCISE 2B INDIVIDUAL PATHWAYS. -6 ì 4 = -6 ì 0 = 4 ì 0 = -6 ì 3 = -5 ì -3 = 4 ì 3 = 4 ì 2 = 4 ì 1 = -5 ì -2 = -6 ì 2 = -6 ì 1 =

HW3, Math 307. CSUF. Spring 2007.

Read section 3.3, 3.4 Announcements:

Prerequisites CHAPTER P

Coalgebra, Lecture 15: Equations for Deterministic Automata

The Fundamental Theorem of Calculus

5.2 Exponent Properties Involving Quotients

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Chapter 1: Boolean Logic

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE

Designing finite automata II

Lecture 3: Equivalence Relations

Resources. Introduction: Binding. Resource Types. Resource Sharing. The type of a resource denotes its ability to perform different operations

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT

Lecture 3: Curves in Calculus. Table of contents

Chapter 3. Vector Spaces

The Regulated and Riemann Integrals

Chapter 1: Logarithmic functions and indices

Polynomials and Division Theory

38 Riemann sums and existence of the definite integral.

2. VECTORS AND MATRICES IN 3 DIMENSIONS

Digital Circuit Engineering

Genetic Programming. Outline. Evolutionary Strategies. Evolutionary strategies Genetic programming Summary

332:221 Principles of Electrical Engineering I Fall Hourly Exam 2 November 6, 2006

Equations and Inequalities

2.4 Linear Inequalities and Interval Notation

First Midterm Examination

Hints for Exercise 1 on: Current and Resistance

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

Improper Integrals, and Differential Equations

Chapter 3 MATRIX. In this chapter: 3.1 MATRIX NOTATION AND TERMINOLOGY

Chapter 8.2: The Integral

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

set is not closed under matrix [ multiplication, ] and does not form a group.

CHAPTER 1 PROGRAM OF MATRICES

Chapter 6 Notes, Larson/Hostetler 3e

Continuous Random Variables Class 5, Jeremy Orloff and Jonathan Bloom

Integrals - Motivation

September 13 Homework Solutions

ECON 331 Lecture Notes: Ch 4 and Ch 5

Homework 3 Solutions

Finite Automata-cont d

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Bases for Vector Spaces

Riemann Sums and Riemann Integrals

Logic Gate Level. Part 2

Fundamental Theorem of Calculus

Transcription:

CPS 4 Computer Orgniztion nd Progrmming Lecture : Boolen Alger & gtes. Roert Wgner CPS4 BA. RW Fll 2 Overview of Tody s Lecture: Truth tles, Boolen functions, Gtes nd Circuits Krnugh mps for simplifying Boolen equtions Exmples: 2- MUX, Red Appendix B CPS4 BA.2 RW Fll 2 How Computers Relly Work Computers mnipulte sequences of s nd s in wys tht simulte ordinry rithmetic, nd comprisons Computer hrdwre uses Boolen opertions, lso clled Logic functions to do this These mthemticl functions operte on 2 vlues, interpreted s True (T) nd Flse (F), or s nd Bsic Boolen functions cn e implemented y circuits whose inputs nd outputs re voltges representing nd. The voltges involved cn e oserved -- cn light lmp, while leves the lmp unlit. Or, the Boolen vlue on wire cn set displyed pixel on or off. CPS4 BA.3 RW Fll 2

Boolen Functions nd Gtes Boolen functions hve rguments tht ech tke one of two vlues (clled either {T,F} or {,}). Ech returns one ({T,F} or {,}) vlue, or vector of such vlues. Boolen functions cn lwys e represented y tle clled: Truth Tle which gives the nswer, for every input comintion. Exmple: F: {,} 3 -> {,} 2 c f f 2 CPS4 BA.4 RW Fll 2 Boolen Functions nd Gtes (Cont.) Exmples: Boolen functions: NOT, AND, OR, XOR,... NOT() AND(,) OR(,) XOR(,) XNOR(,) NOR(,) CPS4 BA.5 RW Fll 2 Boolen Functions nd Gtes (Cont.) Gtes re electronic devices tht implement simple Boolen functions: Exmples (gte shpe indictes the function the gte computes): AND(,) OR(,) NOT() XOR(,) NAND(,) NOR(,) XNOR(,) CPS4 BA.6 RW Fll 2

Boolen Expressions Boolen lger nottion: Use: * for AND, + for OR, ~ for NOT. Using the ove nottion one could write Boolen expressions for functions: Exmple: F(A, B, C) = (A * B) + ( ~A*C) CPS4 BA.7 RW Fll 2 Boolen Functions nd Expressions One cn evlute the Boolen expression with ll possile rgument vlues to construct truth tle. Exmple: F(A, B, C) = (A * B) + ( ~A*C) A B C F CPS4 BA.8 RW Fll 2 Boolen functions simplifiction Boolen expressions could e simplified y using the following rules: A*A = A A+A = A ~~A = A A* = A+ = A* = A A+ = A A*~A = A+~A= A*B = B*A A+B = B+A A*(B+C) = A*B + A*C A+(B*C) = (A+B)*(B+C) ~(A+B) = ~A * ~B ~(A*B) = ~A + ~B CPS4 BA.9 RW Fll 2

Boolen Functions simplifiction Exmple: c f f 2 f = ~*~*c + ~**c + *~*c + **c f 2 = ~*~*~c + ~*~*c + **~c + **c CPS4 BA. RW Fll 2 Boolen Function Simplifiction f = ~*~*c + ~**c + *~*c + **c = ~*(~*c +*c) +*(~*c+*c) = ~*c*(~+) + *c*(~+) = ~*c + *c = c*(~+) = c f 2 = ~*~*~c + ~*~*c + **~c + **c = ~*(~*~c + ~*c) + *(*~c + *c) = ~*~*(c+~c) + **(~c+c) = ~*~ + * CPS4 BA. RW Fll 2 Krnugh Mps Grphicl device for simplifying Boolen equtions For 4-vrile eqution: Enter desired truth tle in 4 y 4 mtrix, whose rows re leled with ll comintions of vlues of 2 vriles, nd whose cols re leled with other vrile vlues Include Don t Cre entries s x Row / Column order: One vrile vlue chnges etween djcent rows, nd etween djcent columns Ech rectngle contining only T or x entries, whose side-lengths re, 2, or 4 represents simplified term -- identified y ANDing vriles or their complements which re constnt over cells in the rectngle. OR enough terms together to cover ll T entries in tle. CPS4 BA.2 RW Fll 2

Krnugh Mp Exmple CD: FF FT TT TF AB FF T x T FT x T x TT x x ~A*~D B*C TF ~A* ~D + B* C CPS4 BA.3 RW Fll 2 Boolen Functions nd Expressions The Fundmentl Theorem of Boolen Alger: Every Boolen function cn e written in disjunctive norml form s n OR of ANDs (Sumof products) of it s rguments or their complements. Proof: Write the truth tle, construct sum-ofproduct from the tle. Exmple: XNOR(,) XNOR = (~ * ~) + ( * ) CPS4 BA.4 RW Fll 2 Boolen Functions nd Boolen Expressions Exmple-2: c f f 2 f = ~*~*c + ~**~c + *~*~c + **c f 2 = ~*~*~c + ~*~*c + **~c + **c CPS4 BA.5 RW Fll 2

Boolen Functions, Gtes nd Circuits Circuits re mde from network of gtes. (function compositions). Exmple: XOR(,) F = ~* + ~* F CPS4 BA.6 RW Fll 2 Circuit Exmple: 2x MUX s y B Gte Gte 3 Y = (A * S) + (B * ~S) A Gte 2 S ~(~A*~B) = ~~A + ~~B = A+B CPS4 BA.7 RW Fll 2 Exmple 4x MUX c d y c d 3 2 y s s 2 S CPS4 BA.8 RW Fll 2

Circuit Exmple: Selector Q 3 Q 2 Q Q I I Q Q Q 2 Q 3 Sets just ONE output True -- the one indexed y the vlue of I I converted to deciml CPS4 BA.9 I I RW Fll 2 Cin Sum + Cout C in Sum C out CPS4 BA.2 RW Fll 2 Exmple: 4-it dder S3 S2 S S C out 3 3 2 2 CPS4 BA.2 RW Fll 2

Exmple: Adder/Sutrctor S3 S2 S S C out Add/Su 3 3 2 2 (XOR gtes): A xor B is (A?~B:B) CPS4 BA.22 RW Fll 2 Overflow Detection: exmples Exmple: 2 (= 53 ) + 2 (= 42 ) 2 (=-33 ) Exmple3: 2 (= 53 ) + 2 (=-22 ) 2 (= 3 ) Exmple2: 2 (=-43 ) + 2 (=-54 ) 2 (= 3 ) Exmple4: 2 (= 2 ) + 2 (= 42 ) 2 (= 63 ) CPS4 BA.23 RW Fll 2 Overflow Detection nd Crries In Addition nd Sutrction opertions, Overflow occurs when two numer of sme sign re dded, nd result hs different sign. Must e function of wht hppens in high-order full-dder A 3 B 3 Cin 3 S 3 Cout 3 OVF Cin= Cout F Y T N F Y F Y F Y F Y T N F Y CPS4 BA.24 RW Fll 2

Add/Sutrct With Overflow detection Overflow S n- S n- 2 S S Add/Su n- n- n- 2 n- 2 CPS4 BA.25 RW Fll 2 MIPS ALU Slice Cin 3 2 Q A F Q + - - NOT - 2 OR - 3 AND Add/su 2 Cout Add/su CPS4 BA.26 RW Fll 2 F The MIPS ALU Overflow = Zero Q n- Q n-2 Q Q ALU Slice ALU Slice ALU Slice ALU Slice n- n- n-2 n-2 CPS4 BA.27 RW Fll 2