Presentation is loading. Please wait.

Presentation is loading. Please wait.

COSC 3330/6308 Solutions to First Problem Set Jehan-François Pâris September 2012.

Similar presentations


Presentation on theme: "COSC 3330/6308 Solutions to First Problem Set Jehan-François Pâris September 2012."— Presentation transcript:

1 COSC 3330/6308 Solutions to First Problem Set Jehan-François Pâris September 2012

2 First problem (I) A program consists of two parts, namely – One part is purely sequential and takes 64 s to complete – Another part takes 1,024 s when run on a uniprocessor architecture Can be easily decomposed into two or more parallel tasks Speedup would be proportional to the number of tasks executing in parallel.

3 First problem (II) What would be the speedups that the program would achieve if it was to run on computers with 2, 4, 8, 16, and 32 processors? What would be the maximum speedup that the program would achieve if it was to run on a computer with an unlimited number of processors?

4 Answer (I) Will use Amdahl's law

5 Answer (II) Sequential Part (s) Number of Proc. Other Part (s) Total (s) Speedup 6411,0241,088NA 6425125761.889 6442563203.400 6481281925.667 6416641288.500 6432 9611.333 64infinity06417.000

6 Second problem Simplify the two following logical expressions: – ABC'D' + AB'D' + ACD + CD – (A  BC) (B + A) using both algebra and Karnaugh maps.

7 First expression (I) ABC'D' + AB'D' + ACD + CD = ABC'D' + AB'D' + CD = ABC'D' + AB'D' + AB'C'D' + CD = AC'D' + AB'D' + CD

8 First expression (II) C'D'C'DCDCD' A’B’0010 A’B0010 AB1010 AB’1011 AC'D' + AB'D' +CD

9 Second expression (I) (A  BC) (B + A) = (A(BC)' + A'BC) (A + B) = (AB' + AC' + A'BC) (A + B) = AB' + AC' + A'BC + ABC' = AB' +AC' +A'BC

10 Second expression (II) ABCBC A  BC A+ BPRODUCT FFFFFFF FFTFFFF FTFFFTF FTTTTTTA'BC TFFFTTTAB'C' TFTFTTTAB'C TTFFTTTABC' TTTTFTF

11 Second expression (III) B'C'B'CBCBC' A’0010 A1101 AB' + AC' +A'BC

12 Second expression (IV) A'B'A'BABAB' C’0011 C0101 AB' + AC' +A'BC

13 Third problem Simplify the expression – (ABC)' (A + DE)' (A  BC) (B + E) and convert it to a form that can be represented using a programmable logic array.

14 Answer (I) (ABC)' (A + DE)' (A  BC) (B + E) Let us do it in two parts – (ABC)' (A + DE)' = (A' + B' + C')(A'(DE)') = (A' + B' + C')(A'(D' +E') = A'(D' +E') + A'B'(D' +E') +A’C’(D’ +E’) = A'D' +A'E'

15 Answer (II) The second part is – (A  BC) (B + E) = (A(BC)' + A'BC)(B + E) = (AB' + AC' + A'BC)(B + E) = ABC' + A'BC + AB'E + AC'E + A'BCE

16 Answer (III) The product is – (A'D' +A'E')  (ABC' + A'BC + AB'E + AC'E + A'BCE) = A'BCD' + A'BCE' + A'BCD'E = A'BCD' + A'BCE' Sum of products can be represented by a PLA I checked the answer on a spreadsheet with 2 5 rows and 14 columns

17 Fourth problem Implement the double implication operation: – A  B = AB +A’B’ using only NAND gates.

18 NAND gates A nand B = (AB)' = A' + B' nand (A) nand nand(B) = (A'B')' = A + B nand(A nand B) = (AB)'' = AB nand(nand(A) nand nand(B)) = (A' B')'' = A'B'

19 Answer A B A'+B' A B A+B ((A + B)(A' + B')' = (A + B)' + (A' + B')' = A'B' +AB I started with a solution having more NANDs and simplified it

20 Fifth problem Build a regular D flip-flop using an R’S’ latch, that is, an RS latch with inverted values for R and S, and as few NOR gates as possible.

21 NOR gates A nor B = (A + B)' = A' B' nor (A) nor nor(B) = (A' + B')' = AB nor(A nor B) = (A+B)'' = A + B nor(nor(A) nor nor(B)) = (A' + B')'' = A' + B'

22 From S'R' latch to D flip-flop S'R' has three inputs – S' sets latch when S' = 0 and clock = 1 – R' resets latch when R' = 0 and clock = 1 D flip-flop – Stores a 1 at clock transition when input is 1 – Stores a 0 at clock transition when input is 0 S' R' Q' Q Clock

23 D flip-flop using an S-R latch X Clock S R Q Q' Clock

24 D flip-flop using an S'-R' latch X Clock S' R' Q Q' Clock

25 Introducing NORs X Clock S' R' Q Q' Clock (Clock+Clock')'=ClockClock'

26 Note The solution is fairly simple because we assumed that the R'S' latch had a clock entry Solution for R'S' latch without clock input is more complex Q Q’ R’ S’

27 Sixth problem (I) Build a synchronous sequential circuit with – Two inputs, respectively named P—for plus—and M—for minus – Two outputs respectively named O—for overflow—and U—for underflow

28 Sixth problem (II) The transitions are:

29 Answer Eight states – Three flip-flops X Y Z Will consider separately – How P inputs affect X, Y, Z – How M inputs affect X, Y, Z – When counters outputs O and U

30 How P inputs affect Z Y'Z'Y'ZYZYZ' P'X'0110 P'X0110 PX1001 PX’1001

31 Solution Z = P'Z + PZ' – Will use a T flip-flop triggered by P

32 How P inputs affect Y Y'Z'Y'ZYZYZ' P'X'0011 P'X0011 PX0101 PX’0101

33 Solution Y = P'Y + PYZ' + PY'Z – Will use a T flip-flop triggered by PZ

34 How P inputs affect X Y'Z'Y'ZYZYZ' P'X'0000 P'X1111 PX1101 PX’0010

35 Solution X = P'X + PXY' + PXZ' + PX'YZ – Will use a T flip-flop triggered by PYZ

36 How M inputs affect Z Y'Z'Y'ZYZYZ' M'X'0110 M'X0110 MX1001 MX’1001

37 Solution Z = M'Z + MZ' – Will use a T flip-flop triggered by M

38 How M inputs affect Y Y'Z'Y'ZYZYZ' M'X'0011 M'X0011 MX1010 MX’1010

39 Solution Y = M'Y + MYZ + M Y'Z' – Will use a T flip-flop triggered by MZ'

40 How M inputs affect X Y'Z'Y'ZYZYZ' M'X'0000 M'X1111 MX0111 MX’1000

41 Solution X = M'X + MXY + MXZ +MX'Y'Z' – Will use a T flip-flop triggered by MY'Z'

42 How P inputs affect O Y'Z'Y'ZYZYZ' P'X'0000 P'X0000 PX0010 PX’1000

43 Solution O = PXYZ

44 How M inputs affect U Y'Z'Y'ZYZYZ' M'X'0000 M'X0000 MX0000 MX’1000

45 Solution U = MX'Y'Z' – Will use a T flip-flop triggered by MY'Z'

46 Summary Flip-flops – Z: T flip-flop triggered by P + M – Y: T flip-flop triggered by PZ + MZ' – X: T flip-flop triggered by PYZ + MY'Z' Outputs – O = PXYZ – U = MX'Y'Z'


Download ppt "COSC 3330/6308 Solutions to First Problem Set Jehan-François Pâris September 2012."

Similar presentations


Ads by Google