Computer Science

Cards (140)

  • Why computers use binary to represent all forms of data
    1. Any form of data needs to be converted to binary to be processed by a computer
    2. Data is processed using logic gates and stored in registers
  • Why hexadecimal is used as a beneficial method of data representation
    Hexadecimal is easier for humans to understand than binary, as it is a shorter representation of the binary
  • The concept of overflow and why it occurs in binary addition
    1. An overflow error will occur if the value is greater than 255 in an 8-bit register
    2. A computer or a device has a predefined limit that it can represent or store, for example 16-bit
    3. An overflow error occurs when a value outside this limit should be returned
  • Performing a logical binary shift on a positive 8-bit binary integer
    1. Bits shifted from the end of the register are lost and zeros are shifted in at the opposite end of the register
    2. The positive binary integer is multiplied or divided according to the shift performed
    3. The most significant bit(s) or least significant bit(s) are lost
  • ASCII and Unicode
    1. Text is converted to binary to be processed by a computer
    2. Unicode allows for a greater range of characters and symbols than ASCII, including different languages and emojis
    3. Unicode requires more bits per character than ASCII
  • Why a computer represents sound, including the effects of the sample rate and sample resolution
    1. A sound wave is sampled for sound to be converted to binary, which is processed by a computer
    2. The sample rate is the number of samples taken in a second
    3. The sample resolution is the number of bits per sample
    4. The accuracy of the recording and the file size increases as the sample rate and resolution increase
  • Data storage measurements
    • bit
    • nibble
    • byte
    • kibibyte (KiB)
    • mebibyte (MiB)
    • gibibyte (GiB)
    • tebibyte (TiB)
    • pebibyte (PiB)
    • exbibyte (EiB)
  • Calculating the file size of an image file and a sound file
    1. The file size of an image is calculated as: image resolution (in pixels) × colour depth (in bits)
    2. The size of a mono sound file is calculated as: sample rate (in Hz) × sample resolution (in bits) × length of sample (in seconds)
    3. For a stereo sound file, you would then multiply the result by two: sample rate (in Hz) × sample resolution (in bits) × length of sample (in seconds) x 2
  • Purpose of data compression
    1. Less bandwidth
    2. Less storage space
    3. Shorter transmission time
  • Lossy and lossless compression methods
    • Lossless compression reduces the file size without permanent loss of data, e.g. run length encoding (RLE)
    • Lossy compression reduces the file size by permanently removing data, e.g. reducing resolution or colour depth, reducing sample rate or resolution
  • Describe the structure of a packet
    1. A packet of data in a unit of data contains a packet header, payload, and trailer
    2. The packet header includes the destination address, packet number, and originator’s address
  • Describe the process of packet switching
    1. Data is broken down into packets
    2. Each packet could take a different route
    3. A router controls the route a packet takes
    4. Packets may arrive out of order
    5. Once the last packet has arrived, packets are reordered
  • Types of data transmission
    • Serial
    • Parallel
    • Simplex
    • Full-duplex
    • Half-duplex
  • Benefits of USB
  • Drawbacks of USB
  • USB
    • Benefits
    • Drawbacks
    • Devices plugged into the computer are automatically detected and device
    • Drivers are automatically loaded up
    • Standard USB only supports a maximum cable length of 5m; beyond that, USB hubs are needed to extend the cable length
    • Connections can only fit one way preventing incorrect connections being made
    • Even though USB is backward compatible, very early USB standards (V1) may not always be supported by the latest computers
    • It has become an industry standard, which means considerable support is available
    • Can support different data transmission rates (from 1.5mbps to 5gbps)
    • Even the latest version 3 (V3) and version 4 (V4) USB-C systems have a data transfer rate which is slow compared to, for example, ethernet connections (note: USB V2 has a maximum data transfer rate of 480mbps.)
    • USB protocol notifies the transmitter to re-transmit data if any errors are detected; this leads to error-free data transmission
    • It is relatively easy to add more USB ports if necessary, by using USB hubs
  • USB is backward compatible (that is, older versions are still supported)
  • Checksum
    1. When a block of data is about to be transmitted, the checksum is calculated from the block of data
    2. The calculation is done using an agreed algorithm (this algorithm has been agreed by sender and receiver)
    3. The checksum is then transmitted with the block of data
    4. At the receiving end, the checksum is recalculated by the computer using the block of data (the agreed algorithm is used to find the checksum)
    5. The re-calculated checksum is then compared to the checksum sent with the data block
    6. If the two checksums are the same, then no transmission errors have occurred; otherwise a request is made to re-send the block of data.
    7. Value is calculated from the data using an algorithm. Value is transmitted with the data. Value recalculated by receiver using the same algorithm. If checksum values are different there is an error
    8. A value is calculated from the data using an algorithm. The value is appended to the data to be transmitted. Value is recalculated after transmission and compared. If the values match the data is correct. If the values do not match the data is incorrect.
  • Check Digit
    1. A digit added when transmitting data from a calculation performed on the digits in the data.
    2. Check digit is used to detect errors in data entry and identify.
    3. International standard book numbers (ISBN) and bar codes
  • Parity Checks
    1. Uses the number of 1-bits in a byte
    2. Two Types - Even (Even number of 1-bits), Odd (Odd numbers of 1-bits)
  • Limitations with Parity Checks
  • Parity Blocks
    1. To overcome the limitations of parity bits, Parity blocks would be used.
    2. Any changes in bits would be identified through the rows and columns.
  • Parity bits
    Parity can be set to odd or even. Sender and receiver agree on parity to use. Data is split into bytes of 7 bytes. Sender counts the number of 1s in each byte. Each byte is assigned a parity bit to match the odd or even parity. The receiving device recounts the number of 1s in each byte and compares to parity used and if it does not match the parity, an error is identified. In parity block check the location of the error(s) can be identified at the intersection.
  • Echo Check

    1. Once the data has been sent, the receiver will send the data back to the sender for verification.
    2. The sender would compare the received and original data for errors.
    3. The only downside is that we wouldn’t know if the error occurred when sending the data or sending the data back for verification.
  • ARQ
    1. Uses acknowledgement and timeout
    2. Sender starts a timer when data is transmitted
    3. Receiver uses an error checking method to check whether the data has been received accurately
    4. If no error detected a positive acknowledgement is returned to sender
    5. If error detected negative acknowledgement is returned to sender
  • SES acknowledgement and timeout
    1. Sender starts a timer when data is transmitted
    2. Receiver uses an error checking method to check whether the data has been received accurately
    3. If no error detected a positive acknowledgement is returned to sender
    4. If error detected negative acknowledgement is returned to sender
    5. If sender gets no acknowledgement within the set time it resends the data
  • Encryption
    1. Encryption is a process of turning the data into an unreadable form, so it doesn’t make sense to hackers and other attackers
    2. Plaintext is the original data that is being sent
    3. Ciphertext is the text produced after encryption
    4. Encryption converts plain text to ciphertext by using algorithm
  • Symmetric Encryption
    • Uses an encryption key for the encryption process
    • The same key is used for both encrypting and decrypting the data
  • Asymmetric Encryption
    • Uses a public key and a private key
    • The public key is available to everyone whereas the private key is only available to the user
    • The receiver would have the private key and they would send the public key to the sender
    • The sender can encrypt the message with the public key and the data can be decrypted using the private key
  • The number of cores, size of the cache and speed of the clock can affect the performance of a CPU
  • Core
    One core is made up of an ALU, a control unit and the registers
  • Purpose of a core in the CPU
    1. To perform a fetch-decode-execute cycle
    2. To execute an instruction
  • CPU has more cores
    It may increase the performance because more instructions can be processed simultaneously
  • Buses in a CPU
    • Address bus
    • Data bus
    • Control bus
  • Address bus
    Carries addresses between components in the CPU
  • Data bus
    Transmit data between components in the CPU
  • Control bus
    Transmits control signals from the control unit to other components in the CPU
  • Purpose of the control unit (CU)
    1. It sends control signals that manage the transfer of data and instructions within the CPU
    2. It decodes an instruction using an instruction set
  • MDR and the ALU are used in the fetch–decode–execute cycle
    1. Data fetched from RAM is stored in the MDR
    2. Data from MDR is sent to ALU to be executed
    3. ALU performs calculation and logical operations on data
    4. ALU has a built-in register, accumulator where it stores interim results of calculations
    5. After calculations, ALU sends data to MDR
    6. Data is sent from MDR to be written to RAM
  • Instruction set for a CPU
    An instruction set is a list of all the commands that can be processed by a CPU and the commands are machine code