102 Pages

chapter22

Course: WLE 2581, Fall 2009
School: University of Louisiana...
Rating:
 
 
 
 
 

Word Count: 3089

Document Preview

Programming: C++ Program Design Including Data Structures, Third Edition Chapter 22: Standard Template Library (STL) Objectives In this chapter you will: Learn about the Standard Template Library (STL) Become familiar with the basic components of the STL: containers, iterators, and algorithms Explore how various containers are used to manipulate data in a program Discover the use of iterators Learn about...

Register Now

Unformatted Document Excerpt

Coursehero >> Louisiana >> University of Louisiana at Lafayette >> WLE 2581

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Programming: C++ Program Design Including Data Structures, Third Edition Chapter 22: Standard Template Library (STL) Objectives In this chapter you will: Learn about the Standard Template Library (STL) Become familiar with the basic components of the STL: containers, iterators, and algorithms Explore how various containers are used to manipulate data in a program Discover the use of iterators Learn about various generic algorithms Introduction (continued) ANSI/ISO Standard C++ is equipped with a Standard Template Library (STL) The STL provides class templates to process lists, stacks, and queues This chapter discusses many important features of the STL and shows how to use its tools Components of the STL Components of the STL: - Containers - Iterators - Algorithms Containers and iterators are class templates Iterators are used to step through the elements of a container Algorithms are used to manipulate data Container Types Containers are used to manage objects of a given type Three categories: - Sequence (sequential) containers - Associative containers - Container adapters Sequence Containers Every object has a specific position Three predefined sequence containers: - vector - deque - list Sequence Container: Vector A vector container stores and manages its objects in a dynamic array To use a vector container in a program, the program must #include <vector> To define an object of type vector, we must specify the type of the object because the class vector is a class template. For example, the statement vector<int> intList;declares intList to be a vector and the component type to be int. The statement vector<string> stringList; declares stringList to be a vector container and the component type to be string. The class vector contains several constructors, including the default constructor Sequence Container: Vector (continued) Basic vector operations - Item insertion - Item deletion - Stepping through the elements Vector elements can be accessed using the operations below: The class vector also contains member functions that can be used to find the number of elements currently in the container, the maximum number of elements that can be inserted into a container, and so on. The class vector also contains member functions that can be used to manipulate the data, as well as insert and delete items, in a vector container. Declaring an Iterator to a Vector Container Vector contains a typedef iterator For example, the statement vector<int>::iterator intVecIter; declares intVecIter to be an iterator into a vector container of type int The expression ++intVecIter advances the iterator intVecIter to the next element in the container The expression *intVecIter returns the element at the current iterator position. Container and Functions begin and end Every container contains the member function begin and end - begin returns the position of the first element - end returns the position of the last element Both functions have no parameters The statement in Line 1 declares intList to be a vector container and the element type is int. The statement in Line 2 declares intVecIter to be an iterator in a vector container whose element type is int. After the following statement executes: intVecIter = intList.begin(); the iterator intVecIter points to the first element in the container intList. The following for loop outputs the elements of intList to the standard output device: for (intVecIter = intList.begin(); intVecIter != intList.end(); ++intVecList) cout << *intVecList << " "; Function copy: convenient way to output the elements of a container Can be used with any container type Allows you to copy the elements from one place to another - Can output the elements of a vector - Can copy the elements of one vector into another The prototype of the function template copy is template <class inputIterator, class outputIterator> outputItr copy(inputIterator first1, inputIterator last, outputIterator first2); The parameter first1 specifies the position from which to begin copying the elements; the parameter last specifies the end position. The parameter first2 specifies where to copy the elements. Therefore, the parameters first1 and last specify the source; parameter first2 specifies the destination. Note that the elements within the range first1...last-1 are copied. The definition of the function template copy is contained in the header file algorithm. Thus, to use the function copy, the program must include the statement #include <algorithm> The function copy works as follows. Consider the following statement: int intArray[] = {5, 6, 8, 3, 40, 36, 98, 29, 75}; This statement creates an array intArray of nine components. The statement: vector<int> vecList(9); creates an empty container of nine components of type vector and the element type int. Now consider the statement copy(intArray, intArray + 9, vecList.begin()); This statement copies the elements starting at the location intArray until intArray + 9 - 1 into the container vecList. After the previous statement executes, vecList = {5, 6, 8, 3, 40, 36, 98, 29, 75} Consider the statement copy(intArray + 1, intArray + 9, intArray); Here first1 is intArray + 1 and last is intArray + 9. Also, first2 is intArray. After the preceding statement executes, intArray = {6, 8, 3, 40, 36, 98, 29, 75, 75} Clearly, the elements of the array intArray are shifted to the left by one position. Now consider the statement copy(vecList.rbegin() + 2, vecList.rend(), vecList.rbegin()); Recall that the function rbegin (reverse begin) returns a pointer to the last element into a container; it is used to process the elements of a container in reverse. Therefore, vecList.rbegin() + 2 returns a pointer to the third-to-last element into the container vecList. Similarly, the function rend (reverse end) returns a pointer to the first element into a container. The previous statement shifts the elements of the container vecList to the right by two positions. After the previous statement executes, the container vecList is vecList = {5, 6, 5, 6, 8, 3, 40, 36, 98} The ostream Iterator and the Function copy One way to output the contents of a container is to use a for loop, along with begin (initialize) and end (loop limit) copy can output a container; an iterator of the type ostream specifies the destination When you create an iterator of the type ostream, specify the type of element that the iterator will output ostream_iterator<int> screen(cout, " "); This statement creates screen to be an ostream iterator with the element type int. The iterator screen has two arguments: the object cout and a space. The iterator screen is initialized using the object cout. When this iterator outputs elements, they are separated by a space. The statement copy(intArray, intArray + 9, screen); outputs the elements of intArray on the screen. The statement copy(vecList.begin(), vecList.end(), screen); outputs the elements of the container vecList on the screen. The statement copy(vecList.begin(), vecList.end(), screen); is equivalent to the statement copy(vecList.begin(), vecList.end(), ostream_iterator<int>(cout, " ")); The statement copy(vecList.begin(), vecList.end(), stream_iterator<int>(cout, ", ")); outputs the elements of vecList with a comma and space between them. Sequence Container: deque deque stands for double ended queue Implemented as dynamic arrays Elements can be inserted at both ends A deque can expand in either direction Elements are also inserted in the middle Sequence Container: list Lists are implemented as doubly linked lists Every element in a list points to both its immediate predecessor and its immediate successor (except the first and last element) The list is not a random access data structure Iterators An iterator points to the elements of a container (sequence or associative) Iterators provide access to each element The most common operations on iterators are ++ (increment) and * (dereference) Types of Iterators Five types of iterators: - Input iterators - Output iterators - Forward iterators - Bidirectional iterators - Random access iterators Input Iterators Input iterators, with read access, step forward element-by-element; consequently, they return the values element-by-element. These iterators are provided for reading data from an input stream. Output Iterators Output iterators, with write access, step forward element-by-element Output iterators are provided for writing data to an output stream Forward Iterators Forward iterators combine all of the functionality of input iterators and almost all of the functionality of output iterators Bidirectional Iterators Bidirectional iterators are forward iterators that can also iterate backward over the elements The operations defined for forward iterators apply to bidirectional iterators Use the decrement operator to step backward Random Access Iterators Random access iterators are bidirectional iterators that can randomly process the elements of a container Can be used with containers of the types vector, deque, string, as well as arrays Operations defined for bidirectional iterators apply to random access iterators typedef iterator Every container contains a typedef iterator The statement vector<int>::iterator intVecIter; declares intVecIter to be an iterator into a vector container of the type int typedef const_iterator With the help of an iterator into a container and the dereference operator, *, you can modify the elements of the container If the container is declared const, then we must prevent the iterator from modifying the elements Every container contains typedef const_iterator to handle these situations Stream Iterators istream_iterator - Used to input data into a program from an input stream ostream_iterator - Used to output data from a program into an output stream Associative Containers Elements in associative container are automatically sorted according to some ordering criteria The predefined associative containers in the are: - STL Sets - Multisets - Maps - Multimaps Associative Containers: set and multiset Associative containers set and multiset automatically sort their elements multiset allows duplicates, set does not The default sorting criterion is the relational operator <(less than); that is, the elements are arranged in ascending order The name of the class defining the container set is set; the name of the class defining the container multiset is multiset. The name of the header file containing the definitions of the classes set and multiset, and the definitions of the functions to implement the various operations on these containers, is set. To use any of these containers, the program must include the following statement: #include <set> If you want to use sort criteria other than the default, you must specify this option when the container is declared. For example, consider the following statements: The statement in Line 1 declares intSet to be an empty set container, the element type is int, and the sort criterion is the default sort criterion. The statement in Line 2 declares otherIntSet to be an empty set container, the element type is int, and the sort criterion is greater-than. That is, the elements in the container otherIntSet will be arranged in descending order. The statements in Lines 3 and 4 have similar conventions. Container Adapters The STL provides containers to accommodate special situations called container adapters The three container adapters are: - Stacks - Queues - Priority Queues Container adapters do not support any type of iterator Stack The STL provides a stack class Queue The STL provides a queue class Algorithms Operations such as find, sort, and merge are common to all containers and are provided as generic algorithms STL algorithms can be classified as follows: - Nonmodifying algorithms - Modifying algorithms - Numeric algorithms - Heap algorithms Nonmodifying Algorithms Nonmodifying algorithms do not modify the elements of the container Numeric Algorithms Numeric algorithms perform numeric calculations on the elements of a container Numeric algorithms: - accumulate - inner_product - adjacent_difference - partial_sum Heap Algorithms Heap sort algorithm sorts array data The array containing the data is viewed as a binary tree Heap algorithms: - make_heap - push_heap - pop_heap - sort_heap Function Objects To make the generic algorithms flexible, the STL usually provides two forms of an algorithm using the mechanism of function overloading. The first form of an algorithm uses the natural operation to accomplish this goal. In the second form, the user can specify criteria based on which algorithm processes the elements. For example, the algorithm adjacent_find searches the container and returns the position of the first two elements that are equal. In the second form of this algorithm, we can specify criteria (say, less than) to look for the first two elements, such that the second element is less than the first element. A function object contains a function that can be treated as a function using the function call operator, (). In fact, a function object is a class template that overloads the function call operator, operator(). In addition to allowing you to create your own function objects, the STL provides arithmetic, relational, and logical function objects, which are described in Table 22-26. The STL's function objects are contained in the header file functional. The STL relational function objects can also be applied to containers. The STL algorithm adjacent_find searches a container and returns the position in the container where the two elements are equal. This algorithm has a second form that allows the user to specify the comparison criteria. For example, consider the following vector, vecList: vecList = {2, 3, 4, 5, 1, 7, 8, 9}; The elements of vecList are supposed to be in ascending order. To see if the elements are out of order, we can use the algorithm adjacent_find as follows: intItr = adjacent_find(vecList.begin(), vecList.end(), greater<int>()); where intItr is an iterator of the vector type. The function adjacent_find starts at the position vecList.begin()--that is, at the first element of vecList--and looks for the first set of consecutive elements such that the first element is greater than the second. The function returns a pointer to element 5, which is stored in intItr. Predicates are special types of function objects that return Boolean values. There are two types of predicates--unary and binary. Unary predicates check a specific property for a single argument. Binary predicates check a specific property for a pair--that is, two arguments. Predicates are typically used to specify searching or sorting criteria. In the STL, a predicate must always return the same result for the same value. The functions that modify their internal states cannot be considered predicates. Insert Iterators The STL provides three iterators, called insert iterators, to insert the elements at the destination: - back_inserter - front_inserter - inserter back_inserter: This inserter uses the push_back operation of the container in place of the assignment operator. The argument to this iterator is the container itself. We can copy the elements of list into vList by using back_inserter as follows: copy(list, list + 5, back_inserter(vList)); front_inserter: This inserter uses the push_front operation of the container in place of the assignment operator. The argument to this iterator is the container itself. Because the vector class does not support the push_front operation, this iterator cannot be used for the vector container. inserter: This inserter uses the container's insert operation in place of the assignment operator. There are two arguments to this iterator: the first argument is the container itself; the second argument is an iterator to the container specifying the position at which the insertion should begin. STL Algorithms STL algorithms include documentation with the function prototypes The parameter types in...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 21: GraphsObjectivesIn this chapter you will: Learn about graphs Become familiar with the basic terminology of graph theory Discover how to represent graphs in computer memo
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 20: AVL TreesObjectivesIn this section you will: Learn about AVL treesAVL TreesDefinition: A perfectly balanced binary tree is a binary tree such that: i. The heights of t
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 20: Binary TreesObjectivesIn this chapter you will: Learn about binary trees Explore various binary tree traversal algorithms Learn how to organize data in a binary search t
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 19: Heap SortObjectivesIn this section you will: Learn about the heap sort algorithmsA heap is a list in which each element contains a key, such that the key in the element
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 19: Searching and Sorting AlgorithmsObjectivesIn this chapter you will: Learn the various search algorithms Explore how to implement the sequential and binary search algorit
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 17: Linked ListsVideo List This program requires us to- Maintain a list of all videos in the store - Add a new video to our list Use a linked list to create a list of vide
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 18: Stacks and QueuesObjectivesIn this chapter you will: Learn about stacks Examine various stack operations Learn how to implement a stack as an array Learn how to implemen
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 17: Linked Lists Doubly linked list: every node has next and back pointers Can be traversed in either directionDoubly Linked Lists (continued) Operations: 1. Initialize th
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 17: Linked ListsObjectivesIn this chapter you will: Learn about linked lists Become aware of the basic properties of linked lists Explore the insertion and deletion operatio
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 16: Recursion Let us determine how long it would take to move all 64 disks from needle 1 to needle 3. If needle 1 contains 3 disks, then the number of moves required to move
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 16: RecursionObjectivesIn this chapter you will: Learn about recursive definitions Explore the base case and the general case of a recursive definition Discover what is a re
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 15: Exception HandlingObjectivesIn this chapter you will: Learn what an exception is Learn how to handle exceptions within a program See how a try/catch block is used to han
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 13: Pointers, Classes, Virtual Functions, Abstract Classes, and ListsObjectivesIn this chapter you will: Learn about the pointer data type and pointer variables Explore how
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 14: Overloading and TemplatesObjectivesIn this chapter you will: Learn about overloading Become aware of the restrictions on operator overloading Examine the pointer this Le
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 12: Inheritance and CompositionObjectivesIn this chapter you will: Learn about inheritance Learn about derived and base classes Explore how to redefine the member functions
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 11: Classes and Data AbstractionObjectivesIn this chapter you will: Learn about classes Learn about private, protected, and public members of a class Explore how classes are
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 10: Records (structs)ObjectivesIn this chapter you will: Learn about records (structs) Examine various operations on a struct Explore ways to manipulate data using a struct
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 9: Arrays and StringsObjectivesIn this chapter you will: Learn about arrays Explore how to declare and manipulate data into arrays Understand the meaning of &quot;array index out
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 8: User-Defined Simple Data Types, Namespaces, and the string TypeObjectivesIn this chapter you will: Learn how to create and manipulate your own simple data typecalled the
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 7: User-Defined Functions IIObjectivesIn this chapter you will: Learn how to construct and use void functions in a program Discover the difference between value and referenc
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 5: Control Structures II (Repetition)ObjectivesIn this chapter you will: Learn about repetition (looping) control structures Explore how to construct and use countcontrolled
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 6: User-Defined Functions IObjectivesIn this chapter you will: Learn about standard (predefined) functions and discover how to use them in a program Learn about user-defined
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 3: Input/OutputObjectivesIn this chapter you will: Learn what a stream is and examine input and output streams Explore how to read data from the standard input device Learn
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 2: Basic Elements of C+ObjectivesIn this chapter you will: Become familiar with the basic components of a C+ program, including functions, special symbols, and identifiers E
University of Louisiana at Lafayette - WLE - 2581
C+ Programming: Program Design Including Data Structures, Third EditionChapter 1: An Overview of Computers and Programming LanguagesObjectivesIn this chapter you will: Learn about different types of computers Explore the hardware and software component
University of Louisiana at Lafayette - WLE - 2581
Chapter 1 Intro to Computing A) History of Computing 1.1 pg 3 - 9 B) Structure of the Modern Computer 1.2 pg 10 - 14 C) Pgm Design - 1.3 &amp; 1.4 pg 16 - 34 A) History of Computing 3000 - 4000 - China abacus 1600s - slide rule 1642 - Blaise Pascal, French Ma
Allan Hancock College - CS - 5248
Adaptive Filters for Continuous Queries over Distributed Data StreamsChris Olston, Jing Jiang, and Jennifer WidomStanford University cfw_olston, jjiang, widom@cs.stanford.eduAbstractWe consider an environment where distributed data sources continuousl
Yale - CS - 422
Exokernel: An Operating System Architecture for Application-Level Resource ManagementDawson R. Engler, M. Frans Kaashoek, and James OToole Jr. M.I.T. Laboratory for Computer Science Cambridge, MA 02139, U.S.A engler, kaashoek, james @lcs.mit.eduTraditio
New College FL - LISTS - 20070502
J. Biosci., Vol 18, Number 4, December 1993, pp 457-474. Printed in India.Mass flowering of dipterocarp forests in the aseasonal tropicsS APPANAHForest Research Institute Malaysia, Kepong, 52109 Kuala Lumpur, Malaysia MS received 14 August 1992; revise
Utah - CS - 3700
f d ews i r q p k Yg h k nh $olg k d Yg h k mh lg k ih YjYg @&quot;8u p W Y ) U W d Q X W TT ` u v2 s W $vy d s W 2 1tX w2 x` fw1 YSQ q` s a yy a e1 d c u 1s v2 tW r 1 W q` WW hi 1 W 2 g` f1 2 YSQ p a e d c b a` XW T R 1 Y ) VUT SQ P C H F IGE C A 9 7 6 DB@8
Utah - CS - 3700
MM74HC161 MM74HC163 Synchronous Binary Counter with Asynchronous Clear Synchronous Binary Counter with Synchronous ClearSeptember 1983 Revised February 1999MM74HC161 MM74HC163 Synchronous Binary Counter with Asynchronous Clear Synchronous Binary Counter
Utah - CS - 3700
MM74HC04 Hex InverterSeptember 1983 Revised February 1999MM74HC04 Hex InverterGeneral DescriptionThe MM74HC04 inverters utilize advanced silicon-gate CMOS technology to achieve operating speeds similar to LS-TTL gates with the low power consumption of
Winthrop - CHEM - 106
Exam II Thursday 10.30.08 in class Review Session Tuesday 10.28.08 Be able to draw a free energy diagram for an enzymatic reaction Know Michaelis-Menten Kinetics Understand the various types of inhibition (competitive, noncompetitive, un-competitive) Kno
Winthrop - CHEM - 106
Analyzing Enzyme Kinetic Data with a Graphing Calculator PART A: LINEWEAVER-BURK PLOTS In discussing the properties of an enzyme, certain values, or parameters are determined experimentally under steady state conditions. These values are determined throug
Winthrop - CHEM - 106
12 Lipids-1Chapter 12: Lipids12 Lipids-2Lipids: IntroTriglycerides Phospholipids Steroids Saponification Metabolism of fatsKeyhydrogen carbon oxygen nitrogen sodiumLipids:The term lipid is somewhat poorly defined: it is generally applied to oily o
University of Florida - CGS - 2421
NameUsername _CGS 2425LAB EXAM 1 SUMMER 2007Introduction (Knapsack problem)The Knapsack problem is a classic problem in combinatorial optimization. A hiker must decide which goods to include in her knapsack on a forthcoming trip. She mush choose from
University of Florida - CGS - 2421
NameUsername _CGS 2425 Introduction (Tour)LAB EXAM 2 SUMMER 2007In this test, we will define two classes-City and Tour. A Tour object contains a dynamic array of cities. Suppose that all the necessary header files (&lt;iostream&gt;, &lt;fstream&gt;, &lt;cmath&gt;, &lt;str
University of Florida - CGS - 2421
CGS-2425 C+ EXAM 2, TEST FORM CODE &quot;A&quot;, SPECIAL CODE &quot;28&quot;, FALL 2008 This exam is OPEN BOOK, OPEN NOTES, CLOSED NEIGHBOR. receive a ZERO on the exam. Cheaters willAssume iostream.h and math.h have been included prior to any partial C+ code.T The next fi
University of Florida - CGS - 2421
NameUsername _CGS 2425LAB EXAM 1 SUMMER 2007Introduction (Knapsack problem)The Knapsack problem is a classic problem in combinatorial optimization. A hiker must decide which goods to include in her knapsack on a forthcoming trip. She mush choose from
University of Florida - CGS - 2421
CGS-2421 C+ EXAM 1, TEST FORM CODE &quot;A&quot;, SPECIAL CODE &quot;81&quot;, SPRING 2008 This exam is OPEN BOOK, OPEN NOTES, CLOSED NEIGHBOR. receive a ZERO on the exam. Cheaters willBe SURE to read all instructions. You will not receive any partial credit if the instruct
University of Florida - CGS - 2421
USERNAME _NAME _1. Write a function to calculate the distance from a point to a line. The formula describing the line is: Ax + By + C = 0 . If the coordinates of the point P are ( x0 , y 0 ), the distance dfrom the point P to the line can be calculated
Brandeis - LING - 130
Semantic Types and Function ApplicationLing324 Reading: Meaning and Grammar, pg. 87-98Semantic Types we have specified so far for the fragment of English F1Syntactic Category S N Vi, VP Vt Conj Neg Semantic Type Truth values (0 or 1) Individuals Sets o
National Taiwan University - ECE - 300
ECE300Electrical CircuitsAutumn 2008Catalog Description: Introduction to circuit analysis; circuit analysis concepts and their extension to mechanical and thermal systems by analogy; electrical instruments and measurements. Textbook: Principles and App
National Taiwan University - ECE - 300
ECE300 Initial Problems for quiz preparation. 1. Chp6 - Problem 66Aut08Homework 4.2. Compare your answers from Problem 1 to the speaker circuit frequency response shown in the figure below from the book: Electrical Engineering Uncovered by D. White and
National Taiwan University - ECE - 300
ECE300Aut08Homework 2.Initial Problems for quiz preparation Chapter 2 Problem 2.18 is a basic voltage divider. You can ignore the defined directions and polarities and choose your own. You should know the algebraic solution for the output voltage of a
National Taiwan University - ECE - 300
ECE300 Initial Problems for quiz preparationAut08Homework 31a. Solve for the branch voltage and branch current of the 4K resistor in the circuit in Figure 1. 1b. Replace the 4K resistor with a resistor that absorbs maximum power and state the voltage a
National Taiwan University - EE - 682
Interfacing Telos (rev B) to 51-pin Sensor BoardsJoe Polastre September 7, 20041IntroductionIn this document we describe the theory of operation using Telos, a new IEEE 802.15.4-compliant mote with a Texas Instruments MSP430 microcontroller, to connec
National Taiwan University - EE - 682
ECE 682/3 Group Evaluation List your group members in the table below. Assign a point value out of 50 possible to each group member that reflects their contribution to your groups project. First Name Last Name Score (out of 50) You 1. 2. 3. 4. 5. 6. 7. Us
National Taiwan University - EE - 720
ECE720 CAD Design Report Work on at least one of the two topics described on the following pages, or you can include another topic if you obtain pre-approval. The topic needs to involve mixed signal circuit simulation, analysis, and discussion. The Report
National Taiwan University - EE - 720
TUTORIAL CADENCE DESIGN ENVIRONMENTAntonio J. Lopez Martin alopmart@gauss.nmsu.edu Klipsch School of Electrical and Computer Engineering New Mexico State University October 2002Cadence Design EnvironmentSCHEDULE CADENCE SEMINAR MONDAY, OCTOBER 21 9:00H
National Taiwan University - EE - 720
ECE720Hmwrk 4 and Midterm PrepBefore Midterm Chp. 1 Example 1.11 mos internal capacitancesBe able to relate device physics of Chp. 1 to amplifiers in Chp. 3 to op amp in Chp. 5 to DAC.DC transfer curves, gain, w3db, and wt calculations for various typ
National Taiwan University - EE - 720
1. Analyze the circuit below and predict (algebraically and numerically) the open and closed loop gain and w3db by ignoring Cgs and Cgd and then including them.Cgd 1e-9f RFGm 1mR1vmoutin200K 2meg V1 0 AC 1 PULSE 01 Cgs 0 1n 1n 50u 1e-9fRT 100kC1
National Taiwan University - EE - 720
EE720Homework 3.Reading: Read/Skim the device equations in the J&amp;M textbook, both large and small signal. Read/Skim the CMOS fabrication and layout concepts in sections 2.1, 2.3 and 2.4 of the J&amp;M textbook. Also read the needed sections of 3.12 and rela
National Taiwan University - EE - 720
ECE720Hmwrk 2 Reading:From the ece721 web page, look over the Intro Chapter points slides from the Rabaey textbook. Compare the digital design abstraction diagram with the similar diagram for analog system design in Razavi Chp. 1.Software: 1. Exercise
National Taiwan University - EE - 720
ECE720Hmwrk 1Reading and Software work is on this page, writing assignment on page 2. Reading: Skim over the Johns and Martin ece720 textbook to see how it is organized. Skim over all 25 lectures from the MIT online Circuit I course. Review the followin
National Taiwan University - EE - 720
Ideal Digital to Analog Conversionvdd 2.5vdd 2.5vdd 2.5I1 80uM6 mloadM5 mload L=1um W=150um vout M1 mdif L = 1um W=100um M2 mdif R2 C1 10n vout P1Vb 0R1Vin M4 mdif M3 mdif L = 1um W=100um vss -2.5vss -2.5Figure 9.39 An N-bit D/A converter using
National Taiwan University - EE - 720
National Taiwan University - EE - 720
A differential pair amplifier with inverting feedback: reduce R3 from 1T to enable feedback effects. To improve the DC sweep, R1 can be made smaller than R2. It is easier to make this circuit work with larger supplies, such as 5v and 5v. Larger supplies w
National Taiwan University - EE - 720
National Taiwan University - EE - 720
EE 720 reading guides. Johns &amp; Martin textbook: 1.1 Model the diode behavior as simply as possible, usually in the reverse bias region. In this region, model the pn junction as a constant capacitance per unit area. The area is layout dependent, and the ca
National Taiwan University - EE - 720
WHITE PAPERTHE ADVANCED CUSTOM DESIGN METHODOLOGYTABLE OF CONTENTSIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .