Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.

Slides:



Advertisements
Similar presentations
Combinational Circuits
Advertisements

1 Lecture 12: Hardware for Arithmetic Today’s topics:  Designing an ALU  Carry-lookahead adder Reminder: Assignment 5 will be posted in a couple of days.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design.
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Computer Structure - The ALU Goal: Build an ALU  The Arithmetic Logic Unit or ALU is the device that performs arithmetic and logical operations in the.
1 Lecture 11: Digital Design Today’s topics:  Evaluating a system  Intro to boolean functions.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
Propositional Calculus Math Foundations of Computer Science.
Computer Science 210 Computer Organization The Arithmetic Logic Unit.
CS 105 Digital Logic Design
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.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
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.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 7: 32-bit ALU, Fast Carry Lookahead Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
Combinational Logic 1.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Computing Systems Designing a basic ALU.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
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.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
The Karnaugh Map.
MIPS ALU. Building from the adder to ALU ALU – Arithmetic Logic Unit, does the major calculations in the computer, including – Add – And – Or – Sub –
CPS3340 Computer Architecture Fall Semester, 2013
CS/COE0447 Computer Organization & Assembly Language
Logic Design / Processor and Control Units Tony Diep.
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
Addition, Subtraction, Logic Operations and ALU Design
1 Fundamentals of Computer Science Combinational Circuits.
Introduction to Computing Systems and Programming Digital Logic Structures.
Chapter 3 Digital Logic Structures
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 Arithmetic Where we've been: –Abstractions: Instruction Set Architecture Assembly Language and Machine Language What's up ahead: –Implementing the Architecture.
MIPS ALU. Exercise – Design a selector? I need a circuit that takes two input bits, a and b, and a selector bit s. The function is that if s=0, f=a. if.
Lecture 23: 11/26/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
9/23/2004Comp 120 Fall September Chapter 4 – Arithmetic and its implementation Assignments 5,6 and 7 posted to the class web page.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Mu.com.lec 11.  Used not only to perform addition but also to perform subtraction, multiplication and division  The most basic of the adders is the.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Computer Architecture & Operations I
Computer Architecture & Operations I
Lecture 11: Hardware for Arithmetic
Computer Science 210 Computer Organization
Jeremy R. Johnson Wed. Sept. 29, 1999
MIPS ALU.
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
5. Combinational circuits
CS/COE0447 Computer Organization & Assembly Language
MIPS ALU.
Digital Logic.
Lecture 11: Hardware for Arithmetic
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Digital Logic.
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
Combinational Circuits
MIPS ALU.
MIPS ALU.
Presentation transcript:

Appendix C Basics of Digital Logic Part I

Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics operate with only two voltage levels – high and low other levels are temporary and occur while transitioning between these values binary system matches the underlying abstraction inherent in electronics Use signals instead of voltage levels which are complements or inverses of one another logically true : 1 (asserted) logically false : 0 (deasserted)

Florida A & M University - Department of Computer and Information Sciences Logic Block Each input maybe 0 or 1 Each output maybe 0 or 1 Input(s) Logic block Output(s)

Florida A & M University - Department of Computer and Information Sciences Logic Blocks Combinational without memory output depends on only on the current input completed in one machine cycle Sequential Retains memory of previous state output depends on both the inputs and the logic block state

Florida A & M University - Department of Computer and Information Sciences Combinational Logic Block Defined by the values of the outputs for each possible set of input values (truth table) n inputs  2 n combinations of input values

Florida A & M University - Department of Computer and Information Sciences Truth Table - example Output y is 1 when inputs w and x have the same value Output z is 1 when both inputs are 0 InputsOutputs wxyz

Florida A & M University - Department of Computer and Information Sciences Truth Table Completely describes combinational logic function Grow in size quickly May not be easy to understand

Florida A & M University - Department of Computer and Information Sciences Boolean Algebra Another approach to express logic function as logic equations All variables have the values 0 or 1 Three operators OR AND NOT (unary)

