IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.

Slides:



Advertisements
Similar presentations
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Advertisements

Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
Chapter 4 Gates and Circuits.
Lecture 14 Today we will Learn how to implement mathematical logical functions using logic gate circuitry, using Sum-of-products formulation NAND-NAND.
1 Boolean Algebra & Logic Design. 2 Developed by George Boole in the 1850s Mathematical theory of logic. Shannon was the first to use Boolean Algebra.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Chapter 4 Logic Gates and Boolean Algebra. Introduction Logic gates are the actual physical implementations of the logical operators. These gates form.
Lecture 3. Boolean Algebra, Logic Gates
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Digital Design.
Propositional Calculus Math Foundations of Computer Science.
EMB1006 Boolean Logic Jonathan-Lee Jones.
Building Adders & Sub tractors Dr Ahmed Telba. Introducing adder circuits Adder circuits are essential inside microprocessors as part of the ALU, or arithmetic.
CS 105 Digital Logic Design
22C:19 Discrete Math Boolean Algebra & Digital Logic Fall 2010 Sukumar Ghosh.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
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.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
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.
Binary Addition CSC 103 September 17, 2007.
SUPLEMENTARY CHAPTER 1: An Introduction to Digital Logic The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Lecture 7 Topics –Boolean Algebra 1. Logic and Bits Operation Computers represent information by bit A bit has two possible values, namely zero and one.
CSC Intro. to Computing Lecture 5: Boolean Logic, Gates, & Circuits.
1 Logic Gates. 2 Review of Boolean algebra Just like Boolean logic Variables can only be 1 or 0 Instead of true / false Instead of true / false.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
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.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
Apr. 3, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 3: Review of Digital Circuits and Logic Design Jeremy R. Johnson Mon. Apr.
Digital Electronics Lecture 6 Combinational Logic Circuit Design.
Lecture 9 Topics: –Combinational circuits Basic concepts Examples of typical combinational circuits –Half-adder –Full-adder –Ripple-Carry adder –Decoder.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
Logic Design CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
IT253: Computer Organization
The Karnaugh Map.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
Introduction to Computing Systems and Programming Digital Logic Structures.
Chapter 3 Digital Logic Structures
Addition and multiplication Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
1 Review of Boolean algebra Just like Boolean logic Variables can only be 1 or 0 Instead of true / false Instead of true / false.
Addition and multiplication1 Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
L OGIC G ATES Computer Organization – week 3. W HAT ’ S ALU? 1. ALU stands for: Arithmetic Logic Unit 2. ALU is a digital circuit that performs Arithmetic.
Truth Table to Statement Form
Morgan Kaufmann Publishers
ECE 3130 Digital Electronics and Design
Logic Gates and Boolean Algebra
Digital gates and difinition
Lecture 11: Hardware for Arithmetic
Digital Signals Digital Signals have two basic states:
Basics Combinational Circuits Sequential Circuits
Chapter 4 Gates and Circuits.
Computer Science 210 Computer Organization
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
Boolean Algebra.
Week 7: Gates and Circuits: PART II
Digital Logic.
Lecture 11: Hardware for Arithmetic
Logic Gates.
Digital Logic.
Lecture 4 Logistics Last lecture --- Boolean algebra Today’s lecture
XOR Function Logic Symbol  Description  Truth Table 
Digital Circuits and Logic
Digital Logic Design Basics Combinational Circuits Sequential Circuits.
Presentation transcript:

IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education

Logic Logic is a branch of math that tries to look at problems in terms of being either true or false. It will use a set of statements to derive new “true” statements. Computers rely heavily on logic to run programs. “If” and “else if” statements in programming language are a form of logic that computers use –If x is equal to 5 then do something –if (x == 5) { do something; }

Logic in Hardware Computers must simulate logic in hardware. To do this, it must use special pieces that can act like logic functions Example: CPUs use transistors Transistors are switches that are “on” or “off” –“On” means there is an electrical current –“Off” means there is no electrical current We can use these to mean either true or false. –On = true = 1 = electricity detected –Off = false = 0 = no electricity detected

Boolean Algebra Boolean algebra uses logic to analyze and perform operations on variables Boolean means the math uses just true and false Boolean “functions” can always be represented with a truth table

Boolean Functions

Boolean math We use the symbols –* for AND –+ for OR –~ for NOT In C++ and Java, (and most programming languages) –“&&” is used for AND –“||” is used for OR –“!” is used for NOT

Boolean Algebra With these symbols we can now write functions, such as F(a,b,c) = (a * b) + (~c * b * a) If you solve this function, it means you find all the values of a, b, and c so that F(a,b,c) is true. For example, if a = true, b = true and c = false, then F = true. How do we find all the possible values of F? We make a truth table

Truth Table F(a,b,c) = (a * b) + (~c * b * a) abc(a*b)(~c*b*a)F(a,b,c) = (a*b) + (~c*b*a)

