0% found this document useful (0 votes)
26 views

Computer-Science-IGCSE-notes

Uploaded by

bold banana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Computer-Science-IGCSE-notes

Uploaded by

bold banana
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Chapter 1 Binary systems and hexadecimal

Binary
- Based on 2
- Made up of 1s and 0s

Uses of binary:
1. A register of bits 10010111
2. Robotics e.g. 1 = on, 0 = off for motor
3. Digital instruments
4. Counting systems

e.g. uses for a binary number stored in a register


address in main memory
data
ASCII value
number
instruction

Measurements:

• A binary digit is a bit


• 8 bits is a byte
• Byte is used to measure memory size

Name No. of bits Denary value

1 kilobyte (KB) 2^10 1024 bytes

1 megabyte (MB) 2^20 1024^2 bytes

1 gigabyte (GB) 2^30 1024^3 bytes

1 terabyte (TB) 2^40 1024^4 bytes

Differences between binary and denary:

Binary Denary
a base-2 system a base-10 system
uses 0 and 1 values uses 0 to 9 values
has units/ placeholders/column headings that increase has units/ placeholders/column headings that increase
by the power of 2 by the power of 10
has more digit for the same value has less digits for the same value

e.g. explain the process of converting the binary number 1010 into a denary number

- Correct column headings / place holders by example


- Correctly place a 1 or a 0 for each column
- Identify the columns to be added
- Add together the (denary) values identified...
- ...this will give a total which is the denary number/answer
- Answer is (10)

Hexadecimal
- Base 16
- Numbers 1-9 and letters A-F used

Current uses of hexadecimal numbers in computing:

- HTML colour codes – colour codes//colour in HTML


- Error messages
- MAC addresses
- IP addresses
- Assembly language
- Memory dump // debugging
- Locations in memory
- ASCII // Unicode

Reasons for using hex

• Uses fewer characters // shorter

• Easier to read / write / understand

• Less likely to make mistakes // less error prone

• Easier to debug

Colours in HTML:

Hex can be used to represent colours on web pages and image-editing programs using the format #RRGGBB (RR =
reds, GG = greens, BB = blues). The # symbol indicates that the number has been written in hex format. Different
combinations in hex codes will create different shades/tones/colours.

MAC Addresses:

Made up of 6 pairs of hexadecimal digits, the first half is the identity number of the manufacturer of the device and
second half is the serial number of the device. Universally Administered MAC Adress (UAA) most common or Locally
Administered MAC address (LAA).

Assembly languages and machine code:

Computer memory is machine code/ assembly code

Using hexadecimal makes it easier, faster, less error prone to write code compared to binary because it can
represent 16 bit words as only 4 hexadecimal digits, and it is easy to convert hex digits back to binary if necessary.

Debugging:

Memory Dumps: Hexadecimal is used when developing new software or when trying to trace errors. The hex
number refers to the memory location of the error. This helps programmers to find and then fix problems. Memory
dump is when the memory contents are output to a printer, monitor.

Web Addresses:

Characters on a keyboard use ASCII code. These are represented using


hexadecimal or decimal values.

Why computer programmers may choose to use hex:

- It makes the values easier to read/write/understand/debug


- It is a shorter way to represent the values
- e.g. benefits of using hex notation to represent binary values
- Easier to read/write/understand (for humans)
- Easier to remember (for humans)
- Short way to represent binary // Uses less screen/display space
- Fewer errors made (in data transcription)
- Easier to debug (for humans)

Chapter 2 Communication and internet technologies


Data transmission

Simplex Data transmission in one direction only

Half-duplex Data transmission sent in both directions but not at the same time

Full-duplex Data transmission sent in both directions at the same time. (can be
serial/parallel, not always used to connect a device to a computer, does not
automatically detect errors in data)

Serial data transmission When data is sent, one bit at a time, over a single wire or channel

Parallel data transmission When several bits of data, usually a byte, is sent down multiple wires or
channels at the same time.

Asynchronous data Data being transmitted in an agreed bit pattern.


transmission

Synchronous data Data being transmitted in a continuous stream of data.


transmission

Serial data transmission:

Used for externals usually

Advantages:

- more accurate/fewer errors over a longer distance


- Single wire – therefore can be used over longer distances
- Single wire - less expensive wiring/cheaper to manufacture or buy
- Single wire – therefore less likely to have interference // no crosstalk
- Data sent one bit at a time - less chance of data being skewed/out of synchronisation/order // data received in
order
- Transmission can be synchronised – can reduce the rate of errors

Disadvantages:

- Slower than parallel

Example of use

- Connect computer to a modem


- USB cables
- HDMI cables
- Universal Serial Bus (USB)

Parallel data transmission:

Used for internals usually

Usually used only on short distances because over long distances the data will skew and ‘merge’ between the two
wires or channels.

Uses several/multiple wires, transmits multiple bits at a time


Advantages:

o Transmitted at a faster rate

Disadvantages:

- Only supports short distances (becomes skewed over long distance – bits travel at different speeds)
- More chance of data being skewed due to bits being sent simultaneously/out of order
- More expensive as requires several/multiple wires

Example of use

o Integrated circuit because data is transmitted over a short distance and there is no risk of skewing of
data.
o Integrated circuits – parallel transmission, for sending data internally
o RAM
o Connections to peripheral devices

You need to check for errors because data is easy to corrupt/skew. You also don’t want wrong data.

Simplex Examples:

• Microphone to computer
• Sensor to computer
• Computer to printer
• Computer to speaker
• Computer to monitor
• Webcam to computer
• Sending data to a device // sending data from a device

Duplex Examples.: Telephone call

- Voice over IP
- Computer to printer (only award once)
- Instant messaging
- Broadband connections
- Video conferencing
- Sending data to and from devices e.g wireless technology
- Computer to modem
- -> will allow read and write at the same time

Parity bits

USB
- Asynchronous serial
- Four wire shielded cable
- Two wires for power and earth
- Two wires for data transmission

Three things that happen when a device is plugged into a USB port:
• The computer automatically detects that a device is present(this is due to a small change in voltage level on
the data signal in the cable)
• The device is automatically recognised, and the appropriate device driver is loaded up so that the computer
and device can communicate effectively.
• If a new device is detected, the computer will look for the device driver which matches the device; if this is
not available, the user is prompted to download the appropriate software.
Advantages Disadvantages

- Device automatically detected (drivers are automatically - Maximum cable length is


downloaded) - no need to install them manually 5m
- Universal standard – likely to be compatible with the - Transmission rate is less
computer than 500mb/sec
- Fits one way – less chance of connecting a device - May not be supported in
incorrectly, preventing wrong connections the future
- Different data transmission rates
- Cheap to manufacture.

Serial transmission means it is cheaper to manufacture/buy and


there is less chance of skewing

used for sending data externally, serial transmission


Internet principles of operation
The role of the browser/functions of a browser
A software which allows a user to locate, retrieve and display content on the World Wide Web, e.g. web pages,
videos and other files. It interprets/translates the HTML document and interprets/translates embedded scripting, for
example JavaScript. It also provides functions, such as bookmarks and history and identifies protocols, such as https,
SSL.

• Display a web page

• Sends a request to the web server

• Receives data from web server

• Translates HTML files

• Processes client-side script, e.g. JavaScript

• Store favourites

• Store history

• Navigation forward and backward

• Check security

• Store / access cookies

• Find specific text within a web page

• Downloading file from the web

• Allows a homepage

• Allows multiple tabs / web pages to be opened

• Stores data in its cache

e.g. students use a web browser to access the web pages. Explain the role of a browser in this process

• Sends the URL of the website • … to a DNS to find the IP address • Connects to the webserver (using the IP
address) … • … using HTTP / HTTPS • Renders/Translates the HTML • Runs active/client-side scripts built into
webpages • Manages SSL/TLS certificate process • Stores/retrieves cookies
When a user accesses a website:

Requested

- a web browser is used


- user enters the URL / web address (into the address bar) // clicks a link containing the web address // clicks
an element of the webpage
- the URL / web address specifies the protocol
- protocols used are Hyper Text Transfer Protocol (HTTP) / Hyper Text Transfer Protocol Secure (HTTPS)

Sent

- the URL / web address contains the domain name


- the Internet Service Provider (ISP) looks up the IP address of the company
- the domain name is used to look up the IP address of the company
- the domain name server (DNS) stores an index of domain names and IP addresses
- web browser sends a request to the web server / IP address

Received

- Data for the website is stored on the company’s web server


- webserver sends the data for the website back to the web browser
- web server uses the customer’s IP address to return the data
- the data is transferred into Hyper Text Mark-up Language (HTML)
- HTML is interpreted by the web browser (to display the website)
- Any security certificates are authenticated //SSL/HTTPS used to secure data// data is encrypted before sent.

Internet Service Provider (ISP)

Companies that provide the user with access to the internet and other services such as web hosting and emails,
usually in a monthly fee.

HTML
Hypertext mark-up language used to create/develop/author webpages. It is translated by a browser to display
webpages and uses (opening and closing) tags to display/format content.

Structure:

Instructs how the layout of the content is displayed – layout of the webpage, defined using tags, e.g. where a
paragraph is placed, placing an image alongside some text

Presentation:

instructs how the content will be formatted e.g. colour/style/CSS, the colour that is applied to some text

- Both structure and presentation are defined using (mark-up) tags


- Structure and presentation dictate the appearance of the website
- Structure is used for layout
- Presentation is used for formatting/style
- Separate file/CSS can be used for presentation content

Security on browsers
HTTP and HTTPS

HTTP and HTTPS (Hypertext Transfer Protocol) governs communication between a web server and a client. HTTPS
(secure) includes secure encryption to allow transactions to be made over the internet.

e.g. describe what is meant by https


− Hypertext Transfer Protocol Secure // it is the access protocol // It is a protocol

− It means the website uses SSL/TLS

− It means data sent (to and from the webserver) is encrypted

e.g. explain what is meant by https

• Hypertext Transfer Protocol Secure // It is a protocol...

• ...that is a set of rules/standards

• Secure version of HTTP

• Secure website // secures data

• Uses TLS / SSL

• Uses encryption

SSL

- secure sockets layer


- encrypts data being transmitted
- use of https
- use public and private keys

When a user tries to access a secure website:

- the web browser attempts to connect to a web site which is secured by SSL
- the web browser requests the web server to identify itself
- the web server sends the web browser a copy of its SSL certificate
- the web browser checks whether the SSL certificate is trustworthy; if it is then the web browser sends a
message back to the web server
- the web server will then send back some form of acknowledgement to allow the SSL encrypted session to
begin
- the encrypted data is then shared securely between the web browser and the web server

MAC address:
Hardware identification number that uniquely identifies each device on a network; it is manufactured into every
network card and cannot be altered.

It refers to the network interface card (NIC) which is part of the device

Made up of 48 bits and 6 groups of hexadecimal digits, the first half is the identity number of the manufacturer of
the device and second half is the serial number of the device

Types of MAC Address:

- Universally Administrated MAC Address (UAA), UAA is the most common type set by the manufacturer
- Locally Administrated MAC Address (LAA)

Reasons to change MAC address using LAA

- To ensure they follow the correct formula


- To bypass MAC address filter on a router or a firewall
- To get past certain types of network restrictions

• Media Access Control (address)

• Used to identify a device


• It is a unique (address)

• It is a static address // It does not change

• It is set by the manufacturer

• The first part is the manufacturer ID/number/identifies the manufacturer

• The second part is the serial number/ID

IP address:
Internet protocol address, a location of a given computer/device on a network; can be a static or dynamic value.

Consists of four sets of up to three digits, each with a maximum value of 255

IPv4: the old way of addressing using for sets of digits held in 32 bits.

IPv6: the new way of addressing because there was a huge increase in internet-enabled devices, meaning that the
IPv6 was created which increases the number of available addresses to trillions. They are held in 128 bits.

It gives the device location and can change depending on where you are.

e.g. Describe what is meant by an IP address

- IP address is used to identify a device (on the Internet / network)


- IP address is allocated by the network/ ISP
- Can be used in place of URL
- IP addresses can be IPv4 or IPv6
- IP address can be static....
o ... meaning it doesn’t change each time it is connected to the Internet
- IP address can be dynamic...
o ...meaning that it can change each time a device is connected to the Internet
- Any valid example (e.g. xxx.xxx.xxx.xxx or xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx)

ISP

Internet service provider

Provides access to the internet for customers


Can determine maximum bandwidth available for customers
Monitors the volume of data downloaded by customers
Provides an IP address for the customers.

URL:

Uniform Resource Locator

Made up of file name, protocol and web server name

e.g. http://www.cie.org.uk/index.htm

- Protocol is ‘http://’
- Domain is ‘cie.org.uk’
- Filename is ‘index.htm’

(website’s address. User friendly version of the IP address)

Cookies:
Cookies: is a packet of information sent by a web server to a web browser. Cookies are generated each time the user
visits the website.
- These can be used to store your personal preferences or log in details, so you don’t need to re-enter these
details. A cookie is stored on the client rather than the server as they are personal to you.
- Tracking cookies are used to gather marketing information, and have your details recorded and then transmitted
back to the cookies author.
- Packet of info sent by web server to web browser (pieces of data). It is generated each time user visits site and
collects key info.
- It cannot destroy or modify data in a computer without the user’s knowledge or generate website pop-ups.
- Can be deleted from a computer. Will not corrupt the data on a customer’s computer

What is meant by the term cookies?

- Data / files
- Stored in a text file
- Downloaded to a user’s computer when a website is visited // webserver sends to web browser
- Stored on a user’s computer
- Stored by a browser
- Detected by the website when it is visited again

Examples of the use of cookies:

- To store personal information/data


- To store login details
- To save items in an online shopping basket
- To track/save internet surfing habits // to track website traffic
- To carry out targeted advertising
- To store payment details / credit card details
- To customise a webpage // to store user preferences
- Store progress in online games/quizzes
- To track what products a customer browses

Why cookies might be used:

- Personalises/customises the experience


- Shows who are new and returning customers
- Speeds up log-in times
- Speeds up/allows single click purchases
- Improves experience

Chapter 3 Logic gates and logic circuits

NOT AND OR NAND NOR XOR


Syntax:

X = (A AND B) OR (B AND NOT C)

X = (A.B) + (B.¬C)

Chapter 4 Operating systems and computer architecture


Key definitions:

Operating system – the software running in the background of a computer system. It manages many of the basic
functions. It also allows the user to communicate with the software and hardware of the computer

Interrupt – An interrupt is a signal sent from a device (or from some software) to the processor requesting its
attention

Buffer – a buffer is a temporary memory area in a device

Computer architecture – how a computer system is designed

Buses – buses move data around the computer and also send out control signals to synchronise the internal
operations, a pathway for transmitting data and instructions

Register – High-speed storage areas within the computer

Memory unit – made up of addresses and contents

Control unit – controls the operation of the memory, processor and the input/output devices

ALU – used to carry out calculations on data

Buses – used to connect together the internal components of the CPU

Control Unit – Used to manage the flow of data through the CPU and interaction between the components of the
processor

Immediate access store (IAS) used to hold data and instructions when they are loaded from main memory and are
waiting to be processed

Input/Output used to allow interaction with the computer

Registers used to temporarily hold data and instructions during processing

Accumulator (ACC) - holds data temporarily that is currently being used in a calculation

Operating systems
Features of an operating system:

- provides a user interface


- input/output control/handling
- security
- (handling) interrupts
- spooling
- memory management
- processor management
- utilities (e.g., copy, save, delete, rename, etc.)
- maintain user accounts
- load/run software
- error reporting/handling
- multiprogramming
- batch processing/JCL
- Multitasking

Examples of operating systems:

- Windows – single user (only 1 user can use computer at a time but have many applications open at a time)
- Android
- Linux

When a computer is initially powered up, the initiating programs are loaded into memory from ROM. The programs
run a checking procedure to make sure internal systems (hardware, processor...) are functioning correctly. If no
errors are detected, the operating system is loaded into memory.

Why there is a need for an OS:

- It performs a number of basic tasks, including controlling hardware/file handling (any other suitable
examples)
- It allows the user to communicate with the computer using hardware // without it the user would not be
able to communicate with the computer using hardware
- It provides the user with a user interface // without it the user would not have a user interface to use
- PCs are often used to perform many complex tasks at a time...
– ...the OS is needed to handle this multitasking
– ...therefore, it provides the ability to handle interrupts

Interrupts
Interrupt Signal sent to a processor which may cause a break in execution of the current routine, according to
priorities

It will cause the processor to temporarily stop what it is doing to service the interrupt.

Interrupt requests – the operating system interrupts the processor to handle input from devices such as mouse,
keyboard, printer etc...

An IRQ (interrupt request) value is an assigned location where the computer can expect a particular device to
interrupt it when the device sends the computer signals about its operation.

For example, when a printer has finished printing, it sends an interrupt signal to the computer. The signal
momentarily interrupts the computer so that it can decide what processing to do next. Since multiple signals to the
computer on the same interrupt line might not be understood by the computer, a unique value must be specified for
each device and its path to the computer.

- Used to attend to certain tasks/issues


- Used to make sure that vital tasks are dealt with immediately
- The interrupt/signal tells the CPU/processor (that its attention is required)
- A signal that can be sent from a device (attached to the computer)
- A signal that can be sent from software (installed on the computer)
- The interrupt will cause the OS/current process to pause
- The OS/CPU/ISR will service/handle the interrupt
- They have different levels of priority
- After the interrupt is serviced, the (previous) process is continued
- It enables multi-tasking to be carried out on a computer
- A valid example of an interrupt e.g., ‘out of paper’ message for a printer

Types of interrupts

- Paper jam in a printer


- Pressing <CTRL><ALT><BREAK> keys on a keyboard
- Software trying to divide by zero

Role of Buffers and Interrupts questions:

If only 3-4 marks, then you only need to outline:

- Role of interrupt/definition and how that is used:


o Used to request more data or convey an error
o Signal sent to processor requesting attention
- Role of buffer and how it is used:
o Used to temporarily hold printing data
o Stores data until needed; allows microprocessor to do other tasks, etc.

Vonn Neumann architecture


The stored program concept: program instructions and data are stored in main memory and instructions are fetched
and executed one after another

Fetch and Execute Cycle


The processor fetches data and instructions from RAM memory and executes (carries out) the instructions.

It does this according to the tick of the computers clock.

Fetch

The data and instructions run from the RAM to the processor on a data bus; this means the wires on the
motherboard leading from the CPU pins to the RAM pins.

Once we have identified the memory location in RAM the data at that location is copied onto the Data Bus (parallel
wires on motherboard).

The data flows along the data bus to the Data Register in the CPU (aka MBR). The data is then copied to the Current
Instruction Register (CIR)

Decode

Once the data is in the CIR (instruction register) the opcode is separated from the operand (instruction separated
from data)

Execute

Once the data is in the CIR (instruction register) the opcode is separated from the operand (instruction separated
from data)

The clock

Every computer has an internal clock that regulates how quickly instructions are executed

The faster the clock speed, the more instructions are fetched, decoded and executed

A processor can fetch or execute an instruction for each clock cycle


The clock cycle is measured in hertz (unit of frequency 1 cycle per second) or megahertz (one million cycles per
second 106) or gigahertz (1000 million cycles per second 109)

The stages of the Fetch-decode-execute cycle


▪ The program counter (PC) contains the address of the memory location of the next instruction which has to be
fetched
▪ The address is then copied from the PC to the memory address register (MAR) via the address bus
▪ The contents (instruction) at the memory location (address) contained in MAR are then copied temporarily into
the memory data register (MDR)
▪ The contents (instructions) of the MDR are then copied and placed into the current instruction register (CIR)
▪ The value in the PC is then incremented by 1 so that it now points to the next instruction to be fetched
▪ The address is replaced back into the MAR (memory address register)
▪ The instruction is decoded and then executed by sending the signal (via the control bus) to the various
components of the computer system.

e.g. explain how an instruction in fetched in a Von Neumann model computer

• PC holds address of the instruction

• The address held in PC is sent to MAR...

• ...using address bus

• MAR goes to location in memory where instruction is stored

• Instruction sent to MDR...

• ...using data bus

• Instruction sent to CIR

• Control unit sends signals to manage the process...

• ...using the control bus

1. Program
Address bus
counter PC

6. PC
2. Address
incrimented by
register MAR
1

5. Components 3. Memory
of computer data register
system MDR

4. Current
Control bus instruction
register CIR

Instruction
complete

Registers:
o PC (Program Counter) stores address of next instruction to be processed.
o MAR (Memory Address Register) stores address of next instruction to be processed
o MDR (Memory Data Register) stores an instruction that has been fetched from memory
o CIR or IR ((Current) Instruction Register)
o ACC (Accumulator)
Buses:
Buses are the copper tracks on the motherboard that allows data to flow between the processor, memory (RAM)
and peripherals (keyboard, monitor, hard-drive)

- Control buses

This bus carries signals used to coordinate the computer’s activities: can be uni-directional or bi-directional

- Data buses

This bi-directional bus is used to exchange data between processor, memory and input/output devices

- Address buses

This bus carries signals from the PC to the MAR; it is uni-directional

Other features

• Control unit – controls the flow of data


• Arithmetic logic unit – where calculations are carried out

Chapter 5 Input and output devices.


Input devices
Hardware How the device works Application and how the hardware item is
item used
2d - The most common form of scanners Airport:
scanners - Generally used to input hard-copy (paper) - OCR used to produce digital images,
documents. represents passport pages
- The image is converted into an electronic - Text stored in ASCII form
form which can be stored in a computer. - Passport photo scanned and stored
- Uses a scan head which moves across the as JPEG
image, which uses a mirror to reflect onto a - Face is photographed and compared
charged-coupled device (CCD) which is made to the passport image taken by a
of integrated circuits. digital camera (face recognition)
- OCR (Optical Character Recognition) allows
scanning of text from the document to be
converted to a text file format.
e.g.
(Scanner) shines a light onto the surface of a
document // Light moves across document
– Reflected light is captured
– Uses mirrors and lenses
– Captured image is converted into a digital file
– Produces a 2D digital image
3d - Scan solid object and produce 3D image - Computed tomographic (CT) scanners
scanners - Take images at several points (x, y, z) are used to create a 3d image of a solid
- Scanned images can be used in computer aided object. Tomography builds up an object
design (CAD) or to 3D printer using slices.
- Can use: o X rays – CT scanners
- Lasers o Radio frequencies MRI magnetic
- Magnetic resonance resonance images
- X-rays o Gamma rays – SPECT signal
e.g.
photon emission computed
– Scanners shines a laser (or light) over the surface of tomography.
a 3D object
– Records measurements of the
geometry/dimensions of the object
– Measurements are converted to digital file
– Produces a 3D digital model
Barcode - Series of dark and light parallel lines of varying Supermarket checkout
readers thicknesses - read barcodes to find prices, description
- Numbers 0-9 represented by unique series of - allows automatic stock control
lines, hold up to around 30 digits - advantages to manager:
- left/right sides separated using guard bars - easier and faster to alter prices
- Allows scanning in any direction: - automatic stock control
o Read by red laser/LED • advantages to customer:
o Light reflected off code, dark areas - faster checkouts
reflect little light - less chance of error
o Reflected pattern read by photoelectric - How stock is managed:
cells/sensors − barcode identifies a (unique) product
o Pattern generated is converted to digital − barcode can be used to look up product (in
− Shines light / (red) laser at barcode a database)
− Light is called an illuminator − data about stock levels can be stored on a
− Light is reflected back // White lines reflect light // system
Black lines reflect less light/absorbs light − stock can be automatically deducted from
− Sensors / photoelectric cells detect the light the system
− Different reflections / bars will give different binary − can check stock is below a certain level //
values / digital values // pattern converted to digital check stock level
values − automatic re-order // Alerts when stock is
− A microprocessor interprets the data low
− automatically update new stock level
− to locate if an item of stock is available in
another location
Library system
o can track books on loan
o can link books to borrowers
using barcoded cards
Airport checkouts
- barcodes on luggage to track
whereabouts
Quick - Matrix of filled dark squares on a light - To contain many things such as
response background URL’s, ID’s, Media, etc.
(QR) code - More storage(7000digits) - e.g., explain how QR codes are read
readers - Advantages: - Barcode is captured / scanned /
o No need for user to write down web imaged, by a camera / scanner /
address barcode reader / QR code reader
o Can store websites - Read using a laser
o Can be scanned quickly - Processed by an app
- Light is reflected back
- Black squares reflect less light than
white squares
- Modules are used for orientation /
alignment
- Squares / data are decoded
e.g. explain how information is obtained
from QR codes
• QR code is scanned using a camera on a
mobile device...
• ...and read / decoded using an application
/ software
• Illuminator shone on code
• Squares reflect light differently
• Corners of code are used for orientation
• Opens document with information //
Directs to website with information
• QR code can be saved for future reference
Digital - Controlled by microprocessor - Take photos
cameras - Automatically adjusts shutter speed, focus and
the aperture
- Operates the flash
- Removes ‘red eye’ and hand shake, etc.
- Captured when light passes through lens
- Light sensitive cell
- Cell made up of pixels
- Number of pixels determines file size
Keyboards - Connected to computer by USB or wireless - Type things onto a computer – keys
- Each character has ASCII value, converted to enter data directly into the
digital signal computer
- Processed in cpu
- Slow method
- Error prone
- Computer systems use a keyboard buffer to
stop the microprocessor from being idle
- Can impose health risk (RSI)
How key presses on a keyboard are processes by a
computer:
• Membrane / matrix / circuit board present at base
of keys
• A key is pressed that presses a switch
• When a key is pressed it completes a circuit //
changes the current in a circuit
• The location of the keypress is calculated
• An index of characters is searched to find the
corresponding keypress
• Each character has an ASCII / Unicode value
• The ASCII / Unicode value has a binary value
• Keypress generates an interrupt
• Each character / keypress is added to a buffer to
wait to be processed
• The binary can then be processed by the CPU to
action the key press
Mice - USB or wireless, mechanical ball - Control a cursor on screen
- Or red LEDs detect movement - Select options from menus
Interactive - A user can calibrate the device to make sure
whiteboar the sensors align with a projected image
ds - The user can use either their finger or a
special pen to make selections
Microphon - When sound is picked up, diaphragm Voice recognition system
es vibrates - allows computer to recognise spoken
- Produces electric signal words and use them as input to, e.g., a
- Signal goes through sound card word processor
- Converted into digital values and stored in - compares voice wave patterns to
computer memory
- Voice recognition, when the user's voice is Speech recognition system
recognised and turned into digital. - convert speech patterns to digital
- words broken up into phonemes which
are compared to words in a dictionary.
Multimedia presentations
- allows voice-overs on presentations
Video conferencing/VoIP
- allows users to speak to each other
Sensors - read/measure physical properties Burglar/intruder detection system
(infrared) - Digitises data, sends to microprocessor - detects presence of a person by breaking
- Analogue to digital converter (ADC) beam/change of temperature
converts physical values to digital Monitoring a patient’s vital signs in a
hospital
Monitoring pollution
Automatic doors
- breaking i/r beam allows detection of
person approaching door
Counting, e.g., people/cars
- every time beam is broken it can
automatically send data and allow
automatic counting
Control of street lighting:
- Sensor sends data to ACD
- Sends digital data to microprocessor
- Sample data every minute
- If data from sensor < value in
memory:
o Signal sent from
microprocessor to lamp
o Lamp on

Touch screens:

Used in:

Mobile telephone/tablet

- allows user to select apps/icons


- easy method to input data

Ticket/information kiosk

- limits the options available for ease of use

Capacitive: Infra-red (heat): Resistive:


- Medium cost - Glass as screen material - Upper layer polyester, bottom
- Many layers of glass - Needs warm object for input layer glass – 2 layers with a
- Creating electric fields between operation small space in between
glass plates in layers Infra-red (optical): - They transmit electric current
- When top layer is touched - Grid form array of sensors - When polyester is touched,
current changes which correspond to an infra- layers complete a circuit
- Sensors detect current change red laser - Signals sent out and interpreted
- On-board microprocessor - When laser is broken contact by microprocessor
determines coords of where point based on which coord is - Determines where screen was
screen was touched touched is sent to touched
- Uses the electrical properties of microprocessor by sensors Benefits:
the human body − (Infrared) rays are sent across - inexpensive/cheap to
− Electrical field/charge is spread screen (from the edges) manufacture
across the screen − Has sensors around edge // - can use stylus/finger/gloved
− Sensors are located around the Sensors capture beams finger/pen
screen // sensors are used to read − (Infrared) rays form a grid across Drawbacks:
the electric field the screen - poor visibility in sunlight
− When finger touches screen, the − (Infrared) ray is broken (by a - vulnerable to scratching
charge/ is transferred to the user finger blocking a beam) - wears through time
Sensor Application
infra-red/motion automatic doors:
- place in front of door
- if beam is broken door should be opened
burglar alarm systems
- place in front of door
- if beam is broken alarm should be turned on
temperature chemical process
central heating/air con system
greenhouse environment
oven
sound/acoustic burglar alarm systems
- place in room
- if sound change is detected, alarm should be
turned on
leak detection system
disco lighting
moisture/humidity clothes drier
environmental control (greenhouse, air con)
pressure burglar alarm system
traffic light control
chemical process
carbon dioxide/oxygen/gas pollution monitoring in a river
greenhouse environment (growth control)
confined area (e.g., space craft)
Fish tank/Aquarium
magnetic field mobile phone
anti-lock braking
CD players
pH sensor Acidity in soil
− ...as it is affected by the − Calculation is made (on where - does not allow multi-touch
conductivity of another object beam is broken) to locate the facility
− Coordinates of touch ‘touch’ // Co-ordinates are used to
determined/calculated/measured locate the touch
Benefits: Benefits:
- good visibility in sunlight - good durability
- (very) durable surface - allows multi-touch facility
- allows multi-touch facility - can use stylus/finger/gloved
- Has a quicker response time finger/pen
than resistive Drawbacks:
Drawbacks: - expensive to manufacture
- screen (glass) will - screen (glass) will
shatter/break/crack (on impact) shatter/break/crack (on impact)
- cannot use when wearing - sensitive to dust/dirt
(standard) gloves

