Week 1 Flashcards
When was the invention of the Diffrence Engine
1822
How many stages have the computer languages of the last fifty years come to
Two: The first major language and the second major languages
What is a programming language
A programming language is an artificial
language designed to express computations or
algorithms that can be performed by a
computer
What is a program
A program is computer coding of
an algorithm that
– Takes input
– Performs some calculations on
the input
– Generates output
factorial program in C
int fact(int n) {
int sofar = 1;
while (n>0) sofar *= n–;
return sofar;
}
Master the von Neumann Architecture
Key Features of von Neumann Architecture
- Data and programs stored in memory
– Instructions and data are piped from memory to CPU
– Fetch-execute-cycle for each machine instruction
Describe the fetch-execute cycle
initialize the program counter (PC)
repeat forever
fetch the instruction pointed by PC
increment the counter
decode the instruction
execute the instruction
end repeat
Mention some programmnig languages that mimic von neumann architecture
C, C++ Java
How do these programming languages micmic the von neumman architecture
– Variables → memory cells
– Assignment statements → data piping between
memory and CPU
– Operations and expressions → CPU executions
– Explicit control of execution flows → prog. counter
The architecture is limited by?
Allow efficient mapping between language and
hardware for good execution performance, but
limited by von Neumann bottleneck
How old is LISP
LISP is the second oldest general programming language
that is still in use since 1958
Give a summary of imperative langauge
– Variables, assignment statements, and iteration
– Include languages that support object-oriented
programming, scripting languages, visual languages
– Ex.: C, Java, Perl, JavaScript, Visual BASIC .NE
Give a summary of functional language
– Computing by applying functions to given parameters
– Ex.: LISP, Scheme, ML
Give a sumary of logic language
– Rule-based (rules are specified in no particular order)
– Ex.: Prolog