1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay.

Slides:



Advertisements
Similar presentations
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Advertisements

Modular Combinational Logic
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.
Introduction So far, we have studied the basic skills of designing combinational and sequential logic using schematic and Verilog-HDL Now, we are going.
Class Exercise 1A.
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,
DPSD This PPT Credits to : Ms. Elakya - AP / ECE.
1 CS 140 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris.
Arithmetic II CPSC 321 E. J. Kim. Today’s Menu Arithmetic-Logic Units Logic Design Revisited Faster Addition Multiplication (if time permits)
Fall 2005 L15: Combinational Circuits Lecture 15: Combinational Circuits Complete logic functions Some combinational logic functions –Half adders –Adders.
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.
Fall 2007 L15: Combinational Circuits Lecture 15: Combinational Circuits Complete logic functions Some combinational logic functions –Half adders –Adders.
ECE C03 Lecture 61 Lecture 6 Arithmetic Logic Circuits Hai Zhou ECE 303 Advanced Digital Design Spring 2002.
30 September 2004Comp 120 Fall September 2004 Chapter 4 – Logic Gates Read in Chapter 4 pages , , section 4.8 through top of page.
Lecture 8 Arithmetic Logic Circuits
Arithmetic-Logic Units CPSC 321 Computer Architecture Andreas Klappenecker.
ECE 301 – Digital Electronics
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
Adders, subtractors, ALUs
 Arithmetic circuit  Addition  Subtraction  Division  Multiplication.