Sensor questions
Answering a short sensor question:

State the name, where you put it and how it works/what it does.

Answering a sensor question about microprocessors:

Sensor (make sure to name specific sensor) -> ADC (analogy to digital converter) -> send data to microprocessor ->
compare data with predetermined value ->if data met, something happens -> output to output device.

e.g., explain what is meant by the term sensor

It is an input device

It measures/takes (physical) readings of the surrounding environment / environment by example / physical


properties

Benefits of using sensors

• Can work continuously

• Avoids human error

• It could be a dangerous environment and will avoid human risk

• Detect errors instantly

• Maintain consistent and correct conditions

Analogue and Digital data

The data from a sensor must be converted from analogue to digital to be processed by a computer

Analogue data is

- Continuous data
- Non-discrete data
- e.g. data such as a sound wave

Digital data is

- Discrete data that has only two values


- e.g. binary data/1s and 0s

Output devices
Type of printer Advantages Disadvantages
Laser • Very high quality of printing • Can be expensive to
• Relatively inexpensive to maintain (e.g., fusers)
buy printer • Produce health hazards
• Large toner cartridges and such as ozone or toner
large paper trays particles in the air
• Very fast printing of
multiple documents
Inkjet • High quality of printing • Ink is expensive to buy and
• Very suitable for printing quickly runs out on a large
photos print run
• Inexpensive to buy printer • Usually have small paper
trays
• Can be noisy in operation
compared to laser printer
Dot matrix • Not adversely affected by • Relatively expensive to buy
damp or dirty/dusty printer
atmospheres • Poor print quality
• Allows use of multi-part • Very noisy and very slow at
stationery (carbon copies) printing
• Allows use of
continuous/fan-folded
stationery

Hardware item How the device works Application and how the hardware item
is used
Inkjet printers - uses cartridges/liquid ink - Used for one-off photos and
- sprays ink in droplets on the paper line documents where a few pages of
by line from a moving print head good quality, colour printing are
- makes use of thermal bubble (tiny needed.
resistors heat up ink into a bubble, - Benefits of inkjet: printing may be
which pops and ejects higher quality, can use larger paper
heat)/piezoelectric technology (a tiny sizes, can print onto different
crystal with a tiny electric charge media, no warm-up time
vibrates, ejects ink) - Drawbacks: printing will be slower,
- suitable for low volume (high quality) ink is more expensive per page, ink
output, e.g., a photo can be smeared//is not smudge
Describe how the inkjet printer prints an proof
image
− Rollers are used to move the paper
through the printer
− Nozzles spray/drop/jet ink onto the paper
− Ink jets/print head/nozzles are moved
across the paper (to distribute the ink)
− Different colour inks are mixed to create
required colours
− Technology could be piezoelectric
− Technology could be thermal bubble

− Ink is heated
− ...and expands/evaporates into a bubble
− Bubble is pushed through the nozzle on to
the paper
− ...then the bubble collapses

− Electrical current is applied to a crystal


− ...which makes it vibrate
− ...which forces a droplet of ink through the
nozzle
Laser printers - makes use of static electricity charges: - Produce high quality printouts
uses a positively (charged) printing drum and are very fast when
and negatively charged paper producing multiple copies of a
- uses powdered ink/toner cartridges document.
which only sticks to certain areas. - They are used often for
- uses a fuser to fix/melt ink onto the advertisements as well, as a
paper large number of high-quality
- uses a discharge lamp to remove static flyers or poster are used.
charge from the drum - Laser printers have two
- useful for high volume (very high quality) advantages over inkjet: they
output, e.g., leaflets have large toner cartridges and
large paper trays.
3D printers - produces solid, 3D objects/prototypes - Making prosthetic limbs, assisting
- used in CAD/CAM - precision reconstructive surgery
- makes use of tomography/slices of an - manufacture of aerospace parts
object - fashion and art
- solid built up in thin layers - making parts no longer in
- uses resin, powdered metal, paper, production by conventional
plastic… manufacturing.
2d cutters - x and y coords - Metal, glass, crystal, polymer and
- cuts materials into 3D objects and are wood
controlled by computers and software.
(cad)
3d cutters • uses x y and z cords • Metal, glass, crystal, polymer
• cuts materials into 3D objects and and wood
are controlled by computers and
software. (cad)
e.g. explain how a 3D cutter could produce
the models
• Design is created on the computer /
software / CAD
• Material is loaded to cutter
• Different types of material can be used
• Uses lasers to cut material...
• ...that use infra-red
• ...that produces extreme heat
• ...that is focussed using a special lens
• Can work on both the x,y and z axis
Speakers/Headphones DAC = digital to analogue converter

Sampling: converting analogue audio/video


signal to sound using a DAC

Sampling rate
Most CDs have a sample frequency of 44,100
hertz (samples per second)

Bit rate: accuracy of sound, bits used per


second of audio
Bit depth: number of bits of info in each
sample (higher = better quality)
Actuators - Hydraulic, Pneumatic and electric
- Converts energy into motion
- Motor type responsible for
moving/controlling mechanism or
system.
- operated by a source of energy, e.g.,
electric current, hydraulic fluid pressure.
Flat-panel display Light crystal display (LCD)/Light emitting LCD/LED advantages over old cold
screens, LCD display and diode (LED) cathode fluorescent lamp (CCFL):
LED display - Diodes are grouped in 3s - no need to warm up reaches
- Backlit by LEDs because: maximum brightness much
- Reach max brightness instantly faster
- Whiter light/sharper pics - uses much less power/more
- Brighter efficient
- Longer lasting - whiter tint more vivid
- Little power colours/brighter image
Organic light emitting diodes (OLED) - higher resolution
- Flexible monitors, organic carbons - much thinner monitors
- Curved screens possible/lighter weight
- Very thin - last almost indefinitely more
- Plastic not glass reliable technology/longer
- Doesn’t need backlighting lasting
OLED advantages over LED:
- allow for very thin and flexible
screens which are lightweight
- brighter light
- no backlighting
- larger field of view
LCD projectors - Older technology - Chromatic-coated mirrors to
- Higher intensity light reflect at different wavelengths
- Light sent to mirrors - Light components pass through
- Reflected at diff wavelengths three LCD screens
- Red, blue, green - Then recombined using a prism
- Passes through 3 LCD screens to produce colour image
- Red, blue, green version emerges - projected onto screen
- Passes through projector lens onto
screen
DLP projectors - Millions of micro mirrors on DLP chip - Light sent to millions of micro
- Mirrors tilt towards light source (on) mirrors which turn on or off to
- Tilt away (off) create various shades of grey
- Mirror number/arrangement = - Colour filters (Red, blue, green)
image resolution allow projected light to be
- Xenon (white) bulb passes through coloured
colour filters on way to chip for - projected onto screen
colour
- e.g., how a DLP displays an image
- Uses a large number of tiny mirrors
- Mirrors are laid out in a grid/matrix
- Each mirror creates a pixel in the
image
- Mirrors can tilt toward or away from
light source
- The mirrors reflect light toward a
(projection) lens
- Colour is produced using a colour
wheel // Light passes through colour
wheel // filters light into
red/green/blue
- Can be used to display an image on a
wall/screen

Chapter 6 Memory and data storage


Memory, storage devices and media

MEDIU TYPE CAPACI SPEED PORTABILITY DURABILITY RELIABILITY TYPICAL USE


M TY OF
ACCES
S
HARD Magneti 500 GB- Slow Internal Reasonable, Generally, very Long-term storage of
DISK c 12 TB devices are but prone to reliable if programs and data
fixed. damage if looked after
External dropped or
hard disks knocked
are portable
CD- Optical 640 MB Very Very Easily Generally, very Backups, archives,
ROM/R slow portable scratched, reliable if copies of data,
damaged or looked after distribution of
broken programs and music
CD-RW Optical 640 MB Very Very Easily Generally, very Copies of data,
slow portable scratched, reliable if transferring files
damaged or looked after between computers
broken
DVD- Optical 4.7 GB Slow Very Easily Generally, very Backups, copies of
ROM/R portable scratched, reliable if data, distribution of
damaged or looked after games, TV
broken programmes and
movies
DVD- Optical 4.7 GB Slow Very Easily Generally, very Backups, archives,
RW portable scratched, reliable if copies of data
damaged or looked after
broken
BLU- Optical 50 GB Slow Very Easily Generally, very Distribution of TV
RAY- portable scratched, reliable if shows and movies
ROM/R damaged or looked after
broken
BLU- Optical 50 GB Slow Very Easily Generally, very Backups, archives
RAY- portable scratched, reliable if
RW damaged or looked after
broken
SOLID- Flash 256 GB- Very Internal Robust and Reliable Long-term storage of
STATE memory 4 TB fast devices are resilient programs and data
DRIVE fixed. where high
External performance is
hard disks required. To store
are portable files/software
USB Flash 2 GB-2 Fast Very Robust and Reliable Copies of data,
MEMO memory TB portable resilient transferring files
RY between computers
STICK

