O Levels & IGCSE Computer Science Notes - Paper 1: Computer Systems 2210 & 0478

Unit 1: Data Representation

  • Uses of Binary System:

    • To process data in logic gates/transistors.

    • To store data in registers.

    • To process data on the computer.

  • Differences between Denary, Binary and Hexadecimal:

    • Denary (Base 10 system):

    • Used in counting and calculation in daily life.

    • Uses the digits 0 to 9.

    • Has fewer digits for the same value.

    • Binary (Base 2 system):

    • Used to store data in registers and process data in logic gates and computers.

    • Uses 0s and 1s.

    • Has more digits for the same value.

    • Hexadecimal (Base 16 system):

    • Used in MAC addresses, IP addresses, HTML colour codes, error codes, etc.

    • Uses digits 0 to 9 and alphabets A to F.

    • Has fewer digits for the same value than both binary and denary.

  • Hexadecimal as a Beneficial Method of Data Representation:

    • Used in colour codes, error codes and IP & MAC addresses.

    • Easily understandable and easier to debug.

    • Takes less space on the screen.

Data Conversions




  • Binary to Denary Conversion:


    • For example, convert 11101110 to denary:

    • 128+64+32+8+4+2=238128 + 64 + 32 + 8 + 4 + 2 = 238.

    • Thus, 11101110 = 238.




  • Denary to Binary Conversion:

    • Method 1 (Subtraction with Largest Power of 2):



    • Convert 142 to binary:


      • 142−128=14142 - 128 = 14

      • 14−8=614 - 8 = 6

      • 6−4=26 - 4 = 2

      • 2−2=02 - 2 = 0

      • Therefore, 142 = 10001110.




    • Method 2 (Successive Division by 2):



    • The table format to illustrate the method of calculation.


      DIV

      MOD



      142

      0



      71

      1



      35

      1



      17

      1



      8

      0



      4

      0



      2

      0



      1

      0



      0

      1


      • 142 = 10001110.



      • Binary to Hexadecimal Conversion:






      • For example, convert 101111100001 to hexadecimal:



      • Break into sets of 4:




      • 1011 1110 0001



      • B E 1.



      • Thus, 101111100001 = BE1.



      • Hexadecimal to Binary Conversion:






      • Convert 45A to binary:



      • 45A = 4 --> 0100, 5 --> 0101, A --> 1010



      • Therefore, 45A = 010001011010.



      • Hexadecimal to Denary Conversion:






      • Convert 45A to denary:



      • 256imes4+16imes5+10imes1=1024+80+10=1114256 imes 4 + 16 imes 5 + 10 imes 1 = 1024 + 80 + 10 = 1114



      • Denary to Hexadecimal Conversion:






      • Convert 2004 to hexadecimal using division with modulus:



      • Table demonstrating the conversion:



      DIV

      MOD



      ------

      -----



      2004

      4



      16

      125



      125

      13



      7

      7



      0

      0


      • Thus, 2004 = 7D4 (where 13 = D).






      Binary Addition & Overflow Concept



      • Binary Addition Example:

        • Add 126 and 62 in binary:

        • 126=10100010126 = 10100010; 62=0001101062 = 00011010

        • Calculation of carry and sum illustrated below:

          • CARRY: 1 1 0 1 0 0 0 1 0

          • 0+0+0+1+1+0+1+0=10 + 0 + 0 + 1 + 1 + 0 + 1 + 0 = 1

          • Thus, 126+62=188126 + 62 = 188.

      • Overflow Error Concept:

        • Overflow error occurs when a calculation exceeds the maximum value that can be stored in allocated bits.

        • Example: Add(110+222inbinary)=332Add (110 + 222 in binary) = 332; binary cannot store it in an 8-bit register which has a max of 255.

        • The appearance of excess carry indicates an overflow error.

      Logical Binary Shifts

      • Concept of Shifts:

        • Left Shift: Each shift left is equivalent to multiplying the binary number by 2n2^n (where n is the number of places shifted).

        • Example: Shift 0001010100010101 (21) two places to the left to become 0101010001010100 (84).

        • Right Shift: Each shift right is equivalent to dividing the binary number by 2n2^n (where n is the number of places shifted).

        • Example: Shift 0110010001100100 (100) two places right to become 0001100100011001 (25).

      • Two’s Complement Format:

        • Used to represent negative binary numbers.

        • The leftmost bit determines the sign (0 for positive, 1 for negative).

        • Convert negative binary numbers in two's complement format to denary value.

        • Example: Convert 1001001110010011 to denary.

          • C=−128+64+16+2+1=−45C = -128 + 64 + 16 + 2 + 1 = -45.

      Text, Sound & Images

      • Data Type Conversions:

        • Text is converted to binary via character sets (e.g., ASCII).

        • Audio:

        • Sound waves are sampled for conversion into binary via an ADC (Analog to Digital Converter).

        • Sample Rate: Number of samples taken each second.

        • Sampling Resolution: Number of bits per sample (bit depth).

      • Image Processing:

        • Images consist of pixels converted to binary.

        • Image Resolution: Total number of pixels in X-Y direction.

        • Colour Depth: Number of bits representing each colour.

      Data Storage and File Compression

      • Memory Sizes:

        • Name of Memory and Sizes:

        • 1 KiB = 210=10242^{10} = 1024 bytes.

        • 1 MiB = 220=1,048,5762^{20} = 1,048,576 bytes.

        • 1 GiB = 230=1,073,741,8242^{30} = 1,073,741,824 bytes.

        • 1 TiB = 240=1,099,511,627,7762^{40} = 1,099,511,627,776 bytes.

      • Calculation of File Size:

        • Image File Size: extImageresolution(pixels)imesextColourdepth(bits)ext{Image resolution (pixels)} imes ext{Colour depth (bits)}

        • Audio File Size: extSamplerate(Hz)imesextSampleresolution(bits)imesextLength(seconds)ext{Sample rate (Hz)} imes ext{Sample resolution (bits)} imes ext{Length (seconds)}

      • Data Compression:

        • Lossy Compression:

        • Cannot reconstruct original file.

        • Examples: JPEG, MP3, MP4.

        • Reduces size by altering image quality and audio fidelity.

        • Lossless Compression:

        • Reduces file size without loss of data.

        • Example: RLE (Run-Length Encoding).

      Unit 2: Data Transmission

      • Data Transmission Principles:

        • Data is split into packets for efficient long-distance transmission.

        • Each packet includes a header, payload, and trailer for proper routing and error checking.

      • Packet Switching:

        • Data packets are sent through different paths; routers help decide the best route.

        • Packets may arrive out of order, necessitating reassembly.

      • Direction of Data Transmission:

        • Simplex: One-way only (e.g., computer to printer).

        • Half-duplex: Two-way, but not simultaneously (e.g., walkie-talkies).

        • Full-duplex: Two-way simultaneously (e.g., broadband connection).

      • Transmission Types:

        • Serial: Sends one bit at a time.

        • Works well over long distances but slower.

        • Parallel: Sends multiple bits at once.

        • Works well for short distances but may arrive unsynchronized.

      • Error Detection Methods:

        • Parity Checks: Helps to identify errors by checking 1-bit counts.

        • Checksum: A calculated value sent with data for error checking.

        • Echo Checks: Data is sent back to sender to verify integrity.

        • Automatic Repeat Requests (ARQ): Resends data until correct transmission is confirmed.

      Unit 3: Hardware

      • Computer Architecture:

        • Central Processing Unit (CPU): The brain of the computer, executing instructions and processing data.

        • Components of CPU:

        • Control Unit (CU): Directs operations and manages data flow.

        • Arithmetic and Logic Unit (ALU): Performs calculations and logic operations.

        • Registers: Small storage locations for quick data access (e.g., CIR, ACC, PC).

        • Fetch-Decode-Execute Cycle: Process by which the CPU retrieves, decodes, and executes instructions systematically.

      • Memory Types:

        • RAM (Random Access Memory): Temporary storage for active data.

        • ROM (Read-Only Memory): Permanent storage for BIOS and essential programs.

      Unit 4: Software

      • Types of Software:

        • System Software: Manages hardware and provides a platform for applications (e.g., operating systems).

        • Application Software: Programs that perform specific tasks for users (e.g., word processors, spreadsheets).

      • Operating System Functions:

        • Managing files, interrupts, peripherals, memory allocation, multitasking, user interfaces, security, and user accounts.

      Unit 5: Internet and its Uses

      • Internet vs. World Wide Web:

        • Internet: The infrastructure and network.

        • WWW: The multimedia and resources accessed via browsers.

      • URL Structure:

        • Consists of protocol, domain name, and file path.

      • Web Browsers Functions:

        • Interpret and render HTML, manage bookmarks, history, and use cache for performance.

      Unit 6: Automated Technologies

      • Automated System Definition and Applications:

        • Systems designed for specific tasks automatically using software and sensors.

        • Applications across various sectors including industry, transport, agriculture, and gaming.

      • Advantages and Disadvantages of Automation:

        • Advantages: Speed, efficiency, consistency, and safety.

        • Disadvantages: High initial cost, maintenance requirements, and potential job loss.

      • Examples of Automated Systems:

        • Industrial automation (e.g., manufacturing robots), transportation (e.g., self-parking cars), and agricultural systems (e.g., automated irrigation).

      • Robotics and AI:

        • Robotics uses automated systems to perform tasks typically done by humans, while AI enables machines to simulate human intelligence by learning and adapting to data.

      • Expert Systems and Machine Learning:

        • Expert systems replicate human expert decision-making while machine learning algorithms automatically learn from data and improve over time.