Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Arithmetic Circuits: Creating Logic Gates for Addition and Subtraction, Slides of Computer Science

An introduction to arithmetic circuits, focusing on creating logic gates for addition and subtraction. It covers the concepts of carry and overflow, truth tables, and the use of one and multiple bit adders and subtracters. The document also discusses the concept of look-ahead carry and reduced propagation for improving the speed of arithmetic circuits.

Typology: Slides

2012/2013

Uploaded on 03/22/2013

dhrupad
dhrupad 🇮🇳

4.4

(17)

221 documents

1 / 13

Toggle sidebar

Related documents


Partial preview of the text

Download Arithmetic Circuits: Creating Logic Gates for Addition and Subtraction and more Slides Computer Science in PDF only on Docsity! Arithmetic Circuits Arithmetic Computer Architecture d O i tian rgan za on Goal for Today • Create logic gates that perform arithmetic Elementary School 17 010001 + 7 +000111 24 011000 You add two numbers together. If the sum is greater than the number base, you add one to the next column. When you add two numbers, you may also have to add the carry from the column to the right. 1 Bit Adder • A one bit adder has three inputs, numbers A and B and Carry in. There are two t t th S d C tou pu s, e um an arry ou . A B one bit adder CinCout Sum Docsity.com Arithmetic Circuits Multiple Bit Adder one bit adder A B one bit adder A B one bit adder A B Cout SumSumSum 1 bit Adder Truth Table figure from textbook Addition Sum A’ B’ A’ B A B A B’ Cin’ 0 1 0 1 Cin 1 0 1 0 Sum = A’BC’ + AB’C’ + A’B’C + ABC Addition Carry Out A’ B’ A’ B A B A B’ Cin’ 0 0 1 0 Cin 0 1 1 1 Cout = AB + BC + AC Docsity.com Arithmetic Circuits What is the equation for Bout? 25% 25%25%25%1. Bout = XY + Bin 2. Bout = YBin + XBin 3. Bout = XBin’+YBin’+XY 4. Bout = XY + X’Bin B ou t = X Y + B i... B ou t = Y Bi n + ... B ou t = X Bi n’+ Y. .. B ou t = X Y + X ’... The equation for Bout X Y Bin Bout Diff 0 0 0 0 0 Bout= XBin’ + YBin’ + XY 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 0 X’ Y’ X’ Y X Y X Y’ Bin’ 0 1 1 1 1 1 0 0 0 1 1 1 1 1 Bin 0 0 1 0 Subtraction • Instead of building a separate subtraction circuit, you can add the negative of the operand. • To make a twos complement number negative, you must invert the bits and add one • A NOT gate can be used to invert all the bits. • Setting the Carry In on the rightmost bit will add one to the result. A+B’+1 = A + (B’+1) = A + (-B) = A - B Draw a Subtraction Circuit • Using one bit adder boxes and OR, AND or NOT gates, draw the logic diagram for a four bit twos complement A - B subtraction circuit. A B one bit adderCarryout Carryin Docsity.com Arithmetic Circuits Subtraction Circuit Propagation Delay • To make a 32 bit adder, you can use 32 bit ddone a ers. • The left most bit cannot be computed until all of the other bits are computed so that the Carry In value will be known. • Each one bit adder requires the signal to go through two gates. Each gate takes a small amount of time to react. • This limits the speed of the adder. Timing for Ripple Adder diagram from Digital Fundamentals by Thomas Floyd Look Ahead Carry • The Carry Out is determined by Ci+1 = Ai*Bi + Ai*Ci + B*Ci Ci+1 = Ai*Bi + Ci*(Ai+ Bi) • The A*B term is true when this bit generates a carry out. Call it Gi • The other term is true when a carry propagates from an earlier bit. Call it Pi Docsity.com Arithmetic Circuits Carry Equations • We can express the carry as: Ci+1 = Gi + (Pi * Ci) Ci+2 = Gi+1 + (Pi+1 * Gi) + (Pi+1 * Pi * Ci) Ci+4 = Gi+3 +(Pi+3 * Gi+2) + (Pi+3 * Pi+2 * Gi+1) + (Pi+3 * Pi+2 * Pi+1 * Gi) + (Pi+3 * Pi+2 * Pi+1 * Pi * Ci) 4 bit Adder with Look Ahead Carry diagram from Digital Fundamentals by Thomas Floyd Reduced Propagation • The simple n bit ripple adder took O(2n) ti t dd bit d t time o a n s ue o carry propaga on. • With carry look ahead, it takes O(3) time to propagate the carry. The look ahead requires more circuitry. Further Simplification • Creating a big adder out of groups of adders can reduce propagation and circuitry four bit adder As Bs four bit adder As Bs four bit adder As Bs Cout SumsSumsSums Docsity.com Arithmetic Circuits B1 is zero so do nothing 01010A 00101 00101 P B Shift A left one bit 10100A 00101 00101 P B B2 is 1 so Add 10100A 11001 00101 P B + Shift A left one bit 01000A 11001 00101 P B Docsity.com Arithmetic Circuits B3 is zero so do nothing 01000A 11001 00101 P B Shift A left one bit 10000A 11001 00101 P B B4 is zero so do nothing 10000A 11001 00101 P B Done 10000A 11001 00101 P B Docsity.com Arithmetic Circuits Combinatorial Multiplier One Bit Multiplier A Pin BB CinCout A if B = 0 then Pin if B = 1 then Pin + A 3 x 3 Example 3 x 3 Example Docsity.com
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved