You are on page 1of 115

Computer Science Theory Notes

September 2023
Chapter 1
System Fundamentals
Reasons for a new system

• To replace a currently inefficient, outdated, or redundant system

• To replace a system not suitable for its original purpose

• To replace a faulty system

• To increase productivity or quality of output while minimising costs


Organisational Issues of new systems

• Installation process: putting the new system in place

• Defining user roles and operational changes in the organisation: control, authority
and access

• Compatibility with existing systems: format, conventions

• Mission statements / Organisational culture change: non-IT to IT-oriented


Success Factor of new systems

• Ability of the system to be used through effective training

• Managing the changes successfully

• Benefits to the company and Organization

• Appreciation of the benefits by stakeholders


Change Management

• A systematic approach to dealing with change, moving an organisation from one


stable state to another

• Why? - to keep things running and successfully implement complex systems


which could behave in unpredictable ways
Factors of Change Management
• Continuity in operations: maintain the day-to-day work of the company, no major
disruptions, especially in critical systems!

• Data Integrity: protect data from being lost, corrupted or hacked when
transitioning them from old to new system

• Privacy: the need to maintain security of data and prevent them from being
compromised

• People: reaction against change, acceptability and adaptability factors

• Costs: the effectiveness of the change and the cost must be healthily balanced out
Legacy System and Mergers

• Legacy system is older IT equipment that has been suspended or made obsolete by
the rise of new equipments

• They can still work with the equipments that support its functionalities

• Business merger is when one company joins with another company in organisation
structure and operations, therefore causing data to be combined

• The two business integrate their operations, services, data and information
Problems in Mergers and Legacy
Systems
• Hardware compatibility: same equipment used on data?

• Software Compatibility: can be used with existing to manipulate data?

• Data versions and conventions: same type of data and structure across?

• Knowledge of staff about system: users will be able to handle system?


Outsourcing

• Letting someone outside the organisation deal with certain parts of its computer
system

• Leads to cost saving and specialisation benefits

• Number of IT services offered could be increases


Remotely Hosted System

• Computer systems could be hosted entirely on servers and technical equipment


that belong to another company.

• Benefits: specialisation, reliability, saved resources, less maintenance, low cost

• Drawbacks: lack of control (hard to fine tune to unique needs), security issues
Cloud Storage

• Saving data on another company’s or remote servers as main storage or backup

• Apple Cloud, DropBox, Google Drive are used for personal needs, compared to
AWS or BitBucket for big softwares

• Benefits: more reliable, access anywhere, easier sharing, cost saving

• Drawback: slow retrieval, server farms pose environmental issues, privacy and
security concerns
Software as a Service (SaaS) Model
• A way of delivering applications over the internet as a service such that any
company or individual can make use of it to do their processing

• Executed on remote servers in a way that only “thin client” or front-end


processing visible to main user

• Microsoft Azure and AWS (Amazon Web Services) are common platforms for
SaaS

• Benefits: cost savings, no robust equipment needed, specialisation, updated

• Drawbacks: less control, privacy and security, dependency on internet connection,


time zone issues
Changeover Methods
Definition Advantages Disadvantages

All the old system terminated


Immediate, no compatibility Confusion, less time to adapt, no
Direct Changeover and immediate installation of
problems, low cost backup, pressure to succeed
new

Old and new system running Can go back to old one if fail,
Lot of money, extra time and
Parallel Changeover together till new system fully backup available, compare
effort, employees get stressed
implemented and safe results for accuracy

System introduced to certain Doesn’t show true outcome of


Easy to improve, easier training,
Pilot Changeover parts of organisation then complete implementation,
less risk during system failure
extended to others disconnection, up-front costs

Less shocking, prioritise, safe, High cost, complicated, more


Gradual replacement of old parts
Phased Changeover economically viable, staged mgmt needed, compatibility
with new ones
training more efficient problem, inequality in org.
Problems of data migration

• Incompatible formats due to time-zone, language and convention differences

• Data lost in migration leading to potential risks in operations

• Unavailability of system during migration causing service disruption

• Data keeps coming in during migration causing complications


Testing - general overview

• Methods that are used to make sure that system is performing as per expectations,
is accurate and precise with any computational results.

• There are various stages to testing

• General factors include: all outputs, criteria for success, analogous considerations
Types of testing

• Debugging - to remove errors include syntax, semantic and runtime, improving


efficiency and optimising system for good working

