Lecture 11: Hardware for Arithmetic

Slides:



Advertisements
Similar presentations
Lecture 19: Hardware for Arithmetic Today’s topic –Designing an ALU –Carry Look-Ahead Adder 1.
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.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
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.
Computer Science 210 Computer Organization The Arithmetic Logic Unit.
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.
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.
Chapter 6-1 ALU, Adder and Subtractor
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
Computing Systems Designing a basic ALU.
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.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
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.
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.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
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.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computer Arthmetic Chapter Four P&H. Data Representation Why do we not encode numbers as strings of ASCII digits inside computers? What is overflow when.
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.
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.
Computer Arthmetic Chapter Four P&H.
Combinational Circuits
Prof. Sin-Min Lee Department of Computer Science
ECE 3130 Digital Electronics and Design
Lecture 11: Hardware for Arithmetic
Computer Science 210 Computer Organization
Swamynathan.S.M AP/ECE/SNSCT
Homework Reading Machine Projects Labs
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.
Computer Science 210 Computer Organization
ECE 331 – Digital System Design
5. Combinational circuits
Arithmetic Where we've been:
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 12: Adders, Sequential Circuits
Lecture 12: Adders, Sequential Circuits
minecraft.gamepedia.com/Tutorials/Basic_Logic_Gates
CS/COE0447 Computer Organization & Assembly Language
MIPS ALU.
Digital Logic.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
robosavvy.com/forum/viewtopic.php?p=32542
Homework Reading Machine Projects Labs
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

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