Computer Organization: Hardware

This diagram shows the organization of the hardware in a computer.
                       _______________
                       |  _________  |
                       |  |  CPU  |  |
                       |  ----|----  |
                       |      |      |           
                       |      |b     |          
                       |      |u     |         
                       |      |s     |           
                       |  ____|____  |        
Secondary Storage  ----|--|   MM  |--|---- Output Devices
Communications     ----|--|rom____|  |
                       |------|------|      
                              |
                              |
                        Input Devices

Software

Software is the part of the computer you can't touch; it's the ideas of programmers codified into machine language, represented by electrical impulses, that tell the computer what to do (via the CPU). (There are other parts of the computer you shouldn't touch, like the power supply and the inside of the monitor, but software is something you can't touch because, in a sense, software doesn't really exist in the real world.) Programming, the topic of this course, is the process of writing programs (software).

There are two kinds of software: application and system software. Application software does what people use the computer for, e.g., word processors, spreadsheet programs, video games, etc. System software exists for the sake of the computer, from the operating system that organizes and allocates resources to a program to list the files in your account.

The operating system is a big piece of system software that is loaded into main memory when the computer first comes up, and stays there until you turn off the computer. It manages the activities of the computer, allocating and controlling access to resources (such as memory, CPU time, storage, the printer, etc.) On runner, the operating system is a version of Unix System V called Solaris. Other operating systems are BSD Unix, Linux, MacOS, VMS, and Windows NT.

Computer Languages

In the beginning, programmers simply programmed in machine language. This can be quite tedious, so computer scientists invented computer languages that could be used instead of machine language. A program would be written in this high-level language, then automatically translated to machine language by another program.

The first computer languages were simply human-readable forms of machine language called assembly languages. For instance, if the machine language instruction for "add two numbers" was 100101010, the assembly language version might be "ADD". A program called an assembler (hence the name "assembly language") would translate the program into machine language. Assembly language is still used today for specialized applications.

Higher level languages were developed that used mathematical and human language notation in place of machine instructions. Two of the first were FORTRAN, for scientific programming, and LISP, for list processing (used mostly for artificial intelligence). A FORTRAN program looks like this:
	program	number
		integer	i

		do 10 i=1,10
			print*, i
 10 		continue
		stop
	end
This simple program prints the numbers from 1 through 10.

A text file containing a program written in assembly or a high level language is called a source file. It can be translated by a compiler into a machine language file, called an object file, that must then be linked with some other object files, and can then be executed. On runner, the compiler and linker are accessed through the cc command; cc stands for "C Compiler."