• A/B Testing - gathering feedback from users through controlled experimentation,


however it harder to isolate system components for specific outcomes

• UAT (User Acceptance Testing) - testing by client community against


requirements before release

• Beta Testing - releasing a sample version to public to test under real-world


conditions, not a completely finished or polished version
User documentation

• Documents for a product that are provided to end-users to help them understand
and use it effectively and efficiently.

• Helps new users to get used to software, boosts speed of implementation, explains
sophisticated and unique features for productivity

• Can be in the form of user/installation manuals, configuration/reference guides,


admin guides or online help
Things to consider when providing
docs
• Accessibility

• Understandability

• Environmental impact

• Efficiency

• Conciseness
Training Methods

• Self Instruction: users learn about the system at their own pace

• Formal Classes: training using a formal instructor and syllabus

• Remote Learning: through applications or course management platforms to deliver


lessons publicly and receive certifications
Causes of Data Loss

• Hardware damage • Malfunction of software


• Electromagnetic Interference from
devices that intercept signals • Incomplete Read/Write functions
(improper ejection)
• Physical Loss

• • Natural disaster
Hacking

• Theft • Malicious activities


Consequences of Data Loss

• Loss of attention for emergencies (such as in hospitals due to lack of records)

• Inability to track progress

• Data confusion

• Aggression and aggravation of situation


Methods to prevent data loss

• Physical methods: safe-keeping, backup power supply

• Removable media: store in multiple different types of data storage devices

• Failover System: to takeover the system processing in case original system fails

• Offsite/Online storage: storing a backup copy elsewhere from original locatiom


Types of Software Releases

• Update: a newer version of a software application including new features and


increased efficiency or performance in some way

• Patch: a software application that needs to be released, installed or patched onto a


certain version of software application to fix glitches or problems

• Deployment methods include online download, packaged CDs and DVDs, FOTA
(Firmware over the Air), Flash-stick

• Need to evaluate advantages and disadvantages also


Key components of system design
• Hardware: the physical parts of a computer such as monitor, mouse and keyboard

• Software: the programmes, drivers, libraries that a computer needs in order to


perform tasks

• Peripherals: Device connected to the computer to add to its functionality

• Network: A series of points or nodes interconnected by communication paths that


allow data exchange b/w computers

• Human Resources: all the people involved in an IT network


Client-Server Model

• Devices are linked together to establish a network by assuming the role of a client
(a device receiving data) or a server (a device giving data)

• Examples of servers include E-mail server (allowing computers to setup email


accounts and manage mail) and DNS server (to help the internet keep track of
where to find all websites)

• Other important server computers include a router (that routes files and other data
from one place to another) and firewall (that authenticate IP addresses that access
computer or network)
Social and Ethical Issues
Social Issue - affects society Ethical issue - morality

• Language • Copyright violation: stealing someone’s


• Ruining of real-life interactions intellectual property
• Cyber-bullying • Plagiarism: claiming someone else’s
• Piracy intellectual work as their own
• Identity Theft • Privacy invasion: invading someone’s personal
• Cybercrime life
• Hacking • Anonymity: Disrespect of someone’s desire to
• Lack of mindful moments not reveal their identity
• Health Issues • Criminal activities like hacking
Methods of collecting requirements
• Surveys: quick, easy, anonymity, large scale, objective and honest, statistical
analysis possible. Lack of follow up, insecurity, biased data creation, unclear data,
loaded questions, trolling
• Interviews: direct feedback, follow up, nonverbal reactions, in depth. Hard to
schedule, time consuming, cost, not anonymous, dishonest opinion, sensitivity
• Observation: real and natural data, more details and depth, less data gathered,
Hawthorne Effect, time consuming, difficult to analyse
• Focus groups: interaction, easier to understand, nonverbal response, efficient,
underlying issues surface. Small size = not a good rep, peer pressure, difficult to
control, domination.
System Study Processes
• Examination of current systems

• Suggestions and problem reports / analyses

• Improvements made by users / workarounds

• Organisational capabilities

• Analysis of competing products

• Literature search and market research


Illustration of System Processes

• IT System Flowcharts

• Data Flow Diagram

• Structure chart / UML Diagrams


Prototyping

• A model that represents final design and functioning of a product without


implementation of full functionality

• Software prototypes - wireframes, diagrams

• Hardware prototypes - robot model, draft pieces

• Purpose - seek feedback and clarification to refine planning process


