Construct a legal tree of gates

Assignment Help Computer Engineering
Reference no: EM1374990

A sequence of n arrival times t0, t1, ..., tn-1, . a library of mlogically equivalent gates {(d0, c0), (d1, c1), ..., (dm-1,cm-1)} where d is delay and c is cost. a maximum allowable arrival time at the output of the tree tmax

Objective: Construct a legal tree of gates which minimizes the total cost of the tree subject to the constraint that the arrival time at the output is no greater than tmax. Use dynamic programming to solve this

Problem:

Signal i arrives at its input pin at time ti.  The arrival time at the output of a gate g with inputs x and y is determined by:

tg = max (tx, ty) + dg

where tx and ty are the arrival times of inputs x and y respectively and dg is the delay through the gate.

The figures below give two trees for the given input.  The input pins are at the left of the diagrams and are labeled with their arrival times.  The two configurations

340_Construct a legal tree of gates which minimizes total cost.png

Allowable Trees

Because of the given ordering of the inputs, we will not allow just any tree structure; the trees must be "consistent" with the input pin ordering:

The leaves (inputs) of every subtree must be a consecutive subsequence of length two or more from the given pin ordering.

The tree in the diagram below violates this rule.

Don't worry, this is good news for you:  it makes the problem more tractable.

1612_Construct a legal tree of gates which minimizes total cost1.png

Given:  

? A sequence of n arrival times t0, t1, .........tn-1,

? a library of m logically equivalent gates { (d0,c0), (d1, c1),..........(dm-1, cm-1)}

? a maximum allowable arrival time at the output of the tree tmax

Objective:  Construct a legal tree of gates which minimizes the total cost of the tree subject to the constraint that the arrival time at the output is no greater than tmax.

Formats

Pin Arrival Times and Ordering:  The first file format specifies the signal arrival times in sequence.  The inputs are implicitly labeled t0, t1, .........tn-1.  The file is as simple as can be: 

? the first line specifies the number of input pins n;

? this is followed by n lines containing t0.........tn-1 as floating point numbers.

The problem instance used in the preceding diagrams would look like this:

6

6.0

3.0

4.0

7.0

2.0

3.0

 

Gate Library:  A gate library is specified in a file organized as follows:

? The first line is the integer m -- the number of gates in the library.

? This is followed by m lines, describing gates 0..m-1.  each line contains two positive floating point numbers (in this order).

? the delay -- a floating point number

? the cost -- an integer

? The ordering of the gates implicitly determines their IDs -- 0..m-1

? The gates are ordered in decreasing order of delay and increasing order of cost:  slowest/cheapest gate first.

For example, a library with three gates might look like this:

3

5.0 1

4.5 1

3.5 3

Topology Format:  postfix notation

A solution is a binary tree in which the leaves are labeled

b0, b1, ...

Each internal node represents a gate and is labeled:

gX

where X is the gate ID from the library (or simply 0 if there is only one such gate).

The structure of the tree itself is specified in postfix notation on a single line. Think of the gates as operators and as the inputs as operands.

The topology from the first figure would be specified as:

b0 b1 b2 g0 b3 b4 b5 g0 g0 g0 g0

Your program will use this format when reporting an optimal configuration.

Usage

Your program should run from the command line as follows:

% gtree <pin-file> {<library-file>} {-t <tmax>}

The pin file is required.

If no library file is specified, the default library is just a single gate with unit delay and unit cost.

If no maximum arrival time tmax is specified, the program should minimize the arrival time.

For example the following would run the program on a pin file test1 using gate library lib1 with timing constraint 10.0

% gtree test1 lib1 -t 10.0

Your program will then print a report to the terminal containing the following:

? Whether a feasible solution exists or not

? If a solution exists:

?     The arrival time of the solution

?     The cost

?     The topology in postfix notation

Assumptions:  For this assignment, you may assume the following:

? Input files are well-formatted

? The command line arguments are in exactly the order specified above.

Reference no: EM1374990

Questions Cloud

Explaining international trade patterns : As an international economist you have been tasked to make a short speech which answers the given questions:
Rank order voting : One popular voting scheme is rank order voting, where persons assign a rank (1,2,3) to the possible options; the assigned ranks are then added up and alternative with lowest sum wins.
Importance of leadership in bringing about necessary changes : Assess importance of leadership in bringing about the necessary changes at Porsche. Describe answer with examples.
Objective costs and valid techniques based analysis : When economists with different political views do cost or profit comparisons, they often reach different decisions. If their analysis is based on objective costs and valid techniques, why would not they reach similar decisions,
Construct a legal tree of gates : Construct a legal tree of gates which minimizes the total cost of the tree subject to the constraint that the arrival time at the output is no greater than tmax. Use dynamic programming to solve this
International trade between countries : One of major political developments of last many decades is the increasing size and economic or monetary integration of the European Union. Determine what effect do you think this will have on international trade between nations?
Hypothesis test : Traditionally, two% of the citizens of US live in a foreign nation because they are disenchanted with United States politices or social attitudes. In order to test if this prportion has raised since the September 11, 2001, terror attacks, United Stat..
Questions about economic policy : A lawyer who drives a beat-up car and wears frumpy dresses may have a hard time getting customers. Potential clients may conclude from his appearance that he is poor, and if he is poor, he probably is not very good.
Common macroeconomic indicators : Economic indicators are economic statistics that tell us how well the economy is doing. The GDP, unemployment value, and inflation vale are the most common macroeconomic indicators.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to establishing a secure computer room

Include the principles of separation of duties to find out who should be granted access into the computer room and the type of access they should have.

  Methods of defense and provide examples

Methods of defense and provide examples

  Test a program that generates 1000 random numbers

write and test a program that generates 1000 random numbers between 1 and 6 and stores them in a data file.Write down a second program the takes the data produced by the first program and analyses it to produce a table showing the number of times ..

  What devices use to get efficient network communication

CNT Books has expanded considerably as you first got network up and running three years ago. It at the present occupies an entire floor in building, and its LAN has full-grown to contain several servers and more than 60 workstations.

  What may cause the loss of one control file

Why must a business have its database in ARCHIVELOG mode?

  Define php and asp.net

What are some of the pros and cons of open source versus proprietary software.

  Make a visual studio 2008 asp .net web site

make a Visual Studio 2008 ASP .NET Web Site with two Web Forms. Add a DropDownList server control and a Label server control to the first Web Form.

  Use the queue to reverse the elements of the stack

Write down a function template, reverseStack, that takes a parameter a stack object and a queue object whose elements are of the same type. The function reverseStack uses the queue to reverse the elements of the stack.

  Reconnaissance tools

Enlist some of the popular reconnaissance tools, comparing three of the reconnaissance tools describing the advantages.

  Make gui application that a clerk can use to choose services

Create a GUI application that a clerk can use to select services and that will total and display the charge for a customer's visit to the Automobile Maintenance Service.

  Cellular network

Calculate how many users a cell may support for a 5% call blocking rate. Suppose that each user generates 35mE of load in the busy hour.

  Make a public static method named comparescores

Write down a public static method named compareScores that takes two doubles as its arguments and returns the integer value of -1 if the first argument is less than the second, 0 if the first argument is the same as the second, and +1 if the first..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd