Test 1 Flashcards
(45 cards)
What is the CPU?
Central Processing unit, or the “Brain” of the computer. Controls all other computer functions. Also known as the microprocessor or simply processor.
What is the BUS?
Computer Components are connected by a bus, or a group of parallel wires that carry signals and data between components.
What is main memory?
Main memory is made up of capacitors. If a capacitor is charged it’s state is 1 or ON, or set. If not its state is 0 or OFF or reset or cleared.
How is memory divided?
Divided into cells where each cell contains 8 bits (a 1 or 0) called a byte. Each cell is uniquely numbered, with a number called its address.
What kind of storage is Main Memory?
Volatile, meaning if power is lost the information in main memory is lost.
How do other components access information in Main Memory?
Other components can get the information at a particular address in MM, known as READ. This does not alter the contents. Other components can also store information at a particular address known as WRITE, which alters the contents of MM.
What kind of access is MM, what does this mean?
Random access or direct access means any memory address can be reached in the same amount of time because we can go directly to the address we want without starting from 0 and reading everything until we get to where we want (sequential address).
What are some kinds of Secondary Storage Media?
Disks (floppy, hard, removable) Tapes CDs DVDs This kind of storage is called persistent (permanent) because it is nonvolatile.
What are some I/O Devices?
Also known as peripheral devices.
Keyboard, mouse, monitor, disk drive, CD or DVD drive, printer, scanner.
What are the kinds of languages?
Machine languages: machine dependent, a set of binary strings, each of them is a sequence of ‘0’ and ‘1’, of fixed length.
Assembly languages: English-like abbreviations to represent operations of computer.
Example: ADD A Reg1
High-level language (HLL): Assembly languages are still too troublesome even for simple operations like C=A+B. An HLL has structures well recognized by humans.
What are some high level languages?
Fortran: IBM during 50’s. Scientific/engineering computation.
COBOL (Common Business Oriented Language), Late 50’s. Database
C, 70’s at Bell Lab. System language. Many modern OSs are written using C.
C++, 80’s
Java: Early 90’s SUN Microsystems. Written using C++.
What is the process of running a normal HLL?
HLL is turned into Assembly Language by the compiler, then the assembler turns it into machine code, then the loader loads it onto your computer to run.
How does Java run programs?
Compiler turns program into byte code, which is then loaded into and executed by the Java virtual machine which is then run on the real machine.
What does readability mean?
How easy is it to read and understand programs written in the programming language?
Arguably the most important criterion!
Factors effecting readability include:
Simplicity: too many features is bad
Orthogonality: small set of primitive constructs combinable in a small number of ways to build the language’s control and data structures
Makes the language easy to learn and read
Meaning is context independent
Control statements
Data type and structures
Syntax considerations
What does writability mean?
How easy is it to write programs in the language?
Factors effecting writability:
Simplicity and orthogonality
Support for abstraction
Expressivity
Fit for the domain and problem
What are the factors in reliability?
Factors:
Type checking
Exception handling
Aliasing
Readability and writability
What are the categories of cost?
Categories:
Programmer training
Software creation
Compilation
Execution
Compiler cost
Poor reliability
Maintenance
What other concepts are important in determining the usefulness of a PL?
Portability
Generality
Well-definedness
Good fit for hardware (e.g., cell) or environment (e.g., Web)
etc…
What are von Neumann Machines?
John von Neuman is generally considered to be the inventor of the “stored program” machines, the class to which most of today’s computers belong
One CPU + one memory system that contains both program and data
Focus on moving data and program instructions between registers in CPU to memory locations
Fundamentally sequential
What is the von Neumann Diagram?
Memory ^ ^ | | v v Control --> Arithmetic Output (Accumulator)
Processor
What were some PL Methodologies through the decades?
50s and early 60s: Simple applications; worry about machine efficiency
Late 60s: People efficiency became important; readability, better control structures. maintainability
Late 70s: Data abstraction
Middle 80s: Object-oriented programming
90s: distributed programs, Internet
00s: Web, user interfaces, graphics, mobile, services
10s: parallel computing, cloud computing?, pervasive computing?, semantic computing?, virtual machines?
What are the big 4 PL Paradigms? What are some others?
The big four PL paradigms: Imperative or procedural (e.g., Fortran, C) Object-oriented (e.g. Smalltalk, Java) Functional (e.g., Lisp, ML) Rule based (e.g. Prolog, Jess)
Others: Scripting (e.g., Python, Perl, PHP, Ruby) Constraint (e.g., Eclipse) Concurrent (Occam) …
What are some language design tradeoffs?
Reliability versus cost of execution
Ada, unlike C, checks all array indices to ensure proper range but has very expensive compilation
Writability versus readability
(2 = 0 +.= T o.| T) / T < iN
APL one-liner producing prime numbers from 1 to N, obscure to all but the author
Flexibility versus safety
C, unlike Java, allows one to do arithmetic on pointers, see worse is better
What are some implementation methods?
Direct execution by hardware
e.g., native machine language
Compilation to another language
e.g., C compiled to Intel Pentium 4 native machine language
Interpretation: direct execution by software
e.g., csh, Lisp, Python, JavaScript
Hybrid: compilation then interpretation
Compilation to another language (aka bytecode), then interpreted by a ‘virtual machine’, e.g., Java, Perl
Just-in-time compilation
Dynamically compile some bytecode to native code (e.g., V8 JavaScript engine)