Iteration - Agile Process Planning
• Iteration: repeating the design cycle iteratively to develop complete product
Usability of a system
• The degree to which a product is easy to use

• Consideration factors

• Learnability / Memorability - less complicated

• Efficiency / Error-free - accurate and does only required processing

• Satisfaction - visual aesthetic, fulfilling

• Ergonomic - comfortable

• Accessible - to the impaired and disabled


Chapter 2
Computer Organisation
The CPU (Central Processing Unit)
• The single most component of the computer that controls its entire working and
• Components
• ALU: basic logical and calculative operations
• Control Unit: input and output control
• Address bus and data bus: transfer of memory addresses and data values
• Registers: general memory locations purposed for different functions
• MAR/MDR: holds the addresses of the data and the data itself
• RAM: Runs current processes
• Cache: common tools and utilities stored
Primary vs. Secondary Memory

• Primary Memory: direct interaction with CPU (RAM and ROM)

• RAM - volatile, stores currently open programs, BIOS and OS loaded in here

• ROM - nonvolatile, stores the OS and BIOS, immutable, written just once
during creation

• Secondary Memory: stores data and is accessed by components of CPU (External


storage device)
RAM v. ROM
Cache Memory

• A part of the computer that stores data and commands used over and over again

• Multimedia operations and other forms of frequently used data are stored in the
cache so that they are retrieved quicker

• Located conveniently between RAM and CPU to decrease latency


Machine Instruction Cycle (a.k.a
FDE)
Persistent Storage

• Definition: storing data in a location for long period of time without deletion

• To store data during and/or after running of program

• Some data is critical and must be stored. Persistent storage is necessary for this
What is an Operating System (OS)?

• Operating system is the collection of software programmes that run the computer
and its various hardware components, acting as an interface between these two
components

• High level operations are performed and seeable to the users - GUI processing,
WIMP

• Low level operations are instigated and run in the background - kernel, BIOS
Functions of the OS

• Machine management - tasks, programmes by a process called time-slicing (where


CPU components are portioned out for each task)

• Memory management - to parcel out the memory in a fair and efficient manner
while obeying to prioritization commands such as interrupts by a process called
pagination (assign a page to each task and put one on sleep while executing
another)

• Hardware interfaces and peripherals - for device drivers that help create an
interface between computer processing and devices
Functions of the OS

• User Access Levels: which users can use the device and what kinds of access can
they have over the system

• File Management: folders, stacks, documents management and placement

• Utilities: disk utility, colour utility to perform checks on computer for health or
colour detection (more geeky tasks)

• Security: password, keychain, firewall, antivirus, biometric authentication, etc.


Binary Representation

• Binary representation is the single way in which data is understood by computers


that contain open circuits to perform its operations

• Bit - one single binary digit that is either a 1 or a 0

• Nibble - 4 bits or 1/2 a byte

• Byte - 8 bits
Data Representation Types
• There’s binary (obviously!)

• Denary or Decimal notation (in the base 10)

• Octal (in the base 8)

• Hexadecimal (in the base 16)

• String and Characters

• All of these can be represented using binary digits for final processing by the
CPU.
Hexadecimal Uses
• Colour Codes: in the form RR GG BB which each stands for Red, Green or Blue
and each digit ranging from 0 to 9 and A to F

• MAC Address: uniquely identities system on the network and is represented by the
format XX:XX:XX:YY:YY:YY where the first three pairs denote manufacturer
and second three pairs denote unique device

• Unicode: the characters needed to construct the Asian or Latin-based languages


including English

• ASCII (American Standard Code for Information Interchange): elements replaced


by hex digits
Boolean Logic

• ON = 1

• OFF = 0

• Order of Operations - NOT,


Parentheses, And/Nand then
Or/Nor/XOR from left to right
Chapter 3
Networks
Networks - overview

• Network: A system in which multiple systems are connected to each other and
share information

• However networks vary vastly in terms of geographical span and use. Hence, it is
important to identify the most suitable kind of network connection based on the
situation.

• In exams, therefore, you may be asked to evaluate the pros and cons or
applicability of one or more different types of networks!
Types of Networks
Type Definition Components

LAN (Local Area Network) A network in a confined area Hub and Ethernet Cables

A logical confinement defined for Another network, potentially the broader


VLAN (Virtual LAN)
closely connected computers internet

A network in a confined area without the Wireless Access Point and network
WLAN (Wireless LAN)
use of physical wires and/or cables segments

