You are on page 1of 471

OCR Computer Science A Level

1.1.1 Structure and Function of the Processor


Flashcards

PMT Education is licensed under https://bit.ly/pmt-cc


This work by https://bit.ly/pmt-edu-cc CC BY-NC-ND 4.0

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Arithmetic and Logic unit
do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Arithmetic and Logic unit do?

The ALU completes all the arithmetical


and logical operations.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the Control Unit?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the Control Unit?

A part of the processor which directs


operations inside the CPU.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What are registers?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What are registers?

Small memory cells that operate at high


speeds.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
Where do all the arithmetic, logic, or shift
operations occur?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
Where do all the arithmetic, logic, or shift operations
occur?

They occur in registers.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Program Counter (PC)
do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Program Counter (PC) do?

The Program Counter holds the address


of the next instruction.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
In which register do all calculations take
place?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
In which register do all calculations take place?

The Arithmetic and Logic Unit (ALU).

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
Where are intermediate arithmetic and
logic results stored?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
Where are intermediate arithmetic and logic results
stored?
In the accumulator (ACC).

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Memory Address Register
do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Memory Address Register do?

Holds the address of a location that is to


be read from or written to.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Memory Data Register
do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Memory Data Register do?

Temporarily stores the data that has just


been read from or the data needs to be
written.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Current Instruction
Register do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Current Instruction Register do?

Holds the current instruction divided up


into opcode and operand.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is a Bus?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is a Bus?

A set of parallel wires connecting two or


more components together.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the system bus?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the system bus?

The collection of the data bus, address


bus, and control bus is called the system
bus.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the width of a bus?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the width of a bus?

The number of parallel wires it has.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the data bus?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the data bus?

A bidirectional bus used to transport data


and instructions between components

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the control bus?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the control bus?

The bi-directional bus used to transmit


control signals between internal and
external components.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the address bus used for?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the address bus used for?

Used to transmit the memory address


specifying where data is to be sent from
or retrieved from.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does adding a wire to the address
bus do to the number of addressable
locations?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does adding a wire to the address bus do to
the number of addressable locations?

It doubles the number of addressable


locations

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the Bus Request indicate?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does Bus Request indicate?

indicates a device is requesting access


to the data bus.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does Bus Grant indicate?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does Bus Grant indicate?

Indicates the CPU has granted access to


the data bus.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does memory write do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does memory write do?

Causes the data on the data bus to be


written into the addressed location

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does memory read do?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does memory read do?

Causes the data from the addressed


location to be placed onto the data bus.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the interrupt request control
signal indicate?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What does the interrupt request control signal
indicate?

Indicates that a device is requesting


access to the CPU.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the clock control signal used for?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the clock control signal used for?

It is used to synchronise instructions.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Assembly Language?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Assembly Language?

Assembly Language is a programming


language where mnemonics are used to
represent instructions.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is opcode?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is opcode?

Opcode is used to determine the type of


instruction and what hardware to use to
execute it.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the operand?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the operand?

The operand is the address of where the


operation is performed.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the fetch phase?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the fetch phase?
- The address from the PC is copied to the MAR,
- Instruction held at that address is copied to the
MDR by the data bus, simultaneously the
contents of the PC is increased by 1,
- The value of the MDR is copied to the CIR

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the decode phase?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the decode phase?

The contents of the CIR is split into


operand and opcode.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the execute phase?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What occurs during the execute phase?

The opcode is executed on the data.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the clock speed?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is the clock speed?

The number of clock cycles completed


per second.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is cache memory?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is cache memory?

Cache memory is the CPU’s onboard


memory which can be accessed a lot
faster than main memory

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
A-Level only

What is pipelining?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is pipelining

The process of completing the fetch,


decode and execute of three separate
files simultaneously.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Von Neumann architecture?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Von Neumann architecture?

Architecture in which there is a single


shared memory and shared data bus for
both data and instructions.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Harvard architecture?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is Harvard architecture?

Architecture in which there is two


separate memory and data buses for
data and instructions.

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is contemporary processing?

https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
What is contemporary processing?

Processing in which Von Neumann


architecture is used for main memory.
Cache uses Harvard architecture, divided
into instruction cache and data cache
https://bit.ly/pmt-cc
https://bit.ly/pmt-edu https://bit.ly/pmt-cc
OCR Computer Science A Level
1.1.2 Types of Processor
Flashcards

www.pmt.education
What does RISC mean?

www.pmt.education
What does RISC mean?

Reduced Instruction Set Computer

www.pmt.education
What does CISC mean?

www.pmt.education
What does CISC mean?

Complex Instruction Set Computer

www.pmt.education
What are the properties of RISC?

www.pmt.education
What are the properties of RISC?

- Small instruction set


- Each instruction is one line of machine
code
- Used in everyday devices
www.pmt.education
What are the properties of CISC?

www.pmt.education
What are the properties of CISC?

- A large instruction set


- Instructions are built into hardware
- Used in embedded systems and
microprocessors
www.pmt.education
What are the benefits of RISC
processors?

www.pmt.education
What are the benefits of RISC processors?

Pipelining is possible since each


instruction takes one clock cycle.

www.pmt.education
What are the benefits of CISC
processors?

www.pmt.education
What are the benefits of CISC processors?

- Compilers have to do less work,


- They require less RAM since
instructions are smaller

www.pmt.education
What is a graphics processing unit?

www.pmt.education
What is a graphics processing unit?

A co-processor made up of lots of


independent parallel processors.

www.pmt.education
A-Level only

What are GPUs used for now?

www.pmt.education
What are GPUs used for now?

GPUs are used for image processing


and machine learning.

www.pmt.education
What are multi-core systems?

www.pmt.education
What are multi-core systems?

Systems where there are multiple cores


that separate fetch-execute cycles.

www.pmt.education
What are parallel systems?

www.pmt.education
What are parallel systems?

Systems where multiple instructions can


be completed at any given time, doesn’t
require multiple cores, it can use
threading and pipelining instead.
www.pmt.education
OCR Computer Science A Level
1.1.3 Input, Output and Storage
Flashcards

www.pmt.education
Give two types of magnetic storage

www.pmt.education
Give two types of magnetic storage

Two from:
● Hard disk drive
● Floppy disk
● Magnetic tape

www.pmt.education
Give three examples of input devices

www.pmt.education
Give three examples of input devices

Three from:

Keyboard Touchpad
Mouse Barcode reader
Microphone Magnetic stripe reader
Webcam Etc.
www.pmt.education
Give an example of a device which is
used for both input and output

www.pmt.education
Give an example of a device which is used for both
input and output

Touchscreen

www.pmt.education
What name is given to the areas on a
CD’s surface which have been burned
into grooves by a laser?

www.pmt.education
What name is given to the areas on a CD’s surface
which have been burned into grooves by a laser?

Pits

www.pmt.education
What does CD stand for?

www.pmt.education
What does CD stand for?

Compact Disc

www.pmt.education
Give three examples of output devices

www.pmt.education
Give three examples of output devices

Three from:

Speaker
Monitor
Printer
Projector
www.pmt.education
Which has the highest typical storage
capacity: CD, DVD or Blu-Ray?

www.pmt.education
Which has the highest typical storage capacity: CD,
DVD or Blu-Ray?

Blu-Ray

www.pmt.education
In a hard disk drive, what is mounted at
the end of the actuating arm?

www.pmt.education
In a hard disk drive, what is mounted at the end of
the actuating arm?

Read / write head

www.pmt.education
Give two types of magnetic storage

www.pmt.education
Give two types of magnetic storage

Two from:
● Hard disk drive
● Floppy disk
● Magnetic tape

www.pmt.education
Which storage device has typical
capacities in the range 500GB-5TB?

www.pmt.education
Which storage device has typical capacities in the
range 500GB-5TB?

Hard disk drive

www.pmt.education
Give two disadvantages of SSDs

www.pmt.education
Give two disadvantages of SSDs

● High cost per GB


● Limited lifespan

www.pmt.education
What does ROM stand for?

www.pmt.education
What does ROM stand for?

Read only memory

www.pmt.education
Describe the structure in which
information is stored in flash memory

www.pmt.education
Describe the structure in which information is stored
in flash memory

Information is stored in blocks, which


are combined to form pages.

www.pmt.education
What is meant by non-volatile?

www.pmt.education
What is meant by non-volatile?

A non-volatile storage medium does


not lose its information when power is
lost.

www.pmt.education
Which two types of logic gate are used in
flash storage?

www.pmt.education
Which two types of logic gate are used in flash
storage?

NAND and NOR

www.pmt.education
Give three advantages of SSDs

www.pmt.education
Give three advantages of SSDs

● High transfer speeds


● Lightweight
● No moving parts

www.pmt.education
Is ROM volatile or non-volatile?

www.pmt.education
Is ROM volatile or non-volatile?

Non-volatile

www.pmt.education
Which form of storage device uses
silicon semiconductors to store
information?

www.pmt.education
Which form of storage device uses silicon
semiconductors to store information?

Flash

www.pmt.education
Give three disadvantages of CDs

www.pmt.education
Give three disadvantages of CDs

● They are easily damaged by scratches


● They have relatively low capacities
● They have relatively slow transfer speeds

www.pmt.education
OCR Computer Science A Level
1.2.1 Systems Software
Flashcards

www.pmt.education
What is an operating system?

www.pmt.education
What is an operating system?

A collection of programs that work


together to provide an interface between
the user and computer

www.pmt.education
Give 3 functions of an operating system.

www.pmt.education
Give 3 functions of an operating system.

Three from:
- Memory management - Security
- Resource management - User interface
- I/Output management - Utility software
- Interrupt management

www.pmt.education
What are the similarities and differences
between paging and segmentation?

www.pmt.education
What are the similarities and differences between
paging and segmentation?

Both: Are used when RAM space is insufficient, can cause


disk thrashing

Paging: Uses equal-sized sections called pages

Segmentation: Uses variable-sized, logical sections called


segments
www.pmt.education
Describe how virtual memory is used
when there is not enough RAM.

www.pmt.education
Describe how virtual memory is used when there is
not enough RAM.
A section of the hard drive is used to act as RAM

Sections of programs not currently being used are temporarily


moved into virtual memory through paging.

This frees up memory for other programs in RAM.

www.pmt.education
What is an interrupt?

www.pmt.education
What is an interrupt?

A signal generated by software or


hardware to indicate to the processor
that a process needs attention.

www.pmt.education
Explain the stages of the Interrupt
Service Routine.

www.pmt.education
Explain the stages of the Interrupt Service Routine.

● Interrupt register checked at the end of each Fetch-Decode-Execute cycle.


● If there is an interrupt exists with a higher priority to the current process, the current contents of the registers
in the CPU are transferred into a stack.
● The relevant interrupt service routine (ISR) is loaded into RAM.
● A flag is set to signal the ISR has begun.
● The flag is reset once the ISR has finished.
● Interrupt register checked again. If interrupts are of a higher priority, the process is repeated.
● If there are no interrupts with a higher priority, the contents of the stack are popped and place back into the
special memory registers
● The fetch-Decode-Execute cycle renews as before

www.pmt.education
Are these scheduling algorithms
pre-emptive or non pre-emptive?
FCFS, SRT, SJF, MLFQ, RR

www.pmt.education
Are the scheduling algorithms pre-emptive or non
pre-emptive?

Pre-emptive: RR, SRT, MLFQ


Non-preemptive: FCFS, SJF

www.pmt.education
What are the advantages and
disadvantages of using Multilevel
Feedback Queues for scheduling?

www.pmt.education
Give one advantage and disadvantage of using
Multilevel Feedback Queues for scheduling.

Advantage: Services most urgent


interrupts first
Disadvantage: Hard to implement

www.pmt.education
Define a real-time operating system and
when it may be used.

www.pmt.education
Define a real-time operating system and when it may
be used.
Real-time operating systems perform a task
within a guaranteed time frame. They are used in
systems were a response within a given time
frame is critical eg. life support systems,
self-driving cars, power systems.
www.pmt.education
Describe three functions of the BIOS.

www.pmt.education
Describe three functions of the BIOS.

Running tests upon the computer’s start-up:

● POST (Power-on self test) which ensures that all


hardware is correctly connected and functional
● Checking the CPU clock, memory and processor
● Testing for external memory devices

www.pmt.education
What is the role of a device driver?

www.pmt.education
What is the role of a device driver?

Enable the operating system to interact


with hardware devices.

www.pmt.education
Describe an instance in which a Virtual
Machine may be used.

www.pmt.education
Describe an instance in which a Virtual Machine may
be used.
● Testing programs
● Protection from malware
● Running software compatible with different
versions and types of operating systems

www.pmt.education
Give one advantage and one
disadvantage of intermediate code.

www.pmt.education
Give one advantage and one disadvantage of
intermediate code.

Advantage: Platform independent,


portable
Disadvantage: Slower execution

www.pmt.education
OCR Computer Science A Level
1.2.2 Applications Software
Flashcards

www.pmt.education
What is the difference between
applications and systems software?

www.pmt.education
What is the difference between applications and
systems software?

Applications software is utilised directly


by the end-user whereas systems
software ensures the high performance
of the computer.
www.pmt.education
Give 3 examples of utilities

www.pmt.education
Give 3 examples of utilities
Three from
- Compression - Automatic backup
- Disk defragmentation - Automatic updating
- Antivirus

www.pmt.education
Give one advantage of using closed
source code

www.pmt.education
Give one advantage of using closed source code

- Thorough, regular and well-tested updates


- Expert support and user manuals from company
- High levels of security as it is developed in a professional,
controlled environment

www.pmt.education
State two features of open source code

www.pmt.education
State two features of open source code

- Does not require a license to be used


- Distributed with the source code
- Can be modified and sold on

www.pmt.education
Give two advantages of using compiled
code over interpreted code

www.pmt.education
Give two advantages of using compiled code over
interpreted code

- Faster to execute
- Does not require compiler to run

www.pmt.education
Give two advantages of using interpreted
code over compiled code

www.pmt.education
Give two advantages of using interpreted
code over compiled code
Two from:
- Is platform independent
- Runs instantly without time waiting for compilation
- Useful for debugging

www.pmt.education
What is assembly language?

www.pmt.education
What is assembly language?

A low-level language that has almost a


one-to-one relationship with machine
code. It is platform specific.

www.pmt.education
What are the stages of compilation?

www.pmt.education
What are the stages of compilation?

● Lexical analysis
● Syntax analysis
● Code generation
● Optimisation

www.pmt.education
What happens during syntax analysis?

www.pmt.education
What happens during syntax analysis?

- Tokens are compared to the rules of the


programming language
- Syntax errors are identified
- Symbol table updated with more details
- Semantic analysis (finding logic errors)
www.pmt.education
What are the similarities and differences
between static and dynamic linkers?

www.pmt.education
What are the similarities and differences between
static and dynamic linkers?

Similarities: Both link external modules and libraries to main


program

Static: Library code copied into the file. File size increased.

Dynamic: Addresses of libraries included within file. External


updates automatically feed through to main program.
www.pmt.education
Give three advantages of using libraries.

www.pmt.education
Give three advantages of using libraries.

- Error-free
- Save time
- Re-usable
- No need to ‘reinvent the wheel’
- Designed by experts

www.pmt.education
Describe the function of a loader

www.pmt.education
Describe the function of a loader

Provided by the operating system, a loader


retrieves the library or subroutine from the given
memory location.

www.pmt.education
What is the purpose of the optimisation
stage of compilation?

www.pmt.education
What is the purpose of the optimisation stage of
compilation?

● Reduce execution time


● Reduce inefficient sections of code
● Remove redundant code

www.pmt.education
OCR Computer Science A Level
1.4.1 Data Types
Flashcards

www.pmt.education
What data type should be used for
storing a phone number like
07886756443?

www.pmt.education
What data type should be used for storing a phone
number like 07886756443?

String
Numeric types would omit the leading 0.

www.pmt.education
Perform an AND mask on the binary
numbers:

10101101
01011011

www.pmt.education
Perform an AND mask on the binary numbers

00001001

www.pmt.education
Which data type stores a
collection of characters?

www.pmt.education
Which data type stores a collection of characters?

String

www.pmt.education
Add the two binary numbers:

01011011
00111010

Give your answer in decimal


www.pmt.education
Add the two binary numbers 01011011 and
00111010, giving your answer in decimal

149
0 1 0 1 1 0 1 1
+ 0 0 1 1 1 0 1 0
1 0 0 1 0 1 0 1

www.pmt.education
What is the decimal 45 in binary?

Give your answer as a byte

www.pmt.education
What is the decimal 45 in binary?

00101101

www.pmt.education
What is the hexadecimal 2E in decimal?

www.pmt.education
What is the hexadecimal 2E in decimal?

(2×16) + (14×1) = 46

www.pmt.education
What is the hexadecimal 45 in binary?

Give your answer as a byte

www.pmt.education
What is the hexadecimal 45 in binary?

01000101

www.pmt.education
Which data type stores
just True and False?

www.pmt.education
Which data type stores just True and False?

Boolean

www.pmt.education
What is -5 in sign magnitude binary?

Give your answer as a nybble

www.pmt.education
What is -5 in sign magnitude binary?

1101

www.pmt.education
What does the binary 01101100
represent in hexadecimal?

www.pmt.education
What does the binary 01101100 represent in
hexadecimal?

6C

www.pmt.education
What is the effect of a logical
shift left by one place?

www.pmt.education
What is the effect of a logical shift left by one place?

The value is doubled

www.pmt.education
What is the two’s complement binary
10101101 in decimal?

www.pmt.education
What is the two’s complement binary 10101101 in
decimal?

-83

www.pmt.education
The binary 0011010000110 is a floating
point number with a single-bit sign, 8-bit
mantissa and 4-bit exponent.

What is the number in decimal?

www.pmt.education
What is the number in decimal?

52

www.pmt.education
Perform a logical shift right by two places
on the binary number 01101010 and
convert your result to decimal.

www.pmt.education
Perform a logical shift right by two places on the
binary number 01101010 and convert your result to
decimal.
26.5

www.pmt.education
Perform an XOR mask on the binary
numbers:

01010101
10111011

www.pmt.education
Perform an XOR mask on the binary numbers

11101110

www.pmt.education
Which of the following is not a character?

A: 8 C: %
B: R D: 43

www.pmt.education
Which is not a character?

www.pmt.education
The binary 1100110000011 is a floating
point number with a single-bit sign, 8-bit
mantissa and 4-bit exponent.

What is the number in decimal?

www.pmt.education
What is the number in decimal?

-9.5

www.pmt.education
OCR Computer Science A Level
1.4.2 Data Structures
Flashcards

www.pmt.education
What is an array?

www.pmt.education
What is an array?

An ordered, finite set of elements of a


single type.

www.pmt.education
What type of array is a linear array?

www.pmt.education
What type of array is a linear array?

A one-dimensional array.

www.pmt.education
How can you visualise a two-dimensional
array?

www.pmt.education
How can you visualise a two dimensional array?

As a spreadsheet or table.

www.pmt.education
How can you visualise a three
dimensional array?

www.pmt.education
How can you visualise a three dimensional array?

A three dimensional array can be


visualised as a multi-page spreadsheet.

www.pmt.education
What is a record also known as?

www.pmt.education
What is a record also known as?

A row in a file

www.pmt.education
What is a record made up of?

www.pmt.education
What is a record made up of?

A record is made up of fields.

www.pmt.education
How can you select a field from a record
using pseudocode?

www.pmt.education
How can you select a field from a record using
pseudocode?

recordName.fieldName

www.pmt.education
What is the definition of a list?

www.pmt.education
What is the definition of a list?

A data structure consisting of a number


of items in which the items can occur
more than once.

www.pmt.education
What are the main differences between
arrays and lists?

www.pmt.education
What are the main differences between arrays and
lists?

- Lists can store data non-contiguously


whereas arrays store data in order.
- Lists can store data of more than one
data type.
www.pmt.education
What is a tuple?

www.pmt.education
What is a tuple?

An immutable, ordered set of values of


any type.

www.pmt.education
What is the difference between a tuple
and an array?

www.pmt.education
What is the difference between a tuple and an array?

Tuples are initialised using regular


brackets instead of square brackets.

www.pmt.education
What is a linked list?

www.pmt.education
What is a linked list?

A dynamic data structure used to hold an


ordered set of items which are not stored
in a contiguous locations.

www.pmt.education
What is the name given to the items in a
linked list?

www.pmt.education
What is the name given to the items in a linked list?

Nodes

www.pmt.education
What does each item in a linked list
contain?

www.pmt.education
What does each item in a linked list contain?

It contains a data field and another


address field called a link/pointer

www.pmt.education
What is a data field in a linked list?

www.pmt.education
What is a data field in a linked list?

A field that stores the actual data.

www.pmt.education
What is a pointer field in a linked list?

www.pmt.education
What is a pointer field in a linked list?

A field that contains the address of the


next item in the list.

www.pmt.education
What is a graph?

www.pmt.education
What is a graph?

A graph is a data structure consisting of


a set of vertices/nodes connected by
edges/arcs.

www.pmt.education
What is a directed graph?

www.pmt.education
What is a directed graph?

A graph in which the edges can only be


traversed in one direction.

www.pmt.education
What is an undirected graph?

www.pmt.education
What is an undirected graph?

A graph in which the edges can be


traversed in both directions.

www.pmt.education
What is a weighted graph?

www.pmt.education
What is a weighted graph?

A graph in which the arcs/edges have a


cost to traverse

www.pmt.education
Give two ways of representing graphs so
that they can be understood by
computers.

www.pmt.education
What two data types can a computer understand a
graph?

Adjacency Matrix, Adjacency List

www.pmt.education
What are the advantages of using an
adjacency matrix?

www.pmt.education
What are the advantages of using an Adjacency
Matrix?

- Convenient to work with


- Easy to add new nodes to

www.pmt.education
What are the advantages of using an
Adjacency List?

www.pmt.education
What are the advantages of using an Adjacency
Matrix?

Space efficient for large sparse networks

www.pmt.education
What is a stack?

www.pmt.education
What is a stack?

A LIFO (‘last in first out’) data structure,


where items can only be removed from
and added to the top of the list.

www.pmt.education
Give an example of where stacks may
be used.

www.pmt.education
Give an example of where stacks may be used.

- Back button in a web page


- Undo buttons

www.pmt.education
What is a queue?

www.pmt.education
What is a queue?

A FIFO (‘first in first out’) data structure,


where items are added to the end of the
queue and removed from the front of the
queue.
www.pmt.education
What is a tree?

www.pmt.education
What is a tree?

A data structure which has a root node,


and child nodes connected with
branches.

www.pmt.education
What is a node?

www.pmt.education
What is a node?

A node is any item in a tree

www.pmt.education
What is an edge?

www.pmt.education
What is an edge?

An edge is the connection between two


nodes

www.pmt.education
What is the root node?

www.pmt.education
What is the root node?

The node which doesn’t have any


incoming nodes, at the top of the tree

www.pmt.education
What is a child?

www.pmt.education
What is a child?

Any node which has an incoming edge

www.pmt.education
What is a parent?

www.pmt.education
What is a parent?

Any node which has outcoming edges

www.pmt.education
What is a subtree?

www.pmt.education
What is a subtree?

A section of the tree which consists of a


parent and all the children of that parent

www.pmt.education
What is a leaf?

www.pmt.education
What is a leaf?

A leaf is a node which has no children

www.pmt.education
What is a binary tree?

www.pmt.education
What is a binary tree?

A type of tree in which each node has a


maximum of two children

www.pmt.education
What is the purpose of a binary tree?

www.pmt.education
What is the purpose of a binary tree?

A binary tree is used to search for values


quickly.

www.pmt.education
What is a hash table?

www.pmt.education
What is a hash table?

A hash table is an array which is coupled


with a hash function

www.pmt.education
What is a collision? (hashing)

www.pmt.education
What is a collision? (hashing)

A collision is where two inputs result in


the same hashed value

www.pmt.education
What properties does a good hashing
algorithm have?

www.pmt.education
What properties does a good hashing algorithm
have?

A good hashing algorithm must have a


low chance of collision and must be fast.

www.pmt.education
What is pre-order traversal?

www.pmt.education
What is a pre-order traversal?

Traversal algorithm in which you traverse


the root node, followed by the left
subtree then the right subtree.

www.pmt.education
What is in-order traversal?

www.pmt.education
What is in-order traversal?

Traversal algorithm in which you traverse


the left subtree, the root node, then the
right subtree.

