KS41CP2 3.2 to 3.3 28 min read 10 question quiz 13 exam marks

Software and Programming Languages

System software against application software, the four jobs of an operating system, utilities, and how high and low level languages are translated into something a processor can run.

System and application software

System software manages the computer itself and includes the operating system and utility programs. Application software lets a user carry out a particular task: a browser, a word processor, a game.

The test is purpose. Application software serves the user's job. System software serves the machine, so that application software can run at all.

What an operating system does

Processor management. Decides which process gets the processor and for how long, switching between them fast enough that they appear to run at once.

Memory management. Allocates memory to each running program and keeps them out of one another's memory, moving less used pages to virtual memory on the drive when physical memory runs out.

Peripheral and device management. Communicates with input and output devices through device drivers, so an application can say "print this" without knowing anything about the specific printer.

User management and security. Handles accounts, logins and permissions, so different users have different files and different rights on one machine.

It also provides the user interface, graphical or command line, through which everything else is reached.

Do not stop at the word 'manages'

Say what is managed and what would go wrong without it. "Memory management stops one program writing into another program's memory, which would crash it" is the complete answer.

Hardware, operating system, utilities, applicationsThe layers of a computer system, from the metal upwards. At the bottom is the hardware: the processor, the memory, the disks, the screen. On top of it sits the operating system, which manages all of that on everyone's behalf, handling memory allocation, the file system, processes and scheduling, device drivers and user accounts. Beside it sits utility software, the housekeeping programs that keep the system in order: backup, defragmentation, compression and antivirus. On top sit the applications, the browser, the word processor, the game, which is what the person actually wanted to use. The rule that makes this worth drawing is that each layer talks only to the layer below it, shown by the arrows pointing down. A worked example on the right follows one save: the word processor asks the operating system, the operating system asks the device driver, and the driver talks to whichever disk is fitted, a hard disk or an SSD. The application never addresses the disk directly and never needs to know which kind it is. That is exactly why the same program can run on two machines with completely different hardware inside them.Applicationsbrowser · word processor · game Operating systemmemoryfilesprocessesdriversUtilitiesHardwarethe parts you could drop on your footCPURAMdiskasksaskseach layer only talks to the one below itSaving a fileWord processorSave as essay.docxOperating systemfinds space, tracks the fileDevice driverspeaks this disk's languageCTRLhard diskSSDthe app never knows which12345
  1. The hardware at the bottom: the parts you could drop on your foot.
  2. The operating system sits on it and manages all of it for you.
  3. Utility software does the housekeeping jobs around the system.
  4. Your applications sit on top and never touch the hardware directly.
  5. That is why a program written once runs on very different machines.
An application that wants a file asks the operating system. It has no idea whether the file is on a hard disk or an SSD, and it does not need to.
What the operating system does, between the applications and the hardwareThe operating system sits between the applications above it and the hardware below it, with an arrow from the applications down into the operating system and another from the operating system down to the hardware. Six jobs surround it. Memory management decides which program gets which part of RAM. Processor scheduling shares the CPU between the running programs. File management looks after folders, names and where data is stored. Device drivers let programs use printers, screens and disks. Security handles log-ins, accounts and who can open what. The user interface provides windows, icons and menus, or typed commands.Memorydecides which programgets which part of RAMCPUProcessor timeshares the CPU betweenthe running programsFilesfolders, names andwhere data is storedDevicesdrivers let programs useprinters, screens, disksSecuritylog-ins, accounts andwho can open whatUser interfacewindows, icons, menusor typed commandsApplicationsHardwareOperatingsystem123
  1. The operating system sits between the applications and the hardware, so a program never has to deal with the hardware directly.
  2. It shares out the computer's resources: memory, processor time and storage.
  3. It also talks to devices through drivers, keeps the system secure and provides the user interface.
Most exam answers on the operating system are a list of these jobs with one sentence on what each one does.

Utility software

Utility software performs maintenance and housekeeping. It is system software, but it is not part of the operating system's core job.