Binary Numbers.
Logical Circuit Design Week 8: Arithmetic Circuits Mentor Hamiti, MSc Office ,
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CS1Q Computer Systems Lecture 9 Simon Gay. Lecture 9CS1Q Computer Systems - Simon Gay2 Addition We want to be able to do arithmetic on computers and therefore.
IKI a-Combinatorial Components Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Copyright 1995 by Coherence LTD., all rights reserved (Revised: Oct 97 by Rafi Lohev, Oct 99 by Yair Wiseman, Sep 04 Oren Kapah) IBM י ב מ 10-1 The ALU.
Fall 2004EE 3563 Digital Systems Design EE 3563 Comparators  Comparators determine if two binary inputs are equal  Some will signal greater than/less.
Chapter 6-1 ALU, Adder and Subtractor
ECE 3110: Introduction to Digital Systems Chapter 6 Combinational Logic Design Practices Adders, subtractors, ALUs.
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Nov 10, 2008ECE 561 Lecture 151 Adders. Nov 10, 2008ECE 561 Lecture 152 Adders Basic Ripple Adders Faster Adders Sequential Adders.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices X-OR gates and Parity circuits Comparators Adders, subtractors,
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
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.
Logic and computers 2/6/12. Binary Arithmetic /6/ Only two digits: the bits 0 and 1 (Think: 0 = F, 1.
1 Arithmetic I Instructor: Mozafar Bag-Mohammadi Ilam University.
COMP541 Arithmetic Circuits
BR 8/991 Combinational Building Blocks 2/1 Multiplexor (MUX) I0 I1 Y S if S = 0, then Y = I0 if S = 1, then Y = I1 Y = I0 S’ + I1 S I0 I1 Y S A[3:0] B[3:0]
1 Carry Lookahead Logic Carry Generate Gi = Ai Bi must generate carry when A = B = 1 Carry Propagate Pi = Ai xor Bi carry in will equal carry out here.
B1000 ALU ENGR xD52 Eric VanWyk Fall Today Review Timing with Adders Construct Adder/Subtractor Construct ALU.
1 Fundamentals of Computer Science Combinational Circuits.
Cpu control.1 2/14 Datapath Components for Lab The Processor! ( th ed)
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.
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.
Simple ALU  Half adder  Full adder  Constructing 4 bits adder  ALU does several operations  General ALU structure  Timing diagram of adder  Overflow.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ECE 3110: Introduction to Digital Systems Chapter 5 Combinational Logic Design Practices Adders,subtractors, ALUs.
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.
ETE 204 – Digital Electronics Combinational Logic Design Single-bit and Multiple-bit Adder Circuits [Lecture: 9] Instructor: Sajib Roy Lecturer, ETE,ULAB.
Combinational Circuits
Somet things you should know about digital arithmetic:
Lecture 11: Hardware for Arithmetic
Homework Reading Machine Projects Labs
Combinational Logic Logic circuits for digital systems may be combinational or sequential. A combinational circuit consists of input variables, logic gates,
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.
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
CSE 140: Discussion #4 Nima Mousavi.
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 11: Hardware for Arithmetic
Homework Reading Machine Projects Labs
COMS 361 Computer Organization
Combinational Circuits
Lecture 3 Combinational units. Adders
Presentation transcript:

1 The ALU l ALU includes combinational logic. –Combinational logic  a change in inputs directly causes a change in output, after a characteristic delay. –Different from sequential logic which only changes on the clock. l Two major components of combinational logic are – multiplexors & decoders. l 2-input multiplexor (or selector) is implemented with gates below abab s c symbol abab c s gate implementation

2 Multiplexors can have any number of inputs (in theory) Multiplexors can apply to buses  multiplied for many lines. –Example: 1 x 2 multiplexor on 32 bits bus s0 c 3 X 8 multiplexor s1 s2 a31 b31 s c31 a30 b30 c a0 b0 c0 M M M abab s c 32 symbol Multiplexors (MUXes)

3 Decoders l Each combination of the inputs enables exactly one output. I2I1I0O7O6O5O4O3O2O1O DECODER InputsOutputs 3 X 8 Decoder

4 The ALU l The ALU provides the basic logical and arithmetic functions: AND, OR plus addition. l Subtraction in 2's complement  invert +1. l Shift, multiplication and division are usually outside the basic ALU. Logical operations abab select (AND or OR) result 0101 MUX 1 bit logical unit for AND/OR operations

5 abC in sumC out inputs outputs sum = ( a  b  C in ) + ( a  b  C in ) + ( a  b  C in ) + ( a  b  C in ) = a + b + C in C out =(b  C in ) + (a  C in ) + (a  b) = ((a + b)  C in ) + (a  b) abab C out C in Adder hardware for C out in 2 layers 1 bit FULL adder (3,2) ab C in C out sum Carry in Carry out

6 Full Adder from Half Adders Half adder Full adder from 2 half adders + or gate abab Cout sum Cin abab Cout sum

7 1 bit simple ALU for logical / arithmetic operations abab select result Cin Cout 1 Bit Simple ALU

8 Enhanced for subtraction abab select result Cin Cout invert 1's complement 2's complement: use Cin = 1 subtraction: a + b + 1 = a + (b + 1) = a + (-b) = a - b Bit Enhanced ALU

9 Ripple Carry Type Adder l To produce a 32 bit result, we connect 32 single bit units together. l This type of ALU adder is called a ripple adder – Carry bits are generated in sequence. – Bit 31 result and Cout is not correct until it receives Cin from previous unit, which is not correct until it receives Cin from its previous unit, etc. – Total operation time is proportional to word size (here 32). a0 b0 result 0 Cin Cout Cin ALU0 Cout Cin ALU1 Cout Cin ALU2 Cout Cin ALU31 Cout a1 b1 a2 b2 a31 b31 result 1 result 2 result operation = invert + select 32 bit ADDER with ripple carry: 3

10 Carry Lookahead l Ripple arithmetic operations are too slow for high performance l We can calculate all carries in 2-level logic, avoiding the ripple. We know that any logical function can be represented in canonical form (sum of products) but it requires more gates  too expensive. – Carry bit i has two possibilities: either a   b and no carry in, or a + b and carry in. But carry in itself is the same combination of the bits previous to those that created it. Hence two level logic has 2 n terms for n bits. l Practical adders use carry lookahead. – factors out two basic functions which give us the carries » Generate - does bit i create a carry by itself? » Propagate - does bit i send a carry ahead to the next position? g i = (a i  b i ) p i = (a i  b i ) c i+1 = g i + p i   c i

11 Illustration of Carry Lookahead for 4 Bit Adder c in = c 0 C out a 0 b 0 result 0 ALU0ALU1ALU2ALU3 a 1 b 1 a 2 b 2 a 3 b 3 result 1 result 2 result 3 c 1 = g 0 + (p 0  c 0 ) c 2 = g 1 + (p 1  g 0 ) + (p 1  p 0  c 0 ) c 3 = g 2 + (p 2  g 1 ) + (p 2  p 1  g 0 ) + (p 2  p 1  p 0  c 0 ) c 4 = g 3 + (p 3  g 2 ) + (p 3  p 2  g 1 ) + (p 3  p 2   p 1  g 0 ) + (p 3  p 2   p 1   p 0  c 0 ) Carry Lookahead Unit g 0 p 0 g 1 p 1 g 2 p 2 g 3 p 3 p0g0p0g0 p1g1p1g1 p2g2p2g2 p3g3p3g3 c in = c 0

12 Carry Lookahead Concept Generalized to Higher Levels C out a 0..3 b 0..3 result bit Adder bit Adder bit Adder bit Adder result 4..7 result result Carry Lookahead on 4-bit units (provides logarithmic complexity) C in = C 0 G 0 P 0 G 1 P 1 G 2 P 2 G 3 P 3 P i = p i0  p i1  p i2  p i3 C i+1 = G i + P i  C i G i = g i3 + g i2  p i3 + g i1  p i2  p i3 + g i0  p i1  p i2  p i3 C in = C 0 p 00,..., p 03 g 00,..., g 03 p 1x g 1x p 2x g 2x p 3x g 3x a 4..7 b 4..7 a b a b