Chapter 1

hardware

physical pieces of computer

CPU

central processing unit

executes individual commands of a program

main memory

storage that holds software while it’s processed by CPU

secondary memory

store software in more permanent manner

floppy disks, hard drives, tapes, CDs

I/O devices

keyboard, mouse, monitor

allow us to interact with computer

software

consists of programs, series of instructions that hardware executes one line at a time

intangible

core software of computer is OS – provides user interface and manages computer resources

applications are other software, such as Microsoft Word

use GUIs, with elements like windows, pull-down menus, icons, buttons

they are point-and-click interfaces

analog vs. digital

analog is continuous, in direct proportion to source

digital breaks information down into discrete pieces and represents those pieces as numbers

take a number of measurements per second, called a sampling rate

computers are digital

discrete signal, either hi or low at any one time (binary values of 1 or 0)

single binary digit = 1 bit

n bits represents 2 to the nth values

computer architecture

information travels across wires called a bus

controllers coordinate activities of peripherals

data transfer devices allow information to go between computers (i.e. modems)

I/O devices

bar code readers, light pens, microphones, VR devices, scanners

plotters, speakers, goggles

main memory

made up of small memory locations, each with a unique address

data stored overwrites any data previously there

reading data doesn’t affect it

each location can usually hold 8 bits = 1 byte – can  use multiple locations if necessary

volatile

secondary memory

nonvolatile

hard disk is most common – magnetic medium where bits are represented by magnetized particles

read/write head passes over spinning disk

direct access device

magnetic tape is sequential access device

CD-ROM – pits and burned in to disk to represent bit 1, smooth for bit 0

shining laser beam on disk reads it

RAM vs. ROM

random access memory = main memory

read only memory – usually embedded in main circuit board for initializing instructions of computer

CPU

control unit coordinates processing steps

registers provide storage

arithmetic/logic unit performs calculations

instruction register holds current instruction being executed

program counter holds address of next instruction to be executed

use fetch-decode-execute cycle

CPU is on microprocessor chip

system clock nearby on circuit board, generates electronic pulses regularly, called clock speed

example:

600 MHz Pentium III processor (600 million pulses per second clock speed)

256 MB RAM (approx. 256 million bytes of main memory)

16 GB hard disk (approx. 16 billion bytes of secondary storage)

24x speed CD ROM drive (data transfer rate)

17” video display with 1280x1024 resolution (17” diagonal display area, with a grid of 1280x1024 pixels)

56 KB modem (transfers data at 56,000 bits per second)

networks

2 or more computers together

point-to-point connection physically connects them

each computer has unique network address

send messages in packets to avoid delay

LAN

spans short distances and small number of computers

WAN

connects 2 or more LANs

led to Internet

Internet

protocol – set of rules for computers

TCP/IP (Transmission Control Protocol / Internet Protocol)

each computer has IP address and a name

local name of computer, then domain name

name is translated to its IP address using Domain Name System (DNS)

World Wide Web used most on internet

uses hypertext and hypermedia, in a browser

browsers use Hypertext Markup Language (HTML)

Java and HTML are linked because Java programs can be embedded in HTML documents and executed through Web browsers

find information on web using URL (Uniform Resource Locator) – contains protocol, internet address, then file name of interest (http://www.breakaway.com/vision.html)

the Web is not a network – it can be used without a network

problem solving

understand problem

dissect problem into pieces

design solution

consider alternatives and refine solution

implement solution

text and fix solution

write programs in a particular programming language

Java

developed by James gosling at Sun Microsystems in 1995

programs can be executed using WWW

object-oriented language, like C++

comes with libraries and other software we can use

sample program – p. 26 listing 1.1

comments
class definition
main
println and system.out object
identifiers
reserved words
case sensitive

programming languages

machine language

used in CPU

assembly language

replaced binary digits with mnemonics

high-level languages

we use these – must be translated into machine language
use editor, compiler, interpreter
compiler translates source code into target language
interpreter interweaves translating and executing instructions

fourth-generation languages

Java

compiler translates Java source code into Java bytecode
interpreter reads bytecode and executes it on a specific machine
bytecode is not tied to any particular processor type – it’s architecture neutral
there must be a Java interpreter or bytecode compiler on any processor you want to execute Java bytecode on
Java compiler and interpreter are part of SDK
has syntax rules that must be followed for it to compile with no errors
can get compiler errors, run-time errors and logical errors
finding and fixing  errors is called debugging

graphics

pictures drawn in pixels (picture elements)

black and white picture represents each pixel as one bit, 1 for black, 0 for white

coordinate system starts in top left corner at (0,0) – moving right and down makes x and y get larger

colors represented as RGB values between 0 and 255 (each color represented with 1 byte)