Remember_Computer_Science_ (1)
Remember_Computer_Science_ (1)
as possible :)
Software
A software is a set of instructions written in a programming language that performs a certain task in the computer.
Managing Provides
● Files and directories ● Platform for the OS to run
● Interrupts ● System Security
● Memory ● User Interface
● Peripherals & drivers
● Multi-tasking
● User Accounts
Driver: Software that is required for the communication between two devices which are externally
connected, which translates code from one device to another.
A firmware is a program that provides low level control for devices. For example: Bootloader.
● Stores instruction required for bootup
● Provides a platform for the OS to load.
Interrupt is a signal sent to the computer’s CPU asking for its attention.
Interrupt Service Routine retrieves the interrupt and performs necessary actions to resolve it.
After the current FDE cycle finishes, the CPU checks the interrupt queue.
If an interrupt is found with a higher priority level than the current process then:
● The current process is stored.
● The source of the interrupt is found
● An appropriate Interrupt Service Routine is called to handle the interrupt.
1
After the interrupt is handled, the CPU then once again checks for interrupts with high priority. If none, the current process is
loaded.
Assembly Language uses mnemonics and requires assembler to translate it to machine code.
Interpreter Compiler
● Translate high level language into machine code. ● Translate high level language into machine code
● It translates the code line by line ● It translates the entire code all in one go
● Code needs to be run every single time. ● Code needs to be compiled only once.
● Which requires an interpreter software to run. ● Doesn’t require a compiler to run the code.
Integrated Development Environment (IDE) is a software that allows users to write, edit and execute code.
● Purpose: To translate the code to low level language
2
● Access Web pages ● Save Bookmarks & Store Cookies
● Render HTML & display it to the user ● Provides address bar and navigation tools
● Render HTML
● User History
● Multiple Tabs
Web Servers: A web server is a remote computer that stores the files needed to display a web page on the
Internet.
URL is a text based address that is used to uniquely identify a webpage on the internet.
Format: protocol://[domain host].[domain name].[domain type]/[path]/[filename]/
Cookies are small text files sent by a website to the user’s browser, to remember the user's preferences every time they
visit the website.
Stored temporarily in the primary memory Stored permanently in the secondary memory
Will be deleted as soon as the browser is closed. Will be deleted if the user deletes it or expires
3
Cryptocurrency is a form of digital currency that uses decentralized computers to monitor transactions (No
government intervention)
Block chain is a digital ledger which is a time-stamped series of records that cannot be altered.
● It is secure because every participant in the network has a copy of the transaction that can be verified.
Brute Force The perpetrator tries multiple combinations of passwords 2-factor authentication.
until it finds the correct one to gain unauthorized access to Use stronger passwords that contains
their accounts. symbols and numbers
Data The perpetrator uses a packet sniffer to collect data that is Use WEP encryption protocol & firewalls.
Interception & being sent on the network through a router to compromise the Avoid using public wifi.
Theft user’s login details to gain unauthorized access.
DDoS attack The perpetrator spreads malware to infect as many Use a proxy server
computers as possible to turn them into botnets to repeatedly Use anti malware software
spam traffic to web servers, potentially crashing them and
preventing users from accessing it.
Hacking The perpetrator hacks user’s devices or accounts to gain 2-factor authentication
unauthorized access to their data without their consent. Use stronger passwords that contains
symbols and numbers
Biometrics
Phishing The perpetrator sends legitimate looking emails to users Avoid clicking any unwanted links
requiring them to follow a link to a fake website.
Ensure the website is genuine by
Pharming The perpetrator causes the user to install a malware that checking its URL
redirects users to fake websites.
Both phishing and pharming are used to trick users into giving their sensitive information to compromise their data
4
All the malware mentioned requires two basic things: Anti Malware Software & Firewall
Type of Malware Purpose Prevention
Virus A malware that can self-replicate with the intention Avoid downloading third-party
of corrupting and deleting user’s files, by causing softwares from the internet.
a crash to the user’s computer
Mindfulness while clicking
Requires an active host, thus the virus affects a unwanted links
software by attaching itself to the program.
Backup any data.
Requires the user to initiate it.
(AMB)
Worm A malware that can self replicate with the intention Mindfulness while clicking
of corrupting computer network by spreading unwanted links
over the network by finding vulnerabilities
Scan computer networks regularly
Doesn’t require an active host
Doesn’t require the user to initiate it. (MS)
(UUUU)
Adware A malware that floods the end-user with unwanted Mindfulness while clicking any
advertisements on websites and applications. unwanted links
Ransomware A malware that encrypts the user’s data on the Backup any important data
computer and holds it hostage until a payment is
received by the perpetrator (B)
Trojan Horse A malware that disguises as legitimate software Avoid downloading third-party
with the intention of harming the user’s computer. softwares from the internet.
Requires the user to initiate the program Mindfulness while clicking any
unwanted links
(AM)
NOTE: Firewalls DON’T encrypt data being sent over the network.
Proxy Servers Acts as an intermediate between the user and the web server (FACK U W[enny])
5
Examines any incoming and outgoing traffic.
Allows faster access to web pages with the help of cache.
Secure Socket Layer SSL is a security protocol that encrypts any data that is sent over the network.
(SSL)
The browser sends a request to the web server for its SSL certificate in order to
authenticate itself.
The web server sends a copy of its SSL certificate which contains a public key .
The browser uses the public key for authentication to establish a secure connection to
take place.
Hardware
● A CPU (Central Processing Unit) processes and executes instructions that are input to the computer
so the result can be output.
● A microprocessor is an integrated circuit on a single chip.
Registers High speed memory components that temporarily stores data in the CPU
6
PC → Stores the memory address of the next instruction to be fetched.
MAR → Stores the memory address of the instruction that is about to be fetched from the RAM
MDR → Stores the instruction that has just been read from the memory.
CIR → Stores the instruction currently being decoded and executed.
ACC → Temporarily holds values while the ALU performs calculations
An instruction set is a list of all the machine code commands that can be processed by a CPU. It contains a
series of operations [opcode and operand]
Fetch:
● The PC holds the memory address of the next
instruction to be fetched.
● The memory address is copied to MAR from PC via
address bus.
● The memory address is then sent to RAM to locate the
instruction.
● Instruction is then sent to the MDR via data bus.
● Instruction is copied to CIR.
● PC increments so that the next instruction can be
fetched.
Decode:
● The instructions are then decoded by the CU using an
instruction set.
Execute:
● ALU performs operations and stores interim values in
the accumulator if needed.
● Instruction is executed and the cycle repeats.
Cache A small fast memory built inside the CPU that is used to store instructions that are
frequently used by the CPU.
The larger the size of cache, the less time it spends retrieving/looking for frequently used
instructions.
If the size of cache is extremely large, the CPU will then spend more time looking for the
frequently used instruction, so a limit is set.
A higher number of cores allows more FDE cycles to be completed at the same time.
However, if there are more number of cores, the time taken for the CPU to communicate
with each core increases
7
Clock Speed Controls the number of FDE cycles completed each second. Measured in Hertz (Hz)
Increasing the clock speed means, more number of FDE cycles are being completed each
second
Embedded Systems are the combination of software and hardware that are used to carry out specific tasks or
functions. They are different from general purpose computers. (SCC, SDC)
Acoustic Detect any unusual sounds Infra-red Detect the motion of any object
Flow Measure the rate at which fluids Magnetic Used in anti-lock braking systems
are flowing Field Used in turbine & motors
Gas Detects the presence of gas Moisture To detect moisture or the dampness of
Measure gas levels any object.
Humidity Measure water vapour levels in air pH Detect the acidity or the alkalinity of any
object
And the rest of the sensors are pressure, proximity and temperature (self explainable)
Describe how the sensors and the microprocessor are used in this system.
● Suitable sensor used e.g. motion sensor/pressure sensor
● The sensor continuously sends digitised data to the microprocessor by converting the Analogue data
into Digital data using ADC
● The microprocessor compares the data with set values
○ If value fall outside range, a signal sent to actuator to do work
○ If value fall within range, no action taken
● It repeats as it’s a continuous loop
Primary storage contains data that can be directly accessed by the CPU.
● Volatile (Exception is ROM)
● Only internal
RAM ROM
8
Hold instructions that are currently in use Hold instructions required for boot up
Secondary storage contains data that cannot be directly accessed by the CPU.
● It is used to permanently store data
● Used for the creation of virtual memory
The read-write head uses magnetized (1s) and demagnetized dots (0s) on the platter to
store information.
Optical Storage: CD
The optical storage uses circular discs and a read-write head with a laser to store DVD
information. Blu-Ray
As the discs spin, the laser makes indentations by burning data onto the surface which
creates pits (1) and lands (0). (CD < DVD < Blu Ray)
DVD uses dual layer technology which allows .. which has a shorter wavelength thus it
it to store more data compared to CD allows more data to be stored in it
compared to CD/DVD.
SSDs use NAND and NOR gates, which consist of millions of floating / control gate
transistors.
Each transistor can trap and store electrons, representing binary data.
9
● When needed, the pages are moved from virtual memory
back to RAM.
Cloud Storage: A collection of servers that is used to store data in a remote location that can be easily
accessed using an internet connection
Affordability No upfront hardware costs, but requires an ongoing High costs due to hardware purchases
payment
Accessibility Accessible from anywhere with the internet. No internet required for access.
Maintenance Managed by the third party Needs to be managed by the user with security
Scalability Storage can be easily expanded Storage cannot be easily expanded due to high
costs
A NIC/WNIC ([Wireless] Network Interface Card) is a hardware that is required for a device to connect to a
network.
It contains a MAC address (Media Access Control) which was generated during the manufacturing process.
● It is usually written in hexadecimal code.
● The first 6 digits refer to manufacturers code, the last 6 digits refer to the serial code.
● 48 bits ( 6 groups x 8 bits) in total separated with dashes.
Dynamic IP Address is an IP address that changes every single time it connects to the network.
● IP address is assigned using DHCP by their ISP provider
Static IP Dynamic IP
Faster Slower
When talking about a IPv4 or IPv6, first state their features and then their characteristics:
IPv4 can be both static or dynamic. Uses denary starting from 0 - 255
It can public or private 4 groups of denary numbers, separated using dots
32 bits
10
It is assigned by the ISP It is assigned by the manufacturer
Has no serial code or manufacturer code Has serial code and manufacturer code
Actuators Makes physical changes causing a mechanical parts to move based on instructions given by the
microprocessor
Robotics is a branch of CS that brings together the design, construction and operation of Robots.
● Factory Equipments, Domestic Robots and Drones
Advantages and disadvantages are pretty much the same for Robots too as well, here are some new ones
Can work 24/7 Can cause the people to be deskilled
It frees the farmer up to do other jobs
It can perform boring repetitive tasks
11
● Has the ability to learn or adapt
It has an interface used to input data and view output It has the ability to learn, adapt or change by editing its own
It has a knowledge base, rule base & inference engine data & algorithms
The inference engine applies rules from the rule base to It can be trained as it can learn with/without human
the knowledge base to provide diagnostics that are used to interaction
derive conclusions.
Analyses patterns and stores successful and unsuccessful
Decides what to ask next based on the previous and current results to influence future decisions
data input
Data Representation
How and why do computers use binary to represent all forms of data?
● Computers use logic gates/switches that only process the values 1 and 0 which are stored in registers.
A character set is a list of characters and symbols that can be represented by a computer system, where each
character and symbol is assigned with an unique value. For example: UNICODE & ASCII
Uses ASCII includes a limited set of Unicode includes many more languages
languages & emojis
Storage Space Less storage is used than ASCII More storage is used than ASCII
Image Sound
An image is a series of pixels that are converted A sound wave is sampled as it is converted to binary,
to binary, which is processed by a computer which is processed by a computer
● A camera captures an image, which is then turned into ● A microphone records sound, which is then sampled
pixels. by measuring the amplitude.
● Each pixel is given a binary value, as they form a grid ● With each amplitude having a unique binary value.
to create an image
12
The sample rate is the number of samples taken in a
The image resolution is the dimensions of the image second
The colour depth is the number of bits used to The sample resolution is the number of bits per sample
represent each colour
Each sample is taken and then converted to binary.
The file size and quality of the image increases as
the resolution and colour depth increase The accuracy of the recording and the file size increases as
the sample rate and resolution increase
Always remember that, KiB starts with 210 and ends with PiB with 250
Importance (BTS):
● Less bandwidth required
● Shorter transmission time
● Less storage space required
● Less time taken to upload or download files
Lossy compression is when data is permanently removed Lossless compression is when data is encoded in order to
in order to reduce the size of the file on secondary storage reduce the size of the file on secondary storage
Lossy compression is irreversible, as file can’t be restored Lossless compression is reversible, as file can be restored
Lossy can greatly reduce the size of a file but at the Lossless can reduce the size of a file but not as
expense of losing quality dramatically as lossy
Lossy is only suitable for data where a loss in the quality is Lossless is only suitable for data where a loss in the quality
acceptable is unacceptable
NOTES: All sorts of calculations are not included here. Please refer to your textbook for that
Data Transmission
● Consist the IP address of the ● Consist of the actual data (around ● Method of identifying the end of
sender and receiver. 64 KiB) the packet
● Size of the packets ● Error checking method (CRC)
● Sequence number of packets
13
Packet Switching
Data is broken into small number of packets where each packet takes a different route
Router controls the route each packet takes while selecting the shortest possible path available
Packets may arrive out of order, so they need to be reordered at their destination.
If a packet is missing/corrupted, it is requested again.
Advantages Disadvantages
No need to tie a single communication line Packet may arrive in different order
A high data transmission rate is possible Packets can be lost and need to be re-sent
Relatively easy to expand the packet usage Delay at destination while the packets are being re-ordered
Serial: Data is sent one bit at a time over a single wire Parallel: Data is sent multiple bits at a time down multiple
(CLAWS) wires
● Cheaper ● Expensive
● Arrives in order, no need to be reordered ● Can arrive out of sequence (skew)
● Less interference thus less chance of errors ● More interference, thus high chance of errors
● Works well over longer distances ● Works well over short distances
● Slower response to requests ● Faster responses to requests
Universal Serial Bus is the industry’s standard to transmit data. It makes the use of Serial Data Transmission
The USB interface includes a: Port, Cable, Connection, & Device
Advantages Disadvantages
Errors can occur during data transmission Data loss can occur due to: Prevention (SAM):
● Data Loss
● Data Gain ● Human Error ● Surge Protection
● Hardware Failure ● Access Rights
● Data Change
● Physical Damage ● Make regular backups of data
● Power Failure
ECM Description
Checksum Checksum is an additional value that is calculated based on the block of data using a checksum
algorithm which is sent alongside the data during data transmission.
Echo Check A copy of the transmitted data is sent back to the sender to be compared with the original data.
Check Digit A value is appended to data that has been calculated using the data. This value is checked on data
entry. Note: This is a data entry check NOT a data transmission check
… if there is any difference between the values and error must have occurred
14
Describe how parity checks and ARQ operate together to detect and correct errors
Encryption is a method that uses a key to scramble the data to make it meaningless by converting it from plaintext to a
cipher text.
● Plain text is encrypted into a cipher using an ● Plain text is encrypted into a cipher using an algorithm
algorithm that uses a public key. that uses a public key.
● The key is sent to the receiver, which can be used to ● The receiver uses their private key to decrypt cipher text
decrypt the text back to plain text
Hardware (CONTINUED)
A camera that is used to scan the QR code A barcode scanner is used to scan barcodes.
The three large squares are used to define the Scanned using a barcode reader that shines red
alignment of then QR code laser light
Light is reflected back since white lines reflect more Light is reflected back since white lines reflect more
light than black lines light than black lines
Each small square is converted to a binary value Different reflections are converted to binary values
which are then processed by a microprocessor.
15
Infrared Touch Screens ● Good durability
● Allows multi-touch facility
Uses an invisible grid on the screen
● Screen will shatter and break
When the finger touches the screen, it breaks the
infrared beams which are detected by a sensor…
… which sends a signal to the microprocessor, calculating the exact touch coordinates.
A DMD chip has numerous micro mirrors that A powerful light beam is shone at a chromatic
adjust based on data received by the computer. coated mirror, splitting the image into red, green,
and blue components.
These micro-mirrors create a grayscale version of
the image from the light source. Three separate versions of the image are created.
A bright light is shone on the DMD chip which A prism is used to recombine the image, producing a
passes through an RGB filter that helps to transform large, full-color display..
the grayscale image into a full-color display.
Higher contrast ratios & reliability Provides a sharper image & Better color saturation
Runs Quieter than LCD projector. More efficient use of its energy
LED Screens:
● Made of tiny red, green, and blue light-emitting diodes.
● Brightness is controlled by varying electric current, creating millions of colors.
● A diffuser is used to distribute light evenly
● Used in outdoor advertising and sports scoreboards.
LCD Screens:
● Made of liquid crystals in a matrix of pixels.
● Require backlighting (usually LED) since they don't emit light.
● Liquid crystal properties change with the varying electric field.
PAPER 2
16
Analysis It is the abstraction, decomposition, and the identification of the problem and its requirements
Design Develop an algorithm to solve the problem using structure diagrams, flowcharts or pseudocode
Abstractions Decomposition
Structure Diagrams
Structure Diagram A diagram that shows the design of a computer system in a hierarchical way.
Flow Chart A diagram that shows the steps required in order to solve a task
Tips Purpose
Comments To annotate each section of the code to define its purpose, for example: Logic or Syntax
Meaningful To clearly identify the purpose of variables, constants, arrays, procedures etc. For
Identifier names example: INT DaysInAYear = 365
17
Validation is an automated check carried out by a Verification is a check carried out to make sure that
computer to make sure the data entered is sensible & a value entered has not changed during input
reasonable
Range Check To check that the value of a number is between an upper values and a lower value
Length Check To check that the data entered has an appropriate number of characters
Type Check To check that the data entered has an appropriate type
Format Check To check that the data entered matches with a predefined pattern
Visual Check To ensure that data has been accurately copied from one source to another
Double data Entry Data is entered twice, the two entries are compared and if they do not match, a re-entry is
requested
Test Data
Boundary Data One value which is accepted while the other is rejected
CONDITIONALS
Count controlled: number of iterations is predetermined
Pre-condition: checks condition at start of loop so loop may not iterate
Post-condition: checks condition at end of loop so loop always iterates at least once
Library Routines
18
Linear Search
CONSTANT ArrayLength 50
DECLARE Number : INTEGER
OUTPUT "Enter a number to search for"
INPUT Number
FOR Count 1 TO 50
IF Number = Arr[Count] THEN
OUTPUT "Number found"
ENDIF
NEXT Count
Bubble Sort:
DECLARE Swap : BOOLEAN
DECLARE Temp : INTEGER
DECLARE Item : INTEGER
CONSTANT ArrayLength 10
REPEAT
Swap FALSE
FOR Item 0 TO (ArrayLength - 1)
IF Arr[Item] > Arr[Item + 1] THEN
// Store the value
Temp Arr[Item]
// Swap Values
Arr[Item] Arr[Item + 1]
Arr[Item + 1] Temp
Swap TRUE
ENDIF
NEXT Index
UNTIL NOT Swap
// Notes: For P2 I recommend you using pupnotes, since I didn’t cover everything necessary.
// TO DO:
19