Lecture 11: Hardware for Arithmetic

Slides:



Advertisements
Similar presentations
Modular Combinational Logic
Advertisements

Combinational Circuits
Lecture 19: Hardware for Arithmetic Today’s topic –Designing an ALU –Carry Look-Ahead Adder 1.
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.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
Cosc 2150: Computer Organization Chapter 3: Boolean Algebra and Digital Logic.
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
1 Lecture 4: Arithmetic for Computers (Part 3) CS 447 Jason Bakos.
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.
Chap 3.3~3.5 Construction an Arithmetic Logic Unit (ALU) Jen-Chang Liu, Spring 2006.
1 Lecture 11: Digital Design Today’s topics:  Evaluating a system  Intro to boolean functions.
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Constructing a Computer Creating a general purpose computing device.
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.
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.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
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.
Computing Systems Designing a basic ALU.
IT253: Computer Organization Lecture 7: Logic and Gates: Digital Design Tonga Institute of Higher Education.
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.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
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 –
1 Lecture 10: Floating Point, Digital Design Today’s topics:  FP arithmetic  Intro to Boolean functions.
CS/COE0447 Computer Organization & Assembly Language
1  2004 Morgan Kaufmann Publishers Performance is specific to a particular program/s –Total execution time is a consistent summary of performance For.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
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.
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.
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.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.
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 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Computer Arthmetic Chapter Four P&H.
Combinational Circuits
Prof. Sin-Min Lee Department of Computer Science
ECE 3130 Digital Electronics and Design
מבנה מחשב תרגול 3.
Computer Science 210 Computer Organization
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
MIPS ALU.
Lecture 10: Floating Point, Digital Design
Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan
5. Combinational circuits
Arithmetic Where we've been:
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 12: Adders, Sequential Circuits
CS/COE0447 Computer Organization & Assembly Language
MIPS ALU.
Boolean Algebra.
Digital Logic.
Lecture 11: Hardware for Arithmetic
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Homework Reading Machine Projects Labs
CS/COE0447 Computer Organization & Assembly Language
Digital Logic.
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
October 8 Rules for Programming Assignments ASK QUESTIONS!
Combinational Circuits
MIPS ALU.
MIPS ALU.
Presentation transcript:

Lecture 11: Hardware for Arithmetic Today’s topics: Logic for common operations Designing an ALU

Boolean Algebra Equations involving two values and three primary operators: OR : symbol + , X = A + B  X is true if at least one of A or B is true AND : symbol . , X = A . B  X is true if both A and B are true NOT : symbol , X = A  X is the inverted value of A

Boolean Algebra Rules Identity law : A + 0 = A ; A . 1 = A Zero and One laws : A + 1 = 1 ; A . 0 = 0 Inverse laws : A . A = 0 ; A + A = 1 Commutative laws : A + B = B + A ; A . B = B . A Associative laws : A + (B + C) = (A + B) + C A . (B . C) = (A . B) . C Distributive laws : A . (B + C) = (A . B) + (A . C) A + (B . C) = (A + B) . (A + C)

DeMorgan’s Laws A + B = A . B A . B = A + B Confirm that these are indeed true

Pictorial Representations AND OR NOT Source: H&P textbook What logic function is this? Source: H&P textbook

Boolean Equation Consider the logic block that has an output E that is true only if exactly two of the three inputs A, B, C are true Multiple correct equations: Two must be true, but all three cannot be true: E = ((A . B) + (B . C) + (A . C)) . (A . B . C) Identify the three cases where it is true: E = (A . B . C) + (A . C . B) + (C . B . A)

Sum of Products Can represent any logic block with the AND, OR, NOT operators Draw the truth table For each true output, represent the corresponding inputs as a product The final equation is a sum of these products A B C E 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0 (A . B . C) + (A . C . B) + (C . B . A) Can also use “product of sums” Any equation can be implemented with an array of ANDs, followed by an array of ORs

NAND and NOR NAND : NOT of AND : A nand B = A . B NOR : NOT of OR : A nor B = A + B NAND and NOR are universal gates, i.e., they can be used to construct any complex logical function

Common Logic Blocks – Decoder Takes in N inputs and activates one of 2N outputs I0 I1 I2 O0 O1 O2 O3 O4 O5 O6 O7 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 3-to-8 Decoder I0-2 O0-7

Common Logic Blocks – Multiplexor Multiplexor or selector: one of N inputs is reflected on the output depending on the value of the log2N selector bits 2-input mux Source: H&P textbook

Adder Algorithm 1 0 0 1 0 1 0 1 Sum 1 1 1 0 Carry 0 0 0 1 1 0 0 1 0 1 0 1 Sum 1 1 1 0 Carry 0 0 0 1 Truth Table for the above operations: A B Cin Sum Cout 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

Adder Algorithm 1 0 0 1 0 1 0 1 Sum 1 1 1 0 Carry 0 0 0 1 1 0 0 1 0 1 0 1 Sum 1 1 1 0 Carry 0 0 0 1 Equations: Sum = Cin . A . B + B . Cin . A + A . Cin . B + A . B . Cin Cout = A . B . Cin + A . B . Cin + B . Cin . A = A . B + A . Cin + B . Cin Truth Table for the above operations: A B Cin Sum Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1

Carry Out Logic Equations: Sum = Cin . A . B + B . Cin . A + A . Cin . B + A . B . Cin Cout = A . B . Cin + A . B . Cin + B . Cin . A = A . B + A . Cin + B . Cin Source: H&P textbook

1-Bit ALU with Add, Or, And Multiplexor selects between Add, Or, And operations Source: H&P textbook

32-bit Ripple Carry Adder 1-bit ALUs are connected “in series” with the carry-out of 1 box going into the carry-in of the next box Source: H&P textbook

Incorporating Subtraction Must invert bits of B and add a 1 Include an inverter CarryIn for the first bit is 1 The CarryIn signal (for the first bit) can be the same as the Binvert signal Source: H&P textbook

Incorporating NOR and NAND Source: H&P textbook

Incorporating slt Perform a – b and check the sign New signal (Less) that is zero for ALU boxes 1-31 The 31st box has a unit to detect overflow and sign – the sign bit serves as the Less signal for the 0th box Source: H&P textbook

Incorporating beq Perform a – b and confirm that the result is all zero’s Source: H&P textbook

Control Lines What are the values of the control lines and what operations do they correspond to? Source: H&P textbook

Control Lines What are the values of the control lines and what operations do they correspond to? Ai Bn Op AND 0 0 00 OR 0 0 01 Add 0 0 10 Sub 0 1 10 SLT 0 1 11 NOR 1 1 00 Source: H&P textbook

Title Bullet