CGP OCR CS CPU and programming

Binary and Hexadecimal

  • Binary Shifts

    • Used to multiply or divide by 2.

    • Left shifts multiply; right shifts divide.

    • Example: Shifting left doubles the number, while shifting right halves it.

  • Hexadecimal (Hex)

    • Base-16 number system using digits 0-9 and letters A-F.

    • Shorter representation than binary.

    • Each hex character represents a 4-bit binary number (nibble).

    • Example: Hexadecimal 87 converts to denary 135.

  • Binary Addition

    • Use column addition for binary numbers.

    • Carry over when necessary (e.g., 1 + 1 = 10).

  • Overflow Errors

    • Occur when binary shifts exceed the bit limit.

    • Can lead to data loss or inaccuracies.

Boolean Logic

  • Logic Gates

    • Basic gates: NOT, AND, OR.

    • Each gate has a specific function and truth table.

    • Logic gates can be combined for complex operations.

  • Truth Tables

    • Show all possible input combinations and corresponding outputs.

    • Example: AND gate outputs 1 only if both inputs are 1.

  • Complex Logic Circuits

    • Can involve multiple gates and inputs.

    • Written using logical statements.

Page 3: Network Topologies

  • Client-Server Networks

    • Managed by a central server.

    • Clients send requests to the server for data.

    • Centralized storage for files and software.

  • Star Topology

    • All devices connect to a central hub.

    • Easy to add devices; failure of one device does not affect others.

  • Peer-to-Peer Networks

    • All devices are equal and connect directly.

    • Files are stored on individual devices.

  • Mesh Topology

    • All devices connect to each other.

    • No single point of failure; data can reroute if one device fails.

Page 4: Network Security

  • Data Protection Act

    • Governs the use of personal data.

    • Organizations must register and follow principles of data protection.

  • Copyright, Designs and Patents Act

    • Protects intellectual property.

    • Illegal to share copyrighted material without permission.

  • Computer Misuse Act

    • Prevents unauthorized access and modification of computer material.

Page 5: Computer Memory

  • RAM (Random Access Memory)

    • Volatile memory used for active processes.

    • Speed affects overall system performance.

  • CPU Performance

    • Depends on clock speed, number of cores, and cache size.

    • More cores allow for better multitasking.

  • Virtual Memory

    • Secondary storage used as extra RAM when needed.

    • Slower than RAM, can affect performance.

Page 6: Computer Architecture

  • Von Neumann Architecture

    • Describes how CPUs process data.

    • Involves fetching, decoding, and executing instructions.

  • Registers in CPU

    • Include Program Counter (PC), Memory Address Register (MAR), and Accumulator.

    • Used to hold data and instructions during processing.

Page 7: Programming Basics

  • Data Types

    • Main types: Integer, Real, Boolean, Character, String.

    • Each type has specific characteristics and memory requirements.

  • Casting

    • Converting between data types using functions like int(), real(), bool(), and str().

  • Arithmetic Operators

    • Basic operations: Addition, Subtraction, Multiplication, Division, Exponentiation.

    • Special operators: DIV (integer division) and MOD (remainder).

Page 8: Program Flow

  • Control Structures

    • IF statements check conditions and execute code based on true/false outcomes.

    • SWITCH statements allow for multiple conditions.

  • Flowcharts

    • Visual representation of algorithms.

    • Use different shapes for different commands (e.g., diamonds for decisions).

Page 9: Random Numbers

  • Use in Programming

    • Generate unpredictable outcomes for games and simulations.

    • Functions like random(x, y) produce random integers or real numbers.

  • Pseudo-Random Numbers

    • Generated by algorithms that appear random but follow a pattern.

Page 10: Constants and Variables

  • Data Storage

    • Constants remain unchanged; variables can be modified.

    • Strings are sequences of characters, manipulated using various functions.

  • String Manipulation

    • Common functions include length, upper, lower, substring, and concat.

Page 11: Algorithms

  • Definition

    • A set of instructions for solving a problem.

    • Can be represented in pseudocode or flowcharts.

  • Pseudocode

    • Structured like programming languages but more readable.

    • Allows for easy conversion to actual code.

  • Flowcharts

    • Visual representation of algorithms, showing the flow of control.

Page 12: Network Security Threats

  • Common Threats

    • Social engineering, phishing, SQL injections.

    • Importance of user education and strong passwords.

  • Preventative Measures

    • Use of encryption, firewalls, and regular security testing.

Page 13: Summary

  • Key Concepts

    • Understanding binary and hexadecimal systems.

    • Familiarity with Boolean logic and network topologies.

    • Knowledge of computer memory, architecture, and programming basics.

  • Practical Applications

    • Apply knowledge in real-world scenarios, such as network setup and

robot