Short Notes
Short Notes
Selection - shows true/false decisions where there are two possible outcomes
5) What is a subprogram?
A self-contained block of code that performs a specific task within a larger
program
6) Give some reasons as to why the use of a subprogram is beneficial.
• Breaks down complex program into smaller parts
• Makes program logic clearer
• Makes it easier to maintain code
• Enables code to be used as many times as needed in program
• Enables code used for common tasks to be stored in libraries
and used in different programs
• Helps efficiency of a team of programmers working on project
at same time
1
7) What is decomposition?
Breaking down a given problem into simple, logical steps or parts
8) What is abstraction?
Removing unnecessary characteristics from something in order to reduce it
to something simpler to understand
9) Give three types of errors that could occur within a program.
• Syntax
• Logic
• Runtime
10) What is a syntax error?
An error that occurs when the rules of the programming language are not
followed (e.g. command word is misspelled, punctuation is incorrect,
variable is used without being initialized)
11) What is a logic error?
An error that occurs when there is a flaw in the design of a program, which
does not prevent it from running but produces an incorrect or unexpected
result
12) What is a runtime error?
An error that occurs during program execution when the processor is asked
to perform an impossible operation (e.g. divide by zero, open a non-existent
file)
13) State the purpose of a trace table.
• To allow the value of a variable, outputs and decisions in certain
points throughout the algorithm to be recorded
• To help detect logic errors in the program
14) What do computers use binary to do?
• To represent data, such as numbers, text, sound and graphics
• To program instructions
15) What is 4 bits known as?
A nibble
2
16) What is 8 bits known as?
A byte
17) Explain one reason why all instructions and data used by a computer
are represented in binary. (3)
• A processor consists of billions of transistors, each having just two
states, on/off
• The on/off states of a transistor represent the binary digits 1/0
18) Describe a ‘bit’. (2)
A bit is short for binary digit, the smallest unit of data in a computer
A bit has a single binary value, either 0 or 1
19) Give one reason why a computer doesn’t need to know what a binary
pattern represents. (1)
The microprocessor hardware only operates on bits, so it has no
concept of type or representation
20) Write an arithmetic expression to show that 256 different colours can
be represented in 8 bits. (1)
2⁸ = 256 colours
21) What can denary numbers also be called?
Decimal numbers
22) Explain one reason why the denary number 256 cannot be represented
in an 8-bit binary pattern. (2)
The number would be represented in binary as 100000000
You would need 9 bits to store it
23) List two ways of representing signed integer numbers.
• Two’s complement
• Sign and magnitude
24) What happens if the most significant bit of a two’s complement or
sign and magnitude pattern is 1?
The number will have a negative value
3
25) Describe one difference between a logical and an arithmetic shift. (2)
One key difference between a logical and an arithmetic shift is how they
handle the sign bit (the most significant bit in a signed binary number):
• Logical shift: It shifts all bits to the left or right, filling the empty
positions with zeros, regardless of the sign bit. This is used with
unsigned numbers.
• Arithmetic shift: It also shifts bits, but when shifting right, it
preserves the sign bit (most significant bit) by filling the empty
positions with the sign bit (1 for negative numbers, 0 for positive
numbers). This is used with signed numbers.
So, the primary difference is that an arithmetic shift preserves the sign
bit, while a logical shift does not.
4
• Unicode can represent all languages, ASCII was developed for English
• Sound can be represented digitally by taking samples of the original
sound.
5
• For example, a 16-bit depth provides 65,536 possible amplitude
levels, while a 24-bit depth provides over 16 million, offering a
greater dynamic range and less noise in the recording.
38) State the effect of increasing the bit depth of a recording. (1)
Increasing the bit depth of a recording improves the dynamic range
and precision of the audio, resulting in more accurate representation
of quiet sounds and less noise or distortion.
39) The sample rate and bit depth affect the size of the file produced.
both the sample rate and bit depth directly affect the size of the file
produced in digital audio.
• Sample rate: A higher sample rate means more samples are taken per
second, which increases the amount of data stored per second of
audio.
• Bit depth: A higher bit depth means more bits are used to represent
each sample, which also increases the amount of data for each sample.
The formula for calculating the file size of uncompressed audio is:
6
42) What is the equation to calculate the file size of an audio file?
See No.39
43) Both kibibyte and kilobyte can be used as measures of file size.
Compare kibibyte and kilobyte. (2)
Any one from:
• Kilobyte is an SI measurement, whereas kibibyte is an International
Electrotechnical Commission (IEC) measurement
• Kilobyte is equivalent to 1000 bytes, whereas a kibibyte is equivalent to
1024 bytes
• Kilobyte is equivalent to 10³ bytes, whereas a kibibyte is equivalent to 2¹⁰
bytes
• Kilobyte is a base 10 measurement, whereas a kibibyte is a base 2
measurement
7
Less successful uses
Text files/ Executable software
48) Give 2 examples of lossy algorithms.
JPEG
MP3
49) Describe what is meant by ‘encryption’.
The process of converting data into a format that cannot be understood by an
unauthorized viewer, unless you have access to the key needed to decrypt it
50) What is meant by ‘plaintext’?
Plaintext describes the original unencrypted text
51) What is the need for encrypting data?
To protect the data’s confidentiality
52) Give examples of two forms of encryption.
• Symmetric encryption
• Asymmetric encryption
53) Describe the difference between symmetric and asymmetric
encryption.
• Symmetric uses the same key to encrypt and decrypt the data
• Asymmetric uses two different keys - public key to encrypt the data
and a private key, which only the recipient knows, to decrypt it
8
56) describe a sequential computational model.
9
Hardware
1. What is Hardware?
Hardware refers to the physical components of a computer system that
you can touch, such as the CPU, motherboard, memory, and storage devices.
10
8. What is the difference between SSD and HDD?
• HDD (Hard Disk Drive): Uses mechanical parts to read/write data,
slower but larger capacity.
• SSD (Solid State Drive): Uses flash memory with no moving parts,
faster but typically more expensive.
9. What is a Bus in a Computer?
A bus is a set of pathways used to transfer data between different
components of the computer, such as the CPU, memory, and input/output
devices.
10. What is an Input Device?
An input device allows the user to provide data or instructions to the
computer. Examples include keyboards, mice, and scanners.
11. What is an Output Device?
An output device displays or outputs data from the computer.
Examples include monitors, printers, and speakers.
12.What is a Graphics Processing Unit (GPU)?
A GPU is a specialized processor used to handle complex graphical
and visual computations, typically for rendering images, videos, and running
games.
13. What is the Power Supply Unit (PSU)?
The PSU converts electrical power from a wall outlet into the proper
voltage and current to power the computer's components.
14. What is the purpose of a Heat Sink or Fan?
A heat sink or fan helps cool the CPU or other components to prevent
overheating and ensure they run efficiently.
15. What is a Bus Width?
Bus width refers to the number of bits that can be transferred at once
on the bus. A wider bus allows faster data transfer.
11
16. What is the Role of the Cache Memory?
Cache memory is high-speed memory located near the CPU that
stores frequently used data to speed up processing by reducing the need to
access slower RAM.
17. What is the difference between Primary and Secondary Storage?
• Primary Storage: Temporary storage used by the CPU, such as
RAM.
• Secondary Storage: Permanent storage, such as hard drives or SSDs,
used to store data long-term.
18. What is an Expansion Card?
An expansion card is a hardware component that can be added to the
computer to provide additional functionality, such as a sound card, network
card, or graphics card.
19. What is the purpose of the BIOS?
The BIOS is firmware stored in ROM that is responsible for
initializing and testing hardware components during the boot process and
loading the operating system.
20. What is the function of the ALU (Arithmetic Logic Unit)?
The ALU performs arithmetic operations (addition, subtraction, etc.)
and logical operations (comparisons, AND, OR, etc.) in the CPU.
12
23. What are the three stages of the FDE cycle?
The three stages of the FDE cycle are:
• Fetch: Retrieve the instruction from memory.
• Decode: Decode the instruction to determine the operation.
• Execute: Perform the operation specified by the instruction.
24. What happens during the "Fetch" stage of the FDE cycle?
During the fetch stage, the CPU retrieves the instruction from memory,
using the Program Counter (PC) to determine the address of the instruction.
25. What happens during the "Decode" stage of the FDE cycle?
In the decode stage, the instruction fetched is decoded by the Control
Unit (CU) to understand what operation needs to be performed.
26. What happens during the "Execute" stage of the FDE cycle?
In the execute stage, the CPU performs the operation specified by the
decoded instruction (e.g., performing a calculation, moving data, etc.).
27. What is the role of the Program Counter (PC) in the FDE cycle?
The Program Counter (PC) holds the address of the next instruction to
be fetched during the FDE cycle.
28. What happens to the Program Counter (PC) after each fetch?
After each fetch, the Program Counter (PC) is incremented to point to
the next instruction in memory.
13
30. What is common registers?
Common Registers:
Accumulator (A):
o Holds intermediate results of arithmetic or logical operations
performed by the CPU.
Program Counter (PC):
o Stores the address of the next instruction to be fetched from memory.
Memory Address Register (MAR):
o Holds the address of the memory location to be read from or written
to.
Memory Data Register (MDR):
o Holds data that is being transferred to or from memory.
Instruction Register (IR):
o Holds the current instruction being decoded and executed by the CPU.
14
Importance:
• A higher clock speed means the CPU can process instructions more quickly,
improving performance for tasks like gaming or video editing.
• It is not the sole factor for performance. The number of cores and CPU
architecture also play a significant role.
Benefits of Increasing Clock Speed:
1. Faster Processing:
o Higher clock speeds allow the CPU to execute more instructions per
second, leading to improved overall performance, especially in tasks
that depend on single-core performance (e.g., gaming, certain
software applications).
2. Improved Responsiveness:
o Applications and tasks that rely on quick responses (like video
editing, rendering, or compiling code) can benefit from a higher clock
speed, as the CPU completes operations faster.
3. Enhanced Performance for Single-Threaded Tasks:
o For software that doesn’t leverage multiple cores, increasing the clock
speed can result in significant performance improvements, as these
programs benefit from faster processing on a single core.
4. Better User Experience in Certain Applications:
o In scenarios where high processing power is required, like gaming,
running simulations, or intensive calculations, a higher clock speed
leads to smoother experiences with fewer slowdowns.
16
5. Collaboration:
o Cloud storage facilitates easy sharing and collaboration on files with
others in real-time, enhancing teamwork and productivity.
6. Security and Redundancy:
o Many cloud providers use encryption and multiple data backups
across different locations to ensure data safety.
17
2. Cost-Effective:
o Since they are task-specific and often use less complex hardware,
embedded systems tend to be cheaper compared to general-purpose
computers.
3. Compact Size:
o They are generally small in size, making them ideal for integration
into devices with limited space, like smartphones, cars, and household
appliances.
4. Real-Time Operation:
o Many embedded systems operate in real-time, offering fast responses
to input or changes in the environment (e.g., in automotive or medical
applications).
5. Reliability:
o Designed for specific applications, embedded systems are often highly
reliable and can operate continuously without failure.
6. Low Power Consumption:
o Optimized for energy efficiency, embedded systems typically
consume less power, making them ideal for portable and battery-
powered devices.
18
o Debugging embedded systems can be more difficult due to their
specialized nature and reliance on hardware and software that may not
be easily accessible.
34. IoT
The Internet of Things (IoT) refers to a network of interconnected physical
devices that communicate and exchange data with each other over the internet,
enabling automation and smart functionality.
Software
Definition➔Software refers to a collection of programs, data, and instructions that
tell a computer how to perform specific tasks. It is the non-physical component of
a computer system.
System Software:
System software controls and manages computer hardware and provides a platform
for running application software.
• Examples:
o Operating Systems (OS): Manages hardware resources (e.g.,
Windows, macOS, Linux).
o Utility Software: Performs maintenance tasks (e.g., antivirus
software, disk cleanup tools).
Application Software:
Application software is designed to help users perform specific tasks.
• Examples:
o Word Processors: (e.g., Microsoft Word) for document creation.
o Spreadsheets: (e.g., Microsoft Excel) for data organization and
analysis.
o Web Browsers: (e.g., Google Chrome, Firefox) for accessing the
internet.
19
Software Licensing:
1. Proprietary Software:
o Software owned by an individual or company, with restricted access
to source code. Users need to purchase a license.
o Examples: Microsoft Windows, Adobe Photoshop.
2. Open Source Software:
o Software with source code that anyone can view, modify, and
distribute. Typically free to use.
o Examples: Linux, Mozilla Firefox.
3. Freeware:
o Software provided free of charge, but with restricted usage or features.
No modification of the source code is allowed.
o Examples: Adobe Reader, Skype.
4. Shareware:
o Software that is initially provided free but requires payment after a
trial period or for additional features.
o Examples: WinRAR, some video games.
Types of Simulation:
1. Discrete Event Simulation (DES):
o Models systems where events happen at discrete times (e.g., customer
service processes, manufacturing processes).
20
o Events are processed in order, and the system state is updated at each
event.
2. Continuous Simulation:
o Used for systems that change continuously over time (e.g., chemical
reactions, weather systems).
o Models are often based on differential equations.
3. Monte Carlo Simulation:
o Uses random sampling and statistical methods to model and simulate
complex systems with uncertainty (e.g., financial forecasts, risk
assessment).
o Provides a range of possible outcomes based on different inputs.
Applications of Simulation and Modeling:
1. Engineering and Design:
o Used in designing products and testing performance before physical
creation (e.g., airplane design, automotive crash simulations).
2. Healthcare:
o Simulations are used for training (e.g., medical procedures) and
understanding the spread of diseases (e.g., epidemiological modeling).
3. Weather Forecasting:
o Mathematical models simulate atmospheric conditions to predict
weather patterns over time.
4. Economics and Business:
o Models can simulate market behavior, predict financial trends, or
optimize supply chain operations.
5. Education and Training:
o Simulations allow students to experience scenarios without real-world
consequences (e.g., flight simulators for pilot training).
Benefits of Simulation and Modeling:
21
1. Risk Reduction:
o Simulations help predict potential problems or failures, allowing for
proactive measures to be taken before real-world implementation.
2. Cost Efficiency:
o Models and simulations reduce the need for expensive real-world
prototypes, testing, or experiments.
3. Improved Decision-Making:
o They allow decision-makers to evaluate different scenarios and
outcomes, making it easier to choose the best course of action.
4. Complex Systems Analysis:
o Helps to study systems that are too complex or dangerous to
experiment with directly (e.g., nuclear reactor modeling).
Drawbacks of Simulation and Modeling:
1. Model Accuracy:
o A model is only as good as the assumptions, data, and simplifications
made during its creation. Inaccurate models lead to unreliable
simulations.
2. Computational Resources:
o Complex simulations require significant computational power, which
may be costly and time-consuming.
3. Time-Consuming:
o Creating, refining, and running simulations can take a long time,
especially for large-scale or intricate models.
4. Over-Simplification:
o Models may omit certain real-world variables or complexities, leading
to less accurate or incomplete results.
22
Programming Language
• Programming Languages: A set of instructions used by programmers to
communicate with computers to perform specific tasks.
o Low-level languages: Closer to machine code (e.g., assembly
language).
o High-level languages: Closer to human languages and more abstract
(e.g., Python, Java).
Translators:
Translators are software tools that convert high-level programming language code
into machine code (or intermediate code) that a computer can execute. There are
three main types of translators:
1. Compiler:
• Definition: A translator that converts the entire high-level program into
machine code at once and creates an executable file.
• Process:
23
o The compiler reads the source code and generates a separate machine
code file (e.g., .exe or .out).
o It then reports errors after attempting the compilation.
• Advantages:
o Faster execution of the compiled program (since it’s already in
machine code).
o No need for the source code during execution.
• Disadvantages:
o Error detection occurs only after the entire program is compiled,
which can be time-consuming.
o Compilation can take a long time for large programs.
• Examples of Compiled Languages: C, C++, Java (compiled to bytecode
which is later interpreted or compiled into machine code).
2. Interpreter:
• Definition: A translator that converts high-level code into machine code
line-by-line during execution.
• Process:
o The interpreter reads and executes each line of code one by one,
converting it into machine code as it goes.
o Errors are reported immediately as the program runs, making
debugging easier.
• Advantages:
o Easier to debug, as errors are found and corrected line-by-line.
o Faster for testing small pieces of code.
• Disadvantages:
o Slower execution speed because the interpreter needs to translate code
during runtime.
24
o The source code needs to be present each time the program runs.
• Examples of Interpreted Languages: Python, JavaScript, Ruby.
3. Assembler:
• Definition: A translator that converts assembly language code into machine
code.
• Process:
o Assembly language instructions are translated directly into machine
code instructions.
o The assembler creates an object file containing machine code, which
can be executed by the CPU.
• Advantages:
o Direct control over hardware, making it ideal for system-level
programming.
• Disadvantages:
o Difficult to write and understand compared to high-level languages.
o Requires detailed knowledge of the hardware.
• Example of Assembler Language: Assembly code for a specific processor.
25
Key Differences Between Compiler and Interpreter:
Aspect Compiler Interpreter
Intermediate Code:
• Definition: Code that is not directly machine code but is translated into an
intermediate form. It is used by some compilers.
• Example: Java programs are compiled into bytecode, which can be run on
any machine with a Java Virtual Machine (JVM) interpreter.
21. Networks
Local Area Network (LAN):
• Definition: A network of computers and devices that are connected within a
limited area, such as a home, office, or building.
• Characteristics:
o Typically covers a small geographic area (e.g., a single building).
o High data transfer rates.
o Owned, controlled, and managed by a single organization or
individual.
o Examples: Home Wi-Fi, office networks.
• Advantages:
o High speed and reliability.
o Easier to set up and maintain in small areas.
o Cost-effective for small-scale communication.
27
• Definition: A network that spans a large geographic area, such as cities,
countries, or even continents.
• Characteristics:
o Connects multiple LANs across vast distances.
o May use leased telecommunication lines, satellites, or public
infrastructure like the internet.
o Data transfer rates are generally lower compared to LAN.
• Examples: The internet, global corporate networks.
• Advantages:
o Allows remote communication between geographically dispersed
locations.
o Supports long-distance communication.
• Disadvantages:
o More expensive to set up and maintain.
o Slower data transfer speeds compared to LAN.
28
o Easy and quick to set up.
o Low cost and energy-efficient.
• Disadvantages:
o Limited range and scope of use.
4. Mail Protocols:
• Definition: Protocols used to send, receive, and manage email
communication across networks.
• Key Mail Protocols:
1. SMTP (Simple Mail Transfer Protocol):
▪ Used for sending emails from a client to a server or between
email servers.
▪ Typically used for outgoing email.
2. IMAP (Internet Message Access Protocol):
▪ Used to retrieve and manage emails from a mail server.
▪ Emails remain stored on the server and can be accessed from
multiple devices.
3. POP3 (Post Office Protocol version 3):
▪ Used to retrieve emails from the mail server, but unlike IMAP,
emails are downloaded and typically removed from the server.
▪ Ideal for users who only access emails from one device.
5. Network Protocols:
• Definition: A set of rules and standards used to allow devices to
communicate with each other on a network.
• Common Network Protocols:
1. TCP/IP (Transmission Control Protocol / Internet Protocol):
29
▪ The fundamental suite of protocols used for communication on
the internet.
▪ TCP ensures reliable data transmission, and IP handles
addressing and routing of data packets.
2. HTTP (Hypertext Transfer Protocol):
▪ Used for transferring web pages over the internet.
▪ HTTPS is the secure version of HTTP, using encryption.
3. FTP (File Transfer Protocol):
▪ Used for transferring files between computers over a network.
4. DNS (Domain Name System):
▪ Translates domain names (e.g., www.example.com) into IP
addresses.
6. Network Topologies:
• Definition: The physical or logical arrangement of devices and connections
in a network.
Types of Network Topologies:
1. Bus Topology:
o Description: All devices are connected to a single central cable (bus).
o Advantages: Simple to set up and cost-effective.
o Disadvantages: Performance degrades as more devices are added,
and failure of the main cable causes the entire network to fail.
2. Star Topology:
o Description: All devices are connected to a central hub or switch.
o Advantages: Easy to add or remove devices without affecting the
network. Failure of a single device does not affect the rest of the
network.
30
o Disadvantages: The central hub is a single point of failure; if it fails,
the entire network is affected.
3. Ring Topology:
o Description: Devices are connected in a circular format, where data
travels in one direction around the network.
o Advantages: Data transmission is efficient and organized.
o Disadvantages: Failure of a single device or cable can disrupt the
entire network.
4. Mesh Topology:
o Description: Every device is connected to every other device in the
network.
o Advantages: Highly reliable, as multiple paths exist for data
transmission.
o Disadvantages: Expensive and complex to set up and maintain.
5. Hybrid Topology:
o Description: A combination of two or more different topologies.
o Advantages: Flexible and adaptable to meet specific needs.
o Disadvantages: Can be complex and costly to implement and
manage.
Wired Networks:
Wired networks involve physical cables (such as Ethernet or fiber optics) to
connect devices to the network.
31
o Example: Ethernet can provide speeds up to 10Gbps or more.
2. Stable and Reliable Connection:
o Less prone to interference from external factors like walls, distance, or
electronic devices.
o Data transmission is consistent and reliable.
3. Better Security:
o Wired networks are more secure since it is difficult for unauthorized
users to intercept the signal without physical access to the network.
o Limited to the physical wiring, reducing the risk of unauthorized
access.
4. Lower Latency:
o Wired connections typically experience lower latency, making them
ideal for real-time applications like gaming and video conferencing.
5. No Interference:
o Less affected by environmental factors (e.g., radio waves, weather, or
physical obstructions) that can impact wireless networks.
32
o The cost of laying down cables and maintaining the network can be
high, especially for large installations.
4. Potential for Physical Damage:
o Cables can get damaged due to physical wear, environmental factors,
or accidental cuts.
Wireless Networks:
Wireless networks use radio waves or other wireless technologies (such as Wi-Fi,
Bluetooth, or cellular networks) to connect devices without physical cables.
33
Drawbacks of Wireless Networks:
1. Slower Speeds:
o Generally, wireless networks offer lower speeds compared to wired
connections, especially in congested environments or areas with weak
signals.
o Example: Wi-Fi speeds can be significantly lower than Ethernet,
depending on the router and distance from the access point.
2. Signal Interference:
o Wireless signals can be affected by interference from walls, other
electronic devices (e.g., microwaves, Bluetooth), and radio frequency
congestion.
o Performance can degrade in areas with heavy wireless traffic.
3. Security Concerns:
o Wireless networks are more vulnerable to unauthorized access if not
properly secured (e.g., weak Wi-Fi passwords, unencrypted signals).
o Hackers can intercept wireless signals if encryption is not used, such
as with WPA2 or WPA3 standards.
4. Limited Range:
o The coverage area of wireless networks is typically smaller than wired
networks.
o Signal strength and performance decrease as you move farther from
the access point or router.
5. Higher Latency:
o Wireless networks tend to have higher latency than wired networks
due to the time it takes for data to travel through the air.
o This can be an issue for time-sensitive applications like online gaming
or VoIP calls.
34