A network of one or more LANs


LANs, Hubs and Ethernet Cables and/or
WAN (Wide Area Network) connected together across separate
wireless access points
geographic locations.

Group of servers connected together in a


Servers that appear as single storage
SAN (Storage Area Network) single network for computational
locations between sets of each other
purposes
Types of Networks
Type Definition Components

A web of all the connected computers,


Internet Computers!
servers and domains on the internet

A network available only to members of Members of the organisation, local


Intranet & Extranet
an associated organisation servers, computers and networks

Group of computers connected through


VPN (Virtual Private Network) encrypted lines within a LAN or else, Computers, encrypted lines
around the world

Bluetooth connectivity, personal


A network of one or more devices within
PAN (Personal Area Network) computing device, audio devices and
a personal range
peripherals

When two or more computers share files


P2P (Peer-to-Peer) Network Computers and connections!
without the need for servers/hub
Network Standards

• Standards are a set of guidelines or minimum requirements about different things

• For example, PCI (Peripheral Component Interconnect) allows extension of


peripheral capabilities by inserting its appropriate card

• They provide a common ground for building systems and interconnecting products
which would otherwise be impossible

• It also helps users expect some kind of performance and safety from the
components
Some common network standards
• Cables - CAT5 and CAT6
• Plugs, Terminals and Sockets - RJ45
• Hubs (signal broadcasters), routers (connectors), switches (path determiners)
• Gateway into a LAN (to enter)
• Network Cards (a passport for the computer in the internet world!)
• Wireless Broadcast Stations (send large amount of signals across WANs)
• Wireless Receivers (receive signals in order to connect computers wirelessly)
• Modems (modulator-demodulator)
Network Protocols
• A set of standards that provide preset ways to communicate and interact
• Controls flow of network by dictating ways of controlling traffic and prevent
overwhelming
• Prevents congestion of network by staggering data, re-directing network traffic and
flushing the network
• Prevent deadlock when the network grinds to a halt due to high congestion by
frequent ARQs (Automatic Repeat Requests)
• Data integrity is ensured by the correctness of data over its lifespan of transmission
using error checking algorithms like parity, checksum and
The OSI Model of Networking!
• Application: Provides the user the ability to interact with the network
• Presentation: data representation, encryption/decryption, compression/decompression
• Session: Management of session between applications (start, manage and close)
• Transport: Delivery and receiving of packets using TCP/IP protocols
• Network: Routes the data packets through which it is transmitted
• Link: Establish point-to-point data connection
• Physical: direct, point-to-point connection via hardware
TCP/IP Protocol

• Most commonly used set of networking protocol

• Resides in network and transport layers of OSI model

• Used in packet switching


Packet Switching
A set of data is broken down into smaller chunks called “packets” and routed through
different routes
Steps in Packet Switching

1. Large data broken down into smaller packets

2. An index containing packet structure called header is sent alongside containing


source address, destination address, packet numbers and compression details

3. The packets are routed through different network lines using switches

4. The packets reach the user where it is reconstructed using the header provided
Advantages in Packet Switching

• Best possible routes can be determined

• Quick recovery from broken links during transmission

• Avoids congestion by using more than one route to make network faster

• Small delays can be tolerated

• Cheaper method due to needless mess of dedicated lines and costs


Usage of VPNs

• Companies use VPNs in order to set up remote working conditions for employees
in a safe private network (called site-to-site VPNs) across different geolocations

• Individuals use VPNs in order to mask their identity on the internet and gain
access to complete data in resources by mimicking the identity of another device
on the web. It is also used for privacy purposes and safety.
Technology behind VPNs

• Hardware: Main server (such as your computer) and tunneling server (for VPN)

• Software technologies: tunneling (establishing secure connection over another


network using same hardware and protocols such as an onion layer for TOR) and
encryption (changing normal data to cipher data that can be reconverted only using
key)

• Protocols: SSL using normal web-browser connection methodology


[Extra] SSL v. TLS
Network Nodes

• A node is an endpoint of a network where there is a router managing data traffic

• Router inspects each packet and routes it to the best link

• Important role in network traffic management


Why do transmission speeds vary?

• Constantly changing factors for network speed including number of people,


location-wise network distribution, type of activities, speed provided by ISP in
Gbps or Mbps and interference

