You are on page 1of 7

Comp definitions

2.1.1-2.1.6

CPU
- Hardware component of the computer
- Can perform basic, arithmetic, logical or input/output operations
- Input – process – output – Storage model
- Retrieves and saves data and information from and too the storage (Primary memory)
- Any data that is to be saved or received from some storage medium must pass through the
primary memory in order to be processed by the CPU.
- Can only receive data from the primary memory or input of the computer system.
contains the:
- CU (control unit):
1. Controls the retrieval of instructions from the primary memory as well as the
sequence of their execution.
2. Responsible for providing the ALU with the data that needs to be processed as well
as the instructions of how the data should be processed.
- MAR (Memory address register):
1. Holds the memory address of the data used to be processed by the ALU, so that the
ALU can fetch the corresponding content from the memory and process it
accordingly.
2. Also may hold the memory address of where data that has been processed will need
to be stored.
3. Connected to the primary memory by the Memory Address Bus.
- MDR (Memory data register):
1. Holds the data that is to be used by the ALU and to be saved by the RAM.
2. Whichever address the MAR is holding, the corresponding data will be loaded onto
the MDR for processing by the ALU.
3. After the processing has finished, the ALU places the result onto the MDR and the
data is copied onto the memory address location in the RAM specified by the MAR.
4. The connection between the RAM and the MDR is accomplished by the Data Bus.
- ALU (Arithmetic logic unit):
1. Performs all the basic logical input/output operations

Registers
- A register is a small storage location that can hold data (64 bits).
Primary memory
- Only storage that is directly accessible by the CPU.
- Consists of RAM, ROM and Cache.
RAM (Random access memory):
- Stores the executing program instructions as well as any data that is needed.
- Instructions and the data in the RAM are stores in unique memory locations and every
location has an address as well as content.
- The content is where the instructions and data reside.
- The memory location is used by the CU to find, retrieve and access the data and send it to the
ALU for processing.
- Data can be overwritten.
- Volatile (Whenever power is lost, the contents of its memory are lost).
- Holds the data that is being used.
- DRAM and SRAM

DRAM SRAM
Slower Faster
Less expensive More expensive
Main RAM Cache

ROM (Read only memory)


- Holds instructions and data in unique memory locations
- Every such location has an address as well as content
- Used to store permanent instructions and data that cannot be changes and are used to boot and
operate the computer.
- Data in the ROM cannot be overwritten.
- Non-volatile.
- Holds the BIOS (basic input/output System)
- Much smaller than RAM

Cache
- Holds the information from the RAM that is most actively used, and accessed most
frequently.
- The computer will run faster as the slower main memory will need to be accessed less
frequently.
- When the processor needs to read from the main memory, it first checks if a copy of the data
exists in the cache. If so, the processor reads from the cache instead of reading from the main
memory. If the data to be read do not exist in the cache, the data are first copied to the cache
and then used.
- When the processor needs to write to the main memory it does so through cache memory.
- Divided into L1 and L2 cache, L1 cache is placed on the microprocessor itself, L2 cache is
placed between the primary memory and the microprocessor.
Secondary memory
- Relatively slow memory that may be written to but is also non-volatile.
- Persistent storage.
- Relatively high capacity to hold data as compared to the primary memory.
- Examples: HDD, SSD, CD, DVD, USB, SD, CF, Zip Disk, Floppy disk, Magnetic tape.
Operating system
- A set of software that controls the computer’s hardware resources and provides service for
computer programs.
- Acts as an intermediary between software applications and the computer hardware.
- Functions

4.1.3 – 4.1.13
Sub procedure
- Contains a series of commands that perform a task.
Identifier
- Name used by a programmer to uniquely identify a variable, an object a sub procedure, etc.
Iteration
- The process of repeating instructions.
- Used to repeat a statement or a block of statements within an algorithm.
Conditional Statement
- Performs different instructions depending on a Boolean test.
Input
- Something that is put into a program
Output
- Something that is produced by a program after a process
Pre-Planning
- The process of planning something in advance
Prefetching
- Getting data or instructions from the memory into the cache before they are actually needed.

