Chulalongkorn University Theses and Dissertations (Chula ETD)

REDUCING ENERGY CONSUMPTION IN C PROGRAMS THROUGH REGISTER AND SHARED VARIABLES

Other Title (Parallel Title in Other Language of ETD)

การลดความสิ้นเปลืองพลังงานในโปรแกรมภาษาซีด้วยตัวแปรรีจิสเตอร์และตัวแปรร่วม

Year (A.D.)

2013

Document Type

Thesis

First Advisor

Peraphon Sophatsathit

Faculty/College

Faculty of Science (คณะวิทยาศาสตร์)

Degree Name

Master of Science

Degree Level

Master's Degree

Degree Discipline

Computer Science and Information Technology

DOI

10.58837/CHULA.THE.2013.918

Abstract

Energy consumption around the world increases exponentially. One of the causes to blame is electronic devices such as personal computers, embedded devices, and smartphones. To reckon with reducing energy consumption involves efficient hardware and software. This research focuses on the software part, in particular, how to write a program that is energy efficient. The proposed technique is based primarily on local variable reallocation in C programs to exploit the advantages of global variables and register variables. The experiment was conducted on 24 test programs by comparing between local variables and modified program using global variables and register variables.Analysing the amount of energy consumed is performed at the instruction level. It was found that global variables were the best choice. The benefits are fewer redundant allocations and memory accesses, thereby less energy will be consumed and will help the program execute faster.

Other Abstract (Other language abstract of ETD)

การใช้พลังงานทั่วโลกนั้นเพิ่มขึ้นเรื่อยๆ หนึ่งในสาเหตุที่ก่อให้เกิดปัญหาก็คืออุปกรณ์อิเล็กทรอนิกส์ต่างๆ เช่นคอมพิวเตอร์ส่วนบุคคล อุปกรณ์ฝังตัว อุปกรณ์พกพา และ โทรศัพท์มือถือ การลดการใช้พลังงานที่มีประสิทธิภาพเกี่ยวข้องกับฮาร์ดแวร์และซอฟต์แวร์ งานวิจัยนี้พิจารณาการลดพลังงานซอฟต์แวร์โดยเน้นวิธีการเขียนโปรแกรม เทคนิคที่นำเสนอจะอิงตามหลักการจัดสรรตัวแปรเฉพาะที่ในโปรแกรมภาษา C โดยใช้ประโยชน์จากข้อได้เปรียบของหน่วยความจำที่ใช้ร่วมกันและตัวแปรรีจิตเตอร์ การทดลองเป็นการทดสอบโปรแกรมตัวอย่าง 24 โปรแกรม โดยเปรียบเทียบระหว่างการใช้ตัวแปรเฉพาะที่ การใช้ตัวแปรของหน่วยความจำร่วมกัน และการใช้ตัวแปรรีจิตเตอร์ การวิเคราะห์จะดำเนินการในระดับคำสั่งเครื่องเพื่อคำนวณหาปริมาณการบริโภคพลังงาน ผลการวิจัยแสดงให้เห็นว่าหน่วยความจำที่ใช้ร่วมกันเป็นตัวเลือกที่ดีที่สุดโดยลดการจัดสรรที่ซ้ำซ้อนและการเข้าถึงหน่วยความจำ จึงทำให้เกิดการบริโภคพลังงานน้อยกว่าและประมวณผลคำสั่งได้เร็วกว่า

Share

COinS