• Stagnant factors for network speed includes hardware and software protocols that
do not change and hence don’t affect transmission speed
Steps in data retrieval
1. Data requested is taken out of the server hard drive
2. Server has software that divides data into packets for switching
3. Server puts them into network access server for routing
4. Uses fibre optic, coaxial, satellite or twisted pair wires to transmit
5. Packets reach LAN of requester using gateway / parsing firewall
6. MODEM converts analogue signal to digital signal
7. The signal goes into a wireless router that converts the signal to modulated frequency
8. Frequency picked up by computer and reassembled to open the file!
Compression
• Compression is the process of making size of data files smaller

• Includes .jpeg, .mp3, .mp4 and so on

• Networks compress data for faster transmission as per protocol in a lossless


manner. This reduces the size of data frames. There are algorithms that are used to
compress/decompress at sender and receiver end respectively

• Redundant data are usually replaced by tokens of smaller size in lossless


compression

• Needed to avoid congestion, faster transmission and limit the data being
transferred to prevent overload
Choice of data transmission: media

• Wired OR Wireless?
• Twisted Pair (Ethernet) - short distance, very fast, cheap, , no EMI, less secure
• Coaxial Cables (TV lies) - short distance, very slow, cheap, no EMI, more secure
• Fibre Optic (General) - long distance, fast, expensive, most secure, no EMI
• Wireless (any place for mobiles) - very fast, huge distances, cheap, very low
security
Security on the Internet
• Passwords - known only to user, make complicated by symbols and numbers
• Biometrics - specific to every user, unique, hard to mimic
• User Accounts - divides each user’s work
• Permissions - allows only certain users to be able to do certain things
• Trusted list of MAC Addresses - only allows certain devices to engage in data
transmission
• Firewalls - black listing and white listing of computers for accessing data during
transmission
• Encryption - makes use of algorithm to convert data into non-understandable format
• 2FA - makes use of 2 or more of these methods for added security
Evaluation of the security methods
• Authentication (no extra H/W needed, managed by individuals, works well for good password
habits, brute force attack possible, password can be broken)
• Permissions (works well with system based computer, allows multiple user to access same
files, difficult to manage, potential corruption leading to data loss)
• MAC Address control (prevents security breach, traceability of offender device, spoofing
possible)
• Encryption (no extra H/W, impossible to decipher, inconsistency prone to hacks, can be found
eventually, slows things down)
• Firewalls (free, easy to implement, comprehensive, can be breached, slows internet traffic,
expensive)
Chapter 4
Computational Thinking and Problem
Solving
Operations of a Computer
• Fundamental Operations includes the below -
• Adding and subtracting data
• Comparing data
• Retrieving data
• Storing data
• Deleting data
• Compound Operations involves combining these fundamental operations together
to perform a more complicated task
Features of Computer Languages
• Fixed vocabulary: words and symbols are set with no variation if possible

• Unambiguous meaning: words and expressions can only be interpreted in one way

• Consistent grammar rules: with spelling and punctuation

• Consistent syntax: the order of the words and expressions

• Syntax Error: an error caused due to mistake in order of the words or expression

• Semantic Error: an error caused in the logic due to different


meaning/understanding of syntax
Why high-level languages?
• In machine language the operations are too simple

• The operations in modern high level language are more abstract than basic
operation (hides unnecessary processing)

• Too long and hard to understand / learn machine language

• To provide common ground for programmers to interpret codes in different


formats

• Abstraction in High Level Language >> Low Level Language >> Machine Code
Translation of code

• Translation: changing of code from high level to machine code or vice-versa

• Because machines cannot directly understand high level language, need to be


converted to machine code first.

• Compilers - create an executable file and produces log of errors (faster but harder
to debug or catch errors later)

• Interpreters - executes line by line to give physical output and stops for errors
instantly (one line at a time makes debugging easier, slower)
Key Programming Terms

• Variable: a memory location holding a value that is prone to being changed

• Constant: a memory location holding a static value that will not change

• Operator: defines mathematical calculation b/w variables, constants and/or


numbers

• Object: a variables of a certain reference type with states and behaviours


Conditional Block
A block of code that will be executed only upon fulfilment of a certain criteria
Looping
The iteration of a certain operation until a criteria is fulfilled
Method
• A unique program code or function that is purposed for a particular set of operations
and is done only when it is called
• The signature tells us about the method’s accessibility, return type, name and
parameters list
Arrays
• A set of elements that are of the same type and nature

• Runtime error: when the program calls for an element that is not an index in the
array (such as -1 or 5 in the above case). This called “index out of bounds” in
JAVA