UtilityPurpose
BackupCopies files to a separate location so they can be restored after loss, failure or ransomware
Anti-malwareScans for and removes malicious software before it runs
EncryptionScrambles data so it is unreadable without the key
CompressionReduces file sizes to save storage and transmission time
DefragmentationRearranges the parts of files on a mechanical drive so each file is stored together
Disk clean upRemoves temporary and unnecessary files to reclaim space
Defragmentation is for mechanical drives only

A solid state drive reaches every location in the same time, so gathering files together gains nothing, and the very large number of writes involved shortens the drive's life.

Six utility programs: antivirus, firewall, defragmentation, compression, backup and encryptionSix kinds of utility software, each drawn as a small scene. Antivirus software is a shield that stops a bug, finding and removing malware. A firewall is a wall with a gap, seen from above: unwanted traffic is blocked by the wall while allowed traffic passes through the gate. Defragmentation takes a disk where each file is in separate pieces with gaps between them and gathers every file's pieces together, leaving the free space at the end. Compression turns a 10 megabyte folder into a 4 megabyte one. Backup copies your files to a second place, shown as the cloud, so that a copy is safe if the original is lost. Encryption scrambles plain text, here Hello, into cipher text, here x9#Q!, so that only someone with the key can read it.Antivirusfinds and removes malware1Firewallblocks unwanted traffic2blockedallowedDefragmentationjoins each file's pieces up3beforeafterCompressionmakes files smaller410 MB4 MBBackupkeeps a second copy safe5your filesa copyEncryptionscrambles data; a key unlocks it6Hellox9#Q!plain textcipher text
  1. Antivirus finds and removes malware.
  2. A firewall blocks unwanted traffic and lets allowed traffic through.
  3. Defragmentation puts each file's pieces next to each other, which speeds up a hard disk.
  4. Compression makes files smaller so they use less storage and send faster.
  5. Backup keeps a second copy of your files in case the originals are lost.
  6. Encryption scrambles data so that only someone with the key can read it.
System software has two parts: the operating system, and utilities that look after and protect the computer.

Programming languages and translators

High and low level

A high level language such as Python is written close to human language. One statement usually becomes many machine instructions, which is why it is quick to write and easy to read, and why it runs on any machine that has a translator for it.

A low level language is close to the hardware. Machine code is the binary the processor executes. Assembly language replaces those binary opcodes with mnemonics such as ADD and LDA, roughly one mnemonic per machine instruction.

High levelLow level
ReadabilityClose to EnglishDifficult
PortabilityRuns anywhere with a translatorWritten for one processor
Speed of developmentFastSlow
Control of hardwareIndirectComplete
Memory managementHandled for youThe programmer's job

Low level languages are still used for device drivers, for embedded systems with very little memory, and for small routines where the last few per cent of speed genuinely matters.

Translators

A processor executes machine code and nothing else, so anything else must be translated.

An assembler translates assembly language into machine code, roughly one instruction at a time.

A compiler translates a whole high level program into machine code before it is run, producing an executable file.

  • The finished program runs quickly, because translation has already happened.
  • It can be distributed without the source code.
  • No translator is needed on the machine that runs it.
  • All errors are reported together at the end of compilation.
  • The executable only runs on the platform it was compiled for.

An interpreter translates and executes one statement at a time, every time the program is run.

  • Errors are reported as soon as the offending line is reached, which makes debugging far quicker.
  • The same source runs anywhere the right interpreter exists.
  • Execution is slower, because translation happens on every run and every time round a loop.
  • The source code must be given to whoever runs it.
Development against execution

Interpreters win while you are writing the program. Compilers win once it is finished. Answers that keep those two situations apart get full marks.

