Presentation is loading. Please wait.

Presentation is loading. Please wait.

Decoders and Trees מבנה המחשב + מבוא למחשבים ספרתיים תרגול 4#

Similar presentations


Presentation on theme: "Decoders and Trees מבנה המחשב + מבוא למחשבים ספרתיים תרגול 4#"— Presentation transcript:

1 Decoders and Trees מבנה המחשב + מבוא למחשבים ספרתיים תרגול 4#

2 Decoder’(n)

3 Decoder(n) design shown and proven in class:

4 for k = n-1: Decoder(1) Decoder’(n)

5 Decoder’(n) is a private case of Decoder(n) design. (k = n-1 or k = 1) Decoder’(n) is a correct implementation of a decoder. Cost analysis: Solving the recurrence: asymptotics

6 Linear Delay!!! Delay analysis: Solving the recurrence:

7 Decoder(n) for k = n/2

8 Consider the top two recursion steps: each AND-gate in the “AND-gates array” of the second recursion step, i.e. Decoder(n/2), feeds 2 n/2 AND-gates in the “AND-gates array” of the primary recursion step, i.e. Decoder(n).

9 Decoder’(n)Decoder(n) k=n/2 Design n 111 332 754 1578 31916 Decoder’(n)Decoder(n) k=n/2 Design n 111 10 2 60524 10246168 26215213230416 Cost Delay

10 Balanced Trees OR OR-Tree(n/2) Logarithmic Delay Lower Bound Theorem: Let C = denote a combinational circuit that implements a non-constant Boolean function f: {0,1} n → {0,1}. If the fan-in of every gate in G is at most c, then the delay of C is at least log c |cone(f)|. cone(OR n ) = n fan-in ≤ 2 delay(OR n ) ≥ log 2 (n)·d(OR) Delay of the balanced tree is minimized.

11 Recursive algorithm for computing an OR-tree(n) 1. The case that n ≤ 2 is trivial. 2. If n > 2, then let a, b be any pair of positive integers such that (i) n = a + b and (ii) max{  log 2 a ,  log 2 b  } ≤  log 2 n  - 1. 3. Compute an OR-tree(a) and an OR-tree(b). Connect their outputs to an OR-gate to obtain an OR-tree(n). Claim: the above algorithm computes a minimum delay OR-tree.

12 We first show that for every n > 2 there exist a pair of positive numbers a, b such that: Note that this is the most unbalanced partition of n, and still we get the minimal delay. Proof:

13 Induction hypothesis: Induction step: we prove the claim for n, We prove by induction on n that the delay of the computed OR-tree is  log 2 n  ·d(OR) to obtain delay minimality. Induction basis: n = 1 or n = 2 are trivial cases.

14 A balanced tree structure minimizes the delay and cost. The tree is a binary tree due to fan-out limitations. Notice: * The leaves of the tree feed the gate outputs. * The root of the tree is fed by the gate input. * The first branching is free → no need for a “root” gate. Buffers

15 Cost analysis: 1-buf-trees Fanout limitation effect on design

16 Delay analysis: 1-buf-trees

17 Cost analysis: Delay analysis: 1-buf-trees

18 Cost Decoder(n): n=1: 1 n=2: 10 n=4: 52 n=8: 616 n=16: 132304 n=32: 8.5902e+009 n=64: 3.68935e+019 n=128: 6.80565e+038 Cost Decoder‘(n): n=1: 1 n=2: 10 n=4: 60 n=8: 1024 n=16: 262152 n=32: 1.71799e+010 n=64: 7.3787e+019 n=128: 1.36113e+039 Cost Decoder‘(n), Fanout<=2: n=1: 1 n=2: 11 n=4: 79 n=8: 1511 n=16: 393175 n=32: 2.57698e+010 n=64: 1.1068e+020 n=128: 2.04169e+039 Cost Decoder(n), Fanout<=2: n=1: 1 n=2: 10 n=4: 68 n=8: 1096 n=16: 263312 n=32: 1.71801e+010 n=64: 7.3787e+019 n=128: 1.36113e+039

19 Delay Decoder(n): n=1: 1 n=2: 3 n=4: 5 n=8: 7 n=16: 9 n=32: 11 n=64: 13 n=128: 15 Delay Decoder‘(n): n=1: 1 n=2: 3 n=4: 7 n=8: 15 n=16: 31 n=32: 63 n=64: 127 n=128: 255 Delay Decoder‘(n), Fanout<=2: n=1: 1 n=2: 4 n=4: 8 n=8: 16 n=16: 32 n=32: 64 n=64: 128 n=128: 256 Delay Decoder(n), Fanout<=2: n=1: 1 n=2: 3 n=4: 6 n=8: 11 n=16: 20 n=32: 37 n=64: 70 n=128: 135


Download ppt "Decoders and Trees מבנה המחשב + מבוא למחשבים ספרתיים תרגול 4#"

Similar presentations


Ads by Google