Please enable JavaScript.
Coggle requires JavaScript to display documents.
A-Level Computer Science - Paper 1 Revision (Programming Languages (Object…
A-Level Computer Science - Paper 1 Revision
Operating Systems
Device Drivers
Computer program providing a software interface for a certain piece of hardware
Allows OS to access hardware functions
Drivers are hardware dependant and OS specific
Driver normally communicates with the system bus or communications subsystem to the connected hardware device.
Driver issues commands to the device
Examples
Printer software
Graphics card software
Peripheral software - keyboard, mouse, graphics tablet...
Utility Software
System software design to optimise the performance of the computer or perform specific tasks.
Example utility tasks
Disk Defragmentation
Virus checker
Firewall
Automatic file backup
Automatic updating
Compression software
Memory Management
The allocation and management of memory is done by the OS
The PC needs to allocate memory for things such as all of the programs, files, and items in the clip board that are currently being used.
Paging
Memory divided into fixed sized pages
Processes already in memory may be held in several non-contiguous pages
Page table maps and links the the physical memory address space and logical address space of each process.
Segmentation
Logical division of address space into varying segment length (depending on program structure.
Like with paging, it is possible to load only a part of a program into memory initially
Virtual Memory
Used as an extension of memory when space in RAM is running low
Uses an area of a hard drive disk
Pages are swapped from main memory (RAM) to virtual memory when not needed - they are moved back into main memory when they need to be used again
Disk trashing occurs if the computer moves pages back and forth too often
Benefits
Keeps track of each memory location
Checks how much memory has been allocated to each process
Decides which processes need what memory and when
Helps track when memory is free / unallocated
Programming Languages
IDE (Integrated Development Environment)
Provides tools such as:
Compile
Testing tools
Breakpoint
- cause program to stop at a specific line, can see whether it reaches that line.
Watch
- set on a variable so value is displayed each time it changes
Step through
- goes through line by line so you can see what happens
Debug tools
Enter and edit tools
Procedural Programming
Written in step by step instructions on how to solve a problem
Uses data structures and variables
Pros
Simple to implement compilers or interpreters
Portable source code
Easy to understand
Cons
Hard to write (as code if often not reusable)
Not as efficient as OOP (as code may need to be written over and over again)
Difficult to relate to real world objects (because it is not built up of objects)
Object Oriented Programming
Uses a number of different interacting objects, with each object responsible for its own data and operations performed on that data
Attributes
(methods) - data stored in the class
State
- what each attribute in a class is doing
Behaviour
- actions which are performed by an object
Class
- Template for an object, defines the attributes and behaviours of the object
Pros
Extremely modular
Mimics the real world, thus easier to understand
Easy to manage
Reusable in other programs
Cons
Slower as it needs to use more memory
Longer to create code
Inheritance
- Subclasses can inherit data and behaviours from a Superclass
Encapsulation
- Encapsulates both the state, behaviour and attributes. Stops the data and attributes of one object from affecting another object
Polymorphism
- the programming languages ability to process objects different depending on their class
High Level languages
- Programming languages which a closer to a language which human can easily read and understand. Would need to be converted into machine code in order for a computer to understand the instructions
Little Man Computer
A type of assembly language. An assembler will translate the assembly code into machine code for the computer to understand
Libraries
Pre-compiled programs grouped into software libraries.
Can be loaded and run when they are required
Pros
Tested and error free
Time saving. Programmer does not have to write new code for something that already exists
Cons
Takes up a large amount of memory needs to be used to hold the library when the program is run, even if parts of the library are not used by the program
Linkers
The linker puts the correct machine addresses in the call and return instructions so that all modules and parts of a program are linked properly together
Loaders
Loads the object code anywhere into memory (if the code is in a relocatable format and there are no absolute addresses used)
Boolean Algebra
Two's Compliment
- allows for numbers as big as 128 or higher to be represented. The furthers bit shows whether the number is positive or negative
Sign and magnitude
- Most significant bit used to show positive and negative. 0 - positive, 1 - negative
Hexadecimal
- base 16.
Normalisation
- process of moving a binary point of a floating point number to provide the maximum level of precision for a given number of bits
Underflow
- when the number is to small to be represented with the allocated number of bits
Overflow
- when the number is larger than the amount of allocated bits
Databases
One-to-one
One-to-many
Many-to-many
Many-to-many cant exist as it makes it difficult to reference specific entities. Must be changes into two one-to-many relationships with a third table called a
join table
.
Keys
Composite Key
A primary key which consists of more than one attribute is a composite key. (E.g, the two foreign keys used in a table would be the composite primary key)
Foreign Key
An attribute which creates a join between two different tables - it is an attribute which is common in both tables
Secondary key
Acts as a index to make it easier to find data in a database (by using fields which are likely to be searched on.) (Like a surname)
Primary key
An unique identifier of an entity (like an ID number)
Hashing
Hashing algorithm applied to the value in the key field of each record to transform it into an address
Hash table
A collection of items stored in a way so that they can be quickly located
Searching for an item steps
Apply hashing algorithm to key field of the item
examine resulting cell
if item is there, return item
if cell is empty, item is not in table
if there is another item in the cell, move forward until correct item is found or when a blank cell is found, making it apparent that item is not in the table
Referential Integrity
ensuring that when tables are linked together in a relation database, that all the references and components are refenced across the tables to ensure that there are no errors and that data hasn't been deleted
Networks
Circuit switching
Creates a direct link between two devices for communication. Chanel kept up permanently while communication takes place. Reserved for whole transmission, no one else can use it
Don't have to wait for packets
Whole message sent at once - could compromise security
Electrical interference could corrupt data
Packet Switching
Data split into equal sized packets including the following information
Address
of sender packet
Destination
of the packet
Reassembling
information
Check sum
for error detection
Packets try to find the best path to the destination
Doesn't use one communication route, uses multiple routes so network is being efficiently used
Delays can occur if lots of packets are being sent
Switch
Manages the communication between lots of different computers, at the same time. Allows them to communicate with the server
Peer-to-peer
Doesn't have a server
All computers have equal status on the network
Computers are connected to each other
Pros
Cost effective (cheap) and easy to set up
Resources can be shared between users (such as with printer
Not difficult to maintain
Cons
Security has to be set up individually on each device, cannot be centrally done
Work has to be backed up individually on each computer
Client-server
One computer acts as the server where all of the other clients connect to
Clients can hold their own data, but can also access data and reasources centrally from the server
Pros
Better security as all files are stored centrally where the access rights can be managed by the server
Backups are done centrally where recovery procedures can be put in place centrally from the server if there was a breakdown or data loss
Data and reasources can be shared to clients
Cons
Expensive to install and manage
Trained staff are needed in order to maintain and run the network