Gantt Charts
- Named after Henry Gantt.
- Type of bar chart.
- Widely used for project schedule and project management.
- Shows activities, tasks and events against time.
- Time scale along the top.
- Tasks, events and activities are represented by bars.
- Each bar represents the duration, start day and end day of the task, activity or event.
- Allows easy inspection of activities, overlapping activities and the total duration of the project
etc.
Pre-conditions
- What must be true before the sub procedure is called
Post conditions
- What will be true when the sub-procedure completes its task
- Describes the final state after the execution of an algorithm
Exception
- An act or event that disrupts the flow of the program.
- Take place during the program
- Can be effectively handled by specific mechanisms that most modern programming languages
provide.
- An occasion or a cause that is not compatible with the general rule.
Concurrent
- Something that happens at the same time as something else.

4.2
Variable
- Acts as a storage location that can be used to store a value.
Array
- An array can hold multiple data elements of the same type
- Has a name and a size.
- The length cannot be changed during the program execution
Sequential search
- Linear search
- Does not rely on ordered arrays
- Uses brute force strategy
- Time complexity O(log n)

Binary search
- Used only in sorted arrays
- Relies on divide and conquer strategy
- Time complexity O(n)
- Efficient for few elements
- Efficient if the element to be found is at the beginning of the array or list
- Generally, more comparisons are needed if the element cannot be found at the beginning of
the array or list.
Bubble sort
- Repeatedly steps through the array to be sorted.
- Compares adjacent items and exchanges them if they are not in the correct order (Ascending
or descending)
- Algorithm makes multiple passes until no swaps are necessary (The array is sorted)
- Slow and impractical for most cases

Selection sort
- Slow and inefficient

Collections
- Act as a resizable array
- addItem()
- getNext()
- resetNext()
- hasNext()
- isEmpty()

4.3.1 – 4.3.9
Fundamental operations of a computer
- Add
- Compare
- Retrieve
- Store
Fundamental operator
- Addition, greater than, less than (+<>)
Compound operator
- Max/Min functions
Machine language
- Made up of 0s and 1n (binary).
- Low level language.
- Only language that can be understood by a computer.
- Machine language programs written for a computer of one kind are not suitable for a
computer of another kind.
Mnemonics/Assembly language
- An assembler was used to convert the assembly language mnemonics to machine code.
- Each assembly language was specific to a specific computer system.
- Led to the development of high-level code (Lack of abstraction).
High level programming language
- A programming language that uses elements of natural language.
- Makes program development simpler, faster and more understandable
Compilers
- Translator that executes the translation process only once.
- Translates the whole source program into the object program.
- The object program is saved, no recompilation is necessary.
- Compilers issue an error message for all syntax errors found and all errors are communicated
to the program after the entire program is checked.
- The compilation ends only when all syntax errors have been corrected.
- Compilers are much faster than interpreters.
- Examples: C, C++

Interpreters
- An interpreter is a translator that goes through the process every time s the program is run.
- Process of reading each line, analysing it, translating it into the corresponding line of the
object program and executing the line.
- Syntax errors are communicated to the programmer for every instruction that is interpreted.
- Example: Basic
Virtual machine
- Java combined compilation and interpretation.
- Source code is compiled to java virtual machine bytecode.
- When a java program is compiled from a .java program to a .class file, the class file is java
virtual machine bytecode.
- Java virtual machine bytecode can be interpreted by the java virtual machine interpreter.
- The java architecture allows code to run on any machine to which java virtual machine
interpreter has been installed.
- In java all details of making the code function on a specific hardware platform are handled by
the java virtual machine (JVM).
Variable
- A variable is used to store a data element of a program.
- The stored value can be changed during the program execution.
- Has a name (identifier) and a type.
- The variable name should not clash with reserved keywords and literals of the language.
- A variable in most programming languages can only store a data element of the particular
type.
Constant
- Represent things and quantities that don’t change (non-modifiable variables).
- The data element stored in a constant cannot be modified during the execution of the
program.
Operator
- Used to manipulate operands.
- Operands can be variables, strings, Boolean values, numerical values etc.
- Operators can be arithmetic, logical, relational etc.
Object
- Comprised of data and actions.
- Actions refer to the operations that can be performed by the object (methods).
- Object data may include a number of data members.
- Data members are used to store the current state of an object.
- Methods are used to change or access those data members.

Keywords:
- final: A final value is assigned, the data element cannot be changed.
-

You might also like