Primary storage

Memory that is directly accessible by the CPU, it can only be internal to the computer. It has a faster access speed
and is both volatile and non-volatile. It stores boot up instructions and can hold data whilst being processed.

ROM

- Stores default settings and start up


- BIOS and firmware
- Non-volatile permanent memory – read only
- Primary storage
- Used to boot up the computer when power is turned on
- Contains the setting for frequency.
- Contents are retained when power is turned off
- Cannot be written to
- e.g. to store the firmware/bootup instructions/BIOS
- E.g EEPROM
o pcs/phones as firmware are easily updated
o Electrically erasable programmable
RAM

- Read and write


- Volatile temporary data
- Stores instructions/programs/data currently in use and data/files before save
- Larger ram = faster, higher capacity
- e.g. to store data/instructions/parts of the OS that are currently in use
- Holds buffers
o Buffers hold temporary data
- Two types:
o Dram:
o Sram:

e.g. why a smartphone needs RAM and ROM


− It needs RAM to store the data and programs currently in use
− It needs ROM to permanently store the boot up instructions

DVD-RAM

- optical media which uses concentric tracks to store the data


- this allows read and write operations to be carried out at the same time

Secondary storage

Memory that is not directly accessible by the CPU, it is internal to the computer. It has a slower access speed and is
non-volatile. It stores files/software. Examples include HDD/SSD
Hard disk drive (HDD)

- Data stored magnetically on surface


- Read in blocks
- High latency (time to read/write)
- Data files, apps, system
- Cheaper for larger amounts of storage space
- HDD has greater longevity for read/write functions

Solid state drive (SSD)

- Non-volatile memory device


- Uses NAND flash memories (millions of transistors wired in series on single circuit boards)
- e.g. to store files/software
- Has a quick start up/shut down time, reduces latency so more efficient – less latency // takes less time to warm
up
- More robust/hard wearing
- Lighter, smaller, thinner - more compact/light weight/smaller/portable
- More reliable
- Lower power, does not generate a lot of heat (therefore safer in this application) - uses less energy // battery will
last longer
- No moving parts // more durable
- Quieter
- Not affected by magnetic forces
- Phones, high end pcs, cameras
- faster random access – has a faster read/write/access speed
- Questionable longevity 20GB/day

Off-line storage

- Non-volatile storage
- Storage that can be disconnected/removed from the computer. Can be easily disconnected from the
computer -> removable from a computer // not internal // portable
- Not directly accessed by the CPU
- Must be (physically) connected to computer to obtain stored data
- Used to store files as a backup
- Examples include CD/DVD/USB stick/SD card/

DVD

• Red laser light uses to read/write data on surface


• Thin layer of metal alloy to store data
• Optical media which uses single, spiral track.
• Runs from disk centre to edge
• DVD uses duel layering technology, increases storage (two polycarbonate layers)

CD

- Red laser light uses to read/write data on surface


- Thin layer of metal alloy to store data
- Uses single, spiral track.
- Runs from disk centre to edge
- Pits and lands are read

How data is read on a CD:

- (Red) laser is used


- (Laser beams) shines onto surface of the disk
- It is rotated (at a constant speed) to be read
- Surface is covered in a track (that spirals from the centre)
- Data is represented on the surface using pits and lands
- Pits and lands represent binary values
- Pits reflect light back differently (to the area in between/land)
- Optical device can determine the binary value from the light reflection

Blu-ray

- Blu-ray discs use blue/violet lasers to read or write operations


- Blu-ray discs have a higher storage capacity (5x standard DVDs)
- Wavelength is less than CD/DVD.
- Blu-ray discs use one 1.1 mm polycarbonate layer
- Blu-ray discs have a built-in secure encryption system

e.g. differences between DVDs and Blu-ray discs


− DVD uses red laser/light whereas Blu-ray uses blue/violet laser/light

− DVD has a smaller (storage) capacity // Blu-ray has a larger (storage) capacity

− DVD has two layers (of polycarbonate) whereas Blu-ray disks have a single layer (of polycarbonate)

− DVD has a slower transfer rate (of approximately 10 mbps) // Blu-ray has a faster transfer rate (of approximately
36 mbps)

USB

- Solid state so treated with care


- Small and lightweight
- Suitable for transferring files
- Back up devices for photos, music etc
- Non-volatile memory device
- Uses NAND flash memories (millions of transistors wired in series on single circuit boards)

Removable HDD

Operation of types of storage devices.


Magnetic storage

Magnetic devices such as hard disk drives use magnetic fields to magnetise tiny individual sections of a metal
spinning disk. Each tiny section represents one bit. A magnetised section represents a binary '1' and a demagnetised
section represents a binary '0'. These sections are so tiny that disks can contain terabytes (TB) of data.

As the disk is spinning, a read/write head moves across its surface. To write data, the head magnetises or
demagnetises a section of the disk that is spinning under it. To read data, the head makes a note of whether the
section is magnetised or not.

Magnetic devices are fairly cheap, high in capacity and durable. However, they are susceptible to damage if dropped.
They are also vulnerable to magnetic fields. A strong magnet might possibly erase the data the device holds.

EXAMPLES:

HHD

Reasons for choosing magnetic storage rather than solid state

• More read/write cycles (over its lifetime) // greater longevity...

• ...likely to be a lot of read/write functions each day

• Read/write speed is sufficient...

• ...even though it is slower than solid-state

• Cheaper per unit of data stored...

• ...better value for the company to purchase

• ...so the law company can afford to buy a server with greater storage capacity

• No requirement for portability...

• ...as a server, it does not need to be moved

• Trusted technology...

• ...it has been traditionally used for many years

Optical storage
Optical devices use a laser to scan the surface of a spinning disc made from metal and plastic. The disc surface is
divided into tracks, with each track containing many flat areas and hollows. The flat areas are known as lands and
the hollows as pits.

When the laser shines on the disc surface, lands reflect the light back, whereas pits scatter the laser beam. A sensor
looks for the reflected light. Reflected light (lands) represents a binary '1', and no reflection (pits) represents a binary
'0'.

Optical media also come in different types:

• ROM media have data pre-written on them. The data cannot be overwritten. Music, films, software and
games are often distributed this way.
• R media are blank. An optical device writes data to them by shining a laser onto the disc. The laser burns pits
to represent '0's. The media can only be written to once but read many times. Copies of data are often made
using these media.
• RW works in a similar way to R, except that the disc can be written to more than once.

EXAMPLES:

CD, DVD, Blu-ray discs

How data is written to optical storage media

- The disc is rotated/spun


- Laser beam is used
- The laser beam makes indentations on the surface of the disc/pits and lands
- The data is written in a spiral/concentric tracks
- The pits and lands represent binary values/1s and 0s
- It is called burning data to the disc

Solid state storage

Solid state devices use non-volatile random-access memory (RAM) to store data indefinitely. They tend to have
much faster access times than other types of devices and, because they have no moving parts, are more durable.

Since this type of memory is expensive, solid state devices tend to be smaller in capacity than other types. For
example, a solid-state drive that holds 256 GB might be of a similar cost to a hard disk with several terabytes
capacity.

Solid state devices require little power, making them ideal for portable devices where battery life is a big
consideration. They are also portable due to their small size and durability.

EXAMPLES:

SSD, USB

Reasons for choosing solid state/advantages of solid state

- It has no moving parts so will be durable


- It is small/compact so it can be easily fit onto the device
- It is light so it will not be difficult to lift for the drone
- It can hold the large amount of data needed for the video/film footage
- Uses less power so drone battery will last longer

Data storage
Sound file examples: mp3, wav

Picture examples: png, jpeg

Video examples: mp4, mkv


Text and numbers .txt

Error detection and correction


Parity check:

Parity checking is used to check whether data has been changed or corrupted following transmission from one
device to another. A byte of data is allocated a parity bit

Systems that use even parity have an even number of 1-bits

Systems that use odd parity have an odd number of 1-bits

An error might be not identified because an even number of bits are transposed, or two bits are interchanged.

- Checks a byte of data


- Check is performed when data is received
- A parity bit is added (to the parity byte)
- Counts / checks number of 1’s // counts / checks to see if 1’s are even // counts / checks to see if 1’s are odd
- Can be even or odd
- Each byte is checked after transmission to check against the parity
- If parity is incorrect, error is detected

A parity check CANNOT detect data corruption in 2 situations:

• An even number of bits are changed


• Transposition error has occurred.

e.g. when identifying which parity bit is incorrect and explaining how you found the error

- Count the number of 1/0 bits (in each byte/register)

− Two bytes/registers have an odd number of 1/0 bits // Two use odd parity

− Odd parity must be the parity used

− One byte/register has an even number of 1/0 bits // One uses even parity

− One with an even number of one bits/even parity is incorrect // Register C should have odd parity

Echo checks:

Data is sent back again after being sent to another device, and the sender compares the two sets of data to check if
any errors have occurred during the transmission process. Not reliable because the data can become skewed with
both ways.

Check digits:

An extra value is transmitted to help determine if the data received is correct or incorrect. This value is known as a
check digit. The value of the check digit is usually calculated from the other data being sent

• A digit that is calculated from the data // uses modulo to calculate digit // valid description of modulo //
Multiply each digit by its position and add together, divide the sum by a set number and use remainder as
check digit.
• It is appended / added to the data
• Digit is recalculated when data is entered
• Digits are compared to check for error
• If digits are different, error is detected // If digits match, no error is detected

Checksums:
Another way to find whether data has been correctly transmitted using data sent in blocks and an additional value.
Checksum is another way to see if data has been transmitted correctly. Data is sent in blocks and an additional value
sent at the end of the block.

• A value is calculated from the data // Valid description of calculation


• It is transmitted with the data
• Value is recalculated after transmission
• Values are compared after transmission to check for error
• If values match the data is accurate

ARQ:

ARQ is another method to check if data has been transmitted correctly

