Transcript for:
Fundamentals of Hardware and Computer Science

Chapters 3,4,7,8 Hardware Memory cache – high speed memory external to processor which stores data which the processor will need again. Primary memory * Part of the computer memory directly accessed from the CPU * Contains the RAM & ROM * Allows the processor to access applications and services temporarily stored in memory locations. RAM (Random access memory) * Access time to locate data is much faster in RAM than in secondary devices * Written to or read from * the data stored can be changed by the user/computer * Used to store data or part of an application/ operating system * Volatile * Larger the RAM, faster the computer will operate * When it is ‘full’ the processor accesses the secondary storage to overwrite old data on it with new data Increasing RAM size = less need to overwrite old data with new data = faster operation Two types of RAM ROM (Read only memory) * Cannot be written to or changed * Non volatile * Permanent memory devices * Used to store data which computer needs to access when turned on like the BIOS Difference between RAM & ROM Types of ROM Embedded systems * Miniature computer systems such as microprocessors that are often a part of a more extensive system. * Each embedded system performs a few specific functions, unlike general-purpose computers. Secondary storage devices * Not directly accessible by the CPU * Non volatile memory * Larger than primary memory * Data access time is slower than primary memory Principle Operations of Hardware Devices Laser printer: * A laser beam and rotating mirrors are used to draw an image of the page on a photosensitive drum * The image is converted into an electric charge, which attracts charged toner such that it sticks to the image * Electrostatic-charged paper rolled against the drum * Charge pulls toner away from drum and onto paper * Heat applied in the fuser to fuse toner to the paper * The electrical charge was removed from the drum, and excess toner was collected 3D Printer: * The process starts with a saved digital file that holds the blueprint of the object to be printed * The object is then built by sequentially adding layers of a material (e.g. polymer resin) until the object created * The object is then cured (e.g. resin-made objects are hardened by UV light) Microphone: * Incoming sound waves enter the screen and cause vibrations in the diaphragm * Vibrations cause the coil to move past a magnetic core * Electrical current is generated, which is then digitized Speaker: * Takes electrical signals and translates them into physical vibrations to create sound waves * The electric current in the voice coil generates an electromagnetic field * Change in digital audio signal causes current direction to change, which changes field polarity * Electromagnet is either attracted or repelled to a permanent magnet, causing a diaphragm that is attached to the coil to vibrate * Vibration transmitted to air in front of the speaker * The degree of vibration determines the amplitude and frequency of the sound wave produced Magnetic Hard Disk: * Hard disks have platters whose surfaces are covered with a magnetisable material. * Platters are mounted on a central spindle and rotated at high speed * The surface of platters is divided into concentric tracks & sectors, where data is encoded as magnetic patterns * Each surface is accessed by read/write heads * When writing, current variation in the head causes magnetic field variation on the disk * When reading, magnetic field variation from the disk produces current variation in the read head Solid State (Flash) Memory: * Most use NAND-based flash memory * Consist of a grid of columns & rows that has 2 transistors at each intersection * Two transistors: * Floating Gate: stores electrons, and the presence or absence of charge (electrons) represents either 1 or 0 * Control Gate: controls charge (electrons) flow for read/write Optical Disc Reader/Writer: * The disc surface has a reflective metal layer and is spun * The tracking mechanism moves the laser assembly * The lens focuses laser onto the disc * A laser beam shone onto a disc to read/write * Tracks have sequences of amorphous and crystalline states on the metallic layer * When reading, the reflected light from the different states on the track is encoded as bit patterns * When writing, the laser changes surface to crystalline and amorphous states along the track, corresponding to 1s or 0s. Touchscreen: * Considered as both an input & output device * There are two main-types: Capacitive benefits » Medium cost technology. » Screen visibility is good even in strong sunlight. » Permits multi-touch capability. » Screen is very durable; it takes a major impact to break the glass. Drawbacks » Only allows use of bare fingers as the form of input; although the latest screens permit the use of a special stylus to be used. Resistive benefits » Relatively inexpensive technology. » Possible to use bare fingers, gloved fingers or stylus to carry out an input Operation. Drawbacks » Screen visibility is poor in strong sunlight. » Does not permit multi-touch capability. » Screen durability is only fair; it is vulnerable to scratches and the screen wears out through time. Virtual (Reality) Headset: * Virtual headsets consist of 2 lenses, (an LCD) display, a circuit board with sensors, a cover and foam padding * The display provides a simulation of a 3D environment generated by a 3D graphics package * The user can ‘move’ in the virtual environment by moving their head or using controllers Buffers: * A queue that temporarily stores data to balance input/output speed of data, while the cache is the short-term memory storage that stores frequently used data. Sensors * Sensors are input devices which read or measure physical properties * Real data is analogue in nature – this means it is constantly changing and does not have a discrete value. * Analogue data usually requires some form of interpretation Why data is converted from analogue data to digital * Computers cannot make any sense of these physical quantities and the data needs to be converted into a digital format. * This is usually achieved by an analogue to digital converter (ADC). * This device converts physical values into discrete digital values. Process of converting analogue data into digital data * Monitoring and Control Systems * Monitoring System: * Monitors some state external to the computer system * No changes were made to the environment by the system, and hence, no feedback * Control System: * Regulates the behaviour of other devices or systems * Event-driven system: the controller alters the system's state in response to some event * Time-driven system, where the controller takes action at a specific point in time * Hardware typically used in a system: * Sensor that measures an (analogue) property and transmits it to a processing unit, generally as an electrical or optical signal * Actuators that switch on/off heavy appliances (e.g. heater to heat/fan to cool) * ADC that converts analogue signals to digital signals * Transmission cable to transfer signals * Feedback Systems: * Output from the system affects the input of sensors * Ensures the system operates within the given criteria * Enabling the system output to affect subsequent system inputs may cause a change in the actions taken by the system * This enables the system to adjust conditions in a continuous process automatically Processor fundamentals Features of the von neumann architecture » a central processing unit (CPU or processor) » a processor able to access the memory directly » computer memories that could store programs as well as data » stored programs made up of instructions that could be executed in sequential order. Advantages - simplifies design and control - reduces hardware complexity Components of the CPU (Processor) * Control unit (CU) * Arithmetic logic unit (ALU) * Registers * Cache * Buses * Clock Purpose and roles of ALU Performs all arithmetic calculations (e.g., addition, subtraction). Handles logical operations (e.g., AND, OR, NOT). Purpose and roles of the CU Directs and manages the flow of data and instructions within the CPU. Manages the fetch-decode-execute cycle. Ensures that the program instructions are handled correctly It contains the system clock Clock Provides synchronization for all CPU operations. Measured in Hertz (Hz); a higher clock speed means faster execution. there are two types of clocks - internal & system Internal clock - an electronic signal controlling a microprocessor's operations System clock - controls the timing of all computer operations Immediate access store (IAS) Temporarily holds data and instructions required for processing Registers small, high-speed storage locations inside the CPU that allows very short access time and acts as storage components General purpose registers Used for temporary storage during processing (e.g. calculations). Mainly the ALU Special purpose registers A register that is designed for specific functions - Program counter (PC) - MAR - MDR - ACC - CIR - IX - Status register Program counter (PC) Holds the address of the next instruction to be fetched. Memory address register (MAR) Stores the address of the memory location to be read from or written to. Memory data register (MDR) Temporarily holds data being transferred between the CPU and the memory that has just been read from memory or is just about to be written to memory - Acts as a buffer because transfers of data inside the processor take place much more quickly than transfers outside the processor. Accumulator (ACC) Stores intermediate results of calculations performed by the ALU. Current instruction register (CIR) Holds the current instruction being executed. Index register (IX) Stores a value; only used for indexed addressing Status register Contains bits that are either set or cleared which can be referenced individually Indicates the state of the CPU (e.g., zero, carry, overflow flags). The system bus Set of parallel wires that allow the transfer of data between components in a computer system 3 different types of buses address bus data bus control bus Address bus * carries memory addresses that identify where data is being read from or written to from the MAR * unidirectional * the address designates a specific location in memory or an I/O device that is either set to receive data or serve as the source from which data will be read Data bus * carrying data which may either be an instruction or an address * bidirectional Control bus * carries command and control signals to and from every other components in the CPU by the CU to coordinate activities Factors contributing to performance - no of cores - bus width - clock speed - cache memory Overclocking * Clock speed can be adjusted via the BIOS settings. * Risks of overclocking: * Instruction execution issues: * Instructions may run outside design limits, causing unsynchronized operations. * The CPU may fail to complete instructions in time, leading to crashes and instability. * Overheating: * Excessive heat can reduce reliability and cause performance issues. Clock speed * Number of pulses the clock sends out in a given time interval, which determines the number of cycles (processes) the CPU executes in a given time interval * Usually measured in Gigahertz (GHz) * If the clock speed is increased, then the execution time for instructions decreases. Hence, more cycles per unit time, which increases performance. However, there is a limit on clock speed since the heat generated by higher clock speeds cannot be removed fast enough, which leads to overheating. No of cores * More cores allow simultaneous execution of multiple instructions, improving multitasking. Usage of cache Commonly used instructions are stored in the cache memory area of the CPU. If the cache memory size is increased, more commonly executed instructions can be stored, and the need for the CPU to wait for instructions to be loaded reduces. Hence, the CPU executes more cycles per unit of time, thus improving performance. Bus width * Determines the number of bits that can be simultaneously transferred * Refers to the number of lines in a bus * Increasing bus width increases the number of bits transferred simultaneously, increasing processing speed and performance. How does word length & bus width affect system performance A full word needs to be transmitted by two consecutive data transfer which affects system performance How to receive data from input devices - input devices are connected to the port - and the ports are connected to a device controller which handles the interactions between the cpu & i/o device Computer ports * Input and output devices are connected to a computer via ports. The * interaction of the ports with connected input and output is controlled by the control unit. USB ports * Asynchronous serial data transmission Process » the computer automatically detects that a device is present (this is due to a small change in the voltage level on the data signal wires in the cable) » the device is automatically recognised, and the appropriate device driver is loaded up so that computer and device can communicate effectively » if a new device is detected, the computer will look for the device driver which matches the device. If this is not available, the user is prompted to download the appropriate software. High definition multimedia interface (HDMI) * allow output from a computer to an HDMI-enabled device. They support high- definition signals. Process » They use a widescreen format » The screens use a greater number of pixels » The screens have a faster refresh rate » The range of colours is extremely large * Modern HD televisions require more data, which has to be received at a much faster rate than with older televisions. * HDMI increases the bandwidth, making it possible to supply the necessary data for high quality sound and visual effects. * HDMI can also afford some protection against piracy since it uses high-bandwidth digital copy protection (HDCP). * HDCP uses a type of authentication protocol Video Graphics Array (VGA) * Can only connect output devices (e.g. second monitor/display) to the processor through a VGA port * VGA ports allow only the transmission of video streams but not audio components F-E cycle Fetch: - Address from the PC is loaded into the MAR. - The instruction at that address is fetched into the MDR. - PC is incremented. Decode - The CU decodes the instruction in the CIR. Execute: - The ALU performs the required operation, or data is transferred to/from memory. Register transfer notation Use of Interrupts in the Fetch-Execute Cycle * The interrupt register stores interrupt signals; e.g., 0000 0000 changes to 0000 1000 if a fault occurs. * During each fetch-execute cycle, the CPU checks the interrupt register. * If an interrupt is detected, the CPU decides whether to service it based on priority. * If serviced, the CPU stores register contents before handling the interrupt. * Control shifts to the interrupt handler (ISR) to resolve the issue. * Once resolved, the interrupt register resets, and CPU restores its previous state. Interrupts Causes of interrupts » a timing signal » input/output processes » a hardware fault (an error has occurred such as a paper jam in a printer, for example) » user interaction (the user pressed a key to interrupt the current process, such as <CTRL><ALT><BREAK>, for example) » a software error that cannot be ignored Handling Interrupts in a Processor * Processor receives an interrupt signal. * It either continues its current task or stops to service the interrupt. * The computer identifies the type of interrupt. * It determines the interrupt priority level. Role of Interrupts in Multitasking * Interrupts enable multitasking (e.g., downloading a file while listening to music). * When an interrupt occurs, the status of the current task is saved. * The program counter and other registers are stored. * The Interrupt Service Routine (ISR) is executed by loading its start address into the program counter. * After servicing, the saved registers are restored. * The interrupted task resumes from where it stopped. Assembly language Assembly Language and Machine Code * Machine code is the only language a CPU can use. * Each CPU type has its own set of machine code instructions. * A program in main memory consists of machine code instructions executed in the fetch-execute cycle. * Each instruction performs a simple task (e.g., storing a value in memory). * Machine code is in binary, but often displayed in hexadecimal for readability. * Writing in machine code is time-consuming and error-prone. * Programming languages were developed to simplify coding. * Language translators convert high-level code into machine code. * Assembly language was the first programming language, using mnemonics instead of binary. * Structure of assembly and machine code is the same (contains an opcode and an operand). Stages of Assembly * Assembly language (source code) must be translated into machine code before execution. * An assembler performs the translation and checks syntax for valid opcodes. * Syntax checking helps identify errors before execution, speeding up development. * Two types of assemblers: * Single pass assembler: Directly loads machine code into memory for execution. * Two pass assembler: Generates a machine code object program for later execution. * Two pass assemblers use a loader to store, load, and execute the program. * Pass 2 of a two pass assembler: * Read the assembly program line by line. * Generates object code using the symbol table from Pass 1. * Saves or executes the program. To trace a given simple assembly language program * Watch video AS & A Level Computer Science (9618) - Chapter 6: Introduction to Assembly Language Programming Addressing Modes in Assembly and Machine Code * Absolute Addressing: Uses the contents of the memory location in the operand. * Example: LDD 200 → Stores the value at memory address 200 in the accumulator. * Direct Addressing: Same as absolute addressing; uses the contents of the memory location in the operand. * Indirect Addressing: Uses the contents of the memory location pointed to by the operand. * Example: LDI 200 → If address 200 holds 20, and address 20 holds 5, 5 is stored in the accumulator. * Indexed Addressing: Uses the memory location found by adding the contents of the index register (IR) to the operand. * Example: LDX 200 → If IR = 4 and address 204 holds 17, 17 is stored in the accumulator. * Immediate Addressing: Uses the operand value directly. * Example: LDM #200 → Stores 200 in the accumulator. * Relative Addressing: Uses the current memory address + operand. * Example: JMR #5 → Jumps to the instruction 5 locations ahead. * Symbolic Addressing: Uses labels instead of direct memory addresses. * Example: LDD MyStore → Uses the value stored in the labeled memory location. * Advantage: Easier to modify programs since labels update automatically, unlike absolute addresses. Bit manipulation Types of Bit Shifts * Shift Operation: Moves bits in a register a given number of places. * Each bit may serve a different purpose (e.g., in IR, each bit represents an interrupt). Types of Shifts * Logical Shift: * Bits shifted out are replaced with zeros. * Example: 10101111 (8-bit) left logical shift by 3 → 01111000. * Arithmetic Shift: * Preserves the sign of the number. * Can be used for multiplication or division by powers of two. * Example: 10101111 (8-bit) right arithmetic shift by 3 → 11110101. * Cyclic Shift: * No bits are lost; bits shifted out from one end re-enter from the other end. * Example: 10101111 (8-bit) left cyclic shift by 3 → 01111101. Shift Directions * Left Shift: Moves bits left (used in logical, arithmetic, and cyclic shifts). * Right Shift: Moves bits right (used in logical, arithmetic, and cyclic shifts). Bit manipulation used in monitoring and control Bit Manipulation in Monitoring and Control * Each bit in a register or memory location can act as a flag (tested, set, or cleared separately). * Example: A control system with 8 sensors can use 8 bits in one memory location to track processed data. Bitwise Operations for Flag Management * AND → Used to check if a bit is set. * OR → Used to set a bit. * XOR → Used to clear a bit that has been set. Ethics & ownership Legal, moral, ethical & cultural implications The following definitions are important when considering ethical behaviour: Legal covers the law, whether or not an action is punishable by law. » Morality concerns questions of right and wrong, and is more often thought of in relation to personal or individual choices. » Ethics also concerns questions of right and wrong, but is more often used in a professional context. » Culture refers to the attitudes, values and practices shared by a society or group of people. Computer Ethics * Computer ethics is a set of principles set out to regulate the use of computers. Three factors are considered: * Intellectual property rights – for example, copying of software without the permission of the owner. * Privacy issues – for example, hacking or any illegal access to another person’s personal data. * Effect of computers on society – for example, job losses, social impacts, and so on. Plagiarism and the Internet * Internet use has led to an increase in plagiarism – this is when a person takes another person’s idea or work and claims it was their own. * While it is fine to quote another person’s idea, it is essential that some acknowledgement is made so that the originator of the idea or work is known to others. * This can be done by a series of references at the end of a document or footnotes on each page where a reference needs to be made. * Software exists that can scan text and then look for examples of plagiarism by searching web pages on the internet. British Computer Society (BCS) * The British Computer Society (BCS) is a professional body set up in the UK to represent the rights and ethical practices of IT and computing professionals. * It has now become an international body, working with other groups to monitor and advise IT practices worldwide. BCS Code of Conduct covers four main areas: 1. The Public Interest 2. Professional Competence and Integrity 3. Duty to Relevant Authority 4. Duty to the Profession * The BCS Code of Conduct provides the following guidance: * Public Interest: Both codes emphasize the importance of acting in the public interest and safeguarding the health, safety, and welfare of the public. * Judgement and Integrity: Professionals are expected to exercise sound judgement and maintain their integrity in their work. * Ethical Practice: Both codes stress the importance of ethical behaviour and decision-making. * Lifelong Learning: The IEEE code explicitly mentions the need for continuous learning, which aligns with the need to maintain professional competence. The institute of electrical and electronic engineers (IEEE) * The IEEE Software Engineering Code of Ethics defines eight principles: * PUBLIC: Software engineers shall act consistently with the public interest. * CLIENT AND EMPLOYER: Software engineers shall act in the best interests of their client and employer, while also considering the public interest. * PRODUCT: Software engineers shall ensure that their products meet the highest professional standards possible. * JUDGEMENT: Software engineers shall maintain integrity and independence in their professional judgement. * MANAGEMENT: Software engineering managers and leaders shall promote an ethical approach to the management of software development and maintenance. * PROFESSION: Software engineers shall advance the integrity and reputation of the profession, consistent with the public interest. * COLLEAGUES: Software engineers shall be fair to and supportive of their colleagues. * SELF: Software engineers shall participate in lifelong learning and promote an ethical approach to their practice. Copyright issues Software Copyright and Piracy * Software is protected by copyright laws, similar to music CDs, videos, and articles from magazines and books. Rules When Purchasing Software: * Illegal to copy software and sell or give it away. * Cannot use software on multiple computers or a network without a multi-use license. * Illegal to use copyrighted code in your own software and distribute it without permission. * Illegal to rent out software without permission. * Illegal to use a copyrighted software name on other software without an agreement. Measures to Prevent Software Piracy: * Product key verification during installation. * User agreement confirmation before installation continues. * Hologram stickers on original packaging to indicate genuine copies. * CD/DVD/memory stick requirement for running the software to prevent unauthorized use. * Dongle protection requires a USB device to be plugged in for the software to function. Digital Rights Management (DRM) * Originally designed to control what devices a CD could play on (e.g., preventing playback on computers to stop illegal copying). * Expanded to cover music tracks, video files, ebooks, and more using protection software. DRM Restrictions: * Streaming-only access (e.g., music files that can be streamed but not copied). * Device-specific use (e.g., ebooks restricted to tablets). * Internet-dependent games requiring a connection to a specific website. * Defective copies result from attempts to bypass copyright protection. Examples of DRM in Use: * DRM-protected products may require a key for single-user registration on one device. * Apple Music's DRM layers prevent users from downloading and keeping all music within a trial period before canceling their subscription. Software Licensing Commercial Software * Available for a fee, with a single-use or multi-use license. * Fully copyright-protected, meaning code cannot be used without permission. * Older versions may be provided for free if a previous version was purchased. Free Software & Open Source Initiative * Free Software Foundation (FSF) promotes user freedom in software usage. * Open Source Initiative (OSI) focuses on practical benefits and collaboration. * Users have the four freedoms: * Run the software for any legal purpose. * Modify the source code as needed. * Redistribute copies to others. * Share modified versions with others. Restrictions on Free/Open Source Software: * Cannot add proprietary (copyrighted) code. * Cannot create software that copies copyrighted software. * Cannot modify code in ways that violate copyright laws. * Cannot develop software deemed offensive by third parties. Open Source Initiative’s 10 Principles: 1. Free Redistribution – No restrictions on selling or sharing software. 2. Source Code Access – Must provide source code for free or at a low cost. 3. Derived Works – Modifications and derived works must be allowed. 4. Integrity of Author’s Source Code – Can restrict modified distribution, but must allow "patch files." 5. No Discrimination Against People or Groups – License must be open to everyone. 6. No Discrimination Against Fields of Endeavor – No restrictions on business or research use. 7. Distribution of License – Rights apply to all users without extra agreements. 8. License Must Not Be Specific to a Product – Rights must be consistent across distributions. 9. License Must Not Restrict Other Software – Cannot require other software to be open-source. 10. License Must Be Technology-Neutral – Cannot favor a specific technology. Freeware * Free to download and use, with no associated fees. * Copyright-protected – Users cannot modify or study the source code. Shareware * Free trial period, but requires payment for continued use. * Some features may be locked until purchase. * Once paid, users receive updates and support. * Copyright-protected – Users cannot modify or use the source code. Artificial intelligence (AI) * AI is a machine or application that performs tasks requiring intelligence, similar to humans. * These tasks may include: * Use of language. * Performing mathematical calculations or functions. The Impact of AI 1. Public Perception of AI * AI is often associated with science fiction, fantasy, and robots due to books and films. * Isaac Asimov’s Three Laws of Robotics: 1. A robot must not injure a human through action or inaction. 2. A robot must obey human orders unless it conflicts with Law 1. 3. A robot must protect itself unless it conflicts with the first two laws. 2. AI Applications Beyond Robotics AI is used in: * Autonomous (driverless) vehicles. * Artificial limb technology. * Drones for hazardous tasks (e.g., bomb disposal, welding, nuclear disaster response). * Climate change predictions. * Medical procedures, such as precise eye operations. 3. Impacts of AI on Society, Economy, and Environment Society & Economy * AI advancements may cause job displacement: * By 2030, 600 million jobs could be lost worldwide. * 400 million people may need to retrain or switch jobs. * Low- and medium-skilled jobs are most at risk, but high-skilled jobs (e.g., technicians, architects) may also be affected. * Potential for civil unrest due to rising unemployment. * Historical trends show technology creates new jobs, but this may not happen at the same rate with AI. * Predictions suggest up to 99% of jobs could be eliminated as AI grows exponentially. Automation & AI Self-Maintenance * AI could self-sustain, similar to 3D printers creating other 3D printers without human intervention. * Future robots and AI systems may build and maintain themselves. Impact on Lifestyle * AI could increase leisure time, allowing people to focus on hobbies and improve their lifestyle. * AI-driven industrial revolutions could drastically alter economies and environmental policies. Environmental Impact AI can assist in: * Conserving natural resources (e.g., water management). * Detecting pollution in air and seas more accurately and pinpointing sources faster. * Optimizing renewable energy use by combining weather forecasting and AI analysis. * Monitoring and modeling ecosystems (e.g., river health) to prevent environmental damage. 4. Specific Areas of AI Impact Transport * Driverless taxis may eliminate the need for human drivers. * Autonomous vehicles (cars, buses, trucks) could improve efficiency but lead to job losses. Criminal Justice System * Facial recognition is replacing fingerprinting in forensic science. * AI is being used for legal automation, including: * Sentencing criminals. * Determining parole eligibility. * Key concerns: * Should governments need a warrant to allow AI to scan online data? * Can I listen in on phone calls and monitor emails? * How to prevent bias in AI legal decisions? (e.g., AI parole systems in the USA showing racial bias). Advertising & Data Usage * AI could reduce misuse of personal data, such as in the Cambridge Analytica scandal (2018). * AI-driven machine learning tailors personalized advertising by analyzing: * Search engine activity. * Social media behavior. * Website visits. * AI must be highly sophisticated and fast-acting to prevent data misuse. Databases * Data stored in discrete files, stored on computer, and can be accessed, altered or removed by the user Disadvantages of File Based System: * No enforcing control on organization/structure of files * Data repeated in different files; manually change each * Sorting must be done manually or must write a program * Data may be in different format; difficult to find and use * Impossible for it to be multi-user; chaotic * Security not sophisticated; users can access everything * Database: collection of non-redundant interrelated data * DBMS: Software programs that allow databases to be defined, constructed and manipulated Features of a DBMS: * Data management: data stored in relational databases - tables stored in secondary storage * Data dictionary contains: * List of all files in database * No. of records in each file * Names & types of each field * Data modeling: analysis of data objects used in database, identifying relationships among them * Logical schema: overall view of entire database, includes: entities, attributes and relationships * Data integrity: entire block copied to user’s area when being changed, saved back when done * Data security: handles password allocation and verification, backups database automatically, controls what certain user’s view by access rights of individuals or groups of users Data change clash solutions: * Open entire database in exclusive mode – impractical with several users * Lock all records in the table being modified – one user changing a table, others can only read table * Lock record currently being edited – as someone changes something, others can only read record * User specifies no locks – software warns user of simultaneous change, resolve manually * Deadlock: 2 locks at the same time, DBMS must recognize, 1 user must abort task Tools in a DBMS: * Developer interface: allows creating and manipulating database in SQL rather than graphically * Query processor: handles high-level queries. It parses, validates, optimizes, and compiles or interprets a query which results in the query plan. Relational Database Modelling * Entity: object/event which can be distinctly identified * Table: contains a group of related entities in rows and columns called an entity set * Tuple: a row or a record in a relational database * Attribute: a field or column in a relational database * Primary key: attribute or combination of them that uniquely define each tuple in relation * Candidate key: attribute that can potentially be a primary key * Foreign key: attribute or combination of them that relates 2 different tables * Referential integrity: prevents users or applications from entering inconsistent data * Secondary key: candidate keys not chosen as the primary key * Indexing: creating a secondary key on an attribute to provide fast access when searching on that attribute; indexing data must be updated when table data changes Normalization 1st Normal Form (1NF): contains no repeating attribute or groups of attributes. Intersection of each tuple and attribute contains only 1 value. 2nd Normal Form (2NF): it is in 1NF and every non-primary key attribute is fully dependent on the primary; all the incomplete dependencies have been removed. 3rd Normal Form (3NF): it is in 1NF and 2NF and all non-key elements are fully dependent on the primary key. No inter-dependencies between attributes. Data definition language (DDL) SQL Commands & Syntax Database Structure Modification (DDL - Data Definition Language) * Creating a database * CREATE DATABASE <database-name> * Example: CREATE DATABASE 'Personnel.gdb' * Creating a table * CREATE TABLE <table-name> (...) * Modifying a table * ALTER TABLE <table-name> * Adding a primary key * PRIMARY KEY (field) * Adding a foreign key * FOREIGN KEY (field) REFERENCES <table>(field) * Adding a new field to a table * ADD <field-name> <data-type> Data Manipulation Language (DML) - Querying & Maintaining Data * Creating a query * SELECT <field-name> FROM <table-name> WHERE <search-condition> * SQL Operators: * = → Equals to * > → Greater than * < → Less than * >= → Greater than or equal to * <= → Less than or equal to * <> → Not equal to * IS NULL → Check for null values * Sorting data in ascending order * ORDER BY <field-name> * Grouping identical data * GROUP BY <field-name> * Joining tables * INNER JOIN Data Maintenance Inserting new data into a table INSERT INTO <table-name> (field1, field2, field3) VALUES (value1, value2, value3); Deleting a record from a table DELETE FROM <table-name> WHERE <condition>; Updating a field in a table UPDATE <table-name> SET <field-name> = <value> WHERE <condition>; Chapters 1,2,5,6 Computing Theory Information Representation Binary vs. Decimal Prefixes Number Systems Binary Coded Decimal (BCD) * Combination of Binary and Decimal: Each decimal digit is represented by its four-bit binary equivalent. This system is used in some applications for ease of converting between human-readable forms and binary. * Benefits of BCD * More straightforward to convert between BCD and Denary * Less complex to encode and decode for programmers * Easier for digital equipment to use BCD to display information * Can represent monetary values exactly * Applications of BCD * A string of digits on any electronic device displaying numbers (calculators) * Accurately measuring decimal fractions * Electronically coding denary numbers (easy conversion) One’s and Two’s Complement One’s Complement * Formation: Invert all bits of a binary number (0s become 1s and vice versa). * Negative Numbers: Used to represent negative numbers in binary. For instance, the one’s complement of 0011 (3 in decimal) is 1100, which can be interpreted as -3 in one’s complement notation. Two’s Complement * Creating Two’s Complement: Add one to the one’s complement of a number. * Significance: This system simplifies the process of binary addition and subtraction, particularly with negative numbers. * Converting from negative denary to binary two’s complement (example -42): * Find the binary equivalent of the denary number (ignoring the negative sign) | 42 = 101010 * Add extra 0 bits before the MSB, to format the binary number to 8 bits | 00101010 * Convert binary number to one’s complement (flip the bits) | 11010101 * Convert binary number to two’s complement (add 1) |1010101 + 1 = 11010110 * Converting binary two’s complement into denary (example 11010110): * Flip all the bits | 00101001 * Add 1 | 00101010 * Convert binary to denary and put a negative sign) | -42 * Maximum positive number in 8 bits: 127 * Maximum negative number in 8 bits: -128 Binary Addition and Subtraction Binary Addition Rules 1. 0 + 0 = 0 2. 0 + 1 = 1 3. 1 + 0 = 1 4. 1 + 1 = 10 (0 carry 1) 5. 1 + 1 + 1 = 11 (1 carry 1) Two’s Complement Method (for Subtraction) 1. Find the two’s complement of the number to subtract: * Invert all bits (one’s complement). * Add 1 to the result. 2. Add it to the original number. 3. Ignore overflow (if any). Base Conversions Binary to Decimal * Conversion Technique: Multiply each binary digit by its place value (power of 2) and sum the results. For example, to convert * 10102 to decimal, the calculation would be 1×23+0×22+1×21+0×20=1010. Decimal to Binary * Method: Repeatedly divide the decimal number by 2 and record the remainders. The binary number is formed by reading the remainders in reverse order. * Example: Converting 13 to binary involves dividing 13 by 2 (remainder 1), then 6 by 2 (remainder 0), then 3 by 2 (remainder 1), and finally 1 by 2 (remainder 1), resulting in 11012. Binary to Hexadecimal * Process: Group the binary digits into nibbles (groups of four) from right to left and convert each group to its hexadecimal equivalent. * Example: To convert 110110102​ to hexadecimal, separate it into 11012​ and 10102 , which translates to DA16. Hexadecimal to Binary * Direct Conversion: Convert each hexadecimal digit to its four-bit binary equivalent. * Example: Converting 3C16 to binary involves translating 3 to 00112 and C (12 in decimal) to 11002, resulting in 001111002 Character Data Representation Multimedia Images * Pixel: the smallest identifiable component of a bitmap image, defined by its position in the bitmap matrix and its colour * File header: Bitmap images contain a file header with metadata, including image size, number of colours, etc. * Image Resolution: The number of pixels that make up an image * Screen Resolution: The number of pixels that can be viewed horizontally and vertically on a device’s screen. * Colour Depth: The number of bits used to represent the colour of a single pixel. * Bit Depth: the number of bits used to represent each of the RGB colours. * Effect (Image Resolution): Higher resolution results in sharper, more detailed images. * Calculation (Screen Resolution): Number of pixels = width x height Sound * Analogue data consists of continuous electrical signals. * Digital data consists of discrete electrical signals * Conversion: * Analogue signals are converted to digital signals by sampling. * The sound wave’s amplitude is sampled at set time intervals * These samples are encoded as a binary number sequence, providing a digital representation of the sound wave * Sampling Rate: Number of samples taken per unit of time. * Effect: Increasing the sampling rate improves the accuracy of the digitized sound wave representation but increases file size. * Sampling Resolution: Number of bits used to encode each sample. * Effect: Increasing sampling resolution improves the accuracy of digitized sound waves but increases file size. * Bit Rate: Number of bits used to store 1 second of sound. * Calculation: Bit Rate = Sampling Rate*Sampling Resolution File Compression Compression is the process of reducing file size without significant loss in quality, resulting in: * Reduced time needed to search for data. * Faster transfer of compressed files, using less bandwidth than uncompressed files. Communication Networking Client-Server and Peer-to-Peer networking models * The client-server model is a distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients * Server: a computer program running to serve the requests of other programs (clients). Client:Clients are software programs and processes that connect to server, sending and receiving requests. * A server host runs one or more server programs which share their resources with clients * A client does not share any of its resources, but requests a server’s content/service. Therefore clients initiate communication sessions with servers which await incoming requests. Thin Clients and Thick Clients Networking topologies Bus * A single line (bus) connects all devices with terminators at each end. * Other computers can read data being sent between any two computers. * Unsuitable for heavy traffic due to frequent collisions. Star * Devices only connected to central router/device (switch/hub) * Each computer only connected to server * Fewer collisions - high performance as each device only connected to switch * Easily scalable - device directly connected to switch * More resilient - not reliant on one single cable How data is transmitted * Data from sending device is transmitted to the router * Data has address of recipient * Router determines recipient’s destination address * Router transmits data directly/only to recipient Mesh * Every device (node) is directly interconnected with each of the other devices (nodes) * Multiple routes between devices. Computers can act as relays - forward packets to final destination. * Commonly used for wireless networks, such as the Internet, through the mesh connection of routers. Advantages of mesh topology * If one line goes down alternate routes are available * Improved security - not using one main line * Fewer collisions (more routes available) * New nodes can be added without interfering with others Hybrid : A combination of two or more topologies. Public and Private Cloud Computing * Public cloud is a storage environment where the customer/client and cloud storage provider are different companies * Private cloud is storage provided by a dedicated environment behind a company firewall. Customer/client and cloud storage provider are integrated and operate as a single entity. Network Infrastructure Wired Networks * Use copper (twisted-pair cable or coaxial cable) or fiber-optic cables. * Cables are connected to an Ethernet port on the network router. Copper Cable * Characteristics * Offers good conductivity and flexibility. * Prone to electromagnetic interference (EMI) in industrial settings. * Use Cases * Widely used in office and residential buildings for Ethernet connections. Fibre-Optic Cable * Characteristics * Transmits data via light, making it immune to EMI. * Fragile and more expensive than copper cables. * Use Cases * Ideal for long-distance communication and high-speed networks like in internet backbones. Radio Waves * Characteristics * Travels through the air, allowing for wireless communication. * Susceptible to interference from other electronic devices and structures. * Use Cases * Commonly used in mobile phone networks, Wi-Fi, and Bluetooth technology. Microwaves * Characteristics * High-frequency waves capable of carrying large amounts of data. * Requires line-of-sight between transmitter and receiver. * Use Cases * Used in point-to-point communication links and satellite communications. Satellites * Characteristics * Provides wide area coverage, reaching remote locations. * Signals can be affected by atmospheric conditions, leading to latency. * Use Cases * Vital for global telecommunications, GPS systems, and remote internet access. Network Design Considerations * Physical Layout * Wired networks require careful planning of cable routes and management. * Wireless networks offer flexibility but need strategic placement of access points for optimal coverage. * Scalability * Wired networks can be complex and costly to scale. * Wireless networks are more adaptable to changing needs and expansion. Performance Implications * Bandwidth and Throughput * Wired networks typically offer higher bandwidth, supporting more simultaneous users without degradation. * Wireless networks, while improving, may struggle with high-density user environments. * Latency and Stability * Wired networks offer lower latency, essential for real-time applications like gaming and video conferencing. * Wireless networks can experience variable latency and stability issues. Application Suitability * Wired Networks * Ideal for environments requiring stable and high-speed connections, like data centres and professional studios. * Wireless Networks * Better suited for consumer applications, small offices, and areas where wiring is impractical. Networking Hardware Switch * Allows communication between devices * Connects individual devices to each other * Receives transmissions and forwards them to their destination Server * Manages access to a centralised resource (usually between devices on LAN) Network Interface Card (NIC) * Provides each end-system in the wired LAN with a unique MAC address to uniquely identify it on the network * Allows each device to connect to the network Wireless Network Interface Card (WNIC) * Provides interface/allows connection to wireless network as an antenna * Receives analogue waves and converts them to digital * Takes digital input and converts it into analogue waves - sends radio waves through antenna * Encrypts and decrypts data * Provides MAC address to identify device on network WAP (wireless access point) * Hardware that provides radio communication from central device to nodes on a network * Allows connection of devices using radio waves/signals/Wi-Fi * Allows wireless enabled devices to connect to wired network Bridge * Connects two LANs with the same protocol * Allows communication/data transmission between two networks with same protocol Repeater * Restores a digital signal so it can be transmitted over greater distances Role of Router* * Receives packets from devices// external network/internet * Stores IP and MAC addresses of all devices attached to it * Maintains routing table * routes/forwards packets to destination * Finds destination of a packet (using IP addresses) * Assigns Private IP addresses to devices on a LAN * Finds most efficient path to destination * Can act as a firewall, gateway (+ perform protocol conversion/changes packet format) Ethernet * A protocol * Used for data transmission over a wired network * Uses CSMA/CD * Data is transmitted in frames - each frame has source and destination address and error checking data CSMA/CD * Device checks if the channel is busy before transmitting * If busy, the device waits a random time before retrying * During transmission, the device listens for other transmissions * If a collision occurs, transmission is aborted, and both devices wait random times before retrying. Bit Streaming * Sequence of bits transferred over a communication path at high speeds, requiring a fast broadband connection and buffers * Real-Time: Live events captured and transmitted directly * On-demand: Pre-existing files are converted and streamed as requested Importance of high broadband speed/Bit-ratee * The user has to download and display bits at the same time * Higher quality media requires faster speeds due to larger data frames as well * Real-time streaming needs higher speeds due to simultaneous data requests coming from multiple different users. * Modems: * Allows a device to connect to the Internet via a telephone line. * Function: A transmitter uses a modem to convert digital signals (from the transmitting device) to analogue signals sent down the telephone line. A receiver uses a modem on the other end to convert the analogue signals to digital signals so the receiving device can understand the data. * PSTN (Public Switched Telephone Network): * Refers to all telephone networks. * Channel: Used between two endpoints for the call duration via circuit switching. * Resilience: Lines are active even during a power outage. * Communication: Bi-directional. * Dedicated Lines: * Telecommunication path between endpoints. * Not shared with multiple users; it’s bought/leased. * Function: Able to host websites as well as carry phone calls. Allows continuous, uninterrupted access to the Web. * Cell Phone Network: * Wireless networks spread over land areas divided into (hexagonal) cells. * Base Stations: Each cell is served by at least one base station (transceiver), which uses a different frequency range compared to adjacent cells to transmit data. * Capacity: Larger capacity is possible since the same frequencies can be used in non-adjacent cells. * Transmission: Radio waves are usually used for transmission. Can be broadcast in all directions over a wide area. * Portable Transceivers: Devices like mobile phones can communicate and access the internet via base stations. World Wide Web (WWW): * Description: collection of web pages stored on websites * Function: Protocols are used to transmit data across the WWW Internet (Interconnected Network): * Description: Massive, open network of networks * Protocol: Uses TCP/IP protocol, which uses IP addresses to identify devices connected to the internet * Access: Provided by Internet Service Provider * Communication Methods: wired, radio and satellite * Network Identifier (netID): Identifies the network to which the host (device) is connected. * Host Identifier (hostID): Identifies the host within the network. * Classful Addressing: Used for IPv4, where different bit lengths for identification impose restrictions on available addresses. Subnetting * Definition: The practice of dividing a network into two or more networks. * Structure: IP addresses are broken down into three parts by not changing the netID but partitioning the host ID into a subnet ID and host ID. * Subnet ID: These bits are used to identify each subnet within the network. * Subnet Masks: Numbers that hide (mask) the netID of a system's IP address and leave only the host part as the machine identifier, allowing data to be routed within the subnet to the appropriate host. Public and Private IP Addresses Public IP * Provided by the ISP * Unique and can be accessed across the internet Private IP * Issued by the LAN’s router * Unique within the LAN and can only be accessed within the LAN NAT (Network Address Translation): Required for private IP addresses to access the internet directly Security: Private IPs are more secure than public IPs since they are not directly accessible on the Internet and are hidden by NAT. Address Range: The range of IP addresses used for private IP addressing can never be assigned to public IP addresses. * URL (Uniform Resource Locator) * Unique reference address for the exact location of an internet resource on the WWW * Protocol: Enables the browser to know what protocol is used to access information in the domain. * Host-name: The domain name. * Location of Server: The path indicating the server location. * Domain Name Service (DNS) * Definition: A naming system used for computers or resources having an internet connection. * Structure: Consists of a hierarchy of DNS servers which have a URL database and their corresponding IP addresses. System Software Operating Systems Purpose of an operating system An operating system is a set of programs designed to run in the background of a computer system: * To provide a user interface * To provide a platform for a software to run/be executed * To hide complexities of hardware from user Management Tasks Memory Management * Controls the movement of data between RAM/processor * Allocates memory to process * Dynamically allocates memory to processes/programs How MM allocates RAM * RAM is assigned into blocks * Dynamic allocation of RAM to programs * Reclaims unused block of RAM * Prevents two programs occupying the same area of RAM simultaneously * Moves data from secondary storage when needed (manages paging and virtual memory) File Management Tasks * Space allocated to particular files * Maintains a directory structure * Provides file naming abilities * Implements access rights * Allows file sharing * Specifies tasks that can be performed on a file (copy, paste, delete, close..) Security Management * Creates accounts/passwords * Provides a firewall or anti-malware * Validates user and process authenticity Hardware Management * Receives data from input devices * Sends data to output devices * operates/installs device drivers- installs programs for devices connected to external ports * Allows communication between peripheral devices and computer handles buffers for transfer of data- ensures smooth transfer between devices transmitting and receiving at different speeds * Manages interrupts from device Process Management * Manages scheduling of processes- decides which process to run next// order of processes * Manages resources that the process requires (memory allocation) * Enables processes to share/transfer data * Prevents interference between processes * Handles process queue * supports/allows multitasking- ensures fair access, handling priorities/interrupts Utility Software * Help set-up/optimise/maintain the computer * Makes memory allocation more efficient * Checks the system for faults Disk formatter: disk needs to be initialised for use * Initialises a disk for storing files by partitioning it (generates new file system) * Can delete all data from the disk * Sets up file allocation table * Needs to check disk for errors Defragmentation: Over time, saving and deleting small files fragments disk * Moves blocks of files so that each individual file is contiguous in memory * Moves free space together * Less time taken to access files (less head movement as data is contiguous) * Improves disk access times - no need to search for next fragment Disk Repair: needed to optimise performance * Scans for errors/inconsistencies in a disk and corrects them - prevents bad sectors being used * Reduces access times by optimising storage Back-up (software): allows revival of data, provides security against loss * Creates copy of data in case the original is lost (in regular intervals) * Allows retrieval of data if any is lost/corrupted Disk/System clean up * Optimises storage by removing unwanted files Compression Software * Reduces file size * Saves storage and memory space * Reduces transmission time Virus Checker * Frees up RAM - removes software that takes up memory/replicates, scans for malicious program code * Checks for and then removes any viruses found * Constantly checks all incoming and outgoing files Program Library * Contains pre-written functions and subroutines * Can be referenced or imported * The functions/routines it has can be called in own program * Saves time as code does not have to be written from scratch * More likely to work (already tested) * Program updates automatically (if update in routine) * Can perform more complex calculations than programmer is able to do Dynamic Link Library Benefits * Requires less main memory as DLL is only loaded once when needed * Executable file is smaller (does not contain all library routines) * No maintenance needed from programmer (DLL is separate from program) * No need to recompile program if changes are made to DLL (changes/improvements to DLL file code are done independently of the main program) Language Translators * Convert a high-level or assembly programming language to a different form (usually machine/object code) Assembler * Translated assembly code into machine code Compiler * Translate high-level language (entire code is translated then run) * Used after program is completed * Produces error report after translating * Creates executable file- can be run without source code After testing * Produces executable file * User cannot access/edit/sell the code * Users do not need translator to run the program * Can be compiled for different hardware specifications (generates more income) * Program can be tested multiple times without need to retranslate Drawbacks when testing * Code cannot be changed without recompilation * Program will not run if there are any errors * Errors cannot be corrected in real-time * One error may result in false errors being reported * Cannot easily test individual sections of code / cannot test if code is unfinished Advantages when testing * Can debug multiple errors simultaneously * Produces executable file * Developer can test program multiple times without recompiling Interpreter * Translate high-level language line by line (is translated then run) * Used while writing a program for testing and debugging * Errors can be corrected in real-time - stops when an error occurs and displays position When Testing * Allows developer to make real-time changes that can be seen immediately * Program can be debugged at each stage * Developer can test when incomplete - small parts can be tested individually, if one section does not work others can still be tested * To avoid dependant errors Partial Interpreters/Compilers * Can be used on different platforms as they are interpreted when run * Code is optimised for CPU as machine code is generated at run time * Source code does not need to be recompiled - more efficient to run * Software may not need to be compiled if the software is already an executable file, has been pre-compiled/built using compiler or if the source code has not been provided IDE Features/Tools Coding * Context sensitive prompts - as the code is being written, displays predictions/options to complete the statements, suggests additions * Auto-complete - helps programmer figure out what to type next * Auto-correct Error Detection * Dynamic syntax check - underlines/highlights syntax errors as code is being entered/in real-time Presentation * Pretty printing - helps identify key terms (colour coding) * Auto indentation * Expand/collapse code blocks Debugging * Single stepping - allows programmer to run the code one line at a time (breaking in between) so effects of each statement on values can be seen/checked * Breakpoints - stop the code executing at a set line (to check current values/progress) * Report windows - output contents of variables and data structures (see how variables change) Security, Privacy and Data Integrity Data Security Data Security * Protects data against loss/corruption * Ensure recovery Data Privacy * Ensuring data is protected against unauthorised access Data Integrity * Ensures consistency/accuracy of data and whether it is up to date * Validation/verification rules, cascading update/delete Why data needs to be kept secure * To protect against someone installing malware or damaging the system/accessing data on it Measures used to protect computer systems * Two factor authentication * Strong username and passwords * Prevents unauthorised access * Biometric passwords Digital signatures * User puts message through hashing algorithm to produce a digest * Digest encrypted with sender’s private key (created digital signatures) * Message and signature sent to receiver * Receiver decrypts signature to reproduce digest - same hashing algorithm used on received document to create second digest * Signature digest and receivers digest are compared (document is authentic as they are the same) * Digital signature can only be decrypted using matching sender’s public key Firewall: accepts or rejects incoming/outgoing packets based on criteria * Monitors incoming and outgoing traffic/packets - compares it to criteria set by user (checks against whitelist/blacklist/blocked IP addresses) * blocks/rejects files or transmissions that do not match criteria, accepts ones who do Up-to date Anti-Malware: scans files on hard drive for malicious software * Regularly scans computer for viruses, checks against stored database of viruses * Databases need to be updated regularly * If virus detected, it is quarantined or deleted * Compares downloaded files to database of known viruses - prevents download from continuing Anti-spyware * Scans computer for spyware, checks against stored database of spyware * Database needs to be updated regularly * If spyware detected, it is quarantined or deleted * Compares downloaded files to database of known spyware - prevents download from continuing Threats to computer and data security Malware/Virus * Malicious software that replicates itself * Downloaded/run without user’s knowledge * Runs in the background * Can pretend to be legitimate * Can damage/delete/corrupt data * Does not send data out of computer Spyware * Malicious software * downloaded/run without user’s knowledge * Runs in background * Can pretend to be legitimate * Secretly records/collects user’s data/actions * Sends data/activity logs to third party * Does not replicate itself Hacking/hackers * illegal/unauthorised access used to delete/damage/collect data * Done with malicious intent Phishing * Requires user action * Email pretends to be from official body * Persuades individuals to disclose private information * Requests authentication by redirecting to unofficial website Pharming * Automatic * Redirects user to a false/fake website * Prevention - check URL validity, ensure connection is secure (https) Security Methods to Protect Security of Data Access Rights * Give certain users access to different elements * Uses different account/logins which have different levels of access * Specific views can be assigned Encryption * Data is converted into cipher text // data is encoded * Use - cannot be understood if intercepted without a decryption key Data Integrity Validation * Checks data is reasonable/sensible * E.g checking data is given in the right data type * Format check: makes sure data is in required format * Length check: makes sure data contains correct number of characters * Type check: ensures only correct data type is entered * Existence check: makes sure data is already present in the system Verification * Checks that data matches the original/is accurate * Visual check: person manually compares original data with that entered to check if correct * Double entry: enter data into computer twice and compares * If differences found, go back to raw data to fix error Data transfer verification methods Parity check * All data transmitted as bits * Number of 1s in a byte must always be either an odd number or an even number * Parity can be set either as even or odd * E.g. two communicating devices decide there will always be an odd number of 1s. A byte is received that has even number of 1s so error occurred and receiving device would ask for it to be sent again * Used also when data sent between parts of the CPU * Not foolproof: if 2 bits are transposed, data accepted Checksum Check * Data sent from one place to another as block of bytes rather than individual bytes * Computer adds together all bytes being sent * Any bits lost at most-significant end as carry ignored so answer is an 8-bit number * Checksum calculated before and after data sent * If two bytes different, error occurred therefore block of bytes must be sent again