This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:papc:chapter_6_14 [2025/11/15 12:02] – ktokarz | en:multiasm:papc:chapter_6_14 [2025/11/18 11:08] (current) – ktokarz | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Energy-efficient programming is crucial while we consider the influence of the program execution, computation, | Energy-efficient programming is crucial while we consider the influence of the program execution, computation, | ||
| - | During computations, | + | During computations, |
| - | == Cytat == | + | Energy |
| - | Now, software energy | + | The need to reduce energy consumption in consumer electronics can influence the battery life of smartphones. Users try to avoid CPU-intensive apps to get a bit more time out of the phone battery. |
| + | |||
| + | The energy consumed by the computer running the software depends on the execution time, clock frequency and average power consumption of the hardware. It can't be expressed with a simple formula, but in general, all coefficients are directly proportional. If the power, time or frequency increases, the energy consumption also grows. It indicates where one can look for reductions in the energy needed to perform a task. It is worth noting that for the same code, the time and frequency are interdependent. If the system runs faster, the time of task execution will be shorter. This means that the code efficiency relies on the number of cycles the software requires to complete the task. This leads to the conclusion that reducing the number of instructions can further reduce energy consumption and make the computation more environmentally friendly. There are two main possible approaches to reduce the number of instructions: | ||
| + | * improve algorithm, | ||
| + | * optimise the executable code. | ||
| + | Code optimisation is implemented well in modern compilers. The machine code is generated using techniques that reduce the number of unwanted instructions, | ||
| + | |||
| + | In certain computer systems, it is possible to reduce energy consumption by modifying the approach to software implementation from continuous execution to interrupt-driven execution. In continuous execution, the software continually executes the infinite loop and reads data from the input elements at regular intervals. In an interrupt-driven approach, the processor enters the idle state when there is nothing to be done. Input devices signal when new data appears, indicating a need to wake the processor up to execute the necessary part of the code. In the Windows operating system, power management is implemented as part of system functionality, | ||
| + | |||
| + | The most important thing to consider when writing a program in any programming language is to cooperate with the processor and not work against it. This includes the proper placement of data in memory, taking into account both alignment and cacheability, | ||
| - | Consumed power by a running code in a digital system is described by the formula: | ||
| - | P = ΔT x F x U x I | ||
| - | where F is the frequency clocking the digital components, ΔT the code run time and | ||
| - | U and I are voltage value and current rating. Minimizing the average F is discussed at | ||
| - | point B. Minimizing ΔT means to cut the number of clocks at the average F using | ||
| - | programming techniques on the HLL or use Parallel Assembly instructions for integer | ||
| - | or float data types ((Iossifov, V. (2021). Programming Techniques for Energy-Efficient Software. In: Georgiev, I., Kostadinov, H., Lilkova, E. (eds) Advanced Computing in Industrial Mathematics. BGSIAM 2018. Studies in Computational Intelligence, | ||