5 Pages

cs313-2006-t1-midterm1-solution

Course: CPSC 344, Fall 2010
School: UBC
Rating:
 
 
 
 
 

Word Count: 1109

Document Preview

313, CPSC 06w Term 1 Midterm 1 Solutions Date: October 4, 2006; Instructor: Norm Hutchinson 1. (8 marks) 1a. Short answers. Is the address of a local variable in a C function determined statically or dynamically? Briey explain. (2 marks) It is determined dynamically, as it is allocated on the stack. 1b. Is the code address to which a procedure returns when it exits determined statically or dynamically?...

Register Now

Unformatted Document Excerpt

Coursehero >> Canada >> UBC >> CPSC 344

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.
313, CPSC 06w Term 1 Midterm 1 Solutions Date: October 4, 2006; Instructor: Norm Hutchinson 1. (8 marks) 1a. Short answers. Is the address of a local variable in a C function determined statically or dynamically? Briey explain. (2 marks) It is determined dynamically, as it is allocated on the stack. 1b. Is the code address to which a procedure returns when it exits determined statically or dynamically? Briey explain. (2 marks) It is dynamically determined when the procedure is called during execution of the program, by pushing the return address on the stack. 1c. (2 marks) Does the IA32 instruction-set architecture require that %esp be used as the stack pointer? Briey explain. It does require it. The call and ret instructions implicitly refer to the %esp register and there are no reasonable alternatives that compiled code can use if chooses to use a different register to point to the stack. 1d. (2 marks) Give assembly-language code that computes %eax = %eax * 9 + 7 as efciently as possible. leal 2. (8 marks) 7(%eax,%eax,8), %eax # eax = eax * 9 + 7 Consider the following C source le. /* global variables */ int g, *gp, **gpp; void foo (int *a1, int a2) { int l; /* consider each statement as if it were here */ } Give an assembly-code implementation of each of the following statements of function foo(). Consider each statement in isolation (i.e., as if it were the only statement of foo). Do not assume that variables start out in registers. Be sure to write results to the appropriate location in memory. Assume that the local variable l is in memory (not in a register). A fully correct answer will use as few instructions as possible. Comment your code. 2a. (2 marks) gp = &l; leal movl -4(%ebp), %eax %eax, gp # eax = &l # gp = &l 2b. (2 marks) l = *a1 * a2; movl movl imull movl 8(%ebp), %eax (%eax), %eax 12(%ebp), %eax %eax, -4(%ebp) # # # # eax eax eax l= = a1 = *a1 = *a1 * a2 *a1 * a2 2c. (2 marks) **gpp = 3; movl movl movl gpp, %eax (%eax), %eax $3, (%eax) # eax = gpp # eax = *gpp # **gpp = 3 2d. (2 marks) if (a2 > g) l = a2 else l = g; movl cmpl jg movl .L0: movl 3. (8 marks) 12(%ebp), %eax # eax = a2 g, %eax # (a2 ? g) .L0 # if (a2 > g) goto .L0 (then-part) g, %eax # %eax is now g rather than a2 %eax, -4(%ebp) # l = either a2 or g Consider the following assembly language code. 3a. (4 marks) Comment every line of this code carefully. foo: pushl movl movl movl cmpl je L8 L6: cmpl jle L4 subl jmp L2 L4: subl L2: cmpl jne L6 L8: popl ret %ebp %esp, %ebp 8(%ebp), %eax 12(%ebp), %edx %edx, %eax # prologue # arg 0 in %eax # arg 1 in %edx # if the same, return arg 0 %edx, %eax # if arg0 > arg1 %edx, %eax # arg0 -= arg1 %eax, %edx # arg1 -= arg0 %edx, %eax # if arg0 != arg1 # loop %ebp # epilogue 3b. (4 marks) Give an equivalent C-language function. int gcd (int a, int b) { while (a != b) { if (a > b) { a -= b; } else { b -= a; } } return a; } 4. (10 marks) Consider this C procedure int foo(int i) { 2 switch (i) { case 1: i = i * 2; break; case -1: case -4: i = i - 7; break; default: i = 0; } return i; } Give the assembly code that implements this switch statement using a jump table, in the most efcient manner possible. Include both .text and .rodata denitions. Comment your .L2 jmp .L0: code. .text movl movl subl cmpl ja sall jmp .L1: subl jmp .L2: movl .L3: .rodata .L4: .long .long .long .long .long .long 5. (6 marks) 8(%ebp), %eax %eax, %ecx $-4, %ecx $5, %ecx # eax = i *.L4(,%ecx,4) $1, %eax .L3 $7, %eax .L3 $0, %eax # goto .L4[i-(-4)] # case 1: i = i * 2 .L1 .L2 .L2 .L1 .L2 .L0 # # # # # # # ecx = i-(-4) (base) # if out of range goto default # case -1, -4: i = i - 7 # default: case case case case case case i=0 -4 -3 => default -2 => default -1, like -4 0 => default 1 Consider the procedure call to callee() in this C code. void caller (int i, int j) { int l; l = callee (&j); } Assume that callee uses one callee-save register (i.e., %esi) and that caller has a value in one callersave register (i.e., %edx) that must not be changed by the call to callee. 5a. (4 marks) Give the assembly code of the procedure call to callee(), including storing the result in local variable l in memory. 3 pushl leal pushl call movl addl popl %edx 12(%ebp), %eax %eax callee %eax, -4(%ebp) $4, %esp %edx # # # # # # # save caller-save register edx eax = &j push &j as argument callee (&j) l = callee (&j) discard argument from stack restore saved register edx 5b. (2 marks) Give the assembly code of callee()s prologue. pushl movl pushl 6. %ebp %esp, %ebp %esi # save old base pointer # create new frame # save callee-save register esi If you think about what weve been doing in this course so far, you may have been getting frustrated that it is all about doing again in assembly language things that you could already do in C. However, assembly code is strictly more powerful than C because you can access information that is not exposed to the C language programmer. This question hints at some of this information. (10 marks) 6a. (5 marks) Draw a picture of the runtime stack indicating three procedures, A which calls B which calls C. On your picture, very clearly indicate the locations of the saved frame pointers and return addresses. You should indicate the general location of parameters and local variables, but need not show them in detail. Clearly indicate exactly where in the stack the registers %esp and %ebp point. %esp towards 0 Locals/temps %ebp Saved %ebp Cs stack frame Return addr arg0 arg1 Locals/temps Saved %ebp Bs stack frame Return addr arg0 arg1 Locals/temps Saved %ebp As stack frame Return addr arg0 arg1 Towards 232 - 1 6b. (5 marks) Write in assembler a function fetch that can be called by a function like C and fetches the program counter of Cs caller and Cs callers caller. Its prototype is: void fetch(int *callerspc, int *callerscallerspc); Be careful to get the return address of Cs caller, and not fetchs caller! 4 .text .p2align 4,,15 .globl fetch .type fetch, @function fetch: # movl %ebp, %ecx # movl 4(%esp), %edx # movl 4(%ecx), %eax # movl %eax, (%edx) # movl movl movl movl (%ecx), %ecx 8(%esp), %edx 4(%ecx), %eax %eax, (%edx) # # # # # I dont push the %ebp callers %ebp is in %ecx callerspc in %edx callers callers return addr callerspc = callers callers return addr repeat for the callers caller callers callers %ebp is in %ecx callerscallerspc in %edx callers callers callers return addr callerscallerspc = callers callers callers ret ret 5
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:

UBC - CPSC - 344
CPSC 313, 06w Term 1 Midterm 2Date: November 17, 2006; Instructor: Norm HutchinsonThis is a closed book exam; no notes; you may use a calculator if you wish. Answer in the space provided;use the backs of pages if needed. There are 6 questions on 8 page
UBC - CPSC - 344
CPSC 313, 06w Term 1 Midterm 2 SolutionsDate: November 17, 2006; Instructor: Norm Hutchinson1. (10 marks)Short answers.1a.(2 marks) In the standard pipeline (F, D, E, M, W), does stalling stage D one cycle cause stalls orbubbles for any other cycles
UBC - CPSC - 344
CPSC 313, 06w Term 2 Midterm 1Date: February 9, 2007; Instructor: Norm HutchinsonThis is a closed book exam; no notes; no calculators. Answer in the space provided; use the backs of pagesif needed.There are 6 questions on 4 pages, totaling 42 marks.Y
UBC - CPSC - 344
CPSC 313, 06w Term 2 Midterm 1 SolutionsDate: February 9, 2007; Instructor: Norm Hutchinson1. (8 marks)Short answers.1a.(2 marks) Is the address of a global variable in a C program determined statically (before theprogram runs) or dynamically (while
UBC - CPSC - 344
CPSC 313, 06w Term 2 Midterm 2Date: March 23, 2007; Instructor: Norm HutchinsonThis is a closed book exam; no notes; you may use a calculator if you wish. Answer in the space provided;use the backs of pages if needed.There are 6 questions on 8 pages,
UBC - CPSC - 344
CPSC 313, 06w Term 2 Midterm 2 SolutionsDate: March 23, 2007; Instructor: Norm Hutchinson1. (12 marks)Short answers.1a. (2 marks) Describe the difference between stalling and creating a bubble.Stalling means that an instruction remains in a particula
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #1Due: Sunday, January 21, 2006 at 11: 59 PM (thirteen-hour grace period)Instructions: Hand all of your solutions in on paper.1. On an IA32 machine (e.g., lin01.ugrad.cs.ubc.ca), using gcc, compile the following C progra
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #1 Solution1. I edited the output slightly to make it shorter..bss_counter:.space 4.text_swap:pushl%ebpmovl%esp, %ebpsubl$8, %espmovl%ebx, (%esp)movl8(%ebp), %edxmovl16(%ebp), %ebxmovl%esi, 4(%esp)movl
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #2Due: Sunday, January 28, 2006 at 11:59 PM (thirteen-hour grace period)All of your solutions should be turned in on paper.1. Variables declared in a C program can be stored in either registers or memory, and if inmemor
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #2 Solution1. The only illegal operation is taking the address of i, since it is in a register. Note the similarity of allof the accesses to the variables that are stored in memory: a, l, and g. Despite the dierences in h
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #3Due: Sunday, February 4, 2007 at 11:59 PM (thirteen-hour grace period)1. Write in C a function int gcd(int x, int y); that returns the greatest common divisorof its two arguments. You may assume that they are both posi
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #3 - Solution1. (a) int gcd(int a, int b)cfw_if (a = b)return a;else if (a > b)return gcd(a - b, b);elsereturn gcd(a, b - a);.file"gcdrec.c".text.p2align 4,15.globl gcd.typegcd, @functiongcd:pushl%ebpmov
UBC - CPSC - 344
CS 313, Winter 2006 - Term 2Assignment 4: Defusing a Binary BombAssigned: February 5, Due: Sunday, February 18, 11:59:59 PM1IntroductionThe nefarious Dr. Evil has planted a slew of binary bombs on our machines. A binary bomb is a programthat consist
UBC - CPSC - 344
CS 313, Winter 2006 - Term 2Assignment 5: HCL and y86Assigned: February 26, Due: Sunday, March 4, 11:59PM (with theusual 13 hour grace period)Instructions: Hand in all solutions on paper.1. Write an HCL expression for a boolean signal implies, true w
UBC - CPSC - 344
CPSC 313 06W Term 2 Problem Set #5 - Solution 1. bool implies = !a | b; 2. The four signals divide into 2 classes, sort0 and sort3 choose the minimum or maximum elements, which look like this. sort3 is identical to sort0, with the comparisons changed from
UBC - CPSC - 344
CPSC 313, Winter 2006 - Term 2Understanding the Y86 Architectureand its Sequential ImplementationAssigned: March 2, Due: Sunday, March 11, 11:59PMFor this problem set, you may either work by yourself or in a group of two. If you choose to work in agr
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #6 - Solution1. iaddl:StageFetchDecodeExecuteMemoryWrite backPC updateiaddl V, rBicode:ifun M1 [PC]rA:rB M1 [PC + 1]valC M4 [PC + 2]valP PC + 6valB R[rB]valE valB + valCsetCCR[rB] valEPC valP2. leave:Sta
UBC - CPSC - 344
CPSC 313, Winter 2006 - Term 2PipeliningAssigned: March 9, Due: Sunday, March 18, 11:59PMAll of these questions are to be handed in on paper.1. Consider a ve-stage pipeline with stage gate delays of 150 ps, 75 ps, 100 ps, 100 ps and 175 ps anda memor
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #7 - Solution1.(a)1185ps= 5.41 109 cycles per second or 5.41 GHz(b) 5.41 Gops (instructions per second)(c) 5 * 185 = 925 ps per instruction(d)1i. 600ps = 1.66 109 cycles per second or 1.66 GHzii. 1.66 Gops (instr
UBC - CPSC - 344
CPSC 313, Winter 2006 - Term 2Problem Set #8Assigned: March 26, Due: Sunday, April 1, 11:59PMYou will hand in all of your solutions to this problem set on paper.1. What is SRAM? Where do you typically nd it? What is good about it? What is bad about it
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #8 - Solution1. SRAM stands for Static Random Access Memory. It can be typically found in caches, on or off thecore. It is fast and persistent, but it requires more transistors so is more expensive per unit of memorythat
UBC - CPSC - 344
CPSC 313, Winter 2006 - Term 2Problem Set #9Assigned: April 2Due Wednesday, April 11, 13:00 pm (no grace period)1. Textbook 10.112. Textbook 10.123. Textbook 10.134. Consider a virtual-memory system with the following parameters PTBR = physical ad
UBC - CPSC - 344
CPSC 31306W Term 2Problem Set #9 - Solution1.A. 00 0010 0111 1100B.VPNTLBITLBTTLB hit?page fault?PPN0x90x10x2NN0x17C. 0101 1111 1100D.COCICTcache hit?cache byte?2.0x00xf0x17N-A. 00 0011 1010 1001B.VPNTLBITLBTTLB hit?pa
American University in Bulgaria - MANAGEMENT - 101
Tutorials: Lecture 1 & 3Introduction to Logistics &Transportationby: Granit BerishaSeptember 29,2011Logistics is that part of SCM that plans, implements, and controlstheefficient, effective, forward and reverse flow and storage of goods,services,
University of Phoenix - HISTORY - HIS/135
Running head: THE CIVIL RIGHTS MOVEMENT1The Civil Rights MovementPamela NewsomeHIS/135September 8, 2011Rebecca HowzeTHE CIVIL RIGHTS MOVEMENT2The Civil Rights MovementThe one event that I consider to be the most influential to the success of the
McGill - PSYC - 215
READING NOTES: CHAPTER 5PERSUASION-Some examples are described They talk about Germans, Nazis, the Holocaust, propaganda, etc. One of theseexamples is particularly related to us as Canadian citizens:o Surveys shortly before the in Iraq revealed that C
Ball State - ASTRO - 101
SUBJECT: HIST 150The West in the WorldASSIGNMENT TEN: An Era of Totalitarianism and World War II.READING ASSIGNMENT:Textbook: Marvin Perry, Western Civilization, A Brief History, 6th ed., BostonHoughton Mifflin Company, 2008, chapters *19 and 20, pp.4
Ball State - ASTRO - 101
SUBJECT: HIST 150The West in the WorldASSIGNMENT ELEVEN: The West in a Global Age and the Epilogue.READING ASSIGNMENT:Textbook: Marvin Perry, Western Civilization, A Brief History, 6th ed., Boston:Houghton Mifflin Company, 2008, chapter 21 and Epilogu
Ball State - ASTRO - 101
SUBJECT: HIST 150The West in the WorldASSIGNMENT TWELVE: Core (Great) Ideas.READING ASSIGNMENT:Textbook: Marvin Perry, Western Civilization, A Brief History, 6th ed., Boston:Houghton Mifflin Company, 2008, chapters 2, 3, 5, 7, 8, 10, 13, 15, 17,and 1
Ball State - SOC - 101
I.The Social Meaning of Race and EthnicityPresented by: Jerry Imel, Chris Trejo, and Wanda BowserA.Jerry will be talking about The Social Meaning of Race and Ethnicity, as well asPrejudice andStereotypesB.Chris will be covering Discrimination and
Ball State - SOC - 101
Jerry ImelSociology03/26/2010The Agents of Socialization and How it Affected MeFor as long as I can remember, my family has always played a positive role in my life. Iwas brought up in a household that strongly believed that you should treat others t
Ball State - ECON - 301
I.The Social Meaning of Race and Ethnicity1. Race2. Racial Typesa. Caucasoidb. Negroidc. Mongoloid3. Ethnicitya. race is constructed from biological traits and ethnicity is constructed from cultural traits.4. Minoritiesa. MAP from table 11-1b.
Ball State - ECON - 301
Jerry ImelEconomics 301-2Intermediate Moment #502/08/201111.)The Slutsky compensation allows for the consumer to purchase their original bundle.From previous exercises, we know that it is unlikely that they will actually purchase the originalbundle
Ball State - ECON - 301
Jerry ImelEconomics 301-2Intermediate Moment #402/01/2011The typical consumer had a cost of living increase equal to 8.5% ($850). This was calculated bythe following method: = = 8.5%Using the same method, The consumer who apportioned her income betw
Ball State - ECON - 301
Jerry ImelEconomics 301-2Intermediate Moment #502/08/20111.)The Slutsky compensation allows for the consumer to purchase their original bundle.From previous exercises, we know that it is unlikely that they will actually purchase the originalbundle,
Ball State - ECON - 301
Jerry ImelEconomics 301-2Intermediate Moment #402/01/2011The typical consumer had a cost of living increase equal to 8.5% ($850). This was calculated bythe following method: = = 8.5%Using the same method, The consumer who apportioned her income betw
Ball State - ECON - 301
Jerry ImelEconomics 301-2Intermediate Moment #803/15/20111.)Will wants the basketball tickets priced so that total ticket revenue is maximized. Since the totalrevenue from basketball games is directly related to how much money the mens golf teamrec
Ball State - ASTRO 100 - 47280
Jerry ImelAstronomy Notes11/09/2010Can turn in some of bonus homework, does not have to be allREVIEWSchematic Diagram of the Eclipsing BinaryUsed to calculate mass and diameter of the starsTowards you = blue shiftAway from you = red shiftTotality
Ball State - ASTRO 100 - 47280
Jerry ImelAstronomy Notes11/16/2010Star Clusters1. Opena. Hundreds of Stars; Disperses; Found in Disk of the Milky Way2. Globulara. Millions of Stars; Remain together; Found in Halo of Milky WayEXAM QUESTION5 DiagramsIndicate the youngest or olde
Ball State - ASTRO 100 - 47280
Jerry ImelAstronomy11-30-2010*Form a list of study questions from the handouts of the questions on the exam come from the TY and questions on handoutsCosmologCosmos + Logic (The study of the universe as a whole)(The study of the beginning and the e
Ball State - ASTRO 100 - 47280
Astronomy Study Guide for Exam 2Structure of the Solar System:Kinds of Planets (2)Kuiper BeltOort CloudPatterns suggesting common origin1. orbital plane and direction2. size of planet3. surface4. spin rate5. tilt6. rings7. satellitesAge1. ra
Ball State - ASTRO 100 - 47280
Drake Equation Purpose is to calculate the probability of intelligent life in the Milky WayType of Equation Stars in Milky Way 10 (n)No Dark Mater 1/10Outer Disk 10-4Not Binary 1/3Type F or G 1/100What are the odds that a star like our sun would ha
Ball State - ASTRO 100 - 47280
10/26/2010Study Session for Astronomy Exam 2SUNREVIEWSOHOOrbits the Sun, not the EarthSUN4 billion years oldPowered by Nuclear FusionCross Section of Galiled or Palisto looks like Ice Covered Rock / Heavily CrateredCross Section of Comet looks l
Ball State - ASTRO 100 - 47280
Group Peer Evaluation FormSemester: FallCase: GoogleAssignment: Group HW # 21.The efforts of any one member of your group are to be compared to the average effort put forth by all of the membersof the group. This average is a scaled score of 100. If
Ball State - ASTRO 100 - 47280
COLLEGEWIDE COURSE OUTLINE OF RECORDSOCI 111, INTRODUCTION TO SOCIOLOGYCOURSE TITLE: Introduction to SociologyCOURSE NUMBER: SOCI 111PREREQUISITES: Demonstrated competency through appropriate assessment or earning a grade of C orbetter in ENGL 025 In
Ball State - ASTRO 100 - 47280
Ball State - ASTRO 100 - 47280
Entrepreneur: Rowdie EmbryPartner In: Visalus - Body By Vi Challenge When did you start your business? What inspired you to start this business? How and where did you get this idea for a business? What need did you see? Did you create a business plan
Ball State - ASTRO 100 - 47280
1 of 2Student name: _Greg Wessels_ Date due: _2/23/2010_Ivy Tech Community College Muncie, INASN ProgramNRSG 202Case Study 137INSTRUCTIONS: All questions apply to this case study. Your responses should be brief and to the point.When asked to provid
Ball State - ASTRO 100 - 47280
Chapter 16Social change the transformation of culture and social institutions over time4 Major Characteristics Social change happens all the time Social change is sometimes intentional but often unplanned Social change is controversial Some changes
Ball State - ASTRO 100 - 47280
CHEST/SHOULDERSJerry ImelDate:20 minutes cardio min.20 minutes cardio min.Cardio & Notes401250860870813510185820062256510510685155106890F100FDB Chest PressBench PressCable Fly (High)Cable Fly (Low)Fly MachineShou
Ball State - ASTRO 100 - 47280
Jerry ImelEconomics 301Intermediate Moment #703/03/2011Clinton AdministrationThe Clinton administration felt that if they stopped building a highway that hadalready been started, Americans would be better-off. First, lets look at the sunk costsinvo
Ball State - ASTRO 100 - 47280
Ball State - ASTRO 100 - 47280
Jerry ImelISOM 43005/23/2011Essay QuestionsEnterprise System has been around since the 1960s, and it has come along way since thattime. In 1960, the system was known as Inventory Management & Control. The platform wasmainframe legacy using 3rd gener
Ball State - ASTRO 100 - 47280
Does the Good Life Consist in Getting What You Want?Jerry ImelEthics/Philosophy 202Dr. Jeffrey P. FrySeptember 30, 2010Jerry ImelPHIL 202 - Ethics09/23/2010Does the Good Life Consist in Getting What You Want?If the good life is determined by a pe
Ball State - ASTRO 100 - 47280
Jerry ImelPhil 20212/07/2010Civil DisobedienceMartin Luther King, Jr. (MLK) feels that a just law is a man-made code thatsquares with the moral law or the law of God and an unjust law is a human law that isnot rooted in eternal law and natural law.
Ball State - ASTRO 100 - 47280
PHIL 202/Ethics/ Fall 2010/Second ExamDr. FryThis is a take-home exam. It is due in class on Tuesday, December 7. Pleaseno late submissions and no e-mail submissions. There are two parts to thisexam. Each part counts equally. Summarize or paraphrase i
Ball State - ASTRO 100 - 47280
Jerry ImelEthics 20211/07/2010Class ExperiencesThroughout this semester, Ethics class has taught me many things from ethicalsubjectivism to Immanuel Kant and the Categorical Imperative. I have observed variousviews from like-minded students in the p
Ball State - ASTRO 100 - 47280
Jerry ImelISOM 430Exam 105/31/2011Essay Question 1Enterprise System has been around since the 1960s, and it has come along way since thattime. In 1960, the system was known as Inventory Management & Control. The platform wasmainframe legacy using 3
Ball State - ASTRO 100 - 47280
2.)3.)Discount showing, but not yet reflective of price.New Price with discount included.4.) Explain the purpose of sales inquiry and sales quotation5.) Discuss the inventory changes from different processes in the sales activities and showappropria
Ball State - ASTRO 100 - 47280
b.)c.)CASE 2
Ball State - ASTRO 100 - 47280
Examples of How to Find the Derivative Using The Power Rule, Product Rule, QuotientRule and Chain RulePower Rule Examples:1. y = 3x4 -2x + 1y = 12x3 -22. y =3xy= xy =131x3233. y = 12x5 + 3x4 -5xy = 60x4 + 12x3 -54. y =x+121x12y=