Skip to document
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

OCR A-Level Computer Science Spec Notes 1.2 Summarized

1.2 A Level CS Notes OCR
Subject

Computer Science

264 Documents
Students shared 264 documents in this course
Academic year: 2023/2024
Uploaded by:
0followers
4Uploads
4upvotes

Comments

Please sign in or register to post comments.

Preview text

OCR A-Level Computer Science Spec Notes

1 Software and software development

1.2 Systems Software

(a) Function and purpose of operating systems Operating System: Low-level software which controls a computer’s basic functions such as: - Controls communication to/from devices using protocols - Manage Software: Loading/Uploading software to memory - Provide Security: Username/Password control - Handles code translations of: compilers/interpreters/assemblers to translate HLL/LLL into machine code. - Provide a user interface (UI) / HCI : So user can interact with the computer e Command Line Interface (CMD/CLI) - Utility software used to carry out maintenance tasks to maintain hardware - Uses job scheduling to provide fair access to processor according to set rules. (b) Memory management (paging, segmentation, virtual memory) - Memory is limited so it needs to be managed. - This is achieved by providing each process with a segment of the total memory - This is so there is no corruption of data during memory transfer - Ensures programs can’t access each other’s memory unless legitimately required to. - Provides security to OS - Allows programs larger than main memory to run - Allows separate processes to run while managing memory Paging Segmentation Virtual Memory

  • Splits memory into fixed-size chunks made to fit the memory
  • Splits memory into variable sized logical divisions which can hold whole programs
  • When memory inefficient = allocated secondary storage memory used to allow programs to run
  • Are assigned to memory when needed to allow programs to run despite insufficient memory.
  • Uses backing store as additional memory for temporary storage
  • Are stored on a backing store disk to swap parts of programs used for virtual memory.
  • Swap pages to/from RAM (paging)
  • Allow programs to be stored in memory non- contiguously.
  • Hold part of program not currently in use
  • May cause disk threshing when more time spent swapping pages from memory to disk than processing so computer may ‘hang’.

(c) Interrupts (function of ISRs) Interrupt: A signal from a device alerting the CPU for its immediate attention - Obtain processor time via generating a signal/message to processor stating they need to be serviced immediately - Breaks current execution which is occuring in the processor - Interrupts have different priorities - Start when current FDE cycle is complete to ensure max efficiency of processor - Can only interrupt a low-priority task to avoid delays/loss of data Interrupt Service Routine (ISR) - Check IR to compare interrupt priority compared to task - If lower/equal priority = current task continues - If higher priority = CPU completes FDE cycle - Contents of registers stored in LIFO stack - Location of ISR is loaded by loading the relevant value into the PC - When ISR is complete ● Flags sent to inactive state ● Further interrupts checked & serviced if necessary ● Contents of stack popped and loaded back onto registers to resume processing (d) Scheduling Scheduler: Manages the amount of time allocated to different processes in the CPU. It has several purposes: - Maximise # of jobs completed in set time - Maximise # of users receiving fast response times with minimal delay - Ensure all jobs are processed fairly so long jobs don’t monopolise the processor - Obtain the most efficient use of processor time and utilise resources dependent upon priorities - Prevent process starvation from applications in deadlock failing to run Scheduling Algorithms Scheduling Algorithm Process of Scheduling Advantages Disadvantages Round Robin

  • All jobs given equal amount of processor time. If not completed = sent to back of queue and

  • Simple to implement as jobs are relatively the same size

  • The importance of the process is not taken into account

  • Some jobs require multiple processing tuns making round robin inefficient for longer jobs

  • Real-time: The data is processed immediately and a response is given within a guaranteed time frame (Planes)

  • Batch: The task of doing the same job over and over again (With different inputs/outputs) (f) BIOS Basic Input/Output system (BIOS) allows the computer to be ‘booted up’ when switched on

  • When switched on, PC points processor to BIOS memory to start up

  • Check to see if computer is functional/memory installed/processor functional

  • Stored in flash memory for modification (g) Device drivers

  • Normally provided with a peripheral device which contains instructions to enable the peripheral and OS to communicate and configure hardware.

  • Enables multiple versions of OS to communicate with devices (h) Virtual machines

  • Theoretical/Generalised computer where a translator is available when programs are run

  • Can run OS on a software implementation

  • Uses an interpreter to run intermediate code (Slower than compiler) Intermediate Code

  • Partially translated/simplified code (high/machine code)

  • Can be produced by compiler (if error free)

  • Protects source code from being copied to keep intellectual property

  • Platform independent = improving portability

  • The program runs more slowly than executable code as it needs to be translated each time it is run by additional software.

1.2 Applications Generation

(a) Nature of applications Software: Set of programs/instructions/code that runs on computers which makes hardware work. (Applications/Utilities software) Applications Software: - Allows user/hardware to carry out tasks - E Word processor/spreadsheet packages/photo-editing suites/web browsers (b) Utilities Utilities Software: - Small piece of systems software with one purpose usually linked with maintenance - E Anti-Virus/Disk defragmentation/File managers