www.pmt.education
What is post-order traversal?

www.pmt.education
What is post-order traversal?

Traversal algorithm in which you traverse


the left subtree, the right subtree
followed by the root node.

www.pmt.education
What does the operation isEmpty() do?
(Lists)

www.pmt.education
What does the operation isEmpty() do?

Checks if the list is empty

www.pmt.education
What does the operation append(value)
do? (Lists)

www.pmt.education
What does the operation append(value) do?

It adds the given value to the end of the


list.

www.pmt.education
What does the operation remove(value)
do? (Lists)

www.pmt.education
What does the operation remove value do?

It finds the first instance of the given


value and removes it

www.pmt.education
What does the operation search(value)
do? (Lists)

www.pmt.education
What does the operation search(value) do?

Searches for the given value in a list

www.pmt.education
What does the operation length() do?
(Lists)

www.pmt.education
What does the operation length() do?

Returns the length of the list

www.pmt.education
What does the operation index(value)
do? (Lists)

www.pmt.education
What does the operation index(value) do?

Returns the index of a value in the list.

www.pmt.education
What does the operation insert(position,
value) do? (Lists)

www.pmt.education
What does the operation insert(position, value) do?

Adds the value to the position in the list.

www.pmt.education
What does the operation pop() do (Lists)

www.pmt.education
What does the operation pop() do?

Returns and removes the last value in


the list

www.pmt.education
What does pop(position) do? (Lists)

www.pmt.education
What does pop(position) do?

It returns and removes the value at the


given position in the list.

www.pmt.education
What does the operation isEmpty() do?
(Stacks)

www.pmt.education
What does the operation isEmpty() do?

Checks to see if the stack is empty

www.pmt.education
What does the operation push(value)
do? (Stacks)

www.pmt.education
What does the operation push(value) do?

Adds the given value to the top of the


stack

www.pmt.education
What does the operation peek() do?
(Stacks)

www.pmt.education
What does the operation peek() do?

Returns the top value of the stack

www.pmt.education
What does the operation pop() do?
(Stacks)

www.pmt.education
What does the operation pop() do?

Returns and removes the value at the


top of the stack

www.pmt.education
What does the operation size() do?
(Stacks)

www.pmt.education
What does the operation size() do?

It returns the size of the stack

www.pmt.education
What does the operation isFull() do?
(Stacks)

www.pmt.education
What does the operation isFull() do?

Checks to see if the stack is full.

www.pmt.education
What does the operation
enQueue(value) do? (Queue)

www.pmt.education
What does the operation enQueue(value) do?

Adds the givn value to the end of the


queue

www.pmt.education
What does the operation deQueue() do?
(Queue)

www.pmt.education
What does the operation deQueue() do?

Removes the item from the end of the


queue

www.pmt.education
What does the operation isEmpty() do?
(Queue)

www.pmt.education
What does the operation isEmpty() do?

It checks to see if the queue is empty

www.pmt.education
What does the operation isFull() do?
(Queue)

www.pmt.education
What does the operation isFull() do?

Checks to see if the queue is full

www.pmt.education
OCR Computer Science A Level
1.4.3 Boolean Algebra
Flashcards

www.pmt.education
Which logic gate is this?

www.pmt.education
Which logic gate is this?

Exclusive Disjunction (XOR)

www.pmt.education
What is the equation symbol
for conjunction?

www.pmt.education
What is the equation symbol for conjunction?

www.pmt.education
Which is the truth table for AND?
A B C D

www.pmt.education
Which was the truth table for AND?

www.pmt.education
What will the value of Y be
in this logic circuit?
1 0

www.pmt.education
What would be the value of Y in the logic circuit?

www.pmt.education
State De Morgan’s laws

www.pmt.education
State De Morgan’s laws

www.pmt.education
Simplify the Boolean expression

www.pmt.education
Simplify the Boolean expression

www.pmt.education
Apply one of De Morgan’s laws to the
Boolean expression .

www.pmt.education
Apply one of De Morgan’s laws to the Boolean
expression

www.pmt.education
What is the purpose of a D-type flip flop?

www.pmt.education
What is the purpose of a D-type flip flop?

To store the value of a single bit

www.pmt.education
When is the stored value in a
D-type flip flop updated?

www.pmt.education
When is the stored value in a D-type flip flop
updated?

On the rising edge of the clock signal

www.pmt.education
What is the logic circuit for a half adder?

www.pmt.education
What is the logic circuit for a half adder?

www.pmt.education
Apply a distributive rule to the
Boolean expression

www.pmt.education
Apply a distributive rule to the Boolean
expression

www.pmt.education
Complete the truth table for a full adder
A B Cin Cout Sum

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

www.pmt.education
Complete the truth table for a full adder
A B Cin Cout Sum

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1

www.pmt.education
OCR Computer Science A Level
2.1.1 Thinking Abstractly
Flashcards

www.pmt.education
What is representational abstraction?

www.pmt.education
What is representational abstraction?

A technique in which excessive details are


removed to arrive at a representation of a
problem that consists of only the key
features.