Florida A & M University - Department of Computer and Information Sciences Boolean Algebra OR operator result is 1 if either of the operands (variables) is 1 also known as logical sum notation: A + B AND operator result is 1 only if both operands (variables) is 1 also known as logical product notation: A  B NOT operator Result is 1 only if operand is 0 Inversion or negation of the value Notation:

Florida A & M University - Department of Computer and Information Sciences Boolean Algebra Laws Identity : A + 0 = AA  1 = A Zero and One : A  0 = 0A + 1 = 1 Inverse: Commutative: A  B = B  A A + B = B + A Associative:A + (B + C) = (A + B) + C A  (B  C) = (A  B)  C Distributive: A  (B + C) = (A  B) + (A  C) A + (B  C) = (A + B)  (A + C)

Florida A & M University - Department of Computer and Information Sciences Boolean Algebra Laws Idempotent : A + A = AA  A = A DeMorgan’s :

Florida A & M University - Department of Computer and Information Sciences Boolean Algebra - example y = w  x + z = InputsOutputs wxyz

Florida A & M University - Department of Computer and Information Sciences Logic Gates Used to build logic blocks by implementing basic logic functions AND gate May have multiple inputs Output equal to the AND of all inputs OR gate May have multiple inputs Output equal to the OR of all inputs NOT gate inverter Single input

Florida A & M University - Department of Computer and Information Sciences Logic Gates - example y = w  x + z = InputsOutputs wxyz z x w What is logic gate implementation for y?

Florida A & M University - Department of Computer and Information Sciences Logic Gate Implementation Algorithm 1. Determine the truth table for problem statement 2. Consider each output independently a. Consider all nonzero entries for the output b. Write the logic equation c. Simplify the logic equation using the laws of Boolean algebra (if possible) 3.Draw the digital logic gate implementation of the simplified logic equation

Florida A & M University - Department of Computer and Information Sciences Logical Function Find a logical expression for the logical function with three inputs A, B, and C and four outputs W, X, Y and Z such that W is true if at least two of the inputs is true, X is true if exactly one of the inputs is true, Y is true if B is false, and Z is true if all three inputs are true. ABCABC WXYZWXYZ Digital Logic Gate Implementation

Florida A & M University - Department of Computer and Information Sciences Logical Function – Truth Table InputsOutputs ABCWXYZ

Florida A & M University - Department of Computer and Information Sciences Logic Function –Boolean Algebra Find a logical expression for the logical function with three inputs A, B, and C and four outputs W, X, Y and Z such that W is true if at least two of the inputs is true, X is true if exactly one of the inputs is true, Y is true if B is false, and Z is true if all three inputs are true.

Florida A & M University - Department of Computer and Information Sciences Function – Simplified Boolean Algebra Find a logical expression for the logical function with three inputs A, B, and C and four outputs W, X, Y and Z such that W is true if at least two of the inputs is true, X is true if exactly one of the inputs is true, Y is true if B is false, and Z is true if all three inputs are true.

Florida A & M University - Department of Computer and Information Sciences Decoder n input bits 2 n outputs (Out0, Out1, …, Out2 n -1) n-bit input translated into a signal that corresponds to the binary value of the n-bit input (i.e. If n-bit input is i, then Outi will be true and others false)

Florida A & M University - Department of Computer and Information Sciences Encoder 2 n inputs n-bit output (Out0, Out1, …, Outn-1) Inverse function of a decoder

Florida A & M University - Department of Computer and Information Sciences Multiplexor / Selector n inputs 1 output – one of the inputs Control (selector) lines determine which input becomes the output  log 2 n  = # of required control

Florida A & M University - Department of Computer and Information Sciences Multiplexor (2-1) S0S0 ABZ

Florida A & M University - Department of Computer and Information Sciences Multiplexor (4-1)

Florida A & M University - Department of Computer and Information Sciences Don’t Cares Situations where one does not care what the value of some output is Another output is true Subset of input combinations determines the values of the outputs Make it easier to optimize implementation of a logic function due to simpler expression Two types Output : don’t care about its value for some input combination Input : output depends on only some of the inputs Appear as x’s in truth table

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ 11111x 11011x 10111x 10011x 01111x

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ 11111x 11011x 10111x 10011x 01111x

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ 1xx11x 1xx11x 1xx11x 1xx11x 01111x

