Intro to Computers & Java Flashcards
Computer program
A sequence of instructions that is executed by a computer to perform a task or solve a problem.
Programming
The act of designing and implementing computer programs.
Algorithm
An unambiguous, executable set of instructions to perform a task or solve a problem.
Machine code
The only instructions that can be processed by a CPU; a stream of binary numbers (1s and 0s). Note, each type of CPU has its own machine language.
Hardware
The physical equipment of a computer.
5 major hardware components of a computer system
- Central Processing Unit (CPU)
- Main memory
- Secondary memory
- Input devices
- Output devices
Central processing unit (CPU)
The heart of the computer that executes the machine instructions.
It is comprised of a Control Unit and the Arithmetic and Logic Unit (ALU). The Control Unit coordinates all of the computer’s operations. It is responsible for determining where to get the next instruction and regulating the other major components of the computer with control signals. The ALU performs mathematic operations. To run a program it follows a fetch/ decode/ execute cycle.
The fetch/ decode/ execute cycle
The process of a CPU running a program.
- Fetch - the Control Unit fetches the next instruction from main memory
- Decode - the instruction is encoded in the form of a number so the Control Unit decides the instruction and generates an electronic signal
- Execute - the signal is routed to the appropriate component of the computer such as the ALU, a disk drive or other device. The signal causes that component to perform an operation.
Main memory / primary storage
Commonly known as random access memory, or RAM, this is a device that holds information. Specifically, RAM holds the sequences of instructions in the programs that are running and the data those programs are using. RAM is usually a volatile type of memory, used only for temporary storage. When the computer is turned off, the contents of RAM are erased.
Memory address
RAM is divided into sections, known as bytes. Each byte is comprised of 8 switches, or bits. Each byte is given an unique number known as an address and all addresses are ordered from lowest to highest like PO Boxes.
Secondary storage
Storage that can hold data for long periods of time and persists without electricity, e.g., a disk drive.
Disk drive
The most common type of secondary storage. A device that stores data by magnetically encoding it onto a spinning circular disk.
Software
The programs that run on a computer. There are two general categories:
- Operating systems - a set of programs that manages the computer’s hardware devices and controls their processes
- Application software - programs that make the computer useful to the user such as word processing
High-level programming languages
A programming language that provides an abstract view of a computer and allows programmers to focus on their problem domain by specifying the overall actions that the program should carry out without having to specify CPU instructions.
Common elements of programming languages
- Key words - reserved words that have a special meaning in a programming language and therefore cannot be used as an identifier by the programmer
- Operators - symbols that denote mathematical or logical operations such as + or &&
- Punctuation
- Identifiers - programmer defined names used to identify storage locations in memory and parts of the program that are created by the developer
- Syntax - rules that define how to form instructions in a paritcular programming language