UIVERSITY OF CALIFORIA College of Engineering Deprtment of Electricl Engineering nd Computer Sciences Lst modified on April 8, 2002 y Tufn Krlr (tufn@eecs.erkeley.edu) Jn M. Rey, Andrei Vldemirescu Homework #9 Solutions EECS 4 Due 04/9/02, 5pm, in 558 Cory Prolem ) In the first prt. We need one XOR dely to otin the first propgte, then two gte delys to rech the c out. Then for the next 6 stges we need 2 gte delys from c in to c out in the finl stge we hve to sum XOR dely. The totl dely is t totl =4*t p + 6*2t p + 2t p = 8t p ) In prt we ssume tht the CLA logic functions implemented re c o3 = g 3 + p 3 g 2 +p 3 p 2 g +p 3 p 2 p g 0 +p 3 p 2 p p 0 c in c o2 = g 2 + p 2 g + p 2 p g 0 + p 2 p p 0 c in c o = g + p g 0 + p p 0 c in c o0 = g 0 + p 0 c in c o3 Ripple the crry etween two locks We spend n XOR dely to otin g s nd p s. Then from inputs to c o3 we go through one 5 input AD nd 5 input OR, then the c o3 is pssed to the next stge nd gin it genertes the c o2 nd finlly goes through n XOR gte c o2 sees 4 input AD n 4 input OR. 2tp + 0.25*5 2 tp + 0.25*5 2 tp+0.25*4 2 tp + 0.25*4 2 tp+2tp = (2+6.25+6.25+4+4+2)tp = 24.5tp 0 0 c o3 Select the sum out etween two lterntives As n lterntive (fster) solution the second lock performs crry select opertion. In the cse oth sums re generted in the second lock. And we only need to choose using
MUX. A MUX implements the function F = s + s. So it hs dely with two input AD, nd two input OR. t totl = 2tp + 0.25*5 2 tp + 0.25*5 2 tp+ tp + tp = (2 + 6.25+6.25 ++)tp = 6.5tp c) In the CLA dder it tkes n XOR dely to generte the individul p i,g i. 4-input AD nd 4-input OR to generte the lock P nd G s (4t p +4t p ). From the outputs of the top level (in the digrm) it tkes n dditionl 4-AD, 4-ADdelys (4t p +4t p ) to generte mid level lock P, G. Then, 2 input AD, 2 input OR mke us go through ottom level (t p +t p ). After n dditionl 2 input AD, 2 input OR we go through middle level (t p +t p ) nd rech ck t top level in the digrm. In this top level 2 input AD, 2 input OR (t p +t p ) is needed to generte the finl crry nd, finl XOR (2t p ) is needed to otin the sum. (2+4+4+4+4+2+2+2+2)tp = 26tp In the RCA cse we gin hve 4tp+30*2tp+2tp = 66tp. As we cn clerly see the s the numer of its increse the crry look hed dder hs distinct dvntge. But for dders with less thn 0-its its usully wiser to do the implementtion simply in ripple crry. Otin p i,g i (2t p ) Clculte the sum it 2t p +2t p Otin P,G lock propgte genertets 8t p +8t p Pss the crry ck 2t p + 2t p The inputs of the top level re the individul p i,g i.as mentioned in prt ) the equtions implemented re p i+3:i = p i+3 p i+2 p i+ p i g i+3:i = g i+3 + p i+3 g i+2 +p i+3 p i+2 g i++ p i+3 p i+2 p i+ g i we cn see tht the worst cse dely is 4 input AD + 4 input OR g i+3:i mens crry is generted within the lock encompssing it positions i+3 to i p i+3:i mens the crry in of the lock is pssed to the crry out of the lock. The mid level locks implement p i+5:i = p i+5:i+2 p i+:i+8 p i+7:i+4 p i+3:i g i+5:i = g i+5:i+2 + p i+5:i+2 g i+:i+8+ p i+5:i+2 p i+:i+8 g i+7:i+4+ p i+5:i+2 p i+:i+8 p i+7:i+4 g i+3:i
Once we hve the p i:k nd g i:k s nd c o(k-) (i.e. the crry out t stge k-), we cn otin the crry out of stge i using the reltion c oi = g i:k + p i:k c o(k-) (Hs dely of 2input AD nd 2-input OR) Mening tht to get crry out t i th it position, the lock encompssing i - k should either generte crry or pss the crry coming s c o(k-) Prolem 2 ) For the first prt of this prolem the simplest wy of implementtion is check to see if B-A <0 if so the sign of the difference would e to signify tht B<A the lock digrm for this would e The MSB of the output is t the sme time the output of the comprtor out[n] out Cin= ) Assuming the dder is Ripple crry dder. The worst cse dely of the comprtor would e, 4*t p +(-2)*2t p +2*t p = (+)*2t p
Prolem 3 For this third prolem we will implement the technique clled Bugh-Wooley multipliers Consider the multipliction of two signed inry numers where the prnthesis signify negtive weighted it. ( 3 ) 2 0 ( 3 ) 2 0 ( 3 0 ) 2 0 0 0 0 ( 3 ) 2 0 ( 3 2 ) 2 2 2 0 2 3 3 ( 2 3 ) ( 3 ) ( 0 3 ) p 7 p 6 p 5 p 4 p 3 p 2 p p0 ( 3 ) 2 0 ( 3 ) 2 0 2 0 0 0 0 2 0 3 3 0 2 2 2 0 2 ( 3 2 ) ( 3 ) ( 3 0 ) ( 2 3 ) ( 3 ) ( 0 3 ) p 7 p 6 p 5 p 4 p 3 p 2 p p 0 As we see ove the prtil products cn e clssified s positive nd negtive terms. We re trying to dd the positive prtil products (ove dshed line) nd sutrct the negtive prtil products (those elow the dshed line). The negtively weighted prtil products cn e interpreted s two numers tht must e sutrcted. Insted of sutrcting, they cn e negted nd the whole rry cn e dded. We need to perform this negtion smrtly. For 3 = we wnt to negte the numer 0 0 ( 3 2 ) ( 3 ) ( 3 0 ) + This requires inverting ll the its nd dding. The logic function tht produces the ove results for 3 = nd zero for 3 =0 is interpret is either s: 3 3 or equivlently s: 4 + 3 i. For the leding two positions we cn
If the method is used lso for negting the prtil products strting with 3 nd the results re entered ck into the initil prtil sum rry. We would get. of the min rry we cn otin the result p[7:0] cout sin sout 3 3 0 2 2 2 0 2 cout sin FA ( 3 ) 2 0 ( 3 ) 2 0 2 0 0 0 0 2 0 3 32 3 30 3 23 3 03 3 3 P 7 P 6 p 5 p 4 p 3 p 2 p p 0 We cn implement these chnges in the following wy. Using the lock elow s the processing element sout 3 3 2 0 0 2 ~3 ~4 3 3 p7 p6 p5 p4 p3 p2 p p0