It uses a timeout and acknowledgement (message sent by the receiver indicating that data has been received
correctly)

- Uses acknowledgement / request and time-out


- Error control protocol
- Check performed on receiving data // error is detected by e.g. parity check, check sum
- If error detected, request is sent to resend data // negative acknowledgement is used
- Resend request is repeated till data is sent correctly / requests time out / limit is reached
- Send acknowledgement that data is received // positive acknowledgement is used
- If acknowledgement not received in set time data is resent – process is continuous until correct

Storage files
MIDI files:

Standard adopted by the electronic music industry for controlling devices such as synthesisers and sound cards. MIDI
only stores or transmits commands about the music (the notes etc), and not audio signals.

Comms protocol allows electronic instruments to interact

Stored as demands not notes

Uses 8-bit serial, asynchronous

• Sequence:
• First byte is status byte informs MIDI what function
• MIDI channel is encoded in status byte

E.g.

- Note on/off indicates key was pressed


- Key pressure

Needs a lot of memory

e.g. describe what is meant by a MIDI file

• Musical Instrument Digital Interface file

• Stores a set of commands / instructions for how the sound should be played

• Does not store the actual sounds

• Data in the file has been recorded using digital instruments

• Specifies pitch of the note // specifies the note to be played

• Specifies when each note plays and stops playing // Specifies key on/off
• Specifies duration of the note

• Specifies volume of the note

• Specifies the tempo

• Specifies the type of instrument

JPEG:

- File compression format designed to make photo files smaller in size for storage and for transmission
- Joint photographic Experts Group
- JPEG used to reduce photo file sizes
- Reducing resolution = changing pixels per cm
- JPEG reduce bitmap by a factor between 5 and 15
- Lossy compression

mp3:

- Uses Audio Compression to convert music/sounds to MP3 file


- This compression reduces size by 90%
- Compression algorithms use Perceptual Sound Shaping
- Removes sounds ear cannot hear
- Sounds removed without affecting quality much
- CD files converted using File Compression Software
- Lossy format as original file lost in compression algorithm
- Data is permnantly removed

mp4:

• Allows storage of multimedia files (not just sound)


• Music, videos, animations, photos, etc
• Videos could be streamed without losing discernible quality

Data compression
Benefits of compression (general)

• File size is reduced...

•... so it uses less storage space

• ...so faster transmission

• ...so quicker to download

Lossless:

- The file is reduced in size for transmission and storage; it is then put back together again later producing a
file identical to the original
- A type of file compression that doesn't lose any data or quality (used in text files)
- Repeating patterns are replaced by data, so that the full quality can be later retrieved, by a compression
algorithm.
- All data bits from original file are reconstructed when file is uncompressed
- Good for files where data loss would be bad
- .zip files are lossless

How a file is compressed using lossless compression:

- a compression algorithm is used


- no data is lost in the process // original file can be restored
- Repeated words are identified // patterns in the data are identified
- … and are indexed/put into a table
- … and are replaced with their index
- … and their position are stored (in the table)
- … and the number of times the word/pattern appears is stored (in the table)
-
- repeated words/patterns can be indexed // repeated sections of words/patterns can be indexed // given by
example
- The indexed words/patterns can be replaced with numerical values // given by example

Specifically image files using lossless ]

− A compression algorithm is used

− No data is removed in the compression process

− An index/dictionary of pixels is created

− The number of times a pixel is repeated in a row is stored

e.g. why you would use lossless (particularly when compressing source code)

− The file can be restored/decompressed to the exact same state it was before compression/ to original

− (It is a computer program so) no data can be lost // Lossy would remove data

− Will not run correctly (with any other compression)

− (Lossless) will give repeating words/sections of word a value// RLE is used // Other valid examples of methods of
lossless compression

− Value is recorded in an index

Lossy:

- Reduction of file size by permanently removing certain, redundant information from the file
- It is a type of file compression that results in lost data and quality (used in music and images) and file is not
exactly like the original (but difference is usually not noticeable)
- File compression algorithm eliminates unnecessary data bits like MP3 and JPEG
- Cannot get original file back once compressed

e.g. describe how sound files are compressed using lossy compression

• A compression algorithm is used

• Discards any unnecessary sounds...

• ...using perceptual musical shaping

• ...such as removing background noise / sounds humans can’t hear // or other suitable example

• Reduces sample size / resolution // by example

• Reduces sample rate // by example

• Sound is clipped

• The data is permanently removed

Advantages of lossy and lossless

Advantage of lossy

- File size smaller than lossless


- Requires less storage space
- Requires less time to transmit

Disadvantages of lossy

- Quality of sound will be reduced


- Original file cannot be restored

Run Length Encoding:

Form of lossless data compression in which runs of data are stored as a single data value and count, rather than as
the original run.

Chapter 7 High and low level languages


High level:
- close to English/native/human language
o easier/faster to correct errors/read/write/understand
o easier to debug at development stage
o therefore, less likely to make errors
- easier to maintain once in use
- works on many different machines/operating systems (portable)
o because it is compiled into object code
o because it is written in source code
o only need to learn one language
- They have built-in functions/libraries
o Saves time when writing the program
- No need to manipulate memory addresses directly
o therefore, specialist knowledge of this is not required

Low level:
1. refers to machine code
2. binary instructions, computer understands => faster, less memory
3. work directly on registers/CPU
4. more control over what happens in computer
5. can use machine specific functions

Features of LLL:
− Closer to/is machine code
− May use mnemonics
− May need an assembler to be translated
− One line of code represents a single instruction
− Machine dependent
− Have direct access to memory locations/registers

Examples of LLL:
− Assembly code
− Machine code

Drawbacks of writing in a LLL:


− It is more difficult to understand
− Error prone
− Have to manipulate memory locations
− Machine dependent

Assembly languages
- use mnemonic codes
- need a translator to be executed
- specific to the computer hardware
- is not machine code
- often used to create drivers for hardware

Translators:
- High level languages need translators to convert code into machine code/binary and low level code needs to be
produced that can be understood by the computer
- Compilers and interpreters both translate high-level languages into machine code
- Assemblers translate programs written in assembly code

Compiler Interpreter Assembler

- Translates program in high level to - Translates high-level language - Low level to machine code
machine code/LLL into machine code/LLL - Executable machine file
- Executable machine code file - Translates line by produced
produced. line/statement by statement - 1 low level statement to 1
- One high level can make several - Stops if it finds an error machine instruction
machine statements - Will only continue when error is - Can be used without
- Compiled program for general use fixed assembler.
- Generates an error report at the end - No executable machine file - Assembled program for
of translation of the whole program produced. general use
- Translates the entire program in one - One high level may require
go several low level lines
- Interpreted programs require
interpreter.
- Used when program is
developed

Benefits of compiling:

• Code will run without the need of an interpreter

• (Object) Code is platform independent

• Source code not available / cannot be modified

Drawbacks of compiling:

• Source code not available / cannot be modified

• Comments, etc. not visible


• Future changes will require code to be recompiled

Chapter 8 Security and ethics


Security aspects
Malware
Hacking

It can:

- Lead to identity theft and gain of confidential data.


- Data can be deleted, changed and even corrupted.

Prevention:

