S 224 DIGITAL LOGI & STATE MAHINE DESIGN SPRING 214 DUE : Mrh 27, 214 HOMEWORK III READ : Relte portions of hpters VII n VIII ASSIGNMENT : There re three questions. Solve ll homework n exm prolems s shown in lss n pst exm solutions. 1) Design moulo-6 (ivie-y-6) synhronous up ounter iruit y using 4-it ounters stuie in lss n few gtes : Moulo-6 ounter z5 z4 z3 z2 z1 z The ount rnge is through 59. lerly show the onnetions of inputs n outputs of the hips n gtes. Lel ll the hip pins. Show wht is onnete to ll inputs n outputs. Note tht the 4-it ounter stuie in lss hs the following lk ox view n opertion tle : D B A LD U/D E 4-it Up/Down ounter 4-it Up/Down ounter Opertion Tle LD U/D E Opertion x Store (DBA) (Next ount is DBA) 1 ount Down (Next ount is 1 own) 1 1 ount Up (Next ount is 1 up) x x 1 x Not store x x x Not store NYU Shool of Engineering Pge 1 of 18 Hnout No : 9 Mrh 6, 214
2) onsier the following iruit whose lk ox view n internl iruitry re given : Lo D B A LD U/D E 4-it Up/Down ounter Lo Wht is the ounting sequene of the ove iruit? Tht is, etermine the purpose of sequentil iruit, i.e. wht the iruit oes. We o not hve to step through the six nlysis steps sine we know the sequentil iruit is ounter with four flip-flops, wiring n gting. All we hve to o is the timing nlysis n the speifition of the purpose : just the 6 th step! To o the timing nlysis, we will strt with n ritrry ount on the 4-it ounter, suh s,,,, t, 1,, 1, respetively. Then oserve the inputs n outputs of the ounter until we figure out pttern whih then les us to the purpose of the sequentil iruit. For tht, we work on tle tht strts with initil input n output vlues, the vlues t t : is onnete to U/D, so t time t the U/D vlue is time t Lo Initil vlues U/D LD D B A Lo 1 1 1 1 1 1 1 1 1 1 Then, get the outputs t t1 from the input vlues t t : time Lo U/D LD D B A Lo t 1 1 1 1 1 1 1 1 1 1 t1 1 1 1 1 NYU Shool of Engineering Pge 2 of 18 S224 Hnout No : 9 Mrh 6, 214
Then, get the input vlues t t1 from the output vlues t t1 : is onnete to U/D, so t time t1 the U/D vlue is time t t1 Lo U/D LD D B A Lo 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Then, get the output vlues t t2, from the input vlues t t1 : time t Lo U/D LD D B A Lo 1 1 1 1 1 1 1 1 1 1 t1 1 1 1 1 1 1 1 t2... ontinue... 1 1 1 1 1 1 ontinue in this fshion to omplete the tle. 3) onsier sequentil iruit with one input n one output. The iruit ontins 3-it lole shift register. The lk-ox view of the sequentil iruit, the 3-it shift register n the opertion tle of the shift register re s follows : x z D LD Opertion 1 Store D 2, D 1, D inputs (Lo) Store,, x (Shift) D 2 D 1 D LD 3-it Shift Register Not store NYU Shool of Engineering Pge 3 of 18 S224 Hnout No : 9 Mrh 6, 214
The shift register lwys shifts n so oes not nee shift input. It is loe vlue when its LD input is 1. The implementtion of this sequentil iruit with 3-it lole shift register n 2-it up ounter re s follows : x D f D 2 D 1 D LD 3-it Shift Register Time x e f z t t1 t2 1 t3 1 t4 2-it Up ounter e t5 1 t6 t7 t8 1 t9 e f t1 1 t11 1 x z Determine wht this sequentil iruit oes (the purpose) y ontinuing with the ove tle n showing the vlues for 12 perios. If you nnot figure out the purpose, just write I nnot etermine the purpose. NYU Shool of Engineering Pge 4 of 18 S224 Hnout No : 9 Mrh 6, 214
RELEVANT QUESTIONS AND ANSWERS ) onsier sequentil iruit with single input n three outputs. The lk-ox view n implementtion of this sequentil iruit re shown elow. The sequentil iruit uses 3-it register whose opertion tle is lso given elow. x 3-it Register Opertion Tle Lo Opertion 1 Lo (D2, D1, D) Not store X Not store Lo ( x x) 3 3-it ADDer 3-it Register Note tht one input of the ADDer is (xx) where x is input x. Therefore, this input of the ADDer is either 1 when x is or 1 when x is 1. Determine the purpose of this sequentil iruit y ontinuing with the following tle n showing the vlues for 11 perios : out 3 1 D2 D1 D (,, ) y2, y1, y 3 in Time x y2, y1, y ( x x) t 1 1 1 1 1 1 1 t1 1 t2 1 t3 1 t4 Time x y2, y1, y ( x x) t6 t7 t8 t9 1 t1 1 t5 A1) The tle is ontinue elow : The purpose of the iruit is lmost ientil to the purpose of the iruit in Pst Exm Question Homework VI. It is 3-it Up ounter tht ount up - y 1 when x is : 3, 4, 5, 6, 7,, 1, 2,... - y 2 when x is 1 : 7, 1, 3, 5, 7, 1, 3, 5,... The only ifferene is tht when the vlue of x is hnge, the new vlue tkes effet immeitely in this iruit. In the Pst Exm Question 9 iruit, it ffets in the following perio. For exmple, in oth iruits, x is NYU Shool of Engineering Pge 5 of 18 S224 Hnout No : 9 Mrh 6, 214
Time x y2, y1, y ( x x) t 1 1 1 1 1 1 1 t1 1 1 1 1 1 1 t2 1 1 1 1 1 t3 1 1 1 1 1 1 t4 1 1 1 1 1 Time x y2, y1, y ( x x) t6 1 1 1 1 t7 1 1 t8 1 1 1 t9 1 1 1 1 t1 1 1 1 1 1 t5 1 1 1 1 1 1 hnge from 1 to in t4. The urrent iruit ounts up y 1 in t4. But, the Pst Exm Question 9 iruit ounts up y 2 in t4. This ifferene n e eliminte y elying x y one perio. This n e one y storing it on FF. This question onfirms l n lssroom isussions tht simple sequentil iruit n e onverte to iruit with registers/ounters/shift registers. ) onsier the following sequentil iruit elow. The sequentil iruit hs 3 inputs (x, shift n ler) n 2 outputs (z n vli). It uses shift register isusse in lss. The shift input is tive when the x input hs vli t so we n shift it in. Determine wht the iruit oes, i.e. its purpose. 1 x Shift ler lok? x 1 ler Seril-to-prllel 4-it shift register isusse in lss shift vli z vli omprtor isusse in lss z A2) We will perform sequentil iruit nlysis where the sequentil iruit is omplex. We re not shown the iniviul flip-flops. We re tol wht the four flip-flops in the iruit form seril-to-prllel 4-it shift register isusse in lss. First, the ler input is lwys intive for this iruit. Thus, it hs no effet on the opertion! Seon, we know tht the omprtor iruit ompres two 2-it unsigne inry numers. It outputs 1, if (, ) is greter thn or equl to (, ). For orret opertion, four its must e shifte into the shift register in four perios uring whih the shift input is 1. As long s the shifting is not omplete, the omprtor output is not orret, so its output is not vli. Its output n reflet orret ompre (is vli) when ll four its re shifte in, i.e. when the shift input is. Tht is why, the vli output is the omplement of the shift input. Then, we see tht we hve n opertion perio whih is t lest five perios long : four perios to shift in x n one perio to ompre. It is importnt to relize tht the iruit tht outputs the shift n x signls knows NYU Shool of Engineering Pge 6 of 18 S224 Hnout No : 9 Mrh 6, 214
this minimum five perio urtion. We note tht numer (, ) is reeive fter numer (, ) is reeive. We now otin tle to relte the vlues of the lines in the iruit. We lso pik n ritrry it sequene for input x s shown on the tle elow : time Shift x vli z omment t 1 1???? First it is eing reeive t 1 1 1??? Seon it is eing reeive t 2 1 1 1?? Thir it is eing reeive t 3 1 1 1 1? Fourth it is eing reeive Thus, this iruit reeives four its serilly, trets them s two 2-it unsigne numers n ompres them. t 4 X 1 1 1 1 1 ompre output is vli. t 5 X 1 1 1 1 1 ompre output is vli t 6 1 1 1 1 First it is eing reeive t 7 1 1 1 1 Seon it is eing reeive..................... ) onsier sequentil iruit with input n four outputs. The lk-ox view n implementtion of this sequentil iruit with the 4-it ounter isusse in lss re shown elow. Determine wht this sequentil iruit oes y ontinuing with the following tle n showing the vlues for 17 perios 1 1 D B A Lo LD Time Lo t 1 1 1 t1............... t16...... 1 U/D E 4-it Up/Down ounter Lo A3) The tle is ontinue elow. This is speil moulo-1 ounter tht lwys ounts s...2, 3, 4, 5, 12, 13, 14, 15,, 1, 2, 3,... NYU Shool of Engineering Pge 7 of 18 S224 Hnout No : 9 Mrh 6, 214
Time Lo t 1 1 1 t1 1 1 t2 1 1 t3 1 1 1 t4 1 1 1 1 t5 1 1 1 1 t6 1 1 1 1 1 t7 1 t8 1 1 Time Lo t9 1 1 t1 1 1 1 t11 1 1 t12 1 1 t13 1 1 1 t14 1 1 1 1 t15 1 1 1 1 t16 1 1 1 1 1 Q4) A sequentil iruit uses two generi 3-it Up ounters : LR E 3-it Up ounter Time EQ y2 y1 y t 1 t1 1 t2 1 1 1............ 1 3-it Up ounter Opertion Tle LR E Opertion 1 x Store (Next ount is ) 1 ount Up (Next ount is 1 up) x Not store (Do not ount up) 1 Not store (Do not ount up) LR E LR E 3-it Up ounter 3-it Up ounter y y1 y2 A A1 B B1 2-it Unsigne Binry omprtor EQ NYU Shool of Engineering Pge 8 of 18 S224 Hnout No : 9 Mrh 6, 214
The lk-ox view, the implementtion with two generi 3-it Up ounters n generi 2-it Unsigne Binry omprtor re shown ove. Determine wht this sequentil iruit oes y ontinuing with the following tle n showing the vlues until pttern emerges. A4) We etermine wht this sequentil iruit oes, y ompleting the tle elow. The ottom ounter (,, ) ounts up from to 7 n then k to. It outputs for one perio, 1 for two perios, 2 for three perios, 3 for four perios, 4 for one perio, 5 for two perios, 6 for three perios n 7 for four perios. It repets this ontinously. If the omprtor were 3-it omprtor, then the numer of perios it woul output vlue woul e one greter thn the vlue ll the time. Time EQ y2 y1 y t 1 t1 1 t2 1 1 1 t3 1 t4 1 1 t5 1 1 1 t6 1 1 t7 1 1 1 t8 1 1 1 t9 1 1 1 1 1 Time EQ y2 y1 y t11 1 1 t12 1 1 1 1 t13 1 1 t14 1 1 1 t15 1 1 1 1 t16 1 1 1 t17 1 1 1 1 t18 1 1 1 1 t19 1 1 1 1 1 1 t2 1 t1 1 1 Q5) onsier sequentil iruit with four outputs. The lk-ox view, the prtil implementtion, the opertion tle of the 4-it up ounter use y the iruit n output vlues for 18 perios re given elow. The prtil implementtion of the sequentil iruit ontins 4-it up ounter n n AND gte for its Lo input. Otin the full implementtion of the iruit whih must ontin (i) the ove 4-it up ounter, (ii) the ove AND gte n (iii) few more gtes. No other omponent n e use! Explin your eision for eh ounter input n the AND gte input. Drw the iruit in your lue ook. NYU Shool of Engineering Pge 9 of 18 S224 Hnout No : 9 Mrh 6, 214
? 4-it Up ounter Opertion Tle Lo E Opertion 1 1 Lo (D3, D2, D1, D) 1 ount up X Not store X Not store????? D3 D2 D1 D Lo E 4-it up ounter Time Lo D3 D2 D1 D t 1 1 1 1 t1 1 1 1 1 t2 1 1 1 1 t3 1 1 1 1 1 t4 1 1 1 1 1 t5 1 1 1 1 1 t6 1 1 1 1 1 t7 1 1 1 1 1 1 t8 1 1 1 1 t9 1 1 1 1 t1 1 1 1 1 t11 1 1 1 1 1 t12 1 1 1 t13 1 1 1 t14 1 1 1 t15 1 1 1 1 t16 1 1 1 1 t17 1 1 1 1 A5) The explntion of the inputs n the iruit re elow : NYU Shool of Engineering Pge 1 of 18 S224 Hnout No : 9 Mrh 6, 214
E : We see tht the ounter ounts up or los every perio. Therefore, its input must e enle ll the time. E must e permnently onnete to 1 : E = 1 Lo : We see tht the ounter los when is 1 n is 1. Therefore, Lo = D: We see tht D is the omplement of. Therefore, D = D3 D2 D1 D D1 : We see tht D1 is the omplement of. Therefore, D1 = D2 : We see tht D2 is 1 when n re the sme t the sme time. Therefore, D2 = + D3 : We see tht D3 is the omplement of. Therefore, D3 = 1 Lo E 4-it up ounter Q6) A sequentil iruit hs input n four outputs. It uses generi 4-it Up/Down ounter esies other omponents. Its lk-ox view n the opertion tle of the generi 4-it ounter re shown elow : Lo U/D Opertion 1 x Store P inputs (Next ount is P) 1 ount Up (Next ount is 1 up) ount own (Next ount 1 own) x Not store The implementtion of the sequentil iruit is shown elow. Determine wht this sequentil iruit oes y ontinuing with the tle elow n showing the vlues for 21 perios : Time Lo U/D t 1............ t2......... NYU Shool of Engineering Pge 11 of 18 S224 Hnout No : 9 Mrh 6, 214
4 (,,, ) 4 in A B 4-it ADDer S3 S2 S1 S out P3 P2 P1 P (, 1, 1, 1) Lo U/D 4-it ounter A6) We etermine wht this sequentil iruit oes, y ompleting the tle shown elow : Time Lo U/D t 1 t1 1 t2 1 t3 1 1 1 t4 1 1 t5 1 1 t6 1 1 Time Lo U/D t7 1 1 1 t8 1 1 t9 1 1 t1 1 1 t11 1 1 1 1 t12 1 1 1 t13 1 1 1 Time Lo U/D t14 1 1 1 t15 1 1 t16 1 t17 1 t18 1 t19 1 1 1 t2 1 1 The ounter ounts lwys own. Every four ounts, it los vlue y ing (7) 1 to its urrent vlue. The loing hppens when the rightmost two outputs of the ounter re oth. In the given exmple, the ounter hs initil vlue 2. It ounts own to, then los 7 n ounts own to 4, then los 11 n ounts own to 8, then los 15 n ounts own to 12 then los 3 n ounts own to. It repets this ontinuously. Q7) onsier sequentil iruit with input n four outputs. The lk-ox view n implementtion of this sequentil iruit with the 4-it ounter isusse in lss re shown elow. Determine wht this sequentil iruit oes (the purpose) y ontinuing with the ove tle n showing the vlues for 17 perios. Note gin tht this ounter is the 4-it ounter stuie in lss. NYU Shool of Engineering Pge 12 of 18 S224 Hnout No : 9 Mrh 6, 214
D B Time Lo t 1 1 1......... t16...... Lo 1 A LD U/D 4-it Up/Down ounter E A7) The tle is ontinue elow : Time Lo t 1 1 1 t1 1 1 t2 1 1 t3 1 1 1 t4 1 t5 1 1 t6 1 1 t7 1 1 1 Time Lo t9 1 1 1 t1 1 1 1 t11 1 1 1 1 t12 1 t13 1 1 t14 1 1 t15 1 1 1 t16 1 t8 1 1 The sequentil iruit ounts up y 1 if the urrent ount is o or elow 8. Otherwise, it ounts up y 2. Q8) onsier sequentil iruit with one input n one output. The lk-ox view, implementtion of this sequentil iruit with 3-it ounter n the opertion tle of the ounter re shown elow : NYU Shool of Engineering Pge 13 of 18 S224 Hnout No : 9 Mrh 6, 214
x z 3-it Up ounter Opertion Tle Lo E Opertion 1 1 Lo 1 ount up X Not store Time x Y Lo z X Not store t 1 t1 1 t2 t3 1 y y 1 y 2 z t4 1 t5 1 t6 1 t7 1 t8 1 t9 1 t1 1 x Lt 3 3 D Q Y Lo LD (y 2 y 1 y ) 1 E 3-it Up ounter t11 1 t12 1 t13 t14 t15 1 t16 1 Y 5 3 3 A B 3-it Unsigne Binry omprtor ALTB Lt Determine wht this sequentil iruit oes (the purpose) y ontinuing with the ove tle n showing the vlues for 17 perios. If you nnot figure out the purpose, just write I nnot etermine the purpose. A8) The tle is ontinue elow. The purpose of this sequentil iruit is tht it is sequene etetor tht heks for 5 (five) onseutive 1s : NYU Shool of Engineering Pge 14 of 18 S224 Hnout No : 9 Mrh 6, 214
Time x Y Lo z t 1 t1 1 t2 1 1 t3 1 t4 1 1 t5 1 2 t6 1 3 t7 1 4 1 Time x Y Lo z t9 1 6 t1 1 7 1 t11 1 t12 1 1 t13 2 1 t14 1 t15 1 t16 1 1 t8 1 5 x 1 1 1 1 1 X X X z 1 1 It outputs 1 for one perio when it reeives the fifth onseutive 1. Then, it outputs two s n 1. Then, it strts heking gin. Thus, it hs yle of eight (8) perios, mening it heks 8-it sequenes. If it reeives n inorret it, it wits until the urrent 8-it sequene is over n then strts heking for new 8-it sequene. There re no overlppe sequenes. Note tht this iruit with ounter n omprtor hs the ientil purpose of the sequentil iruit in Pst Exm Question of Homework VI with two exeptions : x 1 1 1 1 1 X X X z 1 1 This prolem shows how one n onvert sequentil iruit with few flip-flops to sequentil iruit with registers, ounters n shift registers s mentione in lss n in the l. Time Time Q9) onsier the Ppm term projet. Assume tht the plying strtegy of the mhine plyer is s follows : Plyer 1 is he? Ply on the (rightmost) lrgest regulr rewr position (iretly if equl) Y N Lrgest regulr rewr is < 5? Y N Ply on the (rightmost) lrgest isply position iretly Ply on the rightmost lrgest jeny position (iretly if equl) onsier the tle elow tht shows the rnom igit, position isplys efore n fter the mhine plyer plys, whether Plyer 1 is he or not, whether the rnom igit is plye iretly or e, the numer of jenies, the NYU Shool of Engineering Pge 15 of 18 S224 Hnout No : 9 Mrh 6, 214
points erne y the mhine plyer n whether the mhine plyer plys gin. RD Displys Before Ply Displys After Ply P1 Ahe D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 3 F F F F F F F 3 No D 3 No 5 7 7 7 Yes 2 2 2 D No 9 E 6 F No 4 A E 5 9 Yes 1 F F F Yes Assume tht the oe is 1. The first row shows how the rnom igit is plye y the mhine plyer. A irle is rwn on position if it is plye on. The mening of D/A is Diret/A whih is whether the plyer plys the rnom igit iretly on position or y ing to position. Note tht the ses re inepenent of eh other. Tht is, they o not neessrily follow eh other with respet to time. omplete the tle. A9) The tle is omplete elow. Those entries to e fille out re shown in ol. The positions plye on re shown y irles : RD Displys Before Ply Displys After Ply P1 Ahe D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 3 F F F F F F F 3 No D 3 No 5 7 7 7 7 7 Yes A 1 12 Yes 2 2 2 D 2 2 2 No D 2 8 Yes 9 E 6 F E F F No A 1 3 Yes 4 A E 5 9 E E 5 9 Yes A 1 28 Yes 1 F F F F F 1 Yes D 9 No ) onsier the Ppm term projet. Assume tht the plying strtegy of the mhine plyer is elow. onsier the tle elow tht shows the rnom igit, position isplys efore n fter the mhine plyer plys, whether the rnom igit is plye iretly or e, the numer of jenies, the points erne y the mhine plyer n whether the mhine plyer plys gin. Assume tht the oe is 7. The first row shows how the rnom igit is plye y the mhine plyer. A irle is rwn on position if it is plye on. The mening of D/A is Diret/A whih is whether the mhine plyer plys the rnom igit iretly NYU Shool of Engineering Pge 16 of 18 S224 Hnout No : 9 Mrh 6, 214
Y Lrgest jeny is? N Lrgest regulr rewr is < (1) 1 Y N Ply on the (rightmost) lrgest jeny position (iretly if equl) Skip Ply on the (rightmost) lrgest regulr rewr position (iretly if equl) on position or y ing to position. Note tht the ses re inepenent of eh other. Tht is, they o not neessrily follow eh other with respet to time. omplete the tle. RD Displys Before Ply Displys After Ply D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 1 E F E F E F F F A 2 6 Yes 7 2 1 F 1 1 7 F 8 E 7 6 6 6 6 A1) The tle is omplete elow. Those entries to e fille out re shown in ol. The positions plye on re shown y irles : RD Displys Before Ply Displys After Ply D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 1 E F E F E F F F A 2 6 Yes D 3 Yes 7 Skip Skip Skip Skip 2 1 F 1 1 1 1 1 1 A 3 8 Yes 7 F 8 E 7 F 8 7 7 D 1 14 Yes 6 6 6 6 6 6 6 6 D 3 48 Yes Note tht the mhine plyer oes not hek for oe igits n so misses lrge rewr points on rows 3, 5 n 6. The rnom igits on these rows enle it to ply the oe igits. NYU Shool of Engineering Pge 17 of 18 S224 Hnout No : 9 Mrh 6, 214
1) onsier the Ppm term projet. Assume tht the plying strtegy of the mhine plyer is s shown elow. onsier lso the tle elow tht shows the rnom igit, Plyer 1 points in eiml, position isplys efore n fter the mhine plyer plys, whether the rnom igit is plye iretly or e, the numer of jenies, the points erne y the mhine plyer n whether the mhine plyer plys gin. Skip Y Lrgest regulr rewr is =? Ply on the (rightmost) lrgest zero position iretly (if equl) N Plyer 1 oes not hve (64) 1 or more points & there is position with zero & RD is not? Y N Ply on the (rightmost) lrgest regulr rewr position (iretly if equl) Assume tht the oe is 79. A irle is rwn on position if it is plye on. The mening of D/A is Diret/A whih is whether the plyer plys the rnom igit iretly on position or y ing to position. Note tht the ses re inepenent of eh other. Tht is, they o not neessrily follow eh other with respet to time. omplete the tle. RD P1PT (Deiml) Displys Before Ply Displys After Ply D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 3 72 9 7 29 F 8 7 7 1 53 F E E 4 61 7 7 3 9 238 F E 7 9 A11) The tle is omplete elow. The isplys plye on re shown in ol n irle : RD P1PT (Deiml) Displys Before Ply Displys After Ply D/A The Ajeny Points Erne (Deiml) Mhine plyer plys gin 3 72 9 F 9 A 15 N 7 29 F 8 7 7 F F 7 7 A 1 3 Y 1 53 F E E F E 1 E D 1 N 4 61 7 7 3 9 7 7 7 9 A 2 149 Y 238 F E 7 9 F E 7 9 A 15 N We oserve tht the mhine plyer misses hne to ern oe rewr points when RD is 7 n. But, y hne, it erns oe rewr points when RD is 4. NYU Shool of Engineering Pge 18 of 18 S224 Hnout No : 9 Mrh 6, 214