Computer Science

Subdecks (1)

Cards (591)

  • Every one of us is used to the decimal or denary (base 10) number system. This uses the digits 0 to 9 which are placed in 'weighted' columns.
  • Designers of computer systems adopted the binary (base 2) number system since this allows only two values, 0 and 1. No matter how complex the system, the basic building block in all computers is the binary number system.
  • Binary number system
    The binary system uses 1s and 0s only which gives these corresponding weightings: 128, 64, 32, 16, 8, 4, 2, 1
  • Converting from binary to denary and from denary to binary
    1. Each time a 1 appears in a column, the column value is added to the total
    2. Placing 1s in the appropriate position so that the total equates to the denary number
    3. Successive division by 2; the remainders are then written from bottom to top to give the binary value
  • One's complement
    Each digit in the binary number is inverted (0 becomes 1 and 1 becomes 0)
  • Two's complement
    Each digit in the binary number is inverted and a '1' is added to the right-most bit
  • The two's complement uses these weightings for an 8-bit number representation: -128, 64, 32, 16, 8, 4, 2, 1
  • Two's complement
    Method used to represent negative numbers in binary
  • Converting denary to binary using two's complement
    1. Invert the digits
    2. Add 1
  • Converting denary to binary using two's complement
    • +104 becomes 1 0 0 1 1 0 0 0
    • -104 becomes 1 0 0 1 1 0 0 0
  • Two's complement makes binary addition and subtraction more straightforward
  • The byte is the smallest unit of memory in a computer
  • Memory size units
    • Kilobyte (KB)
    • Megabyte (MB)
    • Gigabyte (GB)
    • Terabyte (TB)
    • Petabyte (PB)
  • SI (base 10) system of units

    1 kilo = 1000
  • IEC (binary) system of units
    • 1 kibibyte (KiB) = 1024
    • 1 mebibyte (MiB) = 1,048,576
    • 1 gibibyte (GiB) = 1,073,741,824
  • Internal memories should be measured using the IEC system
  • Hexadecimal
    Base 16 number system using digits 0-9 and A-F
  • Converting binary to hexadecimal
    1. Split binary into groups of 4 bits
    2. Convert each group to equivalent hexadecimal digit
  • Converting hexadecimal to binary
    Take each hexadecimal digit and write the 4-bit binary code
  • Converting binary to hexadecimal
    • 1 0 1 1 1 1 1 0 0 0 0 1 becomes B E 1
    1 0 0 0 0 1 1 1 1 1 1 1 0 1 becomes 2 1 F D
  • Converting hexadecimal to binary
    • 4 becomes 0 1 0 0
    F becomes 1 1 1 1
    0 8 becomes 0 0 0 0 1 0 0 0
  • Memory dump
    Output of a computer's memory contents, often in hexadecimal
  • Binary-coded decimal (BCD)
    1. bit code to represent each decimal digit
  • BCD representation
    • 0 0 0 0 = 0
    0 1 0 1 = 5
    1 0 0 1 = 9
  • Uses of BCD
    Representation of digits on calculator/clock displays
    Storing monetary values accurately
  • ASCII code
  • Binary addition
    1. 0 + 0 = 0
    2. 0 + 1 = 1
    3. 1 + 0 = 1
    4. 1 + 1 = 1 0 (carry 1)
  • This produces 1 1 0 1 which isn't a denary digit; this will flag an error and the computer again needs to add 0 1 1 0
  • Adding 1 to 0 0 0 0 0 0 0 0
    Produces 0 0 0 0 0 0 0 1
  • Final answer: 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 1 which is 1.31 in denary – the correct answer
  • ASCII code

    American Standard Code for Information Interchange, set up in 1963 for use in communication systems and computer systems
  • The standard ASCII code character set consists of 7-bit codes (0 to 127 denary or 0 to 7F in hexadecimal)
  • The ASCII code table includes 32 control codes (which use up codes 0 to 31 (denary) or 0 to 19 (hexadecimal))
  • Extended ASCII uses 8-bit codes (128 to 255 in denary or 80 to FF in hex)
  • Unicode
    Allows characters in a code form to represent all languages of the world, thus supporting many operating systems, search engines and internet browsers used globally
  • Unicode can support several thousand different characters in total
  • Goals of the Unicode consortium
    • Create a universal standard that covered all languages and all writing systems
    • Produce a more efficient coding system than ASCII
    • Adopt uniform encoding where each character is encoded as 16-bit or 32-bit code
    • Create unambiguous encoding where each 16-bit or 32-bit value always represents the same character
    • Reserve part of the code for private use to enable a user to assign codes for their own characters and symbols
  • Vector graphics
    Images that use 2D points to describe lines and curves and their properties that are grouped to form geometric shapes
  • Creating vector graphics
    1. Using computer aided design (CAD) software
    2. Using an application with a drawing canvas on the screen
  • Vector graphic
    • Contains a drawing list (in file header) with the command for each object, the attributes that define the properties of each object, and the relative position of each object
    • Dimensions of each object are not defined, but the relative positions of objects to each other in the final graphic need to be defined
    • Scaling up the vector graphic image will result in no loss of quality