Florida A & M University - Department of Computer and Information Sciences Don’t Cares – example Find a logical expression for the logical function with three inputs A, B, and C and three outputs W, Y and Z such that: W is true if A or C are true, no matter the value of B, Y is true if A or B is true, no matter the value of C, and Z is true if exactly one of the inputs is true and don’t care about its value when both W and Y are true. InputsOutputs ABCWYZ 1xx11x 01111x

Florida A & M University - Department of Computer and Information Sciences Array of Logic Elements Combinational operations must be performed on an entire word (32 bits) Represent by showing that a given operation will happen to entire collection of inputs Example: A and B are both 32 bits Output, which is also 32 bits, gets A or B

Florida A & M University - Department of Computer and Information Sciences What is the digital logic implementation?

Florida A & M University - Department of Computer and Information Sciences What is the digital logic implementation? All multiplexers controlled by the same selector input 0 selects A 1 selects B

Florida A & M University - Department of Computer and Information Sciences Arithmetic Logic Unit (ALU) Brawn of the computer Performs arithmetic operations Addition Subtraction Performs logical operations AND OR

Florida A & M University - Department of Computer and Information Sciences Arithmetic Logic Unit (ALU) MIPS need 32-bit wide ALU Connect 32 1-bit ALUs

Florida A & M University - Department of Computer and Information Sciences ALU Logical Operations Operation value selects logical operation 0 for a AND b 1 for a OR b

Florida A & M University - Department of Computer and Information Sciences ALU Addition (Adder) Three inputs two operands carryin : carryout of neighbor adder Two outputs sum carryout

Florida A & M University - Department of Computer and Information Sciences Adder Implementation? InputsOutputs abCarryInSumCarryout

Florida A & M University - Department of Computer and Information Sciences Adder Implementation

Florida A & M University - Department of Computer and Information Sciences AND, OR, Adder implementation 32-bit ALU constructed from 32 1-bit ALUs

Florida A & M University - Department of Computer and Information Sciences AND, OR, Adder implementation 32-bit ALU constructed from 32 1-bit ALUs

Florida A & M University - Department of Computer and Information Sciences Adder Modification for Subtraction Add a 2:1 multiplexor that chooses between b and CarryIn of ALU0 set to 1 for subtraction Remember two’s complement

Florida A & M University - Department of Computer and Information Sciences NOR functionality Recall DeMorgan’s

Florida A & M University - Department of Computer and Information Sciences slt Functionality RECALL: All bits except the least significant bit is 0, with the least significant bit set according to comparison Expand multiplexor to 4:1 with new input Less Less = 0 on ALU1 – ALU31 (a - b) < 0  a < b ALU31 (most significant bit ALU) has extra output line Set adder output (also used for overflow detection) used only for slt input LESS on ALU0 (least significant bit ALU)

Florida A & M University - Department of Computer and Information Sciences ALU Building Blocks ALU0 – ALU30 ALU31

Florida A & M University - Department of Computer and Information Sciences ALU

Florida A & M University - Department of Computer and Information Sciences Branch Instructions Branch if either two registers are equal or if they are unequal Equality Test: subtract b from a and then test to see if result is 0 REMEMBER: a – b = 0  a = b Implement:

Florida A & M University - Department of Computer and Information Sciences MIPS ALU Combine CarryIn and Binvert into one single control line Bnegate both set to 1 for subtraction both set to 0 for addition and logical operations 4 bit control lines Ainvert (1 bit) Bnegate (1 bit) Operation (selector) for multiplexor (2 bits)

Florida A & M University - Department of Computer and Information Sciences MIPS ALU

Florida A & M University - Department of Computer and Information Sciences MIPS ALU Control Lines Function AinvertBnegateOperation 0000AND 0001OR 0010add 0110subtract 0111slt 1100NOR