Presentation is loading. Please wait.

Presentation is loading. Please wait.

Basic Concepts: computer, program, programming …

Similar presentations


Presentation on theme: "Basic Concepts: computer, program, programming …"— Presentation transcript:

1 Basic Concepts: computer, program, programming …
COM S 207 Basic Concepts: computer, program, programming … Instructor: Ying Cai Department of Computer Science Iowa State University

2 In the beginning Everything in computer is coded as 0 and 1
lowercase "a"  integer 20  10100

3 Bit: 1 digit (either 0 or 1) Byte: 8 bits Kilo (K): 1024 Mega (M): 1024 * 1K Giga (G): 1024 * 1M

4 What is computer about 8-bit, 16-bit, 32-bit, 64-bit CPU?

5 Computer Anatomy

6 Program A sequence of instructions for a computer to execute
All instructions are encoded into a string of 0/1 Program = stored instruction Program = CODE + data

7 Programming The act of writing programs

8 Programming language Machine language
Computers use the alphabet 0 and 1 ONLY. Instructions are built from combinations of 0 and 1! Example might mean ADD 1 and 2

9 Programming language Assembly language
Still machine language alike, but more readable Example: ADD 1 and 2 

10 Programming language High-level language: English-like languages
FORTRAN, COBOL, Pascal, Basic, C, Icon C++, Java, ML Scheme, Lisp, Prolog Perl, Python, Ruby

11 Language Elements Data types Decision (if, switch, etc.)
Primitive (integer, character, double, boolean, etc.) Constructed (string, list, array, object, etc.) Decision (if, switch, etc.) Loop (for, while, until, etc.) To write a program, it is critical that you understand the syntax and semantics of each instruction (also called statement).

12 Compiler Convert a program into machine language instructions that can be executed by a computer Compiler

13 Platform dependency In general, different languages and platforms need different compilers Portability and convenience are issues Compiler for Unix Compiler for Linux ::: Compiler for Mac

14 Java Virtual Machine A virtual machine that can execute Java binary code

15 Java Compiler Convert a program into machine language instructions that can be executed by a computer

16

17 Tools Editor: allows you to enter and edit instructions Compiler
Programmer converts pseudo-code (which he understands) to java code (something java compiler can understand) Compiler Converts java code (something java compiler can understand) to class files (something that a Java Virtual Machine can understand) JVM (Java Virtual Machine): executes/runs class files Debugger Allows you to have the JVM execute one instruction at a time and lets you see what is going on during the execution. This will help you to find runtime errors.

18 Tools Integrated Development Environment (IDE): (e.g., Eclipse)
has all above tools integrated into one tool.


Download ppt "Basic Concepts: computer, program, programming …"

Similar presentations


Ads by Google