CPS3340 COMPUTER ARCHITECTURE Fall Semester, 2013 09/19/2013 Lecture 7: 32-bit ALU, Fast Carry Lookahead Instructor: Ashraf Yaseen DEPARTMENT OF MATH &

Slides:



Advertisements
Similar presentations
1 ECE 4436ECE 5367 Computer Arithmetic I-II. 2 ECE 4436ECE 5367 Addition concepts 1 bit adder –2 inputs for the operands. –Third input – carry in from.
Advertisements

CPS3340 COMPUTER ARCHITECTURE Fall Semester, /15/2013 Lecture 11: MIPS-Conditional Instructions Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Arithmetic for Computers
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.
Datorteknik ArithmeticCircuits bild 1 Computer arithmetic Somet things you should know about digital arithmetic: Principles Architecture Design.
Mohamed Younis CMCS 411, Computer Architecture 1 CMCS Computer Architecture Lecture 7 Arithmetic Logic Unit February 19,
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
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.
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
Chapter # 5: Arithmetic Circuits Contemporary Logic Design Randy H
Lecture 8 Arithmetic Logic Circuits
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
Chapter Four Arithmetic and Logic Unit
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
1  1998 Morgan Kaufmann Publishers Chapter Four Arithmetic for Computers.
Chapter 3 Arithmetic for Computers. Arithmetic Where we've been: Abstractions: Instruction Set Architecture Assembly Language and Machine Language What's.
Binary Arithmetic Stephen Boyd March 14, Two's Complement Most significant bit represents sign. 0 = positive 1 = negative Positive numbers behave.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
Number Systems and Arithmetic or Computers go to elementary school Reading – Peer Instruction Lecture Materials for Computer Architecture by Dr.
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
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Computing Systems Designing a basic ALU.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
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.
1 Lecture 12 Time/space trade offs Adders. 2 Time vs. speed: Linear chain 8-input OR function with 2-input gates Gates: 7 Max delay: 7.
Ch3b- 2 EE/CS/CPE Computer Organization  Seattle Pacific University There is logic to it andRd, Rs, RtRd
1 Arithmetic I Instructor: Mozafar Bag-Mohammadi Ilam University.
COMP541 Arithmetic Circuits
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 –
COMP541 Arithmetic Circuits
CPS3340 Computer Architecture Fall Semester, 2013
1  2004 Morgan Kaufmann Publishers Performance is specific to a particular program/s –Total execution time is a consistent summary of performance For.
Orange Coast College Business Division Computer Science Department CS 116- Computer Architecture Arithmetic: Part II.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
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.
ECE/CS 552: Arithmetic I Instructor:Mikko H Lipasti Fall 2010 University of Wisconsin-Madison Lecture notes partially based on set created by Mark Hill.
Arithmetic-Logic Units. Logic Gates AND gate OR gate NOT gate.
1 Lecture 11: Hardware for Arithmetic Today’s topics:  Logic for common operations  Designing an ALU  Carry-lookahead adder.
Lecture #23: Arithmetic Circuits-1 Arithmetic Circuits (Part I) Randy H. Katz University of California, Berkeley Fall 2005.
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.
EE204 L03-ALUHina Anwar Khan EE204 Computer Architecture Lecture 03- ALU.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
Computer Arthmetic Chapter Four P&H.
Computer Architecture & Operations I
MIPS ALU.
5. Combinational circuits
CSE Winter 2001 – Arithmetic Unit - 1
MIPS ALU.
Arithmetic Circuits (Part I) Randy H
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COMS 361 Computer Organization
Instructor: Mozafar Bag-Mohammadi University of Ilam
A 1-Bit Arithmetic Logic Unit
MIPS ALU.
MIPS ALU.
Presentation transcript:

CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 7: 32-bit ALU, Fast Carry Lookahead Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL STATE UNIVERSITY, WILBERFORCE, OH 1

Review  Last Class  Addition and Subtraction  1-bit ALU  This Class  32-bit ALU  Fast Carry Lookahead  Next Class  Computer Clock

32-bit ALU ripple carry

Subtraction  Subtraction can be done by adding a and b’s negate and 1 By selecting ^b (Binvert = 1) and setting CarryIn to 1 in the least significant bit of the ALU, we get two’s complement subtraction of b from a instead of addition of b to a A 1-bit ALU that performs AND, OR, and addition on a and b or a and -b

Other functions  These four operations (add, subtract, AND, OR) are found in the ALU of almost every computer, and the operations of most MIPS instructions can be performed by this ALU  But, the design of the ALU is incomplete,  NOR function  Support for set on less than instruction (slt)  Handle overflow  Test of zero (equality test to support conditional branch instructions) 5

NOR  Ainvert =1, Binvert =1, Operation =00

Set on less than  Set on less than (slt)  For comparison of two integers a and b  Least significant bit 1 if a < b 0 otherwise  Other bits 0

Set on less than

Handling Overflow

32-bit ALU  Bit 0-30: normal 1-bit ALU  Bit 31: 1-bit ALU with overflow detection

Final 32-bit ALU  Bnegate  Every time we want the ALU to subtract, we set both CarryIn and Binvert to 1  Otherwise, both CarryIn and Binvert are set to 0 NOR operation: Binvert is 1, but CarryIn is Don’t Care  We can combine CarryIn and Binvert to a single line of Bnegate

Test of Zero  We want to quickly test if two integers are equal  Design a single signal of Zero

Final 32-bit ALU

ALU Control Signals

Symbol of ALU

Faster Addition  Carry Lookahead  Speeding up addition  Determining the carry in to the high-order bits sooner  Key mechanism Hardware executes in parallel

Explanation of Carry Lookahead  Try to remember CarryOuti+1=CarryIni  Abbreviation of ci for CarryIni  Then c2 can be evaluated faster without waiting for c1  How about c30? Grows rapidly with the number of bits Very complex

Fast Carry Using the First Level of Abstraction  Consider  Generate (gi) and Propagate (pi)  Then

Generates and Propagates  Why gi is called generate?  when gi is 1  ci+1 is “generated”  Why pi is called propagate?  when gi is 0 and pi is 1  ci+1 is “propagated” from ci

4-bit CarryIn

A Plumbing Analog  Wrenches open and close valves  ci+1 will be full  if the nearest generate value gi is on  or pi is on and there is water further upstream  c0 can result in a carry out without the help of any generates but the help of all propagates

Second Level of Abstraction  Super Propagate  Super Generate  Carryin for 16-bit adder

Four 4-bit ALUs with Carry Lookahead to form a 16-bit adder

Example of Fast Carry Lookahead  Consider adding two 16-bit integers a and b  generate gi=ai·bi and propagate pi=ai+bi  Super generate and Super Propagate

Example of Fast Carry Lookahead (cont.)  Finally  How many “steps”?  step 1: produce generate and propagate  step 2: produce super generate and super propagate  step 3: produce carryout  much faster than adder without fast carry lookahead

Summary  1-bit ALU  Logic Functions  Arithmetic Functions  32-bit ALU  Set on less than  Test of Zero  Fast Carry Look ahead

What I want you to do  Review Appendix C  Work on your assignment 2