(c) Open source vs closed source Open Source Closed Source - Free for others to examine/recompile - Sold as license to use the software - Users can create amended versions of program (Access to source code) - Company/Developer holds copyright so users don’t have access to source code - No helpline since no commercial organisation - Helpline/support available from company + regular updates + large user base - E Linux/Firefox/Libre Office - E MAC OS,iWork,Safari (d) Translators: Interpreters, compilers, assemblers Translators: Converts code from one language to another (Between HLL,LLL,source code,object,intermediate, executable,machine code). There are 3 types of translators: - Interpreters ● Interprets & runs HLL code by converting it to machine code & runs it before reading next line ● Reports one error at a time (stops to show location of error) ● Must be present each time the program is run so program runs slower due to translation ● Source code (visible & changeable) - Compilers ● Converts HHL source code to machine code ● Translates whole program as a unit + creates executable program when completed ● Gives list of errors at end of compilation ● Not readable by humans to protect intellectual property ● Machine dependent & architecture specific (Different code needed) ● Compiler is no longer needed when executable code is used ● Produces intermediate code for virtual machines - Assemblers ● Uses low-level source code to translate assembly -> machine code ● Reserves storage for instructions & data ● One assembly language instruction is converted into one machine code instruction ● Many lines needed for the simplest of tasks (e) Stages of compilation Compilation has several stages: - Lexical Analysis ● Comments/Whitespace removed from program ● Remaining code turns into a series of tokens (sequences of characters)

● Hardware requirements ● Software requirements Testing This process makes sure the project runs smoothly. There are 4 types of testing:

  • Black-Box Testing: Tests the functionality of the program without looking into the internal structures/working. Only input/output

  • White-Box Testing: Tests the structure & workings of the application as opposed to its functionality

  • Alpha Testing: Where testers in the organisation test & identify all possible bugs/issues before the product is released

  • Beta Testing: Test the program in a ‘real environment’ with limited end-users so they provide feedback on the functionality of the program. Docume ntation written through out the process

  • Requirements specification: Details exactly what the system will do

  • Design: Includes algorithms/screen layouts/data storage descriptions

  • Technical Documentation: Details how the system works for future maintenance E Descriptions of code/modules & functionality

  • User Documentation: Tell sythe user exactly how to operate the system E Tutorials/Error messages descriptions/troubleshooting guide The waterfall lifecycle

  • Series of linear stages presented in order (Can only go to next stage after previous is done)

  • Possible to back if necessary

  • List of stages: Feasibility Study, Investigation/Requirements Elicitation, Analysis, Design, Implementation/Coding, Testing, Installation, Documentation, Evaluation, Maintenance Agile development methodologies

  • A group of methodologies to cope with changing requirements

  • Software produced in a iterative manner (Build on previous versions) Extreme Programming (XP)

  • Example of a Agile Development Methodology (Iterative in nature)

  • Customer is part of the team to help decide ‘users stories’ (Requirements/Tested)

  • Each iteration creates a version of the program with code good enough to be the final product

  • Pair programming: One writes/one analyse = switch over The spiral model

  • Designed to manage risk. 4 stages: ● Determine Objectives: Determine objectives according to biggest risks ● Identify/Resolve Risks: Risks identified & alternate solutions considered. Project stopped = Risk too high ● Development & Testing: This is where the program is developed/tested ● Plan next iteration: Determines what happens at next iteration Rapid Application Development (RAD)

  • Involves use of prototypes

  • Prototype shown to user & feedback given to amend prototype until user is happy

  • Constantly developed & reviewed by user until user = satisfied (b) Merits and drawback of different methodologies Waterfall Lifecycle Advantages Disadvantages

  • Suited to large scale static projects - If changes occur, hard to do = loss in time/money

  • Focuses on early stage development - Inflexible/limiting to change requirements

  • Focuses on end user (Can be involved in different parts of project)

  • Dependent on ‘clear requirements’ so there is little ‘splash-back’

  • Progress of development easily measurable

  • Produces excessive documentation = time consuming

  • Generally more progress forward than backward

  • Missing system components tend to be found during design/development

  • Orderly sequence guarantees quality written documents

  • Performance can’t be tested until fully completed Agile development methodologies (Extreme Programming) Advantages Disadvantages

  • New requirements adapted throughout - Client has to be part of team which might be inconvenient for them

  • Lack of documents due to emphasis on coding = not suitable for larger projects

  • End-User is integral throughput

  • Pair programming allows code to be efficient/robust/well written

  • Code is created quickly and modules available for user as they are done The spiral model Advantages Disadvantages

  • Large amount of risk analysis significantly reduces risk as risks are fixed in early development stages

  • High skilled team needed for risk analysis

  • Breaks down the solution into subroutine blocks which are rebuilt and combined to form the program

  • Tasks completed in a specific way

  • Logic of program = series of procedure calls

  • E VB/Python/C (c) Assembly language (LMC) Assembly code:

  • Machine oriented language

  • Closely related to computer architecture

  • Uses mnemonics for instructions

  • Translated by a assembler

  • Easier to write than machine code, but more difficult than HLL.

  • Descriptive names for data stores

  • Each instruction is translated into 1 machine code instruction. LMC: fictional processor designed to illustrate the principles of how processors and assembly code work. LMC instruction set: Mnemonic Function Example Instruction Explanation ADD Add ADD n Add the contents of n to the ACC SUB Subtract SUB n Subtract the contents of n from the ACC STA Store STA n Store the number n LDA Load LDA n Load the contents of n into the ACC BRA Branch always BRA number Unconditional jump to number label BRZ Branch if zero BRZ number Jump to number label if ACC contents is zero BRP Branch if positive BRP number Jump to number label if ACC contents is positive INP Input INP Prompt for a number to be input OUT Output OUT Outputs the contents of the ACC

