{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw4Sol - ELEC 326 Homework 4 Kartik Mohanram Due in DH 3029...

Info icon This preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ELEC 326: Homework 4 Kartik Mohanram Due in DH 3029 by 5pm on Friday, October 30th, 2009 1. Exercise 2.26 from the textbook —— see solution manual at the end. 2. Exercise 2.30 from the textbook ~— see solution manual at theend. 3. (From a past exam) Ones counters: Build a circuit that counts the number of ones in a 8—bit wide bus using half-adders and full-adders. For example, if the input is 11001100, your design must output 0100 since there are four ones in the input. Treat the adders as black—boxes with a, b, and carryin inputs and sum and carryout outputs. (Of course, the half—adders will not have a carrygin input.) Minimize the number of adders that you need in your design. The trick here is to recognize that a full-adder can be used to add the input bits in groups of three, three, and two since they are independent of each other. The sum bits can then be added using a second full—adder at the next logic level, and all that remains is a single sum bit in the least significant position. The carry bits (4 in number) are now added, since there correspond to the second least significant bit position, and so on. Some of you did not perform additions in parallel, thereby having more levels of logic than necessary. The optimum circuit is given below. Implement a ones counter for, say, 12 inputs just to reinforce this concept. 1.} 4. Sorting networks: When sorting lists of some specific size, sorting networks are often employed. Sorting networks only use compare-exchange, 1. e., comparator Operations. A compare-exchange op- eration on the pair {m, 3;} does the following: if(x>y){t=x;x=y;y=t;} (a) Design an optimal comparator unit that is used in a sorting network using CMOS gates. This is done using K-maps for the two outputs lines. Assume that the bits are sorted in ascending ' order, with ones propagating to the bottom through a comparator. The K—maps and CMOS Boolean logic for the comparator are as follows: mm W (b) Design (as optimal as possible) sorting networks with 3 and 4 inputs. The best known results {depth, length (number of comparators)} for 3 and 4 inputs are {3, 3} and {3, 5} respectively. Show that your solution works. The 3-input case is very nivial, and can be derived from the original figure. The 4-input case is slightly more complex, though a non-optimal solution {5, 6} can be directly derived from the original figure. 'IvVealdng this gives the solution below. As far as showing that your solution really works; I expected to see margument- more than a formal proof (which' is beyond the scope - of anything we study' in this classt). O 5. Implement the Boolean function 20,5“, (0,3,4, 7, 14,15) using the 74LSl39 decoder and as few additional gates as possible. Usually, one looks at the K-map and the sum-of-products/product—of-sums forms for inspiration. In this case, cofactoring w.r.t. the variable a, in the sum-of-products provides the optimal solution as follows. Based upon K-map covering, the minimum sum—of-products expression 71(EJ + cd) + a(bc) has an interesting structure of the form sf ($1, :32) + §g(m3, 9:4). This motivates the mapping of the enable signal to a to activate the upper or the lower 2-to-4 decoders, each of which can be used to realize the Z-input Boolean functions Ed + cd and bc independently. Since the 74L8139 has active low outputs, a 3-input NAND gate does the needful to tie the individual outputs together. a 6. We say a variable x is in the support of a Boolean function f if f,c 74$ fy. How many Boolean functions of three variables have three variables in their support? Note that a Boolean formula involving three variables does not necessarily imply that all three vari- ables are in the support of the function denoted by that formula; for example, consider f = wyz + my? that can be simplified to f = my. Begin by recongnizing that a Boolean function of three variables (a, b, c from here on) can have 0, 1, 2, or 3 variables in its support. Now, there are exactly two functions -— constant 0 and constant 1 — that have 0 variables in their support. The only functions that have exactly 1 variable in their support are a, a, b, b, c, and E. Extending this further to functions of a, b, c that have exactly two variables in their support, you should be able to argue that when variable a and b are considered, there are ten such functions. The direct, brute-force approach is to list them all out: ab, ab, ab, db, ab + db, ab + db, a + b, a + b, a + b, and d + b. Altemately, you can argue that there are 16 functions of two variables, of which 2 have no variables in their support and four have exactly one variable in their support. This implies 16 — 2 -— 4 == 10 functions of two variables depend on both variables, i.e., have exactly two variables in their support! Since there are three combinations of two variables that you can consider ({a, b}, {a, c} , and {b, c}), there are a total of 30 functions of three variables that have exactly two variables in their support. So, since there are 256 functions of three variables, exactly 256 — 2 —— 6 — 30 = 218 functions of three variables have all three variables in their support. 3 . (From a past exam) Design a 4-to~10 decoder that receives binary-encoded inputs 2'32'22‘12'0 over the range l-10 (0001—1010). Your solution must provision for an active low EN (enable) input in addition to 7332722'12'0, and the data outputs dlodg - - ’ d1 must also follow the active low convention. For example, if the input is 0101, the output d10d9 - --d1 for EN equals 0 (EN equals 1) must be 1111101111 (1111111111). Your solution must use a minimum number of 7418138 and 7418139 decoders, the combined data- sheet for which follow. All connections for input/output must be clearly marked on a schematic for full credit. Note that using the 74L8139 to drive bits d1 to d3 requires additional logic to enable the 74LS 138 decoder, which will drive bits d4 to dm. The proposed solution’does not require additional logic at all, since it puts the G1, 62, GZA, and G2B pins to good use. It Practice problems (not graded) 9. Prove the following pr0perties of cofactors: (a) ((f)w)y = ((f)y)m Let f z: y fy + gfg. Note that fy and fy are both independent of y, but they may depend on ac. ((f)w)y = ((1%; + 3127):»)?! = ((yfy)x + (:17 fg)m)y use result from (b) = (Mfg/)1; + §(fg)$)y use result from (c) = (y(fy)w)y + (g7(fg)w)y use result from (b) again = (”02% = (fy)ac because (fy)m does not depend on y = ((f)’y)m (h) (f +g)a: = fat- +9m Let f = mfm + 55.1% \and g = 9ch + 51395. Then, (f + g)::: = (mfx + 561% + 379:1: + 5295),, p = fw + gm since setting as = 1 in the Shannon expansion for f + g eliminates other terms. (a) (fg)a.- = mem Again, let f = mfg, + :‘Efa—c and g = xgm + 57:95,. Then, (mm = ((wfac + 561%me + Egan = (mfmgm + Effiggh where xi = 0 is used for simplication of the Boolean AND above 2 fmgm since setting a: = 1 eliminates the Effigfi term. (d) (3")ac :(h) Let f = mfm + ifs—c. Then, (ft, = (cc—F we), = ((m) 65%))36 by De Morgan’s Laws = ((5: + E) (a: + E» 9: again by De Morgan’s Laws = (mg + EE + 3"; E) m = (mfl + fig)”: How did I do this? Figure it out or stop by my office for an explanation! 4799, One trickI used along the way was to simplify the Boolean expression x—f; + 56‘}; + E :f; to the expression mg + 57;. If you cannot derive this independently, I would like you to stop by my office and derive it with me. (O. (From a past exam) A Boolean function is symmetric in its inputs if all that matters is the number of bits that have to be set to logic 1 for it to be TRUE. In other words, the order of the inputs to the Boolean function is irrelevant. For example, the Boolean functions (a. + b) as well as (d + 5) of 2 inputs are both symmetric. (a + b) is symmetric because you just need to know that at least 1 bit must be set to logic 1 for it to be TRUE. Similarly, (a + 5) is symmetric because you just need to know that no more than 1 bit must be set to logic 1 for it to be TRUE. ' 1:: Start by looking at other examples of symmetric functions On two inputs. Ask yourself if ab is sy etric. And think carefully about our friends, the censtant O and 1 functions. (a) List all symmetric Boolean functions of 3 inputs (b) How many symmetric Boolean functions can you construct given n inputs? I need to see a constructive argument, not just a number or closed—form expression. 9%}me That WWI/\S (fin/WW. '[email protected]+a’15)+ob -—a out W i” we OWL k0 myfifi W 130 WWWW 6 5sz (ch+ ME {66% (055+ ch+abc) 3 and Not David Money Ham's and Sarah L. Harris, Digital Design and Computer Architecture, © 2007 by Elsevier Inc. Exercise Solutions 28 SOLUTIONS chapter 2 NONE 2.26 The equations and circuit for Y2“) is the same as in Exercise 2.25, repeated here for convenience. A7 A6 A5 A4 A3 A2 A1 A0 Y2 Y1 Y0 0 0 0 0 0 0 0 0 0 0 0 0 0 O O 0 O 0 l 0 0 0 O 0 0 0 0 0 1 X 0 0 l 0 0 0 0 0 l X X 0 l 0 0 0 0 0 l X X X 0 l l O 0 0 l X X X X l 0 O 0 0 l X X X X X l 0 1 0 1 X X X X X X l l 0 l X X X X X X X l l 1 Y2 = A7+A6+A5+A4 = A7+A—6+A5A4A3 +A5A4A2 David Money Han‘is and Sarah L. Harris, Digital Design and Computer Architecture, © 2007 by Elsevier Inc. Exercise Solutions SOLUTIONS 29 A7 A3 A5 A4 A3 A2 A1 A0 David Money Harris and Sarah L. Harris, Digital Design and Computer Architecture, © 2007 by Elsevier Inc. Exercise Solutions 30 chapter 2 SOLUTIONS The truth table, equations, and circuit for 22:0 are as follows. 20 Z1 A1 A5 A4 A3 A2 A6 A7 000000011111100000111100011.0 0000000000000111111111000001 0000000000000000000000111111 lllllllXXXXXXXXXXXXXXXXXX 1000000111111XXXXXXXXXXXXXXX 010000010000011111XXXXXXXXXX 0010000010000100001111XXXXXX 0001000001000010001000111XXX 0000lOOOOOlOOOOlOOOlOOlOOllX 0000010000010000100010010101 0000001000001.000010001001011 144(A5 +A6 +A7) +A5(A5 +A7) +A6A7 Z2= A2(A3+A4+A5+A6+A7)+ A3(A4+A5 +A6 +A7) +A6A7 Z1 A1(A2+A3+A4+A5+A6+A7)+ A3(A4 +As +A6 +A7) +A5(A6 +A7) Z0= David Money Ham's and Sarah L. Harris, Digital Design and Computer Architecture, © 2007 by Elsevier Inc. Exercise Solutions SOLUTIONS 31 A7 A6 A5 A4 A3 A2 A1 A0 Y YIYIYIYIY YIY iiiiifi“ L—- a I I ’ - l 2.27 Y 6 = A2A1Ao Y5 = A2A1 Y4 = A2A1+A2A0 Y2 = A2+A1A0 Y1 = A2+A1 Y0 = A2+A1+AO David Money Harris and Sarah L. Harris, Digital Design and Computer Architecture, © 2007 by Elsevier Inc. Exercise Solutions 32 SOLUTIONS chapter 2 A2A1Ao 2.28Y=A+C69D =A+CD+EB 2.29Y = 52591 @B)+th9 = ACD+BCD+ZJ§ 2.30 Hv—IHHoooo) I—‘l—‘OOl—‘Hoom I-‘OI—‘Ol—‘OHOO HOOOOOOH< (C) ...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern