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

Slides:



Advertisements
Similar presentations
WSPD Applications.
Advertisements

AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
Recursive Definitions and Structural Induction
Theory of Computing Lecture 3 MAS 714 Hartmut Klauck.
MS 101: Algorithms Instructor Neelima Gupta
Lectures on Recursive Algorithms1 COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski.
Deterministic Selection and Sorting Prepared by John Reif, Ph.D. Analysis of Algorithms.
11 Computer Algorithms Lecture 6 Recurrence Ch. 4 (till Master Theorem) Some of these slides are courtesy of D. Plaisted et al, UNC and M. Nicolescu, UNR.
Greedy Algorithms Basic idea Connection to dynamic programming Proof Techniques.
Tirgul 5 AVL trees.
Topics: 1. Finding a cycle in a graph 2. Propagation delay - example 3. Trees - properties מבנה המחשב - אביב 2004 תרגול 3#
Boolean Algebra cont’ The digital abstraction Graphs and Topological Sort מבנה המחשב + מבוא למחשבים ספרתיים תרגול 2#
Data Structures, Spring 2006 © L. Joskowicz 1 Data Structures – LECTURE 4 Comparison-based sorting Why sorting? Formal analysis of Quick-Sort Comparison.
CSC 2300 Data Structures & Algorithms March 27, 2007 Chapter 7. Sorting.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
Advanced Topics in Algorithms and Data Structures 1 Lecture 4 : Accelerated Cascading and Parallel List Ranking We will first discuss a technique called.
Technology Mapping.
Accelerated Cascading Advanced Algorithms & Data Structures Lecture Theme 16 Prof. Dr. Th. Ottmann Summer Semester 2006.
Topics: 1. Trees - properties 2. The master theorem 3. Decoders מבנה המחשב - אביב 2004 תרגול 4#
Flip-Flops מבנה המחשב + מבוא למחשבים ספרתיים תרגול 10#
מבנה המחשב – מבוא למחשבים ספרתיים Parallel Prefix Computation.
מבנה המחשב + מבוא למחשבים ספרתיים תרגול 1#
Addition מבנה המחשב + מבוא למחשבים ספרתיים תרגול 7#
מבנה המחשב + מבוא למחשבים ספרתיים תרגול 5# Topics: 1.Encoders and decoders 2.Shifters.
Chapter 11: Limitations of Algorithmic Power
מבנה המחשב – מבוא למחשבים ספרתיים Foundations of Combinational Circuits תרגול מספר 3.
Boolean Algebra cont’ The digital abstraction מבנה המחשב + מבוא למחשבים ספרתיים תרגול 2#
מבנה מחשבים תרגול מספר 4. Definition: A Boolean function f :{0,1} n  {0,1} is monotone if x  y  f (x)  f ( y) (where x  y means : for every i x i.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Topics: 1. Priority Encoders 2. A question from an exam 3. Addition (if time permits) מבנה המחשב - אביב 2005 תרגול 6#
מבנה המחשב - מבוא למחשבים ספרתיים U-PENCs, B-PENCs & Half Decoders תרגול מספר 6.
מבנה מחשב – מבוא למחשבים ספרתיים Encoders, Decoders & Shifters תרגול מספר 5.
Induction and recursion
Divide-and-Conquer 7 2  9 4   2   4   7
Analysis of Algorithms
Analyzing Recursive Algorithms A recursive algorithm can often be described by a recurrence equation that describes the overall runtime on a problem of.
Divide-and-Conquer1 7 2  9 4   2  2 79  4   72  29  94  4.
2IL50 Data Structures Fall 2015 Lecture 2: Analysis of Algorithms.
File Organization and Processing Week 13 Divide and Conquer.
Binary Trees. Binary Tree Finite (possibly empty) collection of elements A nonempty binary tree has a root element The remaining elements (if any) are.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Mathematical Background and Linked Lists. 2 Iterative Algorithm for Sum Find the sum of the first n integers stored in an array v : sum (v[], n) temp_sum.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
Algorithm Analysis CS 400/600 – Data Structures. Algorithm Analysis2 Abstract Data Types Abstract Data Type (ADT): a definition for a data type solely.
Lecture 4,5 Mathematical Induction and Fibonacci Sequences.
Recurrences David Kauchak cs161 Summer Administrative Algorithms graded on efficiency! Be specific about the run times (e.g. log bases) Reminder:
Technology Mapping. 2 Technology mapping is the phase of logic synthesis when gates are selected from a technology library to implement the circuit. Technology.
Recurrences – II. Comp 122, Spring 2004.
Lecture 5 Today, how to solve recurrences We learned “guess and proved by induction” We also learned “substitution” method Today, we learn the “master.
Spanning tree Lecture 4.
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
1Computer Sciences Department. Objectives Recurrences.  Substitution Method,  Recursion-tree method,  Master method.
1 Gate Level Minimization EE 208 – Logic Design Chapter 3 Sohaib Majzoub.
Lecture 5 Algorithm Analysis Arne Kutzner Hanyang University / Seoul Korea.
CS6045: Advanced Algorithms Sorting Algorithms. Sorting So Far Insertion sort: –Easy to code –Fast on small inputs (less than ~50 elements) –Fast on nearly-sorted.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Trees.
Equal costs at all levels
Divide-and-Conquer 6/30/2018 9:16 AM
CS 3343: Analysis of Algorithms
Analysis and design of algorithm
Divide-and-Conquer 7 2  9 4   2   4   7
Sungho Kang Yonsei University
Chapter 11 Limitations of Algorithm Power
Lecture 5 Algorithm Analysis
Divide-and-Conquer 7 2  9 4   2   4   7
Presentation transcript:

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

Decoder’(n)

Decoder(n) design shown and proven in class:

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

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

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

Decoder(n) for k = n/2

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).

Decoder’(n)Decoder(n) k=n/2 Design n Decoder’(n)Decoder(n) k=n/2 Design n Cost Delay

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.

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  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.

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:

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.

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

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

Delay analysis: 1-buf-trees

Cost analysis: Delay analysis: 1-buf-trees

Cost Decoder(n): n=1: 1 n=2: 10 n=4: 52 n=8: 616 n=16: n=32: e+009 n=64: e+019 n=128: e+038 Cost Decoder‘(n): n=1: 1 n=2: 10 n=4: 60 n=8: 1024 n=16: n=32: e+010 n=64: e+019 n=128: e+039 Cost Decoder‘(n), Fanout<=2: n=1: 1 n=2: 11 n=4: 79 n=8: 1511 n=16: n=32: e+010 n=64: e+020 n=128: e+039 Cost Decoder(n), Fanout<=2: n=1: 1 n=2: 10 n=4: 68 n=8: 1096 n=16: n=32: e+010 n=64: e+019 n=128: e+039

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