Lecture 12: Adders, Sequential Circuits

Slides:



Advertisements
Similar presentations
Lecture 13: Sequential Circuits
Advertisements

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.
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.
Lecture 22: Sequential Circuits Today’s topic –Clocks and sequential circuits –Finite state machines 1.
1 CONSTRUCTING AN ARITHMETIC LOGIC UNIT CHAPTER 4: PART II.
Lecture 20: Hardware for Arithmetic Today’s topic –Carry Look-Ahead Adder 1.
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.
Lecture 8 Arithmetic Logic Circuits
Lecture 16: Basic CPU Design
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
Chapter # 5: Arithmetic Circuits
Chapter 6-1 ALU, Adder and Subtractor
Csci 136 Computer Architecture II – Constructing An Arithmetic Logic Unit Xiuzhen Cheng
Computing Systems Designing a basic ALU.
COE 202: Digital Logic Design Combinational Circuits Part 2 KFUPM Courtesy of Dr. Ahmad Almulhem.
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.
Building a Faster Adder
CPE 232 MIPS Arithmetic1 CPE 232 Computer Organization MIPS Arithmetic – Part I Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin (
1 Lecture 12: Adders, Sequential Circuits Today’s topics:  Carry-lookahead adder  Clocks, latches, sequential circuits.
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.
C-H1 Lecture Adders Half adder. C-H2 Full Adder si is the modulo- 2 sum of ci, xi, yi.
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.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1.
PRESENTATION Carry Look Ahead Adder.
1 Lecture 13: Sequential Circuits, FSM Today’s topics:  Sequential circuits  Finite state machines  Single-cycle CPU Reminder: midterm on Tue 10/20.
Somet things you should know about digital arithmetic:
Lecture 12 Logistics Last lecture Today HW4 due today Timing diagrams
Lecture Adders Half adder.
Lecture 11: Hardware for Arithmetic
Lecture 15: Basic CPU Design
Addition and multiplication
ECE/CS 552: Carry Lookahead
CS352H: Computer Systems Architecture
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Topics Number representation. Shifters. Adders and ALUs.
Combinational Circuits
Lecture 13: Sequential Circuits, FSM
ECE 331 – Digital System Design
5. Combinational circuits
Digital Logic Structures Logic gates & Boolean logic
CSE Winter 2001 – Arithmetic Unit - 1
Lecture 12: Adders, Sequential Circuits
Topic 3b Computer Arithmetic: ALU Design
Lecture 13: Sequential Circuits, FSM
Lecture 14 Logistics Last lecture Today
Arithmetic Circuits (Part I) Randy H
Lecture 15 Logistics Last lecture Today HW4 is due today
Instructor: Alexander Stoytchev
Digital Logic.
Lecture 11: Hardware for Arithmetic
Topic 3b Computer Arithmetic: ALU Design
CS 140 Lecture 14 Standard Combinational Modules
Digital System Design Combinational Logic
CSE 140 Lecture 14 Standard Combinational Modules
Instructor: Alexander Stoytchev
Addition and multiplication
Instructor: Mozafar Bag-Mohammadi University of Ilam
Instructor: Alexander Stoytchev
Lecture 14 Logistics Last lecture Today
Addition and multiplication
Instructor: Alexander Stoytchev
Lecture 9 Digital VLSI System Design Laboratory
Arithmetic Circuits.
Presentation transcript:

Lecture 12: Adders, Sequential Circuits Today’s topics: Carry-lookahead adder Clocks, latches, sequential circuits

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

Speed of Ripple Carry The carry propagates thru every 1-bit box: each 1-bit box sequentially implements AND and OR – total delay is the time to go through 64 gates! We’ve already seen that any logic equation can be expressed as the sum of products – so it should be possible to compute the result by going through only 2 gates! Caveat: need many parallel gates and each gate may have a very large number of inputs – it is difficult to efficiently build such large gates, so we’ll find a compromise: moderate number of gates moderate number of inputs to each gate moderate number of sequential gates traversed

Computing CarryOut CarryIn1 = b0.CarryIn0 + a0.CarryIn0 + a0.b0 = b1.b0.c0 + b1.a0.c0 + b1.a0.b0 + a1.b0.c0 + a1.a0.c0 + a1.a0.b0 + a1.b1 … CarryIn32 = a really large sum of really large products Potentially fast implementation as the result is computed by going thru just 2 levels of logic – unfortunately, each gate is enormous and slow

Generate and Propagate Equation re-phrased: Ci+1 = ai.bi + ai.Ci + bi.Ci = (ai.bi) + (ai + bi).Ci Stated verbally, the current pair of bits will generate a carry if they are both 1 and the current pair of bits will propagate a carry if either is 1 Generate signal = ai.bi Propagate signal = ai + bi Therefore, Ci+1 = Gi + Pi . Ci

Generate and Propagate c1 = g0 + p0.c0 c2 = g1 + p1.c1 = g1 + p1.g0 + p1.p0.c0 c3 = g2 + p2.g1 + p2.p1.g0 + p2.p1.p0.c0 c4 = g3 + p3.g2 + p3.p2.g1 + p3.p2.p1.g0 + p3.p2.p1.p0.c0 Either, a carry was just generated, or a carry was generated in the last step and was propagated, or a carry was generated two steps back and was propagated by both the next two stages, or a carry was generated N steps back and was propagated by every single one of the N next stages

Divide and Conquer The equations on the previous slide are still difficult to implement as logic functions – for the 32nd bit, we must AND every single propagate bit to determine what becomes of c0 (among other things) Hence, the bits are broken into groups (of 4) and each group computes its group-generate and group-propagate For example, to add 32 numbers, you can partition the task as a tree . . . . . . . . . . . . . . . . . . . . .

P and G for 4-bit Blocks Compute P0 and G0 (super-propagate and super-generate) for the first group of 4 bits (and similarly for other groups of 4 bits) P0 = p0.p1.p2.p3 G0 = g3 + g2.p3 + g1.p2.p3 + g0.p1.p2.p3 Carry out of the first group of 4 bits is C1 = G0 + P0.c0 C2 = G1 + P1.G0 + P1.P0.c0 C3 = G2 + (P2.G1) + (P2.P1.G0) + (P2.P1.P0.c0) C4 = G3 + (P3.G2) + (P3.P2.G1) + (P3.P2.P1.G0) + (P3.P2.P1.P0.c0) By having a tree of sub-computations, each AND, OR gate has few inputs and logic signals have to travel through a modest set of gates (equal to the height of the tree)

Example Add A 0001 1010 0011 0011 B 1110 0101 1110 1011 g 0000 0000 0010 0011 p 1111 1111 1111 1011 P 1 1 1 0 G 0 0 1 0 C4 = 1

Carry Look-Ahead Adder 16-bit Ripple-carry takes 32 steps This design takes how many steps? Source: H&P textbook

Clocks A microprocessor is composed of many different circuits that are operating simultaneously – if each circuit X takes in inputs at time TIX, takes time TEX to execute the logic, and produces outputs at time TOX, imagine the complications in co-ordinating the tasks of every circuit A major school of thought (used in most processors built today): all circuits on the chip share a clock signal (a square wave) that tells every circuit when to accept inputs, how much time they have to execute the logic, and when they must produce outputs

Clock Terminology Rising clock edge Cycle time Falling clock edge 4 GHz = clock speed = 1 = 1 . cycle time 250 ps

Sequential Circuits Until now, circuits were combinational – when inputs change, the outputs change after a while (time = logic delay thru circuit) Combinational Circuit Combinational Circuit Inputs Outputs We want the clock to act like a start and stop signal – a “latch” is a storage device that separates these circuits – it ensures that the inputs to the circuit do not change during a clock cycle Clock Clock Combinational Circuit Combinational Circuit Outputs Inputs Latch Latch

Sequential Circuits Sequential circuit: consists of combinational circuit and a storage element At the start of the clock cycle, the rising edge causes the “state” storage to store some input values This state will not change for an entire cycle (until next rising edge) The combinational circuit has some time to accept the value of “state” and “inputs” and produce “outputs” Some of the outputs (for example, the value of next “state”) may feed back (but through the latch so they’re only seen in the next cycle) Inputs State Clock Outputs Inputs Combinational Cct

Title Bullet