HLT End Program HLT Stops program execution DAT Data Location n DAT 10 Creates data location n and stores the number 10 in it (d) Modes of memory addressing Different ways of accessing memory in low level languages:

  • Direct addressing ● Simplest & most common type of addressing ● Address in the memory where the value actually is that should be used ● “Instruction ADD 10 means go find data value in data location ‘10’ and add that value to the accumulator’ ● Used in assembly language
  • Indirect addressing ● The operand is the address of the data to be used by the operator ● Useful for larger memories ● E. in ADD 23, if address 23 stores 45, address 45 holds the number to be used.
  • Indexed addressing ● Modifies the address given by adding the number from the Index Register to the address in the instruction. ● Allows efficient access to a range of memory locations by incrementing the value in the IR e. used to access an array ● E Adding data value 5 to data location 20, 6 is at 21 etc ● Final address = base address + index
  • Immediate addressing ● Used in assembly language ● Memory remains as constant as it doesn't change (address field = constant) ● Data in the operand is the value to be used by the operator e. ADD 45 adds the data value stored in data location ‘45’ to the value in the ACC. (e) Object-oriented languages (OOP)
  • Programming paradigm which enables programs to solve problems by implementing components such as objects to work together to create a solution
  • Most programs have OOP in them (Java/C++/C#)
  • Components of OOP include: ● Classes: Template used to define an object. Specifies what methods/attributes the object should have.
Was this document helpful?
This is a Premium Document. Some documents on Studocu are Premium. Upgrade to Premium to unlock it.

OCR A-Level Computer Science Spec Notes 1.2 Summarized

Subject: Computer Science

264 Documents
Students shared 264 documents in this course
DegreeGrade:

Sixth Form (A Levels)

A2 - A Level
Was this document helpful?

This is a preview

Do you want full access? Go Premium and unlock all 12 pages
  • Access to all documents

  • Get Unlimited Downloads

  • Improve your grades

Upload

Share your documents to unlock

Already Premium?
OCR A-Level Computer Science Spec Notes
1.2 Software and software development
1.2.1 Systems Software
(a) Function and purpose of operating systems
Operating System: Low-level software which controls a computer’s basic functions such as:
- Controls communication to/from devices using protocols
-Manage Software: Loading/Uploading software to memory
- Provide Security: Username/Password control
- Handles code translations of: compilers/interpreters/assemblers to translate HLL/LLL
into machine code.
- Provide a user interface (UI) / HCI : So user can interact with the computer e.g Command
Line Interface (CMD/CLI)
-Utility software used to carry out maintenance tasks to maintain hardware
- Uses job scheduling to provide fair access to processor according to set rules.
(b) Memory management (paging, segmentation, virtual memory)
- Memory is limited so it needs to be managed.
- This is achieved by providing each process with a segment of the total memory
- This is so there is no corruption of data during memory transfer
- Ensures programs can’t access each other’s memory unless legitimately required to.
- Provides security to OS
- Allows programs larger than main memory to run
- Allows separate processes to run while managing memory
Paging Segmentation Virtual Memory
- Splits memory into
fixed-size chunks
made to fit the memory
- Splits memory into
variable sized logical
divisions which can
hold whole programs
- When memory
inefficient = allocated
secondary storage
memory used to allow
programs to run
- Are assigned to memory when needed to allow
programs to run despite insufficient memory.
- Uses backing store as
additional memory for
temporary storage
- Are stored on a backing store disk to swap parts of
programs used for virtual memory.
- Swap pages to/from
RAM (paging)
- Allow programs to be stored in memory non-
contiguously.
- Hold part of program
not currently in use
- May cause disk threshing when more time spent swapping pages from memory to disk
than processing so computer may ‘hang’.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.

Why is this page out of focus?

This is a Premium document. Become Premium to read the whole document.