Chapter 1 Flashcards
What is a program?
A list of unambiguous instructions meant to be followed mechanically by a computer.
One of the components of a computer is its CPU. What is a CPU and what role does it play in a computer?
A CPU does the actual computing, and its job is to execute programs.
Explain what is meant by an “asynchronous event.” Give some examples.
Events that are not “synchronous”, such as a fetch and execute process being interrupted.
What is the difference between a “compiler” and an “interpreter”?
Compiler translates language instructions into executable machine language programs. Interpreters translates instruction by instruction as necessary, as a program.
Explain the difference between high-level languages and machine language.
High level languages cannot be run on any computer, and must be translated to machine language with a compiler. Machine language can be run on the individual machine its compiled for.
If you have the source code for a Java program, and you want to run that program, you will need both a compiler and an interpreter. What does the Java compiler do, and what does the Java interpreter do?
The java compiler creates bytecode, the java interpreter compiles bytecode into native machine language just in time.
What is a subroutine?
Consists of instructions for performing some task, grouped as a unit, and given a name.
Java is an object-oriented programming language. What is an object?
An object is a module containing data and subroutines
What is a variable? (There are four different ideas associated with variables in Java. Try to mention all four aspects in your answer. Hint: One of the aspects is the variable’s name.)
A variable is a memory location that has been given a name and can be referred to in a program. It generally has a type that indicates what type of data it can hold.
Java is a “platform-independent language.” What does this mean?
Language can be written once, and then compiled & interpreted on a system by system basis.
What is “machine language”?
Instructions that are written in a language understood by a computer, and can only be executed if expressed in that language.
Main Memory
Programs are stored in Main Memory, also called RAM (or Random Access Memory)
Locations
Numbered locations that identify an area in memory.
Address
A numbered sequence of a location, allowing a computer to pick out a piece of information from the millions in memory.
Fetching
A process of reading an instruction from memory
Executing
A process of carrying out an instruction.
Fetch & Execute Cycle
A process of reading an instruction, carrying it out, and then fetching the next instruction.
Arithmetic Logic Unit (ALU)
The part of the processor which carries out operations such as addition or subtraction
Registers
Small memory units capable of holding a single number. CPUs generally have 16 or 32 general purpose registers.
Program Counter
A special purpose register to keep track of the program that is executing
Transistors
Tiny switches that a PC is comprised of, that can be turned on and off as part of a program execution
Bit
Identified as a “zero” or “one” in a binary digit
Byte
A sequence of 8 bits
Hard Disk or Solid State Drive
Used for storing programs and data files in a permanent fashion. Hard drives use spinning magnetic disks, while solid state drives are purely electronic with no moving parts.
Keyboard & Mouse
Devices for user input
Monitor & Printer
Devices for computer output
Audio Output Device
Allows the computer to play sounds
Network Interface
Allows the computer to communicate with other connected computers on a network, via wires or wirelessly
Scanner
Converts images into coded binary numbers that can be stored and manipulated