Date: Mon, 11 Nov 1996 17:19:26 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Thu, 12 Sep 1996 16:55:29 GMT
Content-length: 3444
CS 110 Section 2 Lecture Notes - Week 1
Lecture Notes - Week 1
- Topic:
- Introduction to computers and programming. How to use Microsoft Windows and Microsoft FORTRAN on the Hewlett-Packard Vectra's
- Text:
- Chp. 1.1 - 1.5
- Notes:
-
Introduction to FORTRAN-77
Brief History
- One of the first high-level programming languages (circa 1957).
- FORula TRANslator. Good for engineering and scientific applications.
- FORTRAN-77 (1977 revision) is the standard and most widespread version. FORTRAN-90 (1990 revision) has additional functionality but is not as widespread.
Why learn FORTRAN instead of C++/Pascal/BASIC/...
- Easier to write complex formulas and equations.
- Still widely used in engineering.
- Lots of existing engineering program libraries are written in FORTRAN.
- Easy to learn, similar to BASIC.
How to use FORTRAN on the PC's
Click here
Compiling Steps
- Source Program (.for) in Fortran sent to compiler
- Compiler translates Fortran into "machine language with a couple of holes left",spits out .obj file
- A program may be broken into lots of segments, so there may be other obj's around. At any rate, .objs must be linked together plus some other things needed to "fill in those holes" (don't worry about what the holes are). .obj files all read in, spits out .exe file (runnable machine language).
Inside the Computer
- Input: Keyboard,Mouse
- Output: Monitor,Printer
- Inside:
- CPU: Central Processing Unit. What does computations.
- Memory: Where the data is (the program itself and its data)
- Removable storage. Can take things off disk onto memory or back. Must put things in memory in order to run it.
Machine Language,Assembly,Fortran
- Dark Ages(1960): Everything stored as 0's (no charge) and 1's (charge).
- Machine code is very hard to read. If you saw code like 1101 0001 0011 0010 1010 1111 1110 ... you'd go nuts.
- Solution: Assembly language. ADD %r1 %r2 %r3. Every machine lang. statement corresponds to one assembly statement, and vice versa.
- Problem. Takes a loooong time to write out. You also have to worry about lots of details. Programmers noticed that many times there were sequences of steps that were repeated quite a lot, such as
LOAD TERM %r1
LOAD TERM2 %r2
ADD %r1 %r2 %r3
STORE %r3 SUM
- Instead, it'd be nice to just say SUM = TERM1 + TERM2. This is a Fortran statement which is translated (compiled) into those assembly instructions you see above.
Copyright © 1996 Modified fromJeff Lampert (tick@cs.wisc.edu). Last modified September 11, 1996