29

Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Embed Size (px)

Citation preview

Page 1: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code
Page 2: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code
Page 3: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Parts of a Computer

Page 4: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Why Use Binary Numbers?

Page 5: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Source Code - Assembly - Machine Code

Page 6: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Why Java?

Safety

The safety features of the Java language make it possible to run Java programs in a browser without fear that they might attack your computer. As an added benefit, these features also help you to learn the language faster. When you make an error that results in unsafe behavior, you receive an accurate error report.

Portability

The other benefit of Java is portability. The same Java program will run, without change, on Windows, UNIX, Linux, or Macintosh. In order to achieve portability, the Java compiler does not translate Java programs directly into CPU instructions. Instead, compiled Java programs contain instructions for the Java virtual machine, a program that simulates a real CPU. Portability is another benefit for the beginning student. You do not have to learn how to write programs for different platforms.

Page 7: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Java Versions

Page 8: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

every Java program has a class

the program must have a main method

A Java Program

Page 9: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

A Java Program

programming languages use reserve words that have special meaning and cannot be used for other purposes

the programmer names the program and decides what it should do

this line tells the computer where to display the message later, we will learn some other options for displaying messages

Page 10: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Another Java Program

line numbers are used in book to help with descriptions of programsbook uses a different style to define program blocks

Page 11: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Another Java Program

Page 12: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Computers can "Do the Math"

Page 13: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Steps in the Development of a Java Program

Page 14: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

JVM1

JVM2

JVM3

JVMn

:

One Bytecode, Many JVM's

Java Source CodeText Editor

FileAccess

Program I/O - Compiler Messages

jGraspIntegrated Development Environment (IDE)

There is a different configuration of the Java Virtual Machine (JVM)for every platform (type of computer) and Operating System (OS)

this computer

that computer

mobile device

the other computer

Page 15: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Installing NetBeans

The NetBeans Integrated Development Environment (IDE) is available at the NetBeans Web site: https://netbeans.org/downloads/7.1/

If the Java Development Kit (JDK) is not already installed on your computer, you will need to download and install it as well. The JDK is available on the Oracle Web site:

The Standard Edition (SE) is preferred for both NetBeans and the JDK.

http://www.oracle.com/technetwork/java/javase/downloads/

Page 16: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

https://netbeans.org/downloads/7.1/

Page 17: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

http://www.oracle.com/technetwork/java/javase/downloads/

Page 18: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

don't forget to acceptthe license agreement

For Windows OS...

32-bit computers use x86 version

64-bit computers use x64 version

Page 19: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

NetBeans IDE 7.4

Page 20: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

New Project

Page 21: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Project Name

Page 22: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Writing the Source Code

Page 23: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Installing jGrasp

http://www.jgrasp.org/

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Page 24: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Starting jGrasp

Page 25: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Quick StartOpen - Compile - Run

Page 26: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

A New Editor Window in jGrasp

Page 27: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Creating and Saving a Java Program

Page 28: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

The Encode / Debug Cycle

Page 29: Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code

Summary

A Textbook for Two Courses

Parts of a Computer

Why Computers use binary numbers.

Source Code, Assembly, and Machine Code

Structure of a Java Program

Java Program Development

Bytecode and the JVM

Installing and Using jGrasp

Encoding and Debugging