Page 118 - Computer_Science_F5
P. 118

Exercise 2.8                          2.  How could register renaming be
                                                            used to eliminate the dependency
               1.  Imagine you are a computer               you  identified?  Show  how  the
                   detective investigating a case of        instructions might be rewritten with
                   slow program execution. The culprit      temporary registers assigned by the
          FOR ONLINE READING ONLY
                   is inefficient use of registers in the   renaming process.                      Chapter Two: Performance and optimisation of computer processor
                   processor! You have identified a      3.  Explain how register renaming, by
                   segment of instructions that seem        eliminating dependencies, helps
                   to be creating a problem:                improve overall program execution
                   mul r1, r2, r3                           speed. Hint: Think about how it
                   sub r1, r1, 4                            allows for more efficient instruction
                   add r4, r1, r5                           scheduling.
                   (a)  Identify the data dependency     4.  Modern processors employ
                       between these instructions.          various techniques to optimise
                       What type of dependency is           performance. Research another
                       it (RAW, WAR, or WAW)?               technique (e.g., pipelining or out-
                   (b)  Explain why this dependency         of-order execution) and explain
                       might create a bottleneck in         how it works alongside register
                       program execution.                   renaming for a performance boost.


                     Thread and data Level parallelism




                             Scenario 2.3: Kitchen as a simple processor


                 Imagine planning a pizza party with friends involves ordering pizzas, preparing
                 drinks, decorating, and setting up games. It can be overwhelming for one
                 person to manage everything simultaneously.  A program acts like a recipe
                 for this party—an instruction set understood by the computer, detailing each
                 step of the planning process. When executed, this becomes a process—a live
                 instance of the program, similar to following a recipe while cooking. Multiple
                 processes can run concurrently, like baking cookies while making pizza dough.
                 Threads within a process represent individual tasks, such as preparing dough
                 and toppings concurrently, as they are lightweight and efficient. Multithreading
                 enables simultaneous handling of multiple tasks in party planning, like
                 decorating while a friend prepares drinks, significantly enhancing efficiency. In
                 contrast, parallelism involves multiple chefs collaborating on different dishes
                 simultaneously, reflecting concurrent execution of various party planning tasks
                 using multithreading.



                                                    109
               Student’s Book  Form Five



     Computer Science Form 5.indd   109                                                     23/07/2024   12:33
   113   114   115   116   117   118   119   120   121   122   123