Sie sind auf Seite 1von 47

Lecture 01

 What is a Computer?
 What is inside a computer?
 Programming languages
 What does it take to become a programmer?
 Compiler
 Operating System
 It is an electronic device that stores and
process data.
 It is all around us
 It consists
◦ Hardware
 Example: Motherboard, mouse, keyboard, CPU & etc.
◦ Software
 Example: Window XP, MS Word…
 Hardware
◦ Central Processing Unit (CPU)
 Intel Duo Core, AMD& etc
◦ Memory
 Hard disc, RAM
◦ Storage Devices
 Pen Drive, CD, DVD, Diskert
◦ Input Devices
 Key Board, Mouse, Scanner…
◦ Output Devices
 Monitor, projector, speaker…
◦ Communication Devices
 Modem, Wireless card, Switches and Hub, router…
 Software
◦ Also known as computer programs
◦ A collection of instruction for computer to operate
◦ Can be written in many types of languages
◦ Collections of important program to operate the
basic operation of a computer is Operating System
◦ Example of OS: Microsoft Windows, DOS, OS X
(MAC), UNIX and etc
 ALU (Arithmetic and Logic Unit) stands for
Arithmetic and Logical Unit which performs
Arithmetic functions like Addition,
subtraction, division, etc.

 CU (Control Unit) stands for control unit


which performs the task of controlling
functions of the computer. It monitors and
gives proper instructions to all parts of the
computer.
 A programming language is a machine –
readable artificial language to express
computations that can be performed by a
machine.
 In simple term, the language that can instruct
computer to perform certain operation!
High Level Language
Low Level Language
Hey, do you
hear me?

Operating System
Human
Low Level Language

Operating System
Low Level Language

Operating System
•Computer alone  Dead

•Computer+OS  Alive

•Computer+OS+Compiler Interact
 A compiler is a special program that
processes statements written in a particular
programming language and turns them into
machine language or "code" that a computer's
processor uses
 Basically there are 3 types of programming
language:
◦ Machine languages
◦ Assembly languages
◦ High-level languages
 Machine language is the lowest-level
programming. Machine languages are the
only languages understood by computers.
 Basically machine cannot understand human
language.
 Computer only understand numbers.(Digital
format)
 Machines languages are machine-
dependents, but it generally consists string of
numbers (eventually will reduce to 1s and 0s)
 Example:
◦ 1000100111 (Binary system)
 An assembly language is a low-level
programming language for microprocessors
and other programmable devices.
 Assembly language allow a programmer to
use names instead of numbers. This language
is still useful for programmers when speed is
necessary or when they need to carry out an
operation that is not possible in high-level
languages.
 An English-like abbreviations formed the
basic languages.
 A translator program called assemblers will
later convert the assembly language to
machine language
 Example of assembly languages syntax:
◦ LOAD
◦ ADD
◦ STORE
 A high-level language is any programming
language that enables development of a
program in a much more user-friendly
programming context and is generally
independent of the computer's hardware
architecture.
 It focuses more on the programming logic
rather than the underlying hardware
components such as memory addressing and
register utilization.
 High-level language is easier to use and learn
compare to machine language, but it is still very
tedious to write a complex program which
involve a lot of operation.
 High-level languages are developed, where
single statements can accomplish substantial
tasks.
 It make programming more easier and fun.
 Translator programs called compiler convert
high-level language to machine language
 Example of High-level language
◦ C, C++, JAVA, FOTRAN, COBOL, PYTHON, PHP….
 While easily understood by computers, machine
languages are almost impossible for humans to
use because they consist entirely of numbers.
Programmers, therefore, use either a high-level
programming language or an assembly language.
An assembly language contains the same
instructions as a machine language, but the
instructions and variables have names instead of
being just numbers.
 Programs written in high-level languages are
translated into assembly language or machine
language by a compiler. Assembly language
programs are translated into machine language
by a program called an assembler
Computer Languages Sample Translator Program
Machine Languages 10011110010111110 -
11111111101001001
01100001010100100
10111101010111010
10100010101010111
111
Assembly Language LOAD BASEPAY Assembler
ADD OVERPAY
STORE GROSSPAY
High level languages grossPay = basePay + Compiler
OverTimePay
 Graphical-based programming language with
scripts
 Only simple knowledge on logic is needed in
programming
 Example:
◦ Visual .NET (C, C++, C#, Basic)
◦ JAVA
◦ WEB Programming
◦ Multimedia programming (FLASH…)
 Need to know Math?
◦ Yes, you only need to know the simple arithmetic
operation. The analytical skill is more important
 The Importance of Design
◦ You need to design a solution for a problem
 Importance of Patience
◦ Programming may be frustrating but very rewarding (in
term of satisfactory and monetary)
 Importance of precision
◦ You need to be able to think logically, precisely and in
rigorous way!
 Framing Problems Correctly
◦ Become a good problem solver, not a problem creator!
 Look at the example code
 After reading it, code it, and run (execute) it,
and then modify it!!
 Write your own code ASAP!!
 Seek out more sources
 Mr A just move to a new house, when his
friend ask him what is his house number, he
just tell his friend the range of housing
number at his residential area is between 3
and 85, and 3 questions below:
◦ Guess if his house number is smaller than 39?
◦ Guess if the number can be perfectly divided by 4?
◦ Guess if the number can be square rooted?
 Find Mr. A’s house.
• Guess if his house number is smaller than 39?
>> lets say 36
• Guess if the number can be perfectly divided by 4?
>> 36/4 =9
• Guess if the number can be square rooted?
>>√3
a) Computers process data under the control of
sequences of instructions called computer ____
b)___ is a type of computer language that uses
English like abbreviations for machine language
instructions.
c) ,The three classes of languages discussed in the
chapter are ________, ________, and ________.
d) The programs that translate high-level language
programs into machine language are called ________.
e) Which logical unit of the computer performs
calculations?
f) The only language a computer can directly
understand is that computer's
 a) program
 b)Higher-level language
 c) machine language - assembly language -
high-level language
 d) compiler
 e) ALU
 F) machine language
 IDE: Code Blocker (Mingw-TDD)
#include <stdio.h>

int main()
{
printf("Hello student!\n");

return 0;
}
Thank You!

Das könnte Ihnen auch gefallen