Truth Tables If all the values you get for the function are true (or 1), then it is a tautology –Example: Tautology AB(A+B)(A+B) + ~A

Rules to Simplify Boolean Equations

Simplifying Boolean Equations Let’s try to simplify this equation F1 = c*(~a*~b + ~a*b + a*~b + a*b) F1 = c*(~a*(~b+b) + a*(~b+b)) F1 = c*(~a*(1) + a*(1)) F1 = c*(~a + a) F1 = c*(1) F1 = c

Fundamental Theorem of Boolean Algebra Every Boolean function can be changed into a special format called “sum of products.” “Sum of products” means that the formula will look like –(a * b * ~c) + (~a*b*c) + (a*b*c) +… –The parts in parenthesis are the products (a product is the name when you multiply something) –The “+” represents the “sum” part of the “sum of products”

Fundamental Theorem AB(~A+B*A) What is the “sum of products” form for this formula? “Sum of products” also called The “disjunctive normal form”

Finding Equations from Truth Tables If you have a truth table, it's easy to find a formula that represents the same values –Notice: because you can reduce, it's impossible to know the original formula. You can only find the "normal form" Steps: –For each value that is a one, take the values of each variable and put them together in an and statement –Put all the and statements together with Ors

Finding Formulas ABCF(A,B,C) For each line that ends in 1, take the values and AND them F(a,b,c) = 1 when ~a*~b*c ~a*b*~c a*b*c Put them together with Ors F(a,b,c) = (~a*~b*c) + (~a*b*~c) + (a*b*c)

DeMorgan’s Laws

Theory -> Reality We should know the math theory about boolean algebra. With that theory, we can put it to use in the real world with Boolean "gates". Boolean gates are the simple electronic parts that simulate boolean logic. When you put a lot of boolean gates together, you can build a CPU

Reality A two input boolean gate is a gate that simulates a formula with only two variables. Ex. F(a,b) = (a*b) A two input boolean gate uses between 1 and 4 transistors A Pentium 4 CPU has 42 million transistors (so maybe 7-10 million boolean gates. Some gates will use more transistors)

Circuits Anything that has more than one gate connected together is called a circuit. You can connect gates together with metal wire that can conduct electricity A circuit represents a way for electricity (1 ands 0) (true and false) to travel through gates and perform tasks like add, subtract, etc. By connecting the output from one gate to the input of another gate we can form very complicated circuits

Logic Gates - NOT

Logic Gates - AND

Logic Gates - OR

Logic Gates- AND / OR in action AND Gates OR Gates

Logic Gates – More examples AND NOT OR NOT 0

More Gate pictures - NAND

More Gates – NOR and XOR

Addition We have seen the common gates that are used as building blocks We can put these gates together to make a circuit that can do things like add and subtract. If we put the right ones together we can make a CPU. We will look at how to implement addition with gates

Addition Here is our truth table for addition This means we use the following formulas Sum = ( (~A*B) + (A*~B) ) = (A XOR B) Carry = (A * B) = (A AND B)

Addition We can also just use OR and AND gates to do the same As XOR and AND. In fact any circuit we make can be made in using only AND and OR gates,

Addition What we have created is a adder circuit, but it is actually only a “half adder.” We have made it so that it will compute the sum and the "carry-out," but there is no "carry-in." To make a “full-adder” we need to account for the "carry-in" This is the Half adder picture we will use in the future. We know this picture represents the boolean gates that make a half-adder. We just draw a simple box instead

Addition To make a full-adder is a little more complicated. Here's the truth table

Full -Adder We can create a full adder by putting two ½ adders together with some extra gates to connect the "carry-in" Now we can represent this whole circuit As this one “full adder box” - 

Did we just make a CPU? What we made was a circuit with boolean gates (each gate made up of 1-4 transistors), that can add two bits together. Example Since computers need to add numbers together that are bigger than 1, we need to put more full adders together

A ripple adder Let’s pretend our computer uses 4 bit numbers (ex. 1011). Most computers today use 32 bits We can put four full adders together to add the 4 bits This is a “ripple adder” because each addition requires the carry in from the previous. You can’t add a3 + b3 without doing all the other ones before This is very slow There are faster ways

Another Circuit - MUX MUX – Multiplexor – This circuit will select an input. If there are two possible inputs to use for something, and you want to select one of them, you can use a MUX to select for you.

Multiplexors The first one we looked at is a 2x1 MUX, meaning it has 2 inputs, and 1 selector. It is simple to create larger MUXs if we have more inputs like a 4x1 MUX

Summary Logic Boolean algebra (functions, truth tables, simplification, fundamental theorem, deMorgan’s Laws) Circuits and Logic Gates (boolean gates) Addition in gates (1/2 adder, full adder, ripple adder) MUXs