High-level, assembly and machine codeThree levels of programming language drawn as a ladder. At the top is high-level language, such as Python, Java or C sharp: it is English-like, one line becomes many machine instructions and it runs on any machine. Below it is assembly language, with short codes such as LDA, ADD and STA: one line is one instruction and it is tied to one type of processor. At the bottom is machine code, binary such as 1011 0001, the only thing a processor can run, and very hard for people to read. A green arrow up the left side points towards easier to write, and a coral arrow down points towards closer to the hardware. The panel on the right shows the same sum, total equals a plus b: one line of Python, three lines of assembly, load a, add b, store total, and three binary machine instructions. A translator turns the top form into the bottom one.High-levelPython, Java, C#English-like.One line, many instructions.Runs on any machine.Assembly languageLDA 7, ADD 3, STA 9Short codes, one perinstruction: one line,one instruction. One CPU.Machine code10110001 00000111Binary: the only thinga processor can run.Hard for people to read.easierto writecloser tohardwareThe same sumtotal = a + b1 line of PythonLDA aADD bSTA total3 lines of assembly1010 0001 0000 01010001 1000 0000 01101011 0001 0000 01113 machine instructionsa translator turns the topone into the bottom one1234
  1. High-level: English-like, portable, one line becomes many instructions.
  2. Assembly: one short code per instruction, tied to one processor.
  3. Machine code: binary, the only thing the processor runs.
  4. The same sum at each level. A translator turns the top into the bottom.
High-level is for people to write. Machine code is for the processor to run. Translators connect them.
Compiler, interpreter and assemblerThree translators, one card each. A compiler takes the source code and translates all of it at once into a separate executable file of machine code. The file can then be run again and again without the compiler, and it runs fast and keeps the source code private. An interpreter translates and runs the source code one line at a time, line 1 then line 2 then line 3, so it runs straight away, which makes it easy to test, but it stops at the first error and is slower because the translation happens every time. An assembler translates assembly language into machine code, with one line of assembly becoming one machine instruction, which gives low-level control of the hardware but produces code that only fits one type of processor.CompilerInterpreterAssemblersource codecompileall of it, oncesource codeinterpretone line at a timeassembly codeassembleone to oneprogram.exemachine codeline 1runline 2runline 3run10110001 00000111machine code, one to onetranslates it all firstthen it runs fast, again and againsource code stays privatetranslates as it goesruns straight away, so easy to teststops at the first errorone line is one instructionfor low-level control of hardwareoutput only fits one processor123
  1. Compiler: translates everything first, then the program runs fast and the source stays private.
  2. Interpreter: translates and runs one line at a time, so it is easy to test and stops at the first error.
  3. Assembler: turns assembly into machine code, one line for one instruction.
Compiled code runs faster. Interpreted code is quicker to try out. Learn one point for each.

Key terms you must be able to define

System software
Software that manages the computer itself, including the operating system and utilities.
Application software
Software that lets the user carry out a particular task.
Operating system
System software managing the processor, memory, peripherals and users, and providing the interface.
Device driver
Software allowing the operating system to communicate with a particular hardware device.
Utility software
System software carrying out maintenance tasks such as backup, encryption or compression.
High level language
A language written close to human language, where one statement becomes many machine instructions.
Low level language
A language close to the hardware, either machine code or assembly language.
Assembler
A translator converting assembly language into machine code.
Compiler
A translator converting a whole high level program into machine code before it runs.
Interpreter
A translator converting and executing a high level program one statement at a time.

Flashcards

Say the definition out loud before you flip the card. Retrieving it from memory is what builds recall, reading it again is not.

DefineSystem software
AnswerSoftware that manages the computer itself, including the operating system and utilities.
DefineApplication software
AnswerSoftware that lets the user carry out a particular task.
DefineOperating system
AnswerSystem software managing the processor, memory, peripherals and users, and providing the interface.
DefineDevice driver
AnswerSoftware allowing the operating system to communicate with a particular hardware device.
DefineUtility software
AnswerSystem software carrying out maintenance tasks such as backup, encryption or compression.
DefineHigh level language
AnswerA language written close to human language, where one statement becomes many machine instructions.
DefineLow level language
AnswerA language close to the hardware, either machine code or assembly language.
DefineAssembler
AnswerA translator converting assembly language into machine code.

Reach the top grade on this topic

Two habits earn the top marks on this topic.

Explain a function by its consequence. Memory management stops one program corrupting another. Device drivers mean an application need not know which printer is attached. Naming the outcome is what distinguishes a developed point.

Separate development from execution when comparing translators. "An interpreter is slower" is incomplete. "An interpreter is slower to execute because it translates each line every time it is run, but faster to develop with because it reports an error as soon as it reaches the line containing it" is the answer.

