OOP with Java, David J. Barnes Bits, Bytes, and Java1 The Challenge Writing programs well is a challenge. –From coder to software engineer. We want programs.

Slides:



Advertisements
Similar presentations
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Advertisements

Chapter 1 An Overview of Computers and Programming Languages.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
 The central processing unit (CPU) interprets and executes instructions.  The “brains” of the computer.  The speed of the processor is how fast it.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Chapter 1 Introduction to Object-Oriented Programming.
1 Fall 2008ACS-1903 Chapter 1 Topics Java History Java Programs Why Program? Computer Systems: Hardware and Software Programming Languages What Is a Program.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Lecture 1: Intro to Computers Yoni Fridman 6/28/01 6/28/01.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Ceng 230 Programming with C
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
COMP Computer Basics Yi Hong May 13, 2015.
CS102 Introduction to Computer Programming
 2003 Prentice Hall, Inc. All rights reserved. Chapter 1 – Introduction to Computers, the Internet, and the Web Outline 1.1 Introduction 1.2 What Is a.
COMPUTER TECHNOLOGY What is a Computer?
About the Presentations The presentations cover the objectives found in the opening of each chapter All chapter objectives are listed in the beginning.
Chapter 1 An Overview of Computers and Programming Languages.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CSCI 125 & 161 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk.
Topics Introduction Hardware and Software How Computers Store Data
High-level Languages.
111 © 2002, Cisco Systems, Inc. All rights reserved.
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Introduction Lecture 01.
Introduction to Computer Systems and the Java Programming Language.
What is computer hardware? Computer hardware are the physical components of the computer.
Lecture 3 January 14, 2002 CSC Programming I Fall 2001.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
IT Groundwork ICS3UC - Unit 1 Hardware. Overview of Computer System.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
School of Computer Science & Information Technology G6DICP Introduction to Computer Programming Milena Radenkovic.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
1.4 Representation of data in computer systems Instructions.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Chapter 1 Getting Acquainted With Computers, Programs, and C++
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Chapter 1 An Overview of Computers and Programming Languages.
The Big Picture. My Story  Wrote great programs  Didn’t understand how they worked.
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
CHAPTER 1 COMPUTER SCIENCE II. HISTORY OF COMPUTERS (1.1) Eniac- one of the worlds first computers Used more electricity than an entire city block of.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Operating Systems A Biswas, Dept. of Information Technology.
Introduction To Computer Programming – 1A Computer Parts, Words, and Definition Herriman High School.
Software Engineering Algorithms, Compilers, & Lifecycle.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Java Programming: From the Ground Up
Computer Science II Chapter 1.
Engineering Problem Solving With C An Object Based Approach
Chapter 1 – Introduction to Computers, the Internet, and the Web
Topics Introduction Hardware and Software How Computers Store Data
hardware bits and bytes Java
Lecture 1: Introduction to JAVA
Introduction
Chapter 1: An Overview of Computers and Programming Languages
About the Presentations
Chapter 1: An Overview of Computers and Programming Languages
Computer Electronic device Accepts data - input
Topics Introduction Hardware and Software How Computers Store Data
Presentation transcript:

OOP with Java, David J. Barnes Bits, Bytes, and Java1 The Challenge Writing programs well is a challenge. –From coder to software engineer. We want programs to solve ever more complex problems. Java TM helps to bridge the gap between a problem and its solution.

OOP with Java, David J. Barnes Bits, Bytes, and Java2 A Simple Model of a Computer Hardware –Central Processing Unit (CPU). –Random Access Memory (RAM). –Disk drives, keyboard, mouse, printer, etc. Look-and-Feel Software –Window manager. –Operating system.

OOP with Java, David J. Barnes Bits, Bytes, and Java3 Bits Bit - A Binary Digit –Has a value of either 0 or 1. –A variety of hardware representations. Voltage, light level, magnetic field, etc. –The fundamental building block for modeling data.

OOP with Java, David J. Barnes Bits, Bytes, and Java4 Using Bits to Model Real-Life Objects Bits allow us to model real-world states. –2 bits model four door states. –3 bits model eight colors. Redundant values represent impossible states. Objects (models) should not enter impossible or inconsistent states.

OOP with Java, David J. Barnes Bits, Bytes, and Java5 Bytes 8 bits is known as a byte. One byte can represent 256 different patterns. Hardware and software often deal with bytes rather than single bits. –64 Megabytes of memory. –8 Gigabytes of disk. –4 byte data type.

OOP with Java, David J. Barnes Bits, Bytes, and Java6 Common Powers of = = = = 1, 024 (Kilo) 2 16 = 65,536 (2 bytes) 2 20 = 1, 048,576 (Mega) 2 30 = 1,073,741,824 (Giga) 2 40 = 1,099,511,627,776 (Tera)

OOP with Java, David J. Barnes Bits, Bytes, and Java7 The Central Processing Unit The computational heart of a computer. A CPU obeys its own instruction set. Individual instructions are usually simple. Programs often only run on a CPU with a particular instruction set. –Such programs are not portable.

OOP with Java, David J. Barnes Bits, Bytes, and Java8 The Fetch-Execute Cycle Endlessly repeated by the CPU. –Fetch the next instruction. –Execute the instruction just fetch. The instructions are fetched from the computer’s fast-access memory. The program counter identifies the next instruction. –It is incremented between each step.

OOP with Java, David J. Barnes Bits, Bytes, and Java9 Skipping and Repeating Instructions The fetch-execute cycle will perform an infinite linear sequence of instructions. –We often want to repeat some instructions. –We often want to skip some instructions. Branching is achieved by modifying the program counter’s contents. –This alters which instruction is fetched next.

OOP with Java, David J. Barnes Bits, Bytes, and Java10 High Level Programming Languages CPU instruction sets are low-level programming languages. High level programming languages represent attempts to make writing programs easier. –Ada TM Algol, BASIC, C, C++, COBOL, FORTRAN, Java, Pascal, etc.

OOP with Java, David J. Barnes Bits, Bytes, and Java11 Java’s Ancestry Oak: a reimplementation of C++ in the early 1990s by James Gosling. –Intended for intelligent consumer devices. Oak became Java in –Portability and Security of primary concern. –Eminently suitable for Web applets. –Also a powerful language in its own right.

OOP with Java, David J. Barnes Bits, Bytes, and Java12 Program Translation High-level languages provide data types and control structures. A high-level language program must be translated into low-level instructions. –Compilation. –Increases a program’s portability. –Translated versions may differ in subtle ways on different machines.

OOP with Java, David J. Barnes Bits, Bytes, and Java13 Java's Approach to Portability Its implementation on different machines is rigidly defined. It is defined to be run on a virtual machine. –The JVM is an imaginary CPU with bytecode instructions. Java programs are translated to bytecodes by the Java compiler. Converted programs are interpreted.

OOP with Java, David J. Barnes Bits, Bytes, and Java14 Review A single bit has a value of either 0 or 1. A byte is 8 bits. A CPU repeats the fetch-execute cycle. Each CPU has its own instruction set. High-level languages must be translated. Java programs are translated into bytecodes for a Java Virtual Machine.