Chapter 1
Data representation
Denary
Binary
One's compliment /unsigned integer
8 bit unsigned binary can only represent 256 values from 0 (00000000) to 255
(11111111) (9608 w21p12 Q10a)
Two's compliment
8 bit two's compliment integer can only represent 256 values from -128
(11111111) to 127 (0111111) (9608 w21p12 Q10b)
Hexadecimal
BCD
Can not be represent when each groups of 4 bits is greater than 9 (9618 w21p12 Q4d)
Examples of practical applications (9608 w21p13 Q1d)
Calculator
Digital clock
Financial applications
Adding, subtracting and converting between denary, binary, hexadecimal and BCD (9618
s21p11/13 Q1c, 9618 w21p11/13 Q1b.i/c)
Overflow occurs when the result is greater than (denary value) 255 (for unsigned 8 bit
binary) (9618 w21p11/13 Q1b.ii)
Ascii code
How words are represented by ASCII (9618 s21p12 Q6b)
Each character has it own unique ASCII code
Each character is replaced by its ASCII code
The codes are stored in the order of the word
ASCII character set (9618 s21p12 Q6a)
Can only represent 128 characters
Extended ASCII character set (9618 s21p12 Q6a)
Can only represent 256 characters
Unicode (9618 s21p12 Q6c)
Multimedia
Bitmap image
Definition (9608 s18p11 Q2a)
Made up of pixel
Each pixel has one colour
Colour of each pixel stored as a binary number
How computer stores bitmap image (9608 s18p11 Q2b)
Each pixel needs x bits to store since there only y colour 一般会给你一张图然后问
你怎么 store,这里 x bits 决定于有 y 种颜色,如果图片里只有 2 种颜色(y)那么
就只需 1bit 来储存(x)
0 represent white (colour1), 1 represent black (colour2) 如题,把 colour1 当成白
色,colour2 当成黑色(也可以反过来)
Bit are stored for each pixel is in sequence 储存形式是连续的像素
E.g. 1011010001001 如题,把编码写出来算一分
Pixel 像素 (9618 s21p11/13 Q1a.i)
Smallest addressable(可解读的)element in an (bit map) image
A single square of one colour
File header 图片属性 (9618 s21p11/13 Q1a.i)
Information and data about the bitmap image
E.g. (9608 s21p12 Q7b, 9608 w21p11 Q1b)
File size (in Bytes)
Resolution (vertical heights and horizontal widths in pixel)
Bit depth
Number of colours
(image) Resolution
Bit depth
Features in bitmap graphics (image) software (9608 s20p13 Q7a)
Colour select
Select all pixels of the same colour
Add text
To show the name of the company
Fill an area with colour
Selection
'Grab' a number of pixel to perform a task
Copy
Reduplicate a number of pixels
Vector graphic (9618 w21p12 Q5, 9608 s20p12 Q1b)
How computer stores vector graphic (9608 w20p13 Q7a)
Each item is a drawing object
Drawing objected are created using mathematical calculations (instructions,
commands)
Properties if each drawing object are stored e.g. positions, fill colour, line colour
Calculations for proportional size (not exact dimensions) for each object are stored
Property 图形属性 (9608 s21p11 Q1a, 9608 w21p11 Q1a)
Information and data about the geometric shapes/ drawing objects
E.g. 考试的时候尽量按照所给的图片写 e.g. black line, black fill, solid line
line colour
line style
fill colour
line width
position
Drawing list (9608 s21p11 Q1a)
The list of shapes involved in the (vector graphic) image
The list that stores the command/description of drawing object
E.g. 3 triangle (shapes), 2 capital letter R (letter)
Advantage & disadvantage
Bitmap image
Advantage
Looks more realistic.
Can be compressed with large reduction of its origin file size.
Disadvantage
When enlarge or zoom in, image will be pixelized
Usually has larger file size, because every pixel is needed to be stored
Hard to edit, because every pixel need to be edit separately
Vector graphic
Advantage (9608 s18p11 Q2d)
can resize without getting pixelized, because shapes will get recalculated
when resize
Usually have smaller file size, because it only contains instruction or function
to create shapes)
Disadvantage
Do not compress well because of little data redundant 重复的数据很少所以
很难压缩
Vector graphics need to be 'rasterised'(转化成打格式)to display or print
Difference (9618 w21p12 Q5b.i)
Bitmap is made of pixels || Vector graphic stores sets of instruction/commands about
drawing objects /shapes
Bitmap images are suitable for photographs/ scanned picture || Vector graphics are
suitable for geometric shapes
When bitmap image is enlarged, pixel get bigger, image get pixelized || When vector
graphic is enlarged, shapes get recalculated, image does not get pixelized
Vector graphics need to be 'rasterised'(转化成打格式) to display or print, bitmap
image don't
Sound files
Sampling
Measuring the amplitude of sound wave at set time intervals(间隔)
Sampling rate
Definition (9608 w21p11 Q2a)
The number of samples taken per unit time
Why sound is better (closer to the original) when higher sampling rate is used?
(9618 w21p11/13 Q7a.i, 9608 w20p11 Q7)
Smaller time gaps between samples
The digital sound wave is more accurate
Smaller quantisation error
Why sound file size increases when higher sampling rate is used? (9618 w21p11/13
Q7a.ii, 9608 w20p11 Q7)
More samples are taken, so more bits are used to stored altogether
Sampling resolution
Definition (9608 w21p11 Q2a)
The number of bits used to represent/encode each sample
File size (9618 s21p11/13 Q1a.ii, 9618 w21p11/13 Q1a)
For image files
= image resolution x bit depth
For sound files
= sampling resolution x sampling rate
1 bit = either 0 or 1
1 byte (B) = 8 bit
Estimate
3
1 kilobyte (KB) = 1024 B = 10 B
6
1 megabyte (MB) = 1000 KiB = 10 B
9
1 gigabyte (GB) = 1000 MiB = 10 B
12
1 terabyte (TB) = 1000 byte = 10 B
Accurate
10
1 kibibyte (KiB) = 1024 B = 2 B
20
1 mebibyte (MiB) = 1024 KiB = 2 B
30
1 gibibyte (GiB) = 1024 MiB = 2 B
40
1 tebibyte (TiB) = 1024 byte = 2 B
File compression
Purpose of using file compression (9618 w21p11/13 Q7b.i, 9608 s21p11 Q8b.i, 9608 s19p11
Q1d.i)
To reduce storage space required/needed to store the file (because of the file size
decreases)
To reduce the time for transmit (upload and download) the file (because of the file size
decreases)
(To reduce file size) because emails have limit file size for sending or receiving (transmit) ||
original file is too large for email storage/attachment
Lossless compression
Purpose of using lossless compression (9608 s21p11 Q8b.ii)
Because all the data needs to be recoverable (after decompression), otherwise the
file content will not make sense.
Run-length encoding (RLE) 考试一定要写全称 (9618 s21p11/13 Q1b, 9618 w21p11/13
Q7b.ii, 9608 s18p11 Q2b.ii)
Replace a sequence of same colour pixel with colour code and number of the
sequence.
E.g. 3 black pixels and 4 white pixels can be encode to B3W4 如果考试给了一张图
务必要吧那张图精确的编写出来
Lossy compression (9618 w21p12 Q5b.ii)
Definition (9608 s19p11 Q1d.ii)
A way of compression that data will be loss
The decompressed file is not the same as the original file
Purpose of using lossy compression (9608 s19p11 Q1d.iii)
Lossy compression compresses further than lossless compression, which produce
smaller file size
A very large file needs significant reduction in its size
Lossy removes details which can be lost without people notice
On image
Reduce image resolution
Reduces the number pixel in width and height, which means fewer bits is
need to store the image (all of the pixels), this decreases the file size
Reduce number of colours
Reduces the colour types which means fewer bits is need to store each
colour, this decreases the file size
Reduce bit depth
Reduces the number of bits per pixel which means each pixel has fewer bits,
this decreases the file size
On sound file
Reduce sampling rate
Reduce sampling rate means fewer samples are taken per unit time (e.g.
seconds) so less data is stored, so less bit is stored, this decreases the file size
Reduce sample resolution
Reduce sampling resolution means fewer bit are used to represent teach
sample, so less data is stored, so less bit is stored, this decreases the file size
Chapter 2
Network
Wired network
WAN (Wide Area Network)
MAN (Metropolitan Area Network)
LAN (Local Area Network)
Why LAN? (9618 w21p11/13 Q8a)
Small geographical area
Does not use internet to transmit data within the building
PAN (Personal Area Network)
Wireless network
WLAN (Wireless LAN)
WAP (Wireless Access Point)
Network Model
Client-server network (9608 s21p11 Q11a)
Files/data are held (saved) on servers
User's (e.g. employee, customer 看题说了什么) computers are the clients
Client send request to the server
Server process the request, and sends back the result to the client
Client display the result to the user
People can request (shared) files on any client computer
Peer-to-peer network
Features of peer-to-peer (9618 s21p11/13 Q4a)
All computers are in equal status
Computers can communicate and share resources to each other
Each computer is responsible for its own security
Disadvantage (9618 s21p11/13 Q4b)
No central management of security, each computer is responsible for its own
security, each computer is at risk from virus from other computers
No central management of back up, all data may get lost forever if the computer is
not backed up
No central management of files, so reduced in data consistency
All computers need to be switch on to share files, so files may not always be
available
Clients
Thin client
Client that only provide input and output from software, must connect to the other devices to
process a request. E.g. POS terminal 收银机
Thick clients
Clients that carries out at least some of the processing itself without connecting to other device.
E.g. PC (personal computer)
Network topology
Bus network topology
Network using central cable in which all devices are connected to this cable
Data can only travel in one direction
Only one device is allowed to transmit at a time
Star network topology
Network that uses central hub/switch
All data is routed by switch/hub
Mesh network topology
Direct links between devices
Hybrid network topology
Network made up of a combination of other network
Cloud computing (storage)
Advantage (9618 s21p12 Q5c.i)
Data can be easily shared
Can access from any computer with internet access
Saves storage on existing devices
Most cloud storage services have backup recovery
Better security
Cloud storage can be free
Disadvantage (9618 s21p12 Q5c.ii)
Cannot access data with any computer that cannot access to the internet || Can access
only from computers with internet access
Upload and download data may be very slow because of unstable internet connection
It may be very expensive in long term
There could be issues with the company offering cloud services
Public cloud
Private cloud
Hybrid cloud
Wired and wireless network
Wired network
Advantage (9618 s21p11/13 Q4c.ii)
More stable, less external interference.
Higher data transmit rate / higher connection??
More secured
Disadvantage
Devices are not mobile, and need to be close enough to have cable connections.
移动性低
Cabling can be very complex and hard to organize 这么多线很难管理
Lots of wire may lead to tripling hazards, and is harder to clean areas with lots of
cable. 可能会绊倒人并且很难打扫
Wireless network
Advantage (9618 s21p11/13 Q4c.ii, 9608 w18p13 Q7a, 9608 s21p12 Q9a)
Freedom of movement, users and computers can be mobile, the network can be
access from anywhere within the wireless access point (WAP)
Less hardware and cables required, which reduces the cost
Much easier and straight forward to connect devices, no need physical connection
between devices
Disadvantage
More external interference. 外部干扰增加
Data is less secured compared with wired network, easy to intercept radio waves
and microwaves. 低安全性
Signal can be stopped or decreased when passing thick walls. 穿墙信号就会减弱
Types of electromagnetic radiation
Radio wave 无线电波 e.g. 收音机,WiFi 传输 (9608 s20p13 Q1a)
Carries data wirelessly || carries data in the form of electromagnet waves
Microwave 微波 e.g. 卫星传输
Infrared 红外线
Bluetooth
WIFI
Satellites (9608 s20p13 Q1a)
A communication device in Earth's orbit that receives and transmit data
Hardware
Hardware to support LAN
Cable
Copper cable
Twisted pair cable
Coaxial cable
Fibre optic cable 光缆 (9608 s20p12 Q7b, p13 Q1b, 9608 w18p12 Q2cii, iii)
Transmit data as light || Uses a (bundle of) glass/plastic threads to transmit
data
Advantage
Faster data transmission
Less external interference so more stable connection
More secure
Disadvantage
High (initial) cost
Expertise(需要专业人士)required to complete installation and
connections
Only transmit data in one direction
Fibre optic cable will break when bent
Hub/Switch (9618w21p11/13 Q8b)
Router (9618 s21p11/13 Q4c,i, 9618w21p11/13 Q8b, 9618 w21p12 Q3b.ii, 9608 s19p12
Q1c)
How router works
Connect two similar types of networks e.g. connect LAN to the internet
Allocate/assign private IP address to device on LAN
Store/update/maintain a routing table / a table of MAC and IP address
Receives packets from devices or internet
Find the most efficient path to the destination of the packet
Route/forward packets to the destination
Similarity compares to other hardware (9608 s20p11 Q8c)
Both connect two networks
Both receives packets from a network and forward/send to another network
Difference compare to other hardware
Router connect two networks using similar protocol 因为大部分时候 router
里面有 gateway
Router connect two networks using the same protocol 如果和 gateway 做比
较
Gateway*
Used to connect two networks with different protocols
Similarity compares to other hardware (9608 s20p11 Q8c)
Both devices connect two networks || regulates traffic between two networks
Both receives packets from a network and forward/send to another network
Difference compares to other hardware
Gateway can connect two networks with different protocols
Repeater 信号加强器
Device used to boost(加强)a signal on both wired or wireless networks
Bridge
Used to connect two networks that have the same protocol
E.g. connecting two LANs
Hardware to support internet
NIC (network interface card) 网卡
Provides interface to wired network
Used to connect computer/server to LAN (e.g. company's network) (which connect
to the internet) (9608 s20p12 Q7a)
WNIC (wireless network interface card) 无线网卡 (9618 w21p11/13 Q8c)
Provide interface to wireless network
Receives analogue data(模拟信号)and convert it into digital data (binary)(数字
信号)
Checks incoming transmissions for correct MAC or IP address
Encodes data
Decodes data
Take digital data (binary) and convert it into analogue data
Modem
Used to connect devices (e.g. server) to the internet over a telephone line (9608
s20p12 Q7a)
Bit streaming
How to send video using bit streaming (9608 w19p12 Q6e.i)
Data is compressed before transmitting
Video is transferred continuously as a series of bit
Video is hosted on the media server
To download the video, the server sends the data to the buffer of the client
User's software receives the bit stream from the buffer
Real time steaming (9608 w20p11 Q5a.i)
It is being watch live
It in not already stored online so it cannot be download to watch later
On demand streaming
Video is already been stored|| Video does not need to broadcast live
Users can download and watch the video later
Video can be paused
Why video constantly stops and starts again? (9608 w20p11 Q5a.ii)
Slow and unstable internet connection
The video is too high quality to stream in real time
Too much demand for the video from the client, causing traffic jam
Too many application running on user's computer, CPU and RAM is overloaded
User is trying to watch the video in a high resolution (quality)
Internet (9608 s18p11 Q5b)
Internet (interconnected network)
World wide web (WWW)
Difference between Internet and WWW
Internet uses IP protocol
WWW is accessed over internet
WWW uses http or https protocol
Webpages in WWW are written in HTML
Why both Internet and WWW are both used? (9618 s21p11/13 Q4d)
Internet is used to send data on the infrastructure 物理层面
WWW is used to access to a website (that is stored on a web server) which is a part of the
WWW
Communication system (9608 w21p12 Q3a)
Public Switched Telephone Network (PSTN) (9608 s19p12 Q1b.i)
PSTN has many different types of communication lines
Data is transmitted in both directions at the same time
The communication passes through different switching centres
Cellphone network
Send data to cell towers over mobile connection
Satellite system
Send data to satellites in the Earth's orbit
Dedicated line
Definition
Permanent(永久的)connection often used for organisations
Advantage
More secured
Faster transmission of data
More stable transmission
Disadvantage
Expensive to set up and maintain
IP (internet protocols) address
Definition
Is the physical address of the server
Purpose (9608 w18p12 Q2b)
Used to locate devices on a network
Each IP address is unique in the network
Allows device to send data to the correct destination
IPv4 (9608 w20p13 Q4a.iii)
Uses 4 Bytes
4 groups denary or hexadecimal integers
(value of) Number in each group must between 0 to 255 or 0 to FF
Each group is stored in I byte (8 bits)
Separate by full stops (.)
E.g. 192.168.2.10
IPv6 (9608 w20p13 Q4a.iii)
Definition
Uses 16 bytes
8 groups of denary or hexadecimal integers
(value of) Number in each group must between 0 to 65535 or 0 to FFFF
Each group is stored in 2 Byte (16 bits)
Separate by colon (:)
Zero compression
Only one sequence groups of 0 can be replaced by double colon (::)
E.g. 1234:1145:1419:1981:0FA1::
Purpose (9608 s19p12 Q1a.ii)
The demand for IP address needed is larger than the maximum number IP
addresses that IPv4 can have.
Private IP (9608 w21p13 Q3a)
How to use?
Private is assigned by ISP
Private IP is cannot be access by anyone using the internet
Private IP is used to get communicate within the network
Private IP address are unique within the LAN, it can be duplicated in different
networks
Why computers and routers have private IP? (9608 w20p11 Q8a, 9608 w20p13
Q4a.i)
So computers can be identified in LAN (e.g. home network) and allows
router (or other devices in LAN) to know where to send the data to (the
computer)
So routers can be identify in LAN (e.g. home network)
Routers have both public IP and private IP so it can route (transmit) data
between to networks
Public IP (9608 w21p13 Q3a)
How to use?
Public IP is assigned by router
Public IP is used to get internet service
Private must be unique throughout the internet
Public IP can be access by anyone using the internet
Why computers don't have public IP but routers have? (9608 s20p13 Q1c, 9608
w20p11 Q8a)
Reduce the number of public IP needed
Computers don't connect to the internet directly
Computers will be more secured, since the public IP address is visible
throughout the internet, so computers hide from the internet without public
IP
Only router needs a public IP, because only router needs to be identified on
the internet
All data from the internet must transmitted to the router first
Router has both public IP and private IP so it can route (transmit) data
between to networks
Difference between private IP address and public IP address (9608 s21p11 Q9a)
Private IP address is only known within LAN || Public IP address is known
outside LAN / on internet
Private IP address is allocated by router || Public IP address is allocated by ISP
Public IP address are unique throughout the internet, private IP address are
unique only within LAN
Private IP address are more secure than public IP address
Static IP
Definition (9618 s21p12 Q5d)
Static IP does not change each time a device connects to a the internet
Why static IP? (9608 w20p12 Q7b)
The DNS does not need updating
Might be delay causing "address not found"
Web server may be access directly using just the IP address
Dynamic IP
Definition (9618 s21p12 Q5d)
Dynamic IP is reallocated (changes) each time a device connects the internet
Uniform resource locator (URL)
Definition (9608 w15p12 Q9b)
Reference website address on the internet
Includes protocol and domain name
Protocol
E.g. https, http
Domain name //这里书上写的就是个寄吧,考试里和现实当中 domain name 的范围就
是书上所讲的 website address
Definition (9608 s21p13 Q6b)
Domain name is a memorable form of IP address
Each domain name is linked to an IP address
Domain host*
E.g. www
Website name*
e.g. Cambridge
Domain type*
E.g. .com, .org, .co, .net, .gov
Country code*
E.g. .uk, .cn
File name*
E.g. page1.html
E.g. Protocol://domain name/path/file name
E.g. https://www.Cambridgeinternational.org/6908.html
Domain name service (DNS) server
Definition
Used to translate domain name into corresponding IP address
How to use DNS (9608 w15p12 Q9b, 9608 s17p11 Q7b, 9608 s19p11 Q1b)
Web browser parses(分析)the entered URL to obtain the domain name
Web browser sends the domain name to nearest DNS
DNS stores a database/list of domain name with matching IP address
If a DNS finds the matching IP address, it returns the IP address to the web browser
If a DNS can't find the domain name, It send the request to a higher level DNS
DNS adds returned (from the higher level DNS) IP and URL into is its database/list
将上级发回的 IP 和 URL(也是以前没有的)加到自己的 database 里
DNS server returns the IP address to the web browser
DNS may return error message if the domain name is invalid or doesn't exist
DNS has hierarchy
Chapter 3
Laser printer (9608 s20p13 Q2a)
The drum is initially given an electrical (negative) charge
The laser beam (bounces off moving mirror) scans back and forth and discharge all the
point/area that does not includes the 'shapes' or 'text' (will be print out) of the drum
(Only the area of the 'shapes' or 'texts' of) The drum is then coated with (positive) charged
toner(鼓粉)
The drum is rolled over a (negative) charged paper
(All the positive charged toner of) The 'shape' or 'text' is transferred to the paper
The paper passes through the fuser to seal the image
All electric charged is removed from the drum
3D printer (9608 s20p11 Q2b.i)
Object is designed using CAD (computer aided design) software
The software split the object into slices
The data about each slice is sent to the printer
The solid plastic is melted and transferred to the nozzle
A motor moves the nozzle into position
The nozzle extrudes(挤出)the molten plastic
This repeats (step 5 and 6) until the layer is complete
A fan cools the layer
This process (step 4 to 8) repeats for each layer
Microphone (9618 w21p12 Q3a)
Microphone has a diaphragm
Incoming sound waves cause the vibration of the diaphragm
Causing a coil to move past a magnet
Electrical signal is produced
Speaker (9608 w17p11 Q5a.ii)
Takes an electrical signal and translate it into physical vibrations to create sound waves
An electrical current in the coil create electric magnetic field
Changes in audio signal (sent from computer) will cause changes in direction of the electrical
current
Changes in electrical current in the coil changes the direction of polarity of electro magnet
Electro magnet is attached to a parament magnet
The coil to vibrates
Movement in the coil causes the diaphragm to vibrate
Sound waves is produce and transmitted in air from the diaphragm
Primary storage
(main) Memory
RAM (random access memory)
Purpose (9608 s20p11 Q2.b.ii, p13 Q2b)
Stores currently running parts of (something e.g. 3D printer, laser printer)
software/program
Stores currently process (of something e.g. washing, printing)
Stores data about (e.g. washing machine, printer) such as (e.g. plastic level (for 3D
printers), temperature (for washing machines))
Static RAM (SRAM) (9608 w19p13 Q1b.ii)
Often used as cache
Made from flip-flop
Dynamic RAM (DRAM) (9608 w19p13 Q1b.ii)
Requires refreshing (recharging)
Difference
SRAM is more expensive than DRAM
SRAM has faster access time than DRAM
SRAM has more complex circuitry than DRAM
DRAM has to be refreshed, SRAM does not required to refresh
DRAM often used in main memory, SRAM often used in cache memory
ROM (read only memory)
Types of ROM
ROM (read only memory) 不能修改
PROM (programmable ROM) 只能修改一次
EPROM (Erasable PROM) 可以修改多次
EEPROM (electrically EPROM) 更方便修改多次
Purpose
Stores start-up instructions (of something e.g. printer, washing machine)
Stores OS (of something e.g. printer, washing machine)
Difference between RAM and ROM
RAM is in volatile (容易失去的) || ROM is non-volatile (不容易失去)
RAM can change regularly || ROM usually do not change
RAM is read/write || ROM is read only
Secondary storage
Uses of secondary storage (9608 w17p11 Q5)
Purpose (9608 w19p12 Q6b.i)
To store files in long term
Hard disk drive (HDD) / Magnetic hard disk (9608 s21p12 Q8g)
How to use?
The disks has one or more platters made of aluminum or glass
The surface of the platters has ferrous oxide which can be magnetised
Platters are mounted(堆在)on a spindle
The platters are rotated at high speed
There are read-write heads mounted on an (actuator) arm above each surface of the
platters
Electronic circuits control the movement of the arm and then the heads
The surface of the platters are divided into concentric tracks and sectors
When writing the disks, a variation(变动)in the current through the head produces a
variation in magnetic field on the disk
When reading the disks, a variation in the magnetic field on the disk produces a variation
in current though the head
Advantage (9608 s18p13 Q7c)
Less expensive per unit of storage (compare to SSD)
Cost is low even if large amount of HDD is purchased
Larger storage capacity(上限)
To store video, sound, image file with large file size
Slower degradation(损坏)of data
So will last longer under heavy use
Solid state drive (SSD)
Definition
No moving parts
SSD state memory is volatile (容易失去) 寿命短
Make use of blocks of integrated circuits(集成电路)
Advantage (9608 s18p13 Q7c)
No moving parts so no noise
Faster read and write speed (time)
Do not need to wait to load the (video, image, sound) file (for a long time)
CD/DVD drive/writer
Optical disk drive
USB flash drive
Buffer
A temporary storage area
External (removeable) secondary storage (9608 w17p11 Q5b)
Purpose
Additional secondary file storage
Backup of files
Transfer files to another computer
External HDD 注意这里有区别一般都是 internal HDD (9608 s17p12 Q2c.i)
External SSD 注意这里有区别一般都是 internal SSD (9608 s17p12 Q2c.i)
Touchscreen
Resistive touchscreen (9608 s20p12 Q1a, 9608 s18p13m Q7a)
Resistive touchscreen has two charged layers/plates with a gap/air between the layers
When finger touches the screen, pressure causes the upper layer to touch the bottom layer, and
completes a circuit
Point of contact is (created and) registered
Coordinates (horizontal and vertical position) of the point (of contact) is calculated
Capacitive touchscreen (9608 s18p13m Q7a)
Capacitive touchscreen is made of materials that store electronic charge
When finger touches the screen, electronic charges transfer to the finger
Sensor at the screen corners detects the changes (in electronic charge)
Point of contact is registered
Coordinates (horizontal and vertical position) of the point (of contact) is calculated
Virtual reality (VR) headset
An output device worn on the head that gives the user a 'virtual reality experience'
Used in gaming software to simulate od someone in world experience
VR will have stereo sound(立体声), embedded head movement sensors, separate image
projection for each eye
VR headset must respond very fast with rendered(渲染的)in respond to various input, the
GPU (graphic process unit) is responsible for it
Sensors
Temperature
Pressure
Infrared
Sound
Logic gate (9618 s21p11/13 Q8, 9618 s21p12 Q3, 9618 w21p11/13 Q3)
OR
AND
NOT
NOR
NAND
XOR
Chapter 4
Fetch execute cycle
System clock (9618 s21p12 Q5a)
System clock sends timing signals (to CU and ALU)
System clock synchronises the all component on the motherboard 其实 system clock 只
控制 CU 和 ALU(发 clock pulses(时间信号)给它们)而 CU 收到时间信号就会发
control signal 给主板上的 components 所以书和考试上才会认为是 system clock 控制所
有 components
Control unit (CU)
Arithmetic and Logic Unit (ALU) (9618 s21p12 Q5a)
Is part of the processor that carries out arithmetic operations, logic operations and logic
comparisons
Registers 考试填空题最好写全称 (9618 s21p11/13 Q3a, ???9608 w21p12 Q4b)
Program Counter (PC)
Stores the address of the next instruction to be fetched
The address is transferred to MAR
Memory Access Register (MAR)
Holds the next address to be fetch held in the PC
Sends the address to (main) memory to fetch the matching data
Memory Data (buffer) Register (MDR)
Holds the data received from memory or CIR
The instruction (data) is copied to CIR or to memory (for storage)
Current Instruction Register (CIR)
Holds the instruction received from MDR
Sends a signal to PC ready for the next instruction
Decode and execute the instruction
Index Register (IX)
Status Register (SR) (9608 s21p11 Q3d)
Carry flag
Negative flag
Overflow
Zero flag
Accumulator (ACC)
Interrupt Register
Buses (9618 s21p12 Q5a)
Address bus
Data bus
Control bus
Stages of fetch execute cycle
Words
PC stores the address of the next instruction to be fetched
The address is transfer to MAR using address bus
The MAR holds and transfer the address to (main) memory using address bus
The data of the matching address in memory is copied to MDR using data bus
MDR holds the data from the memory, if the data is an instruction, the instruction
is copied to CIR using data bus
CIR holds the instruction, before decoding, CIR sends a data signal to tell PC ready
for the next instruction
PC is incremented (usually by 1)
CIR decodes the instruction
The decoded instruction in CIR is executed by the processor
Register transfer notation (9618 w21p11/13 Q6a)
MAR [PC]
The data is stored in the Program Counter is passed to Memory Access
Register
MDR [[MAR]]
The data in address pointed to by the Memory Address Register
CIR MDR
PC [PC]+1
The Program Counter is incremented
Computer port(外界设备)
Purpose (9608 s20p13 Q2c.i)
To provide connections to peripheral devices
To provide interface between computer and other devices
USB (universal serial bus) port (9608 s20p12 Q2c.iii)
Faster data transfer
Useful when transferring large files such as video files
Automatic connection
Usually no need to install separate device drivers
USB ports is a standard used by many products/manufactures(产品)
Which means all new computers will equip/have with USB ports
Device can be charged/powered through USB ports
External devices may be charged while working at the computer
HDMI
HDMI ports are standard used by many modern devices
Fast data transfer rate
Improves security
VGA
Old technology
Interrupts
Definition (9608 w18p13 Q6b)
Signal from a source/device
Telling the processor its attention is needed
How interrupts works
At the end of each cycle for current instruction, processor checks if there's an interrupt
If interrupt flag is set, the register content are saved, the address of the interrupt service router
(ISR) is loaded to the program counter (PC)
When ISR competes the processor restores the content of the processor
Assembly language (9618 s21p11/13 Q3b/c, 9618 s21p12 Q4, 9618 w21p11/13 Q6b)
Addressing modes (9618 w21p12 Q8b.iii)
Direct addressing
Indirect addressing
Index addressing
Immediate addressing
Relative addressing
Absolute addressing
Use of opcode and operand code for instruction
Symbolic addressing
Use of symbols for instruction
Trace table
Two-pass assembler
How assembler made entries to the symbol table? (9608 w17p11 Q4c)
Assembler reads the assembly language instructions in sequence
It checks if the instruction meets a symbolic address, if yes then...
If the symbolic address is not on the symbol table, it adds it to symbol table
If it is already on the symbol table, it checks to see if the absolute address is known
If it is known, it is entered
If it is not known, it is marked as unknown
First pass (9608 s15p13 Q2)
Read the assembly language one line at a time
Create a symbolic table
Expansion of macros 展开一个宏指令(一个大型很多步骤的指令)
Adds symbol address
Remove all comments
Any directive are act upon
Second pass (9608 w17p11 Q4d.i)
Read the assembly language one line at a time
Any symbolic address is replaced by the absolute address
Instruction table is needed
Generate(产生)object codes (using the symbol table in the first pass)
Save or execute the program
Improving computer performance
Cores (9618 s21p12 Q5b)
Each core process one instruction per clock pulse
Multiple/more cores means that sequence of instruction can be split between them
More sequence of instruction can be run in the same time
More cores decrease the time taken to complete task, therefore improves the computer
performance
Clock speed (9618 s21p12 Q5b)
Each instruction is executed on a clock purse
Clock speed dictates(规定)the number of instructions that can be run per second
The faster the clock speed, the more instructions can be run per second, therefore
improves the computer performances
Bus width
The width of the buses shows the number of bits that ca be transfer at the same time
Increasing in bus width increases the number of bits of data that can be transferred at the
same time
This improves the processing speed since fewer transfers are needed, so this improve the
computer performance
Double the bus width will transfers double amount (bit) of the data per clock pulse
Cache memory
Instruction grouped (9608 w21p13 Q3c)
Data movement
Arithmetic operations
Compare instruction
Unconditional and conditional jump
Input and output data
Chapter 5
Operating system (OS)
Why using OS? (9608 s17p12 Q4a.i)
The hardware is unusable without an OS
Acts as an interface / controls communications between user and hardware.
Provides software platform/environment that programs can be run.
Management tasks of OS (9618 s21p11/13 Q2b, ???9608 s17p12 Q4a.ii, p11 Q6a, 9608 w17p12
Q1)
Provides Human Computer Interface (HCI)
Controls communications between user and hardware.
Processor management
Allocation of processing time
multitasking
Memory management (9608 w21p11 Q7a.i)
Allocation of processing application in the memory
Provides memory protection, ensure two or more data do not use or store in the
same memory location
Provides the use of virtual memory 虚拟内存
Organise memory e.g. paging, segmentation
Releases memory when a process stops
Reads/writes data to/from memory
Open and close program
File/ secondary storage management
Provide file naming convections
Maintain directory structures 保持文件储存位置不变
Controls access
Preform specific task on files e.g. create and delete, open, close files
Hardware/input/output/device/peripheral management (9608 w21p11 Q7a.ii, 9608
s20p12 Q2c.ii)
Managing communications between devices
Installation of appropriate driver software
Control access to hardware
Sends commands to device
Receives signals from device
Security management
Ensures data privacy
Prevents unauthorised access
Automatic backup
Login password is used for different users
Interrupt Handling
Stops execution of current process when there's an interrupt
Use of priority to handle interrupts at the same time
Saves the data when there's a power cut
Embedded system (9618 s21p11/13 Q5)
Definition
Microprocessor performs one specific task
E.g. embedded system in a washing machine only controls the programs for
the washing cycle
Control system
The system uses feedback
System produces an action (e.g. causing temperature to change)
Monitoring system
The system send signal but do not produce an action and feedback
RAM and ROM in embedded system
RAM store start-up instructions
ROM store choices that the user entered
ROM store data read from the sensor
Utility of software (9618 s21p11/13 Q2a, ???9608 s17p11 Q6b, p12 Q4b, 9608 w16p11
Q7a, 9608 w21p13 Q6, 9608 s20p11 Q1b)
Hard disk formatter 格式化
Prepares hard disk to allow data to be stored
Initialies a disk for first use
Reformat a previously used disk
Anti virus software / virus checker 杀毒软件
Checks for virus and then quarantines(隔离)or remove any virus found
Disk defragmentation software 碎片化整理 (9608 s21p12 Q7.ii)
Finds the file that are split across the disk.
Rearrange fragmented/discrete files into contiguous locations, to bring empty space
together.
To improve the time it takes to access the files
Disk contents analysis software 硬盘修复软件,这里书上写的就是个寄吧,这个软件只有以下
功能,删除 temp 文件是底下的 disk/system clean up (software)
(Areas of disk can become corrupt)
Identify and prevents the bad sectors from being use
Disk repair software
Attempts(尝试)to fix the errors (bad sectors)
File compression software 压缩软件
Reduce file size
Using algorithms to change remove (change) the redundant data
Can be lossy or lossless
Backup software 备份软件
Makes copy of files on another location / specific folder in case of data loss /corruption
Flies (images 如题) can be restored (9608 s21p12 Q7a.ii)
Firewall
Prevents unauthorised access to computer systems from external source
Improving computer performance (???9618 s21p11/13 Q7c)
Defragmentation
Less time is taken to access files because each one is contiguous(连续的)so there is
less head movement
Virus checker
Makes more RAM available for programs to run, because it removes unnecessary
software that is taking up the memory
Disk repair
Identify and prevents the bad sectors from being use
Reduces access times by optimising(充分利用)storage
Disk/system clean up
Releases storage by removing unwanted/temporary files
Program library
How program library is used (9618 s21p12 Q7a)
Use of pre-written tested subroutine
Library program can be referenced/imported
A program stored in a program library manufactures
Advantage
Don't have to write every code for the same routine every time.
Leads to modular programming, several programmers can work on the same program at
the same time. 一个很大的 program 分成很多模块就可以一起做
Saving development time
No error, since library program is already tested by people
Types of library program
Static
Software being developed is linked to executable code in the library at the time of
compilation
Dynamic link library file (DLL)
Definition
Software being developed is not linked to the library routine until run time.
Library routines are stored in DLL which are stand-alone files.
Advantage (9608 s20p13 Q4a.i)
DLL file is separate from the main program is only loaded into memory when
required, it also makes the (file size of the) executable file of the program
smaller
Changes/improvement in the DLL file are independent of the main program,
so the program (e.g. game program) will not be recompiled
The main program will get benefits from the changes/updates (in the DLL
file) automatically
Same DLL file can be used in several programs at the same time
DLL routines are prewritten, which saves developers time
DLL routines are pretested which should be reliable
Disadvantage (9608 s20p13 Q4a.i)
Program (e.g. game program) will not work if DLL is corrupted
Change in DLL file may stops the game from working, or change the way it
works
DLL must be present at run-time otherwise there is an error
IDE (integrated development environment)
(program) writing tools (9618 w21p11/13 Q4b.ii)
Colour coding || pretty printing
Auto complete
Auto correct
Expand and collapse code blocks
Context sensitive prompts 比如说你打 Syst 他低下会弹出 System.out.ln()
Debugging tools (9618 s21p12 Q7b.ii)
Report windows
Break points 程序自己 debug 然后预测问题出在第几行
Single stepping 每次只 debug 一行,用户自己看 report window (trace table)
Language translator (9618 w21p11/13 Q4d)
Assembler
Used to translate assembly code (low level code) into binary (machine code)
Compiler
Definition (9608 w21p12 Q5)
Converts high level code to low level code (assembly code)
Translates the whole program before running it
Create an executable file if there is no errors
Report all errors if found
How to use it? (9618 s21p12 Q7b.i)
Use the compiler after the program is complete
Create an executable file
Use the compiler to repeatedly test the same completed section
Compiler is not needed at runtime
Advantage (9608 s21p11 Q8a.ii)
Compiler is not required to run the program
The program can be distributed without the source code
Compilers produces code that executes/runs faster than the equivalent for
interpreters
Disadvantage
Program won't run if there are errors
Part program cannot be tested
Program cant correct errors in real time
Interpreter
Definition (9608 w21p12 Q5)
Converts high level code to low level code (assembly code)
Translate and runs one line at one time
Stops when an error occurs
Allow errors to be corrected at real time || errors can be continue and translation
continues from the point
How to use it? (9618 s21p12 Q7b.i, 9608 w20p13 Q3a)
Use an interpreter while writing the program
Test/debug the partially completed program
Errors are found when interpreter stops (before the finish translating)
Errors can be corrected in real time || errors can be identified one at a time
Advantage (9608 w21p11 Q10a)
Easier to debug
Errors can be corrected in real time
Parts of the program can be tested before the program is finished
Errors are reported as the interpreter finds them
Disadvantage (9608 w21p11 Q10b)
Source code is needed at run time
Translation software is needed every time the program runs
Execution time increased
Partially compiled and partially interpreted program (9608 w20p13 Q3b)
Advantage
Program may be interpreted on different platforms
Disadvantage
Intermediate code still needs to be interpreted on the user's computer which may
run slowly
Extra CPU resources may be required
Machine independent (9608 w17p13 Q2b.i)
The program code can be translated to run on any processor/platform 因为不同平台的
cpu 有不同平台的 machine code 所以 assembler 不是 machine independent,compiler
和 interpreter 是,因为他们在任意平台都能编辑,底下一个点是一个解释也能拿一分可
记可不记
Source code is translated into machine independent intermediate code not machine
dependent code
Chapter 6
Data integrity
Validation (9608 w21p13 Q7, 9608 w20p12 Q5c.iv)
Why validation? (9618 w21p11/13 Q2b.i, 9608 s21p13 Q1a)
Checks the data is sensible/reasonable
E.g. format check, checks the data is the right data type
Types of validation checks (9618 s21p11/13 Q6)
Range check 范围检测
Format check 检测 data type
Length check 长度检测
Presence check 检测是不是 NULL
Existence check 检查以前有没有出现过
Limit check 数值有没有超过最大值或最小值
Type check 检测数字选项有没有填非数字的数据 e.g. name 选项你填 114514
Checks weather non numeric data has been input a numeric only field
Consistency check 检测两个数据是不是对应的 e.g. 上一个选项填“未成年”下一个
选项填 24 岁
Checks weather two or more fields match up correctly
Uniqueness check 检测数据是不是唯一的 e.g. studentID
Checks that enter value is unique
Check digit 检测数字里的几位数 e.g. 对比身份证的最后几位数
Verification (9608 w21p13 Q7)
Why verification? (9618 w21p11/13 Q2b.ii)
Checks the data is the same as the original
E.g. double entry, visual check
During data entry (9608 w20p11 Q2d.i)
Visual check
Checks the data manually
Double entry
Checks the data twice and automatically compared
During data transfer
Parity check
Definition (9608 w21p12 Q3c)
Counts if the number of 1s and 0s in each bit is even or odd
Add a bit to make a number odd (for odd parity check) or even (for
even parity check)
Parity is recalculated at receiving end, change in parity (bits) indicates
corruption.
Even parity check 那个 parity bit 显示的是 odd 的数字,因为 odd 加一个
parity bit 等于 even
Odd parity check 那个 parity bit 显示的是 odd 的数字,因为 odd 加一个
parity bit 等于 even
Checksum
Data security
Threats to computer that is posed from networks and the internet (9618 s21p12 Q8c)
Malware
Virus (9618 w21p11/13 Q2c)
Similarity compares to other malware
Is a malicious software
Download/ install/run without user knowledge
Runs in background
Try to avoid firewall when download || Can be embedded(捆绑)with
other legitimate(正常的)/normal software when download
Difference compares to other malware
Virus can damage computer data
Virus replicates(复制)itself
Virus does not send data out of the computer (compare with spyware)
Spyware (9618 w21p11/13 Q2c)
Similarity compare to other malware
Is a malicious software
Download/ install/run without user knowledge
Runs in background
Try to avoid firewall when download || Can be embedded with other
legitimate/normal software when download
Difference compare to other malware
Spyware only records/access data
Spyware sends recorded data to third party
Spyware does not replicate itself
Hacking
Phishing
Pharming
Difference between data integrity, security, privacy (9618 s21p12 Q8a, 9618 w21p11/13
Q2a)
Data integrity
Ensuring data consistency/accuracy
Data security
Protects data from loss
Data privacy
Protects data from unauthorised access
Security measures (to protect computer systems) (9618 s21p12 Q8b, 9608 s21p11 Q2d,
p12 Q3d)
Authentication
Username and password
Biometrics e.g. fingerprint scan, retina scan, face recognition, voice recognition
Access rights
Firewall (9608 s20p12 Q7d)
Prevents unauthorised access to data
Blocks access of data that does not confirm to set rules
Maintains a blacklist and whitelist of IP address
Blocks unauthorised transmissions from unauthorised source/website/port
Monitors(监控)incoming and outgoing traffic
Two step authentication 双重认证 e.g. 使用手机令牌来登录 steam
Physical access measures e.g. security guards
Swipe cards
Digital signature (9608 s21p12 Q8b)
Encrypted data
Attached to electronically transmitted document
To verify(核实)its content that it comes from a trusted source
Encryption (9608 s20p11 Q1b, p13 Q5a)
Contents (e.g. files, source code) are scrambled by using encryption key /algorithm
The file will be meaningless (is not understandable) before decryption after the
encryption.
Decryption key /algorithm is needed for decryption (of the file) to unscramble the
content
Backup
A copy of the data is copied and stored in another location
Chapter 7
W21p11/13 Q4
Copyright (9618 s21p11/13 Q1d, 9608 w21p12 Q5c)
Definition
Formal and legal rights to ownership
Protect from unauthorised reproduction of work
Formal and legal restrictions to the use of program
Provides for legal rights of redress(退款)
Software (9618 s21p12 Q2c)
Open source (9608 s21p13 Q7b)
Source code is distribute (赠送)with the software
Free to cost
Users can modify/edit the source code
Users can redistribute(分享)the software
Free software
Users can edit the source software/code
Users can redistribute the software
Freeware e.g. 微信
Users can redistribute the software
Shareware e.g. Adobe 软件,爱奇艺
Has a trial period
Advantage
For customers
Can experience the software temporary without getting charged
Check if the software meet their requirement without getting charge
Commercial software
Definition
Commercial software owner(作者)retains the copyright, so software cannot be
redistribute
Software need to be purchase (for cost) before using
The source code is not distribute || user can not change or copy the code
Advantage
For software owners
Software owners can charge fee for the software/program
Software owners retains(保留)the copyright, so the game cannot be
redistributed without her permission
For customers
Potentially(潜在地) better support to the software owner
Redress available if the game does not function correctly
Likely to have fewer bugs if distributed under other licences e.g. open source
Why software engineer do not want to release software as open source or free software? (9608
s19p12 Q4d.ii)
Because software engineer do not want to release the source code
Does not want anyone to copy and edit the program code
Wants to make profit (money) from the software/program
Professional code of conduct 就是 ieee 那些玩意
Why code of conduct? (9608 s21p13 Q7c)
Identify what employees can do
Identify what employees can not do
Identify employee's and company's responsibility
Identify company's value
Identify what behaviour can be measure against
Why sign a code of conduct? (9608 s20p12 Q4b)
To make sure the software engineer confirms that he understands the code of conduct
To make sure the software engineer knows what behaviour is expected
To make sure the software engineer understands the consequences of some actions
To make sure the all employees (software engineer) adhere/follows(遵循)to the same
standard
Professional ethical body (9618 w21p11/13 Q4a)
Advantage for joining professional ethical body
Has ethical guidelines to follow, so software engineer dong have to decide what is ethical,
it's written down
Provide help and support to software engineers. For example, provide legal advise
Run training courses for software engineers to keep their skills up-to-date
Ethical action (9618 w21p11/13 Q4c)
Why it is important to act ethically in relation with colleagues? (9618 s21p12 Q2a)
To make sure the team members feel valued
To produce the highest standard product for the client
To work well together with colleagues
Ethical actions to make software engineer to feel more confident (9608 s20p12 Q4a.i)
For software engineer
Read about the language she will be using
Visits the office before starting to get used to the environment
Speaks to her manager about concerns(担心的事)
For manager
Invite software engineer in before starting
Introduce software engineer to the team
Give software engineer a mentor(导师)
Prepare induction(就职仪式)
For colleagues
Prepare an introduction
Provide structure support
Invite software engineer to social event before starting to work
Ethical actions to solve bad relationship (between software engineer and colleagues) problems
(9608 w20p12 Q6c)
For manager
Organise social event, external activities, and team building exercises
Discuss problems with software engineer
Discuss problems with colleagues
Assign software engineer a mentor to console the software engineer
Ethical actions to get familiar with IDE or programing language (9618 w21p11/13 Q4b.i)
Own research on how to use it
Tell manager that additional training is needed
Ask for a mentor
Practice at home
Artificial Intelligence (AI) (9618 s21p12 Q2b)
The rules / past moves / decision making algorithms of the game will be stored
AI program is trained by playing many times
AI will look (ahead) at possible moves and choose the move most likely to be successful
Computer could learn how to improve from previous mistakes by storing positive or negative
result for each choice, and changing its future choices
Chapter 8
Database (same as Database management system (DBMS))
Entity 其实就是 table (9618 s21p12 Q1a, 9608 s20p12 Q6b)
Anything that data can be stored about e.g. HOUSE, COSTOMER Field
A column, attribute in a table e.g. CustomerID in CUSTOMER table
Candidate key
An attribute or set of attributes that can be a primary key
Primary key (9618 w21p11/13 Q5a)
An attribute or set of attributes that uniquely identifies each tuple/record
Secondary key
An attribute that is a candidate key but not a primary key
Foreign key (9618 w21p11/13 Q5a, 9618 s21p12 rQ1a, 9608 s20p12 Q6b)
A field linked to primary key in another table e.g. CustomerID in RENTAL table
Relationship (9618 s21p11/13 Q7b.i)
One to one
One to many
Many to many
Referential integrity (9608 s21p11 Q5b)
Each foreign key value must have a matching value in the primary key
E.g. each value store in CustomerID (foreign key) field in BOOKING table (table1) must
have a corresponding/matching value in CustomerID (primary key) field in CUSTOMER
table (table2) 如题,考试的时候会告诉你各种 table 和 primary
Logical schema
Overview of a database structure
Data modelling
Query processor
Part of DBMS that allows user to search for data
Allows user to enter requirement
Search the data which meets the requirement
Organise the result to be display to the user
DBMS developer interface
Task that DBMS developer interface preforms (9608 s20p13 Q6b)
Create a table
Create relationships between tables
Design and create a query
Design and create a report
Design and create a form
Data dictionary (9618 w21p12 Q6b, 9608 w20p12 Q5b.ii)
Stores metadata (information) about the database
E.g. (9618 s21p11/13 Q7c, 9608 w21p13 Q9c)
Field name
Identify the fields in each table, so the cannot be repeated
Data types
To prevent wrong data enter in a field
Primary key
To uniquely identify each record in a table
Foreign key
To link tables || to create relationships between tables
Relationships (between tables)
Table names
To identify the tables
Validation rules
To ensure that data entered is sensible
Password
To allow access only to authorised personnel
DDL (9618 s21p12 Q1c.i)
Use to create the structure of database
Items can be created using DDL in database (9608 s21p11 Q5b)
Database
Table
Field
Relationships
Primary key
Foreign key
Views
Users
DML (9618 s21p12 Q1c.ii, 9618 w21p11/13 Q5c/d)
注意事项
Finding future date [date field name] > ########## "##########"代表现在
的日期 (9608 s20p11 Q7e)
date 也用的是'' e.g. '02/03/2005'
How primary keys and foreign keys is linked in tables in database? (9608 s21p13 Q8b)
[primary key name] is the primary key in table [table 1] is linked to [primary key name]
which is the foreign key in table [table 2]
E.g. EmployeeID is the primary key in table EMPLOYEE is linked to EmployeeID which is
the foreign key in table PROJECT_TEAM
Normalization (9618 w21p12 Q6a.i, 9608 w20p12 Q5c.ii)
1NF
There are no repeating groups of attributes. 其实就是 primary key 不要有重复,不过写
的时候就死记硬背这个句子就行了,不要什么 primary key
Why not 1NF? (9608 s21p12 Q4b)
There are repeating groups of attributes
Must have a unique primary
Field must be atomic || field can be split into field1 and field2
2NF
Entities are in 1NF and there are no partial key dependency.
3NF (9618 s21p12 Q1b)
Entities are in 2NF there are no (partial) non-key dependency. 写的时候别加 partial,这
里加是因为和上面做对比好理解
How access rights protect database from unauthorised access (9618 w21p11 Q5b)
Access rights
Gives manager/himself access to different elements, by having different account/logins, which
have different access rights e.g. read only, read and write, no access
Using views
Specific views can assign to people
People can only see certain fields or table
E.g. manager can only see their data for their own shop
Comparison of file-based approach and relational database
Why not file-based approach? (9618 s21p11/13 Q7a, 9608 s21p12 Q4a)
More data redundancy
Because same data need to be entered and stored multiple times
Lack of data consistency/integrity || More data inconsistency
Because duplicate (same) data might be stored as different values
Lack of privacy
User view cannot easily be implemented
Not easy to preform complex researches/queries
A new program has to be written each time
Why relational database? (9608 w20p11 Q2a, 9608 w20p12 Q5a)
Reduce data redundancy
User (e.g. teacher) usually only need to enter and store each data once
Improve data integrity (consistency or accuracy)
If searching an item (e.g. student's mark) all the result for the item should return
Improve data privacy
Prevent unauthorised (e.g. students) access to data using views
More complex researches and queries can be execute
User (e.g. teacher) can set up a query to search all the data that meet his
requirement (e.g. search all student that is below a certain mark)
Improve data dependency
Adds data without changing data that had been stored
Referential integrity can be enforced
User (e.g. teacher) cannot enter a value for a foreign key (e.g. student result) if the
value in the primary key (e.g. student ID, student) (of the other table) does not exist
Linked tables can be set up
User (e.g. teacher) can set up tables for entity 1 (e.g. students information) and
entity 2 (e.g. students results) and link them by common attribute
Chapter 9
Abstraction
Decomposition
Definition (9618 w21p22 Q1a)
Breaking down problem/task into sub problems (smaller parts)
Which make the problem easier to solve
Assigning parts of the problem to (different) teams
Chapter 10
Data structure (9618 s21p21 Q1c)
Record
Allows different data types
To be stored under one identifier
Two 1D arrays
Same index links the [data1] with [data2]
E.g. Same index links the name with the score
One of [data type1], one of [data type 2]
E.g. One of STRING, one of INTEGER
Files
How (text) files are used (9618 s21p21 Q3a.i)
Data is copied and stored to the text file from the arrays before computer is switched off
|| program is terminated(结束)
Data can be read and copied back to the arrays the next day
No need to enter data manually || only need to enter the data once
Characteristics (of saved files) (9618 s21p21 Q3a.ii)
Data is retained after the program is terminated || computer is switched off
How record (groups of data) is stored in text file (9618 s21p21 Q3a.iii)
Data items are combined to form a single string and saved as a single line in the file
Data items are separate by a special character || make each item a fixed length
Advantage (9618 s21p22)z
Fewer file operations
Disadvantage
Need algorithm to combine the data items
Abstract Data type (ADT)
Types of ADT (9608 w20p42 Q6e)
Link list
Record
Stack
Definition
Last in first out structure
Has top and base stack pointer
Uses push to add item to top of the stack
Uses pop to remove items from top of stack
Linear data structure
Queue
Definition
First in first out structure
Has start and end queue pointer
Can be circular
When end pointer reaches the last position, it returns to the first
Use enqueue to add item to the end of queue
Use dequeue to remove item from start of queue
Linear data structure
How item is removed from the circular queue to be processed (9608 w19p42 Q2b)
If the start pointer reaches the end of the queue. It becomes the index of the
first element in the queue
Checks if circular queue is empty
If empty it reports that it is empty
If not empty return the value of the of the position of the start pointer
Increment the start pointer
Link list 注意!link list 里面的 start pointer 不是一个真正虚拟的 pointer 而是开始的 node
Start pointer
null pointer
Indicates that there no further nodes in the list
How link list is implemented using variables and arrays (9618 s21p21 Q6b)
An (1D) array to store the data and a second (1D) array to store the pointers
An (integer) variable to hold the start pointer and an (integer) variable to store the
next free pointer
Node
How node (contains a data value (e.g. B)) is added to a link list (between nodes)
(9618 s21p21 Q6a)
Check for a free node in the free (node) list
Search for correct insertion(插入)point
Assign the data (e.g. B) to the first node in the free list / node pointed to by
start pointer of free list
Pointer from (the data before the added data) (e.g. A) will be changed to
point to node containing (the added data) (e.g. B) instead of (the data after
the added data) (e.g. C)
Pointer from (the added data)(e.g. B) will be changed to point to node
containing (the data after the added data) (e.g. C)
Start pointer in free list moved to point to next free node 注意,free list 也
有 start pointer
Stack
新的东西加前面
新的东西连旧的东西
[new] [old]
Remove 最前面的(最新的东西)
Queue
新的东西加后面
旧的东西连新的东西
[old] [new]
Remove 最前面的(最旧的东西)
Array
REPEAT
Swap FALSE
FOR i 1 TO top-1
IF array[i] > array[i+1] THEN
temp array[i]
array[i] array[i+1]
array[i+1] temp
swap TRUE
ENDIF
NEXT i
Top top - 1
UNTIL (swap = FALSE) OR (top = 0)
Chapter 11
Iterations 循环
Count-controlled loop (FOR loop) 考试的时候一定不能写 FOR loop
Why count-controlled loop? (9618 s21p21 Q4b)
The number of iterations is known
Conditional loop (9608 s21p23 Q1b.i)
Why conditional loop?
The number of iterations in not known
Post-condition loop (REPEAT loop) 考试的时候一定不能写 REPEAT loop
Pre-condition loop (WHILE loop) 考试的时候一定不能写 WHILE loop
Selection
Features that make pseudocode easier to read (9618 w21p22 Q4b)
Meaningful carriable names
Indentations
Capitalized keyword
Chapter 12
Program Development Life Cycle
Stages in the life cycle
Analysis 提需求
Design 设计
Define the data structure
Design algorithms/flowcharts/pseudocode
Design the user interface / web page layout
Define testing method/plan
Define the programming language
Coding 写程序
Testing 测试
Maintenance 维持
Types of Life cycle (9618 w21p22 Q2b.i)
Waterfall
Definition
Liner 彻底完成 design 之类才能到下一步
一开始用户接入提需求,最后在介入
Why using waterfall
Provide a working model/prototype(原型)at an early stage for review
Iterative
用户接入很大,对于一个小部分
Why using Iterative
Provide a working model/prototype(原型)at an early stage for review
Rapid Application Development (RAD)