h. m. deitel, p. j. deitel. 2004, java how to program, sixth edition · 2003 prentice hall, inc....
TRANSCRIPT
![Page 1: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/1.jpg)
2003 Prentice Hall, Inc. All rights reserved.
1
1.1 Introduction
• H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition– Java 2 Standard Edition– Object-oriented programming
• Java tutorial: http://download.oracle.com/javase/tutorial/• Arnold, K., Gosling, J., and Holmes, J. 2005. The Java™
Programming Language, 4th Edition. Addison Wesley Professional.
• Zakhour, S., et al. 2005. The Java™ Tutorial Fourth Edition: A Short Course on the Basics. Addison Wesley Professional.
![Page 2: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/2.jpg)
2003 Prentice Hall, Inc. All rights reserved.
2
1.2 What Is a Computer?
• Komputer:– Peranti/peralatan yang mampu melaksanakan perhitungan
(komputasi) dan membuat keputusan logika
• Program Komputer (Computer Program):– Sekumpulan instruksi yang mengontrol pemrosesan data yang
dilakukan komputer.
• Hardware:– Sekumpulan peralatan yang membentuk komputer.– Misal: keyboard, mouse, CPU, monitor, CD-ROM, Hard Disk,
Floppy Disk, DVD-ROM, RAM, printer, scanner dsb.
• Software:– Program yang berjalan di atas komputer.
![Page 3: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/3.jpg)
2003 Prentice Hall, Inc. All rights reserved.
3
1.3 Computer Organization (1)
• Secara logis komputer dibagi menjadi 6 bagian:1. Input Unit
– Bagian Penerimaan – Receiving Section– Mendapatkan informasi dari peranti masukan seperti:
keyboard, mouse, microphone, scanner, networks, …
![Page 4: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/4.jpg)
2003 Prentice Hall, Inc. All rights reserved.
4
1.3 Computer Organization (2)
2. Output Unit– Bagian Pengiriman – Shipping Section– Mengambil informasi yang diproses komputer– Menempatkan informasi pada peranti-peranti
keluaran (output devices), seperti: monitor, printer, dsb
![Page 5: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/5.jpg)
2003 Prentice Hall, Inc. All rights reserved.
5
1.3 Computer Organization (3)
3. Memory Unit – Akses yang cepat (rapid access) –
Warehouse Section yang memiliki kapasitas relatif rendah
– Menyimpan informasi dari input unit –secara langsung tersedia bagi proses yang ada
– Menyimpan informasi yang telah diproses – sampai selesai ditempatkan pada output unit
– Berupa memory (RAM), primary memory (cache memory pada processor)
![Page 6: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/6.jpg)
2003 Prentice Hall, Inc. All rights reserved.
6
1.3 Computer Organization (4)
4. Arithmetic and Logic Unit (ALU)– Bagian Fabrikasi – Manufacturing Section – Melaksanakan proses perhitungan aritmatika dan
keputusan logika
5. Central Processing Unit (CPU)– Bagian Administratif / Administrative Section– Mengawasi dan mengkoordinasi bagian-bagian lain di
dalam komputer
![Page 7: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/7.jpg)
2003 Prentice Hall, Inc. All rights reserved.
7
1.3 Computer Organization (5)
6. Secondary Storage Unit– “Warehouse Section” yang memiliki kapasitas besar,
waktu yang lama.– Sebagai penyimpan – program atau data yang sedang
tidak aktif– Peranti penyimpan sekunder – Disks (hard disk, floppy
disk, compact disc dsb– Lebih lama waktu aksesnya dan lebih mahal harganya
daripada primary memory
![Page 8: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/8.jpg)
2003 Prentice Hall, Inc. All rights reserved.
8
1.4 Evolution of Operating Systems
• Batch processing– One job (task) at a time– Operating systems developed
• Programs to make computers more convenient to use• Switch jobs easier
• Multiprogramming– “Simultaneous” jobs– Timesharing operating systems
![Page 9: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/9.jpg)
2003 Prentice Hall, Inc. All rights reserved.
91.5 Personal, Distributed and Client/Server Computing
• Personal computing– Computers for personal use
• Distributed computing– Computing performed among several computers
• Client/server computing– Servers offer common store of programs and data– Clients access programs and data from server
![Page 10: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/10.jpg)
2003 Prentice Hall, Inc. All rights reserved.
101.6 Machine Languages, Assembly Languages and High-Level Languages
• Machine language– “Natural language” of computer component– Machine dependent
• Assembly language– English-like abbreviations represent computer operations– Translator programs convert to machine language
• High-level language– Allows for writing more “English-like” instructions
• Contains commonly used mathematical operations– Compiler convert to machine language
• Interpreter– Execute high-level language programs without compilation
![Page 11: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/11.jpg)
2003 Prentice Hall, Inc. All rights reserved.
11
Bahasa Mesin (Machine Language)
• Bahasa asli komputer – “Native Computer Language”.
• Ditentukan oleh perancangan hardware dan tergantung pada jenis mesinnya – “machine-dependent”.
• Umumnya terdiri dari deretan angka-angka –hampir keseluruhan adalah 0 dan 1 saja.
• Menginstruksikan kepada komputer untuk melaksanakan proses-proses dasar - sekali dalam satu waktu.
• Sulit bagi manusia
![Page 12: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/12.jpg)
2003 Prentice Hall, Inc. All rights reserved.
12
Bahasa Rakitan (Assembly Language)
• Menggunakan singkatan-singkatan dalam bahasa Inggris untuk menggambarkan operasi-operasi komputer dasar
• Lebih jelas bagi manusia• Assembly Language memerlukan beberapa perintah
untuk 1 tugas sederhana• Tidak dimengerti komputer -> perlu translator
(assembler) -> mengkonversi ke bahasa mesin• Misal:
– MOV DX, 100;
![Page 13: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/13.jpg)
2003 Prentice Hall, Inc. All rights reserved.
13
Bahasa Tingkat Tinggi (High-Level Language)
• Menggunakan istilah-istilah dalam bahasa Inggris dan notasi matematis umum
• Satu pernyataan menyelesaikan tugas-tugas substantial• Program translator (compiler) mengkonversi ke
bahasa mesin• Program interpreter mengeksekusi perintah satu
persatu dalam bahasa tingkat tinggi secara langsung
![Page 14: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/14.jpg)
2003 Prentice Hall, Inc. All rights reserved.
14
1.13 Basics of a Typical Java Environment
• Java programs normally undergo five phases– Edit
• Programmer writes program (and stores program on disk)– Compile
• Compiler creates bytecodes from program– Load
• Class loader stores bytecodes in memory– Verify
• Verifier ensures bytecodes do not violate security requirements– Execute
• Interpreter translates bytecodes into machine language
![Page 15: H. M. Deitel, P. J. Deitel. 2004, Java How to Program, Sixth Edition · 2003 Prentice Hall, Inc. All rights reserved. 7 1.3 Computer Organization (5) 6. Secondary Storage Unit –](https://reader031.vdocuments.us/reader031/viewer/2022022807/5cfb99fc88c99359778bb90b/html5/thumbnails/15.jpg)
2003 Prentice Hall, Inc. All rights reserved.
15
Fig. 1.1 Typical Java environment.
PrimaryMemory
.
.
.
.
.
.
Disk
Disk
Disk
Editor
Compiler
Class Loader
Program is created in an editor and stored on disk in a file ending with .java.
Compiler creates bytecodes and stores them on disk in a file ending with .class.
Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory.
Phase 1
Phase 2
Phase 3
PrimaryMemory
.
.
.
.
.
.
Bytecode Verifier Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions.
Phase 4
PrimaryMemory
.
.
.
.
.
.
InterpreterInterpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes.
Phase 5