To handle Computer
Science, a base amount of knowledge of how computers work is very
helpful.
In the pantheon of programming languages there are languages that give
you full control of a computer, where you talk to a computer on terms
it understands natively and where very little error-checking will occur
for you. These languages are harder to write in, harder to
understand (by humans), prone to far more bugs (and bugs of greater
severity), but can in theory generate programs that are more
efficient. The primary example of this is assembly
language. While this may not be a language in the literal
sense in that it actually completely varies depending on what
kind of computer is used... for instance assembly language for an Intel
or AMD based computer (Pentium 4 or Athlon) is completely different and
also completely incompatible with assembly language for a Power PC
based computer (ie: a Macintosh G4 or G5). This is what is known
as a
low level language.
On the other end of the extreme is a category of
high level languages. High
level languages are designed to be much nicer for programmers.
They are generally designed to be closer to natural English (and
programming languages are generally amazingly English-centric), which
in turn makes them much easier to understand, and will in general
protect you from making big mistakes. By doing so, the programs
run a little bit more slowly (due to this extra error checking), but
are generally easier to write, read and maintain. Java is
arguably in the category of a high level language. High level
languages aren't necessarily slow, but they are slower as a rule.
Other examples of high level languages are Basic, and Visual
Basic. C and C++ fit somewhere between these two extremes.
In most languages a
compiler
program is used to translate the
source
code (file or files containing the instructions written in the
programming language that compromise a program) into
machine code (a file containing
instructions written in the CPU's native instruction form that can be
directly executed by the CPU). In the case of other languages
another program known as an
interpreter
is used which translates the source code into machine code as
the program executes. As a rule, compiled code will run quicker,
but an interpreter takes less time to translate, and allows one to
simply copy the source code to another machine in order to run that
program. (as opposed to copying the code and re-compiling
assuming that an interpreter exists for the new computer)
Designers of computers are not very creative. Virtually all of a
computer's architecture is based at least loosely on our understanding
of how our brain works. At the center of a computer is a
CPU which stands for a
Central Processing Unit. The
CPU is analogous to our brains. (more or less) The
computer's CPU is responsible for pulling in data and instructions from
other devices, looking at the instruction and executing them.
Instructions are very simple operations such as "add 1 to this number",
"see if this is bigger than this", and "move to instruction
100." The CPU gets its instructions and data from the
system memory, which is called the
RAM
(
Random Access Memory).
The ram is equivalent to short term memory in the human brain. It
keeps track of information and programs that are currently open.
RAM is quite fast, but also relatively expensive compared to a hard
disk drive. In addition, if power is lost all the data currently
in the CPU and RAM is lost. Thus RAM is considered
volatile memory. Hard disk
drives on the other hand is considered
permanent
memory. When you turn off the computer (hopefully) the
data is not lost. (CD-ROMs, backup tapes also qualify)
Permanent memory is analogous to long term memory in your
brain.
ROM stands
for
Read Only Memory and
refers to any data storage device that a computer uses that can not be
written to. (eg: a CD-ROM disc) While in the case of hard
drives, RAM, and CD-ROMs (which are all examples of
random access storage devices) it is
the case where it takes about the same amount of time to access the
1000th piece of data stored on the device as the 1st, it is not the
case with
sequential access storage
devices. Tape drives, much like VHS tapes are best
designed to display one file, and then the one that exists right after
it. If you want to randomly seek to any file on the tape, you may
have to spend considerable time seeking to that position, thus it is
not good at random accesses. (but if you view the files in
sequence, it works quite well)
In addition to memory, computers need to be able to be
told what to do and give back feedback just as the brain does (most of
the time). Computers take in new information through
input devices, the simplest possible
examples of this are keyboards and mice. Computers talk back to
the user through
output devices
such as the monitor. These are analogous to the 5 senses for
input, and
talking for output.
Computers deal with data in base-2, better known as
binary, where all data is a sequence
of bits that can either be 0 or 1. (hence, base 2)
In computer terminology you will often
encounter the prefixes of kilo, mega, giga and tera. Kilo will mean a thousand (1000) of
something, such as a kilobyte means a thousand bytes. Mega will mean a million (1,000,000)
of something, such as a megabyte means a million bytes. Giga will mean a billion
(1,000,000,000) of something, such as a gigabyte means a billion
bytes. Tera will mean a
trillion (1,000,000,000,000) of something, such as a terabyte means a
trillion bytes. Note: A megabyte is 1000 times a kilobyte, and a
terabyte is 1000 times a gigabyte and so forth.
While many have a claim as to the first inventor of the computer, one
of the most important figures in early Computer Scientist was a man
named Alan Turing. The
award named after him is considered one of the most if not the most
prestigious award in the field of Computer Science. In the late
'30s while a graduate student in Britain, he came up with many of the
theories and fundamentals of Computer Science by working them out on
paper. In the early 40s he was hired by the British government in
order to crack the German "Enigma" machine, a device the Germans used
to scramble communications. He did well, and by the end of the
war, his team had developed one of the first working electronic
computers (if not the first), the COLOSSUS.
The computer was huge (on the order of tons), and could not multiply,
and would take between 1/2 and 2 seconds to perform each calculation,
but it turned out to be fairly flexible and programmable. By the
start of the 50s, IBM was producing computers, which were the size of
huge rooms, and initially required one to manually rewire the computer
in order to reprogram it. In 1957 IBM came up with a method for
writing software that did not require one to program the computer in
the computer's native instructions, it came up with a programming
language called Fortran (Formula
Translation) Fortran was designed for scientists to represent
sequences of computer instructions by algebraic formulas. This
made it so many more people could write software, and allowed one to
write a program once and have the fortan compiler on each possible
computer handle the translation. By the early 1960s a slew of
other programming languages were developed, including Basic, Pascal,
Algol, COBOL, and LISP. In the early 1970s a decedent of Algol
was adapted to become C. In the early 1980s, C was modified to
add in the ability to organize programs in an "object oriented" manner,
was was re dubbed C++. In the mid '90s, a development group
within Sun developed a language based largely on C++ (but simplified)
that allowed one to write a program that compiled to a quasi-machine
code that could then be interpreted on any computer with such an
interpreter, and positioned it for the purpose of developing programs
that would run on web pages within web browsing software. This
language was dubbed Java.
In the early 1970s a small company called Intel designed a small
integrated circuit that could function as a very simple computer, and
dubbed it a Microprocessor.
A microprocessor is a chip that contains a a computer, most commonly it
is referred to or known as a CPU today. (this explanation is
actually very poor, but for the purposes of this class it will
suffice.. you'll learn better when you take real computer architecture
classes) This first CPU was very weak by today's standards, but
it provided an important blueprint. Within a few years Intel and
others were building tiny chips powerful enough to serve as the brains
of the first main generation of personal
computers, computers that were small enough and affordable
enough for "anyone" to own and operate. Apple and IBM were the
main companies who pushed the idea in the mainstream, Apple first with
their Apple computers, and later their Macintosh line, and IBM with
their PC line. No longer were the only computers in the world
expensive, and huge mainframe
computers. (a central computer which many people could connect
to through keyboard/screen devices in order to run programs)