A

Computer Science study notes

  • Resources

    • A student CD-ROM is included with the textbook.

    • Teacher's CD-ROM Contents:

    • Sample examination question responses.

    • Difficulty levels for each question part.

    • Expected response quality at each level.

    • Additional notes clarifying response levels.

    • Answers to all end-of-chapter questions.

    • Complete program files in both Python and Java.

    • A structured scheme of work detailing:

      • Chapter numbers and titles

      • Specific topics covered

      • Recommended time allocation for each topic

      • Syllabus reference alignment

      • Corresponding page numbers in textbook

      • Suggested activities for each chapter

      • Additional teaching notes

  • Binary System Basics

    • Computers operate on the binary system.

    • Consists of two digits: 1 and 0.

    • Represents electrical states:

    • 1: ON (presence of voltage/signal)

    • 0: OFF (absence of voltage/signal)

    State

    Representation

    ON

    1

    OFF

    0

  • Understanding Binary Place Values

    • Each digit in a binary number has a specific place value.

    • For an 8-digit binary number, the place values are as follows:

    Place Value

    128 (2^7)

    64 (2^6)

    32 (2^5)

    16 (2^4)

    8 (2^3)

    4 (2^2)

    2 (2^1)

    1 (2^0)

  • Converting Binary to Denary (Decimal)

    • Process:

    1. Identify each '1' in the binary number.

    2. Add the corresponding place values of these '1's.

    3. Ignore the place values where '0's are present.

    • Example:

    • Binary number: 11101110

    • Conversion:
      128 + 64 + 32 + 0 + 8 + 4 + 2 + 0 = 238

    • Therefore, 11101110 (binary) = 238 (denary)

  • Converting Denary (Decimal) to Binary

    • Two primary methods:

    1. Trial and Error

      • Method:

        • Place '1's in the binary place values that sum up to the denary number.

        • Ensure the sum of these place values equals the original denary number.

    2. Repetitive Division

      • Method:

        • Successively divide the denary number by 2.

        • Record the remainder (0 or 1) at each step.

        • Continue until the quotient is 0.

        • Read the remainders from BOTTOM to TOP to obtain the binary equivalent.

  • Computer Memory Sizes

    • Memory is measured in multiples of bytes.

    • Key units and their values:

    • 1 Kilobyte (KB) = 1024 bytes

    • 1 Megabyte (MB) = 1024 KB = 1,048,576 bytes

    • 1 Gigabyte (GB) = 1024 MB = 1,073,741,824 bytes

    • 1 Terabyte (TB) = 1024 GB = 1,099,511,627,776 bytes

  • IEC (International Electrotechnical Commission) Convention

    • To avoid ambiguity, the IEC defines precise binary multiples:

    • 1 Kibibyte (KiB) = 1024 bytes

    • 1 Mebibyte (MiB) = 1,048,576 bytes

    • 1 Gibibyte (GiB) = 1,073,741,824 bytes

    • 1 Tebibyte (TiB) = 1,099,511,627,776 bytes

    IEC Unit

    Value in Bytes

    1 KiB

    1,024

    1 MiB

    1,048,576

    1 GiB

    1,073,741,824

    1 TiB

    1,099,511,627,776

  • Registers

    • Registers are small, high-speed storage locations used to hold bits and control hardware devices, such as robots.

    • Example - 8-bit Register:

    • In an 8-bit register, each bit can control a specific function or movement of a device.

    Bit

    Function

    1

    Motor B ON/OFF

    2

    Motor C ON/OFF

    3

    B Direction: Forwards/Backwards

    4

    C Direction: Forwards/Backwards

  • Hexadecimal System

    • Base-16 numeral system.

    • Uses 16 symbols:

    • Numbers 0-9

    • Letters A-F

    • (A = 10, B = 11, C = 12, D = 13, E = 14, F = 15)

    • Relationship to Binary:

    • One hexadecimal digit represents four binary digits (since 16 = 2^4).

  • Hexadecimal Conversions

    • Binary to Hexadecimal:

    1. Group the binary number into sets of 4 bits, starting from the right.

    2. If the leftmost group has fewer than 4 bits, pad it with 0s on the left.

    3. Convert each 4-bit group into its equivalent hexadecimal digit.

    • Hexadecimal to Binary:

    • Convert each hexadecimal digit into its corresponding 4-bit binary representation.

    • Hexadecimal to Denary:

    • Multiply each hexadecimal digit by its place value (powers of 16) and add the results.

    • Denary to Hexadecimal:

    • Use the trial and error method or the repetitive division method (similar to denary-to-binary conversion).

  • Uses of Hexadecimal System

    • Memory Dumps:

    • Used in software development and debugging to inspect memory contents in a more readable format.

    • HTML (HyperText Markup Language):

    • Used to represent colors on web pages using hexadecimal codes (e.g., #RRGGBB).

    • MAC Addresses (Media Access Control):

    • Unique identifiers for network interfaces, often represented in hexadecimal format.

    • Consist of 48 bits, displayed as six groups of two hexadecimal digits.

    • Web Addresses (URLs):

    • Used to encode characters with ASCII codes; hexadecimal represents these values.

    • Assembly Code and Machine Code:

    • Simplifies writing code compared to using binary directly, reducing errors and improving efficiency.

  • Data Transmission Factors

    • Key considerations when transmitting data:

    • Direction:

      • The direction in which data is transmitted (one-way or two-way).

    • Method:

      • How data is sent (serially or in parallel).

    • Synchronization:

      • How the sender and receiver coordinate the transmission.

  • Data Transmission Modes

    • Simplex:

    • Data transmission in one direction only.

    • Example: From a computer to a printer.

    • Half-Duplex:

    • Data transmission in both directions, but not simultaneously.

    • Example: Two-way radios where one person speaks at a time.

    • Full-Duplex:

    • Data transmission in both directions simultaneously.

    • Example: Broadband internet connection.

    Mode

    Direction

    Simultaneous

    Example

    Simplex

    One way

    No

    Computer to printer

    Half-Duplex

    Two ways

    No

    Two-way radios

    Full-Duplex

    Two ways

    Yes

    Broadband internet connection

  • Data Transmission Types

    • Serial Data Transmission:

    • Data is sent one bit at a time over a single communication channel.

    • Parallel Data Transmission:

    • Data is sent several bits at a time (typically one byte) over multiple channels simultaneously.

    Type

    Bits Sent

    Channels

    Speed

    Cost

    Serial

    1

    Single

    Slower

    Lower

    Parallel

    Multiple

    Multiple

    Faster

    Higher

  • Data Synchronization

    • Asynchronous Data Transmission:

    • Data is transmitted in agreed-upon bit patterns, with control bits indicating the start and end of each data packet.

    • Synchronous Data Transmission:

    • Data is transmitted as a continuous stream, accompanied by timing signals from an internal clock to keep the sender and receiver aligned.

  • Error Checking Methods

    • Parity Checking:

    • A parity bit is added to each data unit to ensure the number of 1s is either even or odd. Helps detect single-bit errors.

    • Automatic Repeat Request (ARQ):

    • Uses acknowledgements (ACKs) and timeouts to ensure reliable data delivery. If the sender doesn't receive an ACK within a timeout period, it re-sends the data.

    • Checksum:

    • A checksum value is calculated from the data and sent along with it. The receiver recalculates the checksum and compares it to the received value to detect errors.

    • Echo Check:

    • The received data is sent back to the sender, who compares the echoed data with the original data to verify its integrity.

    Method

    Description

    Detection Capability

    Overhead

    Parity

    Adds parity bit

    Single-bit errors

    Low

  • IP vs. MAC Address

    • IP Address (Internet Protocol Address):

    • A logical address that identifies a device on a network, enabling communication over the Internet.

    • MAC Address (Media Access Control Address):

    • A physical address that uniquely identifies a network interface card (NIC) on a network. It is assigned by the manufacturer.

    Feature

    IP Address

    MAC Address

    Type

    Logical

    Physical

    Purpose

    Network routing

    Device Identification

    Assignement

    Configurable

    Manufacturer Assigned

  • HTTP/HTTPS

    • HTTP (HyperText Transfer Protocol):

    • A protocol for transmitting files over the Internet. It defines how messages are formatted and transmitted.

    • HTTPS (HyperText Transfer Protocol Secure):

    • A secure version of HTTP that uses SSL/TLS encryption to protect data in transit.

    Feature

    HTTP

    HTTPS

    Security

    Insecure

    Secure

  • Web Browsers

    • Software applications that enable users to access and view web pages on the World Wide Web.

    • Common Features:

    • Home page: The default page displayed when the browser starts.

    • User favorites (bookmarks): Allow users to save and quickly access frequently visited web pages.

    • History: A record of all web pages visited.

    • Back/forward buttons: Enable navigation through the browsing history.

  • Logic Gates

    • Basic electronic circuits that perform logical operations on one or more binary inputs to produce a single binary output.

    • Six Basic Logic Gates:

    • NOT

    • AND

    • OR

    • NAND

    • NOR

    • XOR

  • Logic Circuits

    • Combinations of logic gates designed to perform specific functions.

    • Example: Control systems in robots.

  • Truth Tables

    • Tables that define the output of a logic gate or circuit for all possible combinations of inputs.

    • NOT Gate: Single input.

    • Other Gates: Two or more inputs.

  • NOT Gate

    • Description: Inverts the input signal. If the input is 0, the output is 1, and vice versa.

    • Symbol: A ---[>--- X

    • Truth Table:
      | Input (A) | Output (X) |
      | :-------- | :--------- |
      | 0 | 1 |
      | 1 | 0 |

    • Equation: X = NOT A or X = \overline{A}

  • Other Logic Gates: AND, OR, NAND, NOR, XOR

    • NAND Gate acts as a universal gate, used to recreate the function of other logit gate.

  • Simplification of Logic Circuits

    • Reduces number of components that lowers costs and provides reliability

  • Operating Systems

    • Enables communication between software and hardware.

  • Interrupts

    • Pauses the processor to service to software and hardware

  • Buffers

    • Manages the speed difference between hardware and processor.

  • Von Neumann Architecture

    • Stores data and programs in memory and handles movement between memory and processor.

  • Fetch-Execute Cycle

    • Used to fetch from memory through Program counter.

  • Digital Cameras

Fetch-Execute Cycle

  • Used to retrieve instructions from memory via the Program Counter.

Digital Cameras

  • Capture images as digital data.

  • Microprocessors manage settings such as focus, shutter speed, and zoom.

  • Image resolution is measured in megapixels.

Input Devices

  • Keyboards:

    • Primary method for data entry.

    • Can lead to Repetitive Strain Injury (RSI).

  • Pointing Devices:

    • Mice, trackballs, and touchpads for making selections.

  • Microphones:

    • Used for audio input.

    • Require sound cards to convert voice to digital signals.

  • Scanners:

    • Convert hard copies into digital format.

    • Digital data can be modified.

    • Optical Character Recognition (OCR) technology converts images to text.

  • Sensors:

    • Translate physical properties (temperature, pressure, light) into digital signals.

  • Bar Code Readers:

    • Use light to interpret bar codes.

    • Each product has a unique bar code.

  • Magnetic Stripe Readers:

    • Read data stored on magnetic stripes.

  • Smart Card Readers:

    • Access smart cards.

    • Cards contain embedded microchips.

Output Devices

  • Monitors:

    • Display output for the user.

    • Liquid Crystal Display (LCD):

    • Thin and flat.

    • Light Emitting Diode (LED):

    • More energy-efficient than LCDs.

  • Printers:

    • Produce hard copies of output.

    • Inkjet Printers:

    • Spray ink precisely onto the page.

    • Laser Printers:

    • Use toner to create images.

    • Dot Matrix Printers:

    • Use pins to form characters.

  • Speakers:

    • Produce audio output.

  • Actuators:

    • Generate movement in control systems.

Storage Devices

  • Hard Disk Drives (HDD):

    • Traditional storage with magnetic platters.

  • Solid State Drives (SSD):

    • No moving parts, offering faster performance and greater durability.

  • CD/DVD:

    • Optical storage media.

  • Blu-Ray:

    • Offers higher storage density than DVDs.

  • Flash Memory:

    • Includes USB drives and SD cards.

  • Cloud Storage:

    • Data is stored on remote servers, accessible over the internet.

  • Blu-Ray:

    • An advanced optical disc tech offering high storage for high definition videos.

  • Flash Memory:

    • Portable storage like USBs and SD cards, fast data access.

  • Cloud Storage:

    • Secure data storage accessible via the internet providing scalable storage, robust data backup, and access for multiple devices.

  • Peripheral Devices:

    • External hardware like keyboards and printers, expands computers capabilities.

  • Networking:

    • Devices engage in Inter-Communication efficiently. Includes connections and enforcement of security.

  • Virtual Networks:

    • Enables device interaction and communication without connection, and leveraging software-defined networking.

  • Network Hardware:

    • Key components for network:

    • Network Interface Card (NIC): Hardware connects a device to a network to transmit and receive data signals.

    • Wireless Access Point (WAP): Enables wireless devices to connect to a wired network using Wi-Fi; acts as a bridge

  • Network Cables:

    • Ethernet Cables (CAT5e, CAT6, CAT7): Used for wired network connections, varying in speed and shielding.

    • Fiber Optic Cables: Transmit data as light signals, offering high speed and long-distance capabilities.

  • Network Topologies:

    • Bus Topology: All devices connect to a single cable. Simple but a break in the cable disrupts the entire network.

    • Star Topology: All devices connect to a central hub or switch. More reliable than bus, as a single device failure doesn't affect the entire network.

    • Ring Topology: Each device connects to exactly two other devices, forming a ring. Data travels in one direction.

    • Mesh Topology: Each device connects to many other devices. Highly redundant and fault-tolerant.

  • Networking Protocols:

    • TCP/IP (Transmission Control Protocol/Internet Protocol): Suite of protocols that govern communication over the Internet.

    • HTTP/HTTPS (HyperText Transfer Protocol/Secure): Protocols for transmitting web pages and data over the Internet; HTTPS provides encryption for secure communication.

    • FTP (File Transfer Protocol): Protocol for transferring files between a client and a server.

    • SMTP (Simple Mail Transfer Protocol): Protocol for sending email.

    • DNS (Domain Name System): Translates domain names (e.g., google.com) to IP addresses.

  • Network Security:

    • Firewalls: Hardware or software that controls network traffic to prevent unauthorized access.

    • Encryption: Converts data into a coded format to prevent unauthorized access.

    • VPN (Virtual Private Network): Creates a secure connection over a public network, encrypting data and hiding IP addresses.

    • Antivirus Software: Protects against malware and viruses.

  • Wireless Communication Standards:

    • Wi-Fi (802.11 standards): Enables wireless devices to connect to a network.

    • Bluetooth: Used for short-range wireless communication between devices.

    • Cellular Data (3G, 4G, 5G): Mobile communication technologies for accessing the Internet over cellular networks.

  • Client-Server Model:

    • A distributed application structure that divides tasks between servers and clients.

    • Server: Provides resources or services.

    • Client: Requests resources or services.

  • Peer-to-Peer (P2P) Network:

    • A distributed network architecture where each device (peer) shares resources directly with others, without the need for a central server.

  • The Internet of Things (IoT):

    • A network of interconnected devices (e.g., sensors, appliances) that can collect and exchange data.

  • Cloud Computing:

    • Delivery of computing services (e.g., storage, processing power) over the Internet.

  • Data Security in the Cloud:

    • Encryption: Securing data by converting it into an unreadable format.

    • Access Controls: Limiting who can access data.

    • Regular Backups: Ensuring data can be recovered in case of loss or disaster.

    • Compliance Standards: Meeting industry-specific regulations.

  • Ethical and Legal Considerations:

    • Data Privacy: Respecting users' rights to control their personal information.

    • Copyright Laws: Protecting intellectual property.

    • **Computer