Mistakes that cost marks here

Avoid these
  • Calling a device driver hardware. It is software.
  • Saying a compiler is simply faster than an interpreter without saying at what.
  • Describing assembly language as machine code. It uses mnemonics and still needs assembling.
  • Saying utilities are application software. They maintain the machine, so they are system software.
  • Claiming defragmentation speeds up a solid state drive.
Fun fact

The first compiler was written in 1952 by Grace Hopper, who was told repeatedly that computers could not understand English-like instructions. Every high level language since exists because she was right and they were wrong.

Knowledge check

0 of 10 answered
1Which of these is application software?
2What does memory management in an operating system do?
3Why does an operating system use device drivers?
4What is the main advantage of an interpreter during development?
5Why does compiled code usually run faster than interpreted code?
6What does an assembler translate?
7Which utility would most directly help recover from a ransomware attack?
8Why would a programmer use a low level language for a device driver?
9What is a disadvantage of a compiled program?
10Which statement about a high level language statement is correct?
Score 0 / 10

Exam-style questions

Five written questions in the style of the real paper. Write a full answer, then let the marker check it against the mark scheme.

13 marks
1State one difference between system software and application software.2 marks
State

Mark scheme0 / 2
  • LSystem software manages or maintains the computer itself
  • LApplication software allows the user to complete a particular task
Model answer

System software manages and maintains the computer itself, the operating system and utility programs being the main examples. Application software is installed so that the user can carry out a particular task such as browsing the web or editing a photograph.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
2Describe two functions of an operating system.4 marks
Describe

Mark scheme0 / 4
  • LMemory management, allocating memory to each running program
  • LExplains the consequence, such as preventing programs interfering with each other
  • LPeripheral management, communicating with devices through drivers
  • LExplains the consequence, such as applications not needing to know the specific hardware
Model answer

The first is memory management. The operating system allocates an area of memory to each running program and keeps track of what is in use, which prevents one program from writing into memory belonging to another and crashing it, and it moves less used pages out to virtual memory when physical memory runs short. The second is peripheral management. The operating system communicates with input and output devices through device drivers, so an application can simply request that a page is printed without containing any knowledge of the particular printer attached, and a new device is supported by installing a driver rather than by rewriting every program.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
3Explain one advantage of using an interpreter and one advantage of using a compiler.4 marks
Explain

Mark scheme0 / 4
  • LAn interpreter reports an error as soon as it reaches the line containing it
  • LWhich makes locating and fixing faults during development much quicker
  • LA compiler translates the whole program once before it runs
  • LSo the finished program executes faster, and can be distributed without the source code
Model answer

An interpreter translates and executes one statement at a time, so when it reaches a line it cannot process it stops there and reports it. That tells the programmer precisely where the fault is and allows an immediate retry after a change, with no compilation step in between, which makes the write, test and correct cycle much faster while a program is still being developed. A compiler translates the entire program into machine code once, before it is ever run. At run time the processor executes machine code directly with no translation happening at all, so the finished program is considerably faster, and it can be distributed as an executable without the source code, which protects the developer's work and means the user needs no translator installed.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
4A company is writing software for a device with only 32 kilobytes of memory. Explain why part of the program might be written in a low level language.3 marks
Explain

Mark scheme0 / 3
  • LA low level language gives direct control over memory and hardware
  • LThe code can be made extremely compact, using far fewer bytes
  • LAcknowledges the cost, that it is slow to write and not portable
Model answer

A low level language lets the programmer decide exactly how every byte of memory is used and exactly which instructions the processor executes, rather than leaving those decisions to a compiler making general purpose choices. With only 32 kilobytes available that control is what makes the program fit at all, since the equivalent high level program would very likely be several times larger. The cost is real: low level code takes far longer to write, is much harder to read and debug, and is written for one specific processor, so it cannot be recompiled for different hardware later. For that reason a company would usually write only the memory critical or timing critical routines this way and keep the rest of the program in a high level language.

The marker looks for key phrases. If you said it another way and it is still right, give yourself the mark.
Machine mark 0 / 13