www.pmt.education
Which form of abstraction involves
grouping together similarities within a
problem to identify what kind
of problem it is?

www.pmt.education
Which form of abstraction involves grouping together
similarities within a problem to identify what kind of
problem it is?

Abstraction by generalisation

www.pmt.education
What is meant by data abstraction?

www.pmt.education
What is meant by data abstraction?

A form of abstraction in which details


about how data is being stored are
hidden.

www.pmt.education
What kind of problems make use of
multiple levels of abstraction?

www.pmt.education
What kind of problems make use of multiple levels of
abstraction?

Large, complex problems

www.pmt.education
How does abstraction allow non-experts
to make use of a system?

www.pmt.education
How does abstraction allow non-experts to make use
of a system?

Hides complex and irrelevant information


in abstract models.

www.pmt.education
State two advantages of using
abstraction in software development

www.pmt.education
State two advantages of using abstraction in
software development
Two from:

- Easier for programmers to focus on core elements


- Reduces the time needed to be spent on the project.
- Prevents program from getting unnecessarily large.

www.pmt.education
Give two applications of
layers of abstraction

www.pmt.education
Give two applications of layers of abstraction

- Networking (TCP/IP layer)


- Programming languages

www.pmt.education
State two advantages of using
abstraction in programming languages

www.pmt.education
State two advantages of using abstraction in
programming languages

- Easier to remember syntax in high-level


languages as it is closer to natural language
- Coding becomes accessible to beginners

www.pmt.education
How does object-oriented
programming use abstraction?

www.pmt.education
How does object-oriented programming use
abstraction?
Objects are an abstraction for real-world entities.
Attributes are an abstraction for the characteristics of
an object.
Methods are an abstraction for the actions a
real-world object is able to perform.
www.pmt.education
What is the difference between
abstraction and reality?

www.pmt.education
What is the difference between abstraction and
reality?

Abstraction is a simplified representation


of reality

www.pmt.education
OCR Computer Science A Level
2.1.2 Thinking Ahead
Flashcards

www.pmt.education
What is the purpose of thinking ahead?

www.pmt.education
What is the purpose of thinking ahead?

To make programs easy and intuitive for


users to use.

www.pmt.education
Define inputs.

www.pmt.education
Define inputs.

Any data that is required to solve a


problem, usually entered into the system
by the user.

www.pmt.education
Define outputs.

www.pmt.education
Define outputs.

The results that are passed back once


the inputs have been processed and the
problem solved.

www.pmt.education
What three considerations do
programmers need to make regarding
inputs and outputs when thinking ahead?

www.pmt.education
What three considerations do programmers need to
make about inputs and outputs when thinking
ahead?
- Method of input/output (device used)
- Data structures used
- Data types used
- Order of data
www.pmt.education
Identify the inputs and outputs that are
likely to be used in a book reservation
system i.e. at a library.

www.pmt.education
Identify the inputs and outputs that are likely to be used
in a book reservation system i.e. at a library.

Inputs Outputs

Book details: name, author Expected waiting time

ISBN Confirmation

Borrower details: name, library card Availability at other libraries


number

Collection point

www.pmt.education
What are preconditions?

www.pmt.education
What are preconditions?

Requirements which must be met before


a program can be executed.

www.pmt.education
Where can preconditions be defined?

www.pmt.education
Where can preconditions be defined?

Within the code or within documentation.

www.pmt.education
Give an example where preconditions
are required.

www.pmt.education
Give an example where preconditions are required.

- Stack functions
- Check that a stack is not empty when popping an element from a stack
- Check that a stack is not full when pushing an element onto a stack

- Factorial function
- The number passed to the function cannot be negative

www.pmt.education
State two advantages of including
preconditions within the documentation
accompanying a subroutine.

www.pmt.education
State two advantages of including preconditions
within the documentation accompanying a
subroutine.
- Reduces the length of the program
- Reduces the complexity of the program
- Saves time needed to debug and maintain a longer program
- Makes subroutine more reusable

www.pmt.education
A Level only

Define caching.

www.pmt.education
Define caching.

The process of storing instructions or values in


cache memory after they have been used, as they
may be used again.

www.pmt.education
A Level only

How is caching used in storing web


pages?

www.pmt.education
How is caching used in storing web pages?

Web pages that a user frequently


accesses are cached, so the next time
one of these pages is accessed, content
can be loaded without any delay.

www.pmt.education
A Level only

What are the advantages of caching web


pages?

www.pmt.education
What are the advantages of caching web pages?

- Content can be loaded without delay


- Images and text do not have to be downloaded again multiple
times
- Frees bandwidth for other tasks on a network
- Less time is spent waiting

www.pmt.education
A Level only

What is the name given to the technique


in which instructions are fetched based
on algorithms which predict which
instructions are likely to soon be used?

www.pmt.education
What is the name given to the technique in which
algorithms are used to predict which instructions are
likely to soon be used?

Prefetching

www.pmt.education
A Level only

Give a limitation of caching.

www.pmt.education
Give a limitation of caching.

- Accuracy of the algorithms used


- Effectiveness of algorithm in managing the cache
- Size of the cache

www.pmt.education
Give three advantages of using reusable
program components.

www.pmt.education
Give three advantages of using reusable program
components.
- More reliable than new components, as they have
already been tested.
- As developing from scratch is not required, this saves
time, money and resources.

www.pmt.education
Give two examples of reusable program
components.

www.pmt.education
Give two examples of reusable program
components.
- Abstract data structures eg. queues and stacks
- Classes
- Subroutines

www.pmt.education
OCR Computer Science A Level
2.1.3 Thinking Procedurally
Flashcards

www.pmt.education
What is the first stage of thinking
procedurally?

www.pmt.education
What is the first stage of thinking procedurally?

Taking the problem defined by the user


and breaking it down into its constituent
parts

www.pmt.education
What is the purpose of problem
decomposition?

www.pmt.education
What is the purpose of problem decomposition?

To make complex problems easier to solve


and more manageable by allowing tasks to
be divided between a group of people
according to individual skill sets.

www.pmt.education
State another name given to top-down
design.

www.pmt.education
State another name given to top-down design.

Stepwise refinement

www.pmt.education
What is the purpose of top-down design?

www.pmt.education
What is the purpose of top-down design?

Continually break problems down into


subproblems until each subproblem can
be represented as a single task and
ideally a self-contained subroutine.

www.pmt.education
What are the benefits of using top-down
design?

www.pmt.education
What are the benefits of using top-down design?

● Problems can be solved and modules


developed by different people.
● Tasks can be tested separately.
Modules are self-contained

www.pmt.education
What sort of problems is top-down
design suited to?

www.pmt.education
What sort of problems is top-down design suited to?

Large, complex problems

www.pmt.education
What is the second stage of thinking
procedurally in software development?

www.pmt.education
What is the second stage of thinking procedurally in
software development?

Identifying components of a solution

www.pmt.education
How can the lowest level subproblems in
top-down design in code?

www.pmt.education
How can the lowest level subproblems in top-down
design in code?

As self-contained modules or subroutines

www.pmt.education
What do software developers need to
consider when recombining components
of a solution?

www.pmt.education
What do software developers need to consider when
recombining components of a solution?

The order in which subroutines are


executed, and how they interact with
each other, based on their role in solving
the problem.
www.pmt.education
What must a software developer do
before designing a subroutine to solve a
particular problem?

www.pmt.education
What must a software developer do before designing
a subroutine to solve a particular problem?

See whether it is possible for an already existing


subroutine or module to be used.

www.pmt.education
State two advantages of utilising
reusable components.

www.pmt.education
State two advantages of utilising reusable
components.

● More reliable than newly-coded components, as


they have already been tested.
● This saves time, money and resources.

www.pmt.education
OCR Computer Science A Level
2.1.4 Thinking Logically
Flashcards

www.pmt.education
What is a decision?

www.pmt.education
What is a decision?

A decision is a result reached after


consideration.

www.pmt.education
When are decisions made?

www.pmt.education
When are decisions made?

A decision is made whenever you have


to choice to make.

www.pmt.education
What is the shape used to indicate a
decision in a flow chart?

www.pmt.education
What is the shape given to a decision icon in a flow
chart?

A diamond

www.pmt.education
In a flow chart how many many options
stem from a decision?

www.pmt.education
In a flow chart how many options can you pick from
a decision?

2 different options - yes or no/ true or


false.

www.pmt.education
How do you make effective decisions?

www.pmt.education
How do you make effective decisions?

By evaluating the importance of different


factors and selecting options which
satisfy the needs of the task the most
appropriately
www.pmt.education
How does the result of a decision affect
the flow of a program?

www.pmt.education
Does the result of a decision affect the flow of a
program?

The program will follow a different route


depending on the decision made by the
user.

www.pmt.education
OCR Computer Science A Level
2.1.5 Thinking Concurrently
Flashcards

www.pmt.education
What is concurrent thinking?

www.pmt.education
What is concurrent thinking?

Concurrent thinking is completing more


than one task at any given time.

www.pmt.education
Are concurrent processing and
concurrent thinking the same thing?

www.pmt.education
Are concurrent processing and concurrent thinking
the same thing?

No

www.pmt.education
What is parallel processing?

www.pmt.education
What is parallel processing?

Parallel processing is completing


multiple tasks simultaneously at any
given time.

www.pmt.education
What is concurrent processing?

www.pmt.education
What is concurrent processing?

Concurrent processing is giving a slice of


processor time to tasks to give the
illusion of parallel processing.

www.pmt.education
What are the benefits of concurrent
processing?

www.pmt.education
What are the benefits of concurrent processing?

- More tasks can be completed in a


given time
- Other tasks can be completed while
waiting for an input/ user interaction
www.pmt.education
What are the drawbacks of concurrent
processing?

www.pmt.education
What are the drawbacks of concurrent processing?

If lots of users are requesting for tasks to


be completed, it takes longer for
everyone to complete their task.

www.pmt.education

You might also like