• .length function in arrays give the length of the array / number of elements in array
Collections
• A data structure in which elements are of several data types and values are linked
together
• Can dynamically change its size
• Methods include - .getNext, .isEmpty, .delete and so on
Sub-programmes
• Sub-programmes are those that compute small operations within a larger task
(such as taking # of students present to execute larger task of “Attendance”)

• They are needed because

• They support debugging by isolation

• They allow for repurposing code across different tasks

• They promote interchangeability of operations in the program (called


modularity)
Scope of Variables

• Local Scope: within that particular class alone

• Global Scope: across entire program

• Scope is defined using keywords private, public or protected.

• Default setting is public


Bubble Sorting Algorithm
• Shift largest value to end and go back to smallest to repeat process. Ascending
only
Selection Sorting Algorithm
• Splits array into sorted and unsorted set of values
Sequential Search Algorithm
• Checks values one by one

• Very slow method


Binary Search Algorithm
• Divide in the middle and look for values lower than that
• Only works for sorted arrays
Big-O Efficiency Notations
Chapter 5
Abstract Data Structures
Dynamic Data Structures

• Dynamic Structure: A collection of data which can grow or shrink in size

• Static Structure: A collection of data that remains constant in size

• The most important benefit for choosing dynamic structure over static is in order
to preserve memory space by initialising locations only when needed
Stacks - a dynamic data structure

• Stack: a data structure that contains elements that operate in a LIFO (Last in First
Out) method

• Items can be pushed onto the top of the stack or popped from the top of the stack

• Think of it like a stack of books. The last book kept is the first book your teacher
takes out to correct!

• In computing, errors in a program are stored by the IDE in a stack form and
unfinished methods that call store their remaining operations in a stack form too.
Stack Algorithms

• Push Method
• Pop Method

• TOP = pointer, X = new element


• TOP = pointer, X = new element

• Check for stack overflow by if TOP


• Check for stack under flow by TOP
>= N =0

• Else increment the TOP


• Else decrement the TOP

• Add X to stack[TOP]
• Return stack[TOP+1] which is the
new top element of stack
Queues - a dynamic data structure
• Queues are an implementation of a data structure that operate in a first-in-first-out
or FIFO manner

• They are made of a chain of self referencing nodes

• Items can be enqueued (added to) or dequeued (removed from)

• Think of it like a queue in front of Apple on launch day, the first person who
comes there will be the first person to go in to purchase the new phone!

• Queuing is used in computing for non-critical tasks and to give all of them
equivalent priority.
Circular vs. Linear Queues

• In circular queues, the data structure itself


is in a circular manner and has a
predefined set of values. When the
elements are all filled, the first element is
overwritten.

• In linear queues, the data structure can be


compared to a hierarchical array, one
where the first element is defined after
which subsequent elements are placed
sequentially behind the first element.
Queue Methods
• For Enqueue
• Initialisation of a “front” variable that • For Dequeue
holds the first element of the queue
• The element in the “front” index of
• If it is the first element, then the front the queue is retrieved
element should be filled

• A “rear” variable is also initialised which • The “front” index is decremented by


holds the index # of last element in queue 1

• Subsequent elements are added to this • The new “front” element is returned
index and “rear” is incremented on each
addition
Recursion

• The process in which a method is interrupted by calls to other instances of itself

• It accomplishes repetition without needing to use any looping structures

• Since the method is interrupted, they need to be placed on a stack to be handled


later on.
Integer Addition - Recursion Example
Method addIntUpTo (n)

If (n ==1) then base condition / break condition

Return 1

Else

Return n + addIntUpTo(n-1) recursion statement

End if

End method
Tower of Hanoi - Complex Recursion
Chapter 6
Resources Management
Resources in Computing

• RAM: when used up, the virtual memory is used, which is much slower so all
applications become slow

• Storage: when internal storage is fully consumed, there is no more room to store
additional files and therefore an external device must be used which is much
slower

• Cache: overall functioning is slower when the cache server is not enough

• Processor: slow clock speed or lack of sufficient processors or cores causes all of
the processing to slow down and have a greater possibility of freezing
Resources in Computing

• RAM: when used up, the virtual memory is used, which is much slower so all
applications become slow

• Storage: when internal storage is fully consumed, there is no more room to store
additional files and therefore an external device must be used which is much
slower

• Cache: overall functioning is slower when the cache server is not enough

• Processor: slow clock speed or lack of sufficient processors or cores causes all of
the processing to slow down and have a greater possibility of freezing
Key terms
• Bandwidth: a range of frequencies within a given band used for transmitting signals
• Sound processor: a circuit that transforms digital audio signals into analogue sound
• Graphics processor: a circuit that transforms digital visual signals into analogue visuals
• Super computers: computers with high processing speeds mainly used in servers
• Mainframes: large storage devices that incorporate big servers
• Sublaptops: smaller laptops for on-the-go use
• PDAs: personal digital assistant
System resources at the limit!

• Single user system: regular PC used by individuals in households or in small


offices

• Multi-access user environment: more than one user is accessing the system at a
given point of time

• Multi-programming environment: more than one program is running on the system


at a given point of time
Prioritisation

• First In First Out (FIFO) - the first element that came in the system is the first
element to go out

• Shortest Job First (SJF) - based on the time taken to execute, the shortest task is
done first

• Priority Scheduling (PS) - based on any interrupt or priority signals for the tasks
that require immediate attention

• Last In First Out (LIFO) - the last element that came in will be the first element to
go out.
Paging
• A memory management technique in which CPU retrieves data from RAM in
same-size blocks called “pages”

• The pages are linked together in a map to their equivalent ram frames

• The addresses are recorded on a page file for retrieval

• This is beneficial due to being able to accommodate large files, takes less time,
less tracking, if one frame corrupted, rest can be found, helps setup virtual
memory

• When RAM is full, some pages are loaded into a part of the hard drive called
virtual memory
Interrupts

• An instruction sent to CPU to stop current processes and address the priority of the
signal

• The interrupt register of the CPU holds the address of the highest priority interrupt

• Java Exceptions and Ctrl+Alt+Delete are examples of software interrupt

• Printer stuck interrupt and battery dead signals are examples of hardware interrupt
Polling

• Polling: System by which the CPU checks the various devices connected to it to
see if there are any requests or actions to be fulfilled and checks the readiness of
the system

• This is different from interrupt because it is casual, and polling is optional whereas
interrupts are mandatory to be fulfilled. Polling usually checks for any needs
whereas interrupts indicate criticality.
Specialised Operating Systems
• To help control specified hardware needs

• To disallow certain operations that are deemed unnecessary or unsafe

• To reduce cost and save on memory space

• To make improvements

• To accommodate unique features

• To make operation faster!


Hardware Complexities
• Drive Letters C, E and F (A,B and C were reserved for floppy disks) to
accommodate for file allocation tables and pointers due to the fragmented nature
of files (organisation)

• Swap files in VMs are placeholders in hard drive for the VM to initiate as soon as
RAM space is out

• JVM processing of code

• RAID (Redundant array of independent disks)

• Hardware systems abstract information in this manner to make things much easier
to understand for human users.
Chapter 7
Control Systems
Microprocessors & Sensors
• Microprocessors incorporate the functions of the computer’s CPU on a single
integrated circuit. It accepts binary data as input, processes it according to
instructions stored and gives an output

• Sensors are input devices that measure physical quantities in analogue form

• ADC (Analog to Digital Converter) are devices that convert the analogue data from
sensors to digital form for microprocessor to intake

• Transducers are devices that will execute a physical action based on the above
processing

• Control systems incorporate all these components to automate physical functions


Sensor types galore!
Pros & Cons of a Control System
• Pros
• Faster and more accurate
• All at a time and uninterrupted
• Can be placed in dangerous and hazardous locations
• Cons
• Costly to develop
• Relies on backup power and other IT equipment
• Inflexible and no ethical oversight
How does it all work together
1. Sensor records surrounding physical parameters and sends the analog data

2. The analog data is received by ADC first and converted into digital signals

3. The ADC then sends this data across to the microprocessor that checks the data against
preset values and/or performs certain processing

4. The microprocessor then sends appropriate signal to the output transducer to execute a
particular action

5. The sensor then continues normal operations

6. The process is continuous and takes place until the system is terminated
General Notes
Inheritance v. Aggregation

• Inheritance is when behaviour of one class is transferred to another class;


aggregation is when a class is contained inside another and used

• Aggregation is useful for modelling the real life situation of containment whereas
Inheritance is useful for modelling the real life situation of one entity being a more
specific type of another entity

• There can be more than 1 aggregation, but just one super class of inheritance

You might also like