• Firewalls
• Use of strong passwords and user ids / biometrics
• Anti-hacking software.
• (two-step verification//two-factor authentication)

Two-step//two-factor:

• Extra data is sent to device, pre-set by user

• ...making it more difficult for hacker to obtain it

• Data has to be entered into the same system

• ...so if attempted from a remote location, it will not be accepted

Viruses:

Viruses are programs or a program code which can replicate itself with the intention of deleting or corrupting files,
or cause the computer to malfunctions.

It can:

- Delete files and data and it can corrupt them.


- Cause the device to crash and not respond.

Prevention:

• Anti-virus software’s
• Staying alert and aware of the emails you open
• Not using software’s from unknown resources.

Anti-virus software:

• Scans the computer system (for viruses)

• Has a record of known viruses

• Removes/quarantines any viruses that are found

• Checks data before it is downloaded

• ...and stops download if virus found/warns user may contain virus

Phishing:

Phishing is run by a person or a creator that sends out a legitimate looking email and as soon as the recipient clicks
on the link, they are sent to a fake website.
It can:

• Access personal data and this can lead to fraud or identity theft.

Prevention:

- ISPs filters on emails


- The user should be alert and aware when opening unknown attachments.

e.g. explain what is meant by phishing

A legitimate looking email is sent to a user

The email will encourage the user to click a link/open an attachment

The link will redirect a user to a legitimate looking webpage (to steal personal data)

Pharming:

Pharming is a code installed on a user’s hard drive or on the web server; the code will re-direct the user to a fake
website without the user knowing.

It can:

- Get access to personal data and leads to fraud or identity theft.

Prevention:

- Anti-spyware software
- The user being alert and aware of strange emails from unknowns.

e.g. explain what is meant by pharming

A malicious code is installed on a user’s hard drive/server

The code will cause a redirection to a legitimate looking webpage (to steal personal data)

Wardriving:

The act of locating and using wireless internet connections illegally; it only requires a laptop (or other portable
device), a wireless network card and an antenna to pick up wireless signals.

It can:

- Lead to the users internet time to be stolen


- It is very easy to steal a user’s password and personal details.

Prevention:

- Use Wired Equivalent Privacy (WEP) encryption.


- Having a complex password before the internet can be accessed.
- Use firewalls to prevent outsiders from gaining access.

Spyware/Key-Logging software:

Software that gathers information by monitoring key presses on the user’s keyboard; the information is then sent
back to the person who sent the software. This gives access to all the data entered using a keyboard on the user’s
computer.

• Malicious software // type of malware

• Tracks / records keypresses // keylogger

• Sends data to third party


• Collected data is analysed to obtain data

It can:

- The software is able to install other spyware.


- Read cookie data
- Change user’s default web browser.

Prevention:

• The use of anti-spyware data.


• Look out for clues that their keyboard activity is being monitored.
• Use mouse to select characters for passwords, rather than keyboard to reduce risk.

How to reduce the impact of spyware when logging on to something

Drop-down boxes // onscreen / virtual keyboard • Means key logger cannot collect data.... and relay it to a third
party

Only requires part of the password • Hacker doesn’t get the full password

Two-step verification // Two-factor authentication • Extra data is sent to device making it more difficult for hacker to
obtain it • Data has to be entered into the same system // if attempted from a remote location, it will not be
accepted

e.g. describe how keylogging software can be used to gain unauthorised access to a customer’s account

− Keylogger is downloaded without knowledge (by example)

− Keylogger records key presses

− Data is relayed back to third party

− Data is analysed // Patterns in data could reveal log-in details …

− … details can then be used to log into the account

Anti-spyware software:

• Scans the computer for spyware

• Removes/quarantines any spyware that is found

• Can prevent spyware being downloaded

Protection software
VPN (Virtual Private Network): is a method used to add security and privacy to private and public networks. It is
recommended to use in the dark and deep web.

Denial of Service (DOS): An attack that floods networks send request after request until the network itself shuts
down/cannot cope with however many requests.

e.g. explain what is meant by as DoS attack

− Designed to deny people access to a website

− A large number/numerous requests are sent (to a server) ...

− ...all at the same time

− The server is unable to respond/struggles to respond to all the requests

− The server fails/times out as a result


Security devices that can be used to help prevent a DoS attack:

- Firewall
- Proxy server

Keeping data safe


Data must be kept safe when stored and transmitted from:

• Malicious actions, unauthorised viewing, deleting, copying and corruption


• Accidental damage, including corruption and human errors

Ways that data can accidentally be damaged

- Human error (e.g. deleting/overwriting data)


- Physical damage
- Power failure/surge
- Hardware failure

How to keep data safe from accidental damage:

- Back data up
- Use surge protection
- Follow correct procedure – regularly saving
- Keep data in a fireproof/waterproof/protective case
- Use verification methods (for deleting files)

Passwords should be complex, different and shouldn’t be meaningful. It should be irrelevant, something like:
W23502Q@#BD9304H.

Bio-metric systems: Bio-metric systems are systems that are protected with things like facial recognition, retina
scan, fingerprints, etc.

Passwords/biometric

- Data cannot be accessed without the use of the password / bio data
- Prevents brute force attacks

Passwords (how they protect)

- Make password stronger


- Change it regularly
- Lock out after set number of attempts // stops brute force attacks // makes it more difficult to guess

Biometric (how they protect computers)

- Data needed to enter is unique to individual


- … therefore very difficult to replicate
- Lock out after set number of attempts

e.g. explain why modern smartphones are secured with a biometric system

− Adds extra level of security

− Biometric device requires properties unique to individual

− Allows quicker access as no need to input password // don’t need to remember password

e.g. how to improve the security of a log on system

• Make the password require more characters • Makes the password harder to crack/guess • More possible
combinations for the password
• Make the password require different types of characters • Makes the password harder to crack/guess • More
possible combinations for the password

• Use a biometric device • Hard to fake a person’s biological data // data is unique

• Two-step verification // Two factor-authentication • Adds an additional level to hack • Have to have the set device
for the code to receive it

• Drop-down boxes // onscreen keyboard • To prevent passwords being obtained using keylogger

• Request random characters • Won’t reveal entire password

• Set number of password attempts • Will lock account if attempting to guess • Will stop brute-force attacks

Firewalls: Hardware or software based security layer that is positioned between the internet and network/user
device. Allow a user to set rules for network traffic. Can be used to block access to certain websites. (They do not
automatically stop all malicious traffic)

- It examines/monitors incoming/outgoing traffic.


- they operate by checking traffic against a set of rules/checks traffic meets any criteis set
- blocks unauthorised traffic which do not fit into those rules/criteria– stops unauthorised access (e.g. hacking)
- Identifies suspicious files/phrases and notifies administrator if anything is flagged.
- White-lists/black-lists websites/applications. // can block certain IP addresses
- The administrator gets monitor.
- can be software and hardware
- cannot act as intermediary servers
- keeps a log of all traffic
- Can close certain ports

Proxy Server: Remember the websites you have visited and remembers all the information with it. It keeps the users
IP hidden. Acts as a firewall if a firewall isn’t present on a network (limited functionality).

- Prevents direct access to the webserver // Sits between user and webserver.
- If an attack is launched it hits the proxy server instead // can be used to help prevent DDOS // help prevent
hacking of webserver.
- Used to direct invalid traffic away from the webserver
- Traffic is examined by the proxy server // Filters traffic
- If traffic is valid the data from the webserver will be obtained by the user
- If traffic is invalid the request to obtain data is declined
- Can block requests from certain IP addresses

Security Protocols:
Secure Sockets Layer (SSL)

Secure Sockets Layer (SSL) is a type of protocol (a set of rules used by computers to communicate with each other
across a network). This allows data to be sent and received securely over the internet.

When a user logs onto a website, SSL encrypts the data only the user’s computer and the web server are able to
make sense of what is being transmitted. A user will know if SSL is being applied when they see https or the small
padlocks in the status bar at the top of the screen. Padlocks suggests that it is safe and secure

What happens when a user wants to access a secure website:

- The users web browser sends a message so that it can connect with the required website which is secured by
SSL.
- The web browser then requests that the web server identifies itself ‘
- The web server responds by sending a copy of its SSL certificate to the users web browser
- If the web browser can authenticate this certificate, it sends a message back to the web server to allow
communication. Sends signal back to webserver that certificate is authentic/trustworthy (browser authenticated
certificate, if authentic, connection is established)
- Once this message is received, the web server acknowledges the web browser, and the SSL-encrypted (can be
asymmetric, symmetric or both) two way data transfer begins.
- Makes use of (public and private) keys to encrypt data. Encrypted data is meaningless (without decryption key /
if intercepted) (any data sent is encrypted using public and private keys)

e.g. describe the process of SSL and how it provides a secure connection

• SSL is a (security) protocol

• It encrypts any data that is sent

• It uses/sends digital certificates...

• ...which is sent to the (buyer’s/user’s) browser // requested by (buyer’s/user’s) browser

• ...that contains the gallery’s public key

• ...that can be used to authenticate the gallery

• Once the certificate is authenticated, the transaction will begin

Applications that use SSL

- Online banking
- Online shopping
- Email
- Cloud based storage
- VPN
- Video conferencing
- Social networking/online gaming

Transport Layer Security (TLS)

Transport Layer Security (TLS) is similar to SSL but is a more recent security system. TLS is a form of protocol that
ensures the security and privacy of data between devices and users when communicating over the internet. It is
designed to provide encryption, authentication and data integrity in a more effective way.

When a website and user are communicating over the internet, TLS is designed to prevent a third party user or
device into this communication since this causes problems with data security.

TLS is formed of 2 layers

- Record protocol, this part of the communication can be used with or without encryption (it contains the data
being transferred over the internet).
- Handshake protocol: this allows the website and the user to authenticate with each other and make use of
encryption algorithms (a secure session between the website and user is established).

Applications of TLS

- Online banking
- Online shopping // Online payment systems
- Email
- Cloud based storage
- Intranet/extranet
- VPN
- VoIP
- Instant messaging (IM) // social networking
Encryption:
Encryption is used to protect data in case it has been hacked. Encryption makes the data meaningless unless it
somehow gets decrypted. There are 2 types of encryptions:

- Symmetric Encryption
- Asymmetric or Public Key Encryption

Symmetric Encryption

Symmetric Encryption is a secret key which can be a combination of different characters. If this key is applied to a
message, its contents is changed and makes it unreadable unless a user has a decryption key which fixes the
problem. One key is needed to encrypt a message and another key is needed to decrypt message.

Increasing the length of the key increases the level of security

However this key is very vulnerable to Key Distribution Problem. So the sender and receiver have to have to same
key for encryption and decryption. The sender has to send the key to the receiver and if somehow it gets
intercepted by a hacker, this can lead to a failure in encryption and security making the contents unprotected. The
hacker can easily decrypt the file/data. There is also an encryption algorithm where you use an algorithm to unlock
the file and keep the data safe.

Asymmetric Encryption

This type of encryption is a safer and more secure method.

- Public Key is a key that is made available to everybody


- Private Key is a key which is only known by the computer user.

Both type of keys is needed to encrypt and decrypt messages. It works like this:

- First User A applies a symmetric key to encrypt the message


- Then the symmetric is then encrypted using the public key known to both A and B.
- User A sends the message over the internet
- User B decrypts the symmetric key by applying their known private key
- The decoded symmetric key is used to decrypt the message sent by User A.

Plain Text: Plain Text is normal text/data before it goes through encryption.

Cypher Text: Cypher text is the output from an encryption algorithm.

Authentication: Authentication is used to verify that data comes from a trusted source. It works with encryption to
strengthen internet security.

e.g. Identify three methods to make online banking safer

- Strong password To make it difficult to hack an account


- Biometric device To use data that is difficult to fake as a password
- TLS // Encryption To make data meaningless if intercepted To encrypt data that is exchanged (TLS only) More
secure than SSL (TLS only)
- Anti-spyware (software) To find and remove any spyware that is installed on a computer To help stop key
loggers recording key presses
- Firewall To help prevent unauthorised access to an account Blocks any requests that do not meet/match the
criteria
- Authentication (card reader at home)/mobile security code app/two-step verification To add another level of
identification of the user
- Use of drop-down boxes (or equivalent) So key loggers cannot record the key presses
- Proxy server To divert an attack away from the main system

Computer Ethics:
Computer Ethics: a set of principles set out to regulate the use of computers.

e.g. explain what is meant by computer ethics and why the art gallery is concerned about computer ethics

• A set of guidelines

• Rules/laws that govern the use of computers / by example

• Tell people how to behave when using computers // helps keep users safe when using computers // by example

• Art gallery could be subject to plagiarism / intellectual property theft

• Art gallery could copyright their work (to make it illegal to steal it)

The three factors consider:

Intellectual Property Rights: this covers copying of software without permission of owners (covers copyright issues
and plagiarism)

Privacy Issues: this covers hacking and illegal access of another person’s personal data

Effect of computers on society: this covers factors such as job losses and social impacts and so on

Copyright: • A law/legislation that requires permission to use intellectual property / other people’s work

Plagiarism: • To claim other’s work as your own • To use other people’s work without consent / acknowledgement •
Theft of intellectual property

show understanding of the ethical issues raised by the spread of electronic communication and
computer systems, including hacking, cracking and production of malware
Free software, freeware and shareware
Free Software: is basically when you download software, you can run it, copy it, change it, it doesn’t
matter. Examples: AbiWord, F-Spot and Scribus.

Freeware: a software a user can download from the internet free of charge. Once it has been downloaded, there are
no extra fees associated with the software. Examples: Adobe, Skype or media players)

