Computer Programming Intro
Computer Programming Intro
Colossus Machine
Used in World War II
first programmable, electronic digital computers.
Designed to break and read encrypted German messages.
FORTRAN
first high level computer programming language
Invented by John Backus of IBM in 1954.
It was released commercially in 1957.
SPACEWAR! 1961.
The first computer game by Steve Russel
Took roughly 200 man-hours to complete.
At Stanford University, Russell introduced Nolan
Bushnell to Spacewar!
Bushnell went to program the first coin-operated arcade game and later started Atari
Computers
Hardware
Input:
Keyboard, Mouse
System unit:
Random Access Memory (RAM)
Central Processing Unit (CPU)
Output:
Monitor, Printer
Secondary Storage:
Disk Drive
Software
Instructions for the hardware.
Actions to be performed
A set of instructions is called a program.
Driving force behind the computer
Without a program – What is a computer?
Collection of Useless Hardware
2 purposes:
Tell the computer what to do
Tell other people what we want the computer to do.
CPU
The central processing unit (CPU)
The “brain” of a computer
Retrieves instructions from memory and executes them.
Memory (RAM)
Stores data and program instructions for CPU to execute
A program and its data must be brought to memory before they can be executed
Stores intermediate and final results of processing.
Volatile: Contents are erased when computer is turned off or reset.
A memory unit is an ordered sequence of bytes, each holds eight bits.
Storage Devices
Hard Drives, CDs/DVDs, Flash Drives, etc.
Non-Volatile or Permanent Storage
Programs and data are permanently stored on storage devices and are moved to memory
when the computer actually uses them.
Computer Language
Digital devices have two stable states, which
are referred to as zero and one by convention
Binary Language: Data and instructions (numbers, characters, strings, etc.) are encoded as
binary numbers
- a series of bits (one or more bytes made up of zeros and ones)
Encoding and decoding of data into binary is performed automatically by the system based on
the encoding scheme
Encoding schemes
Numeric Data: Encoded as binary numbers
Non-Numeric Data: Encoded as binary numbers using representative code
ASCII – 1 byte per character
Unicode – 2 bytes per character
Programming Languages
Computers cannot use human languages
most programs are written using a programming language and are converted to the binary
language
Three major categories of prog languages:
Machine Language
Natural language of a particular computer
Primitive instructions built into every computer
The instructions are in the form of binary code
Any other types of languages must be translated down to this level
Assembly Language
English-like Abbreviations used for operations (Load R1, R8)
Assembly languages were developed to make programming easier
The computer cannot understand assembly language - a program called assembler is used to
convert assembly language programs into machine code