CS 178: Programming with Multimedia Objects Aditya P. Mathur Professor of Computer Sciences Purdue University, West Lafayette August 25, 2004 Last update: August 23, 2004 Computer Organization, Compilation, and Eclipse
Course Introduction Aditya P. Mathur Learning Objectives The compilation process What is a compiler? Eclipse
Course Introduction Aditya P. Mathur Basic Computer Organization CPU|GPU|SPU Primary Storage Secondary Storage Input/Output Devices e.g. 512MB e.g. 60GB e.g. Athelon, R3000A e.g. Joystick, Display Cache CPU: Central Processing Unit GPU: Graphics Processing Unit SPU: Sound Processing Unit
Course Introduction Aditya P. Mathur High Level-Low Level Languages A CPU|GPU|SPU in a computer understands instructions coded as only 1’s and 0’s. The language of 0’s and 1’s is a low level language known as machine language. Java allows the coding of instructions using keywords from English, e.g. applet, class, and String. Java is a high-level language. How does a CPU/GPU/SPU understand instructions coded in Java?
Course Introduction Aditya P. Mathur Language Translation Java Program Java Compiler Byte Code Java Virtual machine (JVM) Instructions executed by the CPU Output JVM interprets Java byte code instructions. JVM instructions are executed by the CPU. Different from machine (CPU) code
Course Introduction Aditya P. Mathur Platform Independence Byte Code Java Virtual machine Java Virtual machine Java Virtual machine WindowsUnixOS X Others
Course Introduction Aditya P. Mathur Structure of a Java Program Java Program Class One or more classes Method Each class contains data and methods. Data Method Data Method Data Instructions
Course Introduction Aditya P. Mathur Sample Java Programs and Eclipse Let us examine a few Java programs..small and not so small!