• A type of software licence • Free of charge • Normally distributed without the source code • Can legally share /
copy • Cannot legally modify code • Cannot resell

Shareware: a software which users are allowed to try out a software free of charge for a trial period. Examples
(Netflix, Music Apps)

Definitions
HTML a hypertext mark-up language used to create webpages, which is translated by a browser to display webpages
and uses (opening and closing) tags to display content.

Structure instructs how the layout of content is displayed.

Presentation instructs how the content will be formatted, e.g. colour/style/CSS

Web browser displays the web page, translates the HTML document

Chapter 9 Problem solving and design


Library routines a set of programming instructions for a given task that is available for use. Is pretested and usually
performs a task frequently required. Eg. ‘and’ function in python

Library routine is

- a list of instructions // block of code // subroutine


- ...that is used often...
- ...which is given a name
- ...and which can be called from other programs

Library routines make writing programs easier and faster as the code is already written

Library routines make program testing easier as the code has already been tested and debugged

Sub-routines a set of programming instructions for a given task that performs a sub-system. Written in high-level
languages called ‘functions’

Algorithm sets out steps to complete task. Usually shown as a flowchart or pseudocode.

Definitions:

Top-down - design breaks down a system into successively smaller pieces

Structure diagram - shows the hierarchy of the different components which make up a system // an overview of a
program or subroutine. A modelling tool used to show the hierarchy of a system. A graphical representation to show
how a system is broken down into sub-systems

Flowchart - shows the steps representing an algorithm using various shapes of boxes. A graphical representation
used to represent an algorithm

Pseudocode - describes a program using simplified high-level notation

Library routine - pre-written code to include in your own program to carry out a common task // a standard
subroutine (/programs) that is available for immediate use.

Trace table - shows the values of variables as you manually test your program

Procedure – a subroutine that does not have to return a value

Function - a subroutine that always returns a value

Test data

Test data is used to determine if a solution is working as it should.

Normal data - to work through solution to find actual results and see if they are the same as expected results.

Erroneous/Abnormal data - should be rejected from the solution e.g. out of range, the wrong data type.

Extreme data - the largest and smallest values accepted, this data should be accepted.

Boundary data - uses to establish where the largest and smallest value occur

e.g. give sets of test data to test your algorithm in part a

Test data set 1: 30, 29, 28 Reason: first number is the largest

Test data set 2: x, y, z Reason: abnormal data, should be rejected

Validation and Verification

e.g. explain what is meant by validation and verification. Give an example for each one

Validation:

• automated checking • checking that data is reasonable / of a certain type • checking that data meets certain
criteria

• range check // length check // type check // check digit

Verification:
• checking that data has not changed... • ...during input to a computer • ...during transfer between computers /
devices

• double entry // checking against original // visual check // checksum

Types of validation:

- Range check - only numbers within a specified range and accepted


- Length check data contains the correct number of characters or data is within a reasonable number of
characters – checks for a maximum number of characters in the data entered
• Type check checks data entered is of a given data type e.g. integer for number of siblings
• Character check checks an entered string of data for invalid characters e.g. a name wouldn’t contain ‘%’
• Format check checks characters conform to predefined pattern e.g. a code may be set to begin with ‘C’
• Presence check checks data is entered e.g. email address for online transaction.

e.g. describe, with examples, the purpose of these validation checks used in programming

Range check

To test if the value input falls between a given upper bound and a given lower bound, If a month has to be input
using an integer, it must be between 1 and 12 inclusive.

Length check

To test if the data input is over/under a certain number of characters, An international telephone number can be no
longer than 15 digits

Type check

To test if the input is of the correct data type, If the input is expecting integer(s) to be entered, it will not permit a
string to be entered

Types of verification:

• Double entry e.g. confirming password.


• Visual checkmanual check by user who enters the data, they are asked to confirm data is correct before
continuing.
• e.g. describe, using an example, how data could be verified on entry
• Either
• Double Entry // suitable practical example
• the data will be entered twice
• compared by the computer or by a human
• if a discrepancy is found, the data entry operator is asked to re-enter the data
• Or
• Visual Verification // suitable practical example
• the data will be compared to the source ‘document’
• compared by a human
• if a discrepancy is found, the data is re-entered

e.g. the difference between a validation and a verification check

Validation checks whether data to be entered is possible/sensible // computer check

Verification checks that data entered is the data that was intended to be entered // can be a human check //
matches the source

Chapter 10 Pseudocode and flowcharts


From the spec: understand and use pseudocode for assignment, using ←

Conditional statements:

IF … THEN … ELSE … ENDIF

CASE … OF … OTHERWISE … ENDCASE

Loop structures:

FOR … TO … NEXT

REPEAT … UNTIL

WHILE … DO … ENDWHILE

Commands and statements:

INPUT and OUTPUT (e.g. READ and PRINT)

totalling (e.g. Sum ← Sum + Number)

counting (e.g. Count ← Count + 1)

understand and use standard flowchart symbols to represent the above statements, commands and

structures

Conditional statements

Case statements

- CASE...OF...OTHERWISE....ENDCASE
- A statement that allows for multiple selections
- Reason for use: to simplify pseudocode/ to make pseudocode more understandable

e.g. pseudocode statements and description

- FOR...TO...NEXT a loop that will iterate a set number of times


- IF...THEN...ELSE...ENDIF a conditional statement with different outcomes for true and false
- CASE...OF...OTHERWISE...ENDCASE a conditional statement to deal with many possible outcomes
- REPEAT...UNTIL a loop that will iterate at least once

Chapter 11 Programming concepts


- Variables and constants
- Basic data types integer, real, char, string, boolean
- Sequence, selection, repetition, totalling, counting

Constants

- A value that never changes whilst a program is running

Explain why constants are used in programming

- The value cannot be changed accidentally...


- ...during the execution of the program
- Value only needs to be changed once if circumstances change/during the initialisation process

Variables

- A value that can change whilst a program is running

Explain why variables are used in programming


− Stores a value that can change...
− ...during the execution of the program
− Can use a variable without knowing its value

e.g. explain how selection and repetition could be used in a program

Selection: use of IF statement to check the values of the meter readings

IF Reading > 400 and Reading < 900 THEN …

Repetition: use of FOR loop to check all 2000 meter readings

FOR Meter = 1 TO 2000 … NEXT

e.g. examples of selection:

CASE A OF

100: B ← A

200: C ← A

ENDCASE

IF A > 100

THEN

B←A

ENDIF

e.g. examples of repetition :

FOR A ← 1 TO 100

B←B+1

NEXT A

REPEAT

A ← B * 10

UNTIL A > 100

e.g. difference between counting and totalling

- totalling is used to sum a list of numbers

- e.g. Total <- Total + Number

- counting is used to find how many numbers/items there are in a list

- e.g. Counter <- Counter + 1

e.g. how totalling and counting could be used in the program

- adding the weight of each basket to the total weight as each weight is entered

- adding one to/incrementing the number of baskets as each weight is entered

- examples of programming statements

Chapter 12 Data structures: arrays and pre-release material


Arrays

• A series of elements of the same data type

Explain why arrays are used in programming

- A list of items of the same data type


- ...stored under a single name
- To reduce the number of variables used
- Any item can be found using an index number to show its place in the list

Table

- A collection of related data

Chapter 13 Databases
Databases
A Database is a structured collection of data that allows people to extract information in a way that meets their
needs. The data can include text, numbers, pictures: anything that can be stored in a computer.

Benefits:
- It records and stores all the data, there isn’t data duplication.
- The same data is used by everyone and if there are any changed to be done, they can be easily done once.

Databases are used by people or organisations such as:

- patients in a hospital
- Students at a school
- cars to be sold
- books in a library
- hotel bookings
- results of races
- and many more things

Inside a database, data is stored in Tables, which consist of many Records and each record consists number of Fields.

Example:

In order to be sure that each record can be found easily and to prevent more than one copy of the same record
being kept, each record includes a Primary Key field. Each Primary Key field in the table is unique. The primary key
can be a field that is already used, provided it is unique, for example the ISBN in the book table, or a new field added
to each record, for example, a unique hospital number could be added to each hospital patients record. Sometimes,
a primary key can be formed by using two or more existing fields for example the doctors appointments could have a
primary key made from the date and the time of each appointment.

A foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table or the same
table.
For making a database, we use Microsoft Access

Validation: Validation is an automatic computer check to ensure that the data entered is sensible and reasonable.
However it does not check the accuracy of data.

Keywords:
Data - raw facts or figures

Table - a structure in which data is stored

Flat file database - a single table database

Record - a collection of data about a single item

Field - one piece of data

Primary key - a unique identifier for each record

Index - a list of values or items

Relational database - a database with several tables linked by primary key fields

Foreign key - a primary key that appears in another table

Query - a method of searching a database

Range - Start/End

Presence checks - if the data is entered in a specific field or not

You might also like