1.4.1 Data types

Cards (92)

  • What are the primitive data types listed?
    Integer, Real, Character, String, Boolean
  • How are positive integers represented in binary?
    Using base 2 with bits
  • What methods are used to represent negative numbers in binary?
    Sign magnitude and Two’s complement
  • What are the two methods for binary addition?
    Binary addition and Binary subtraction
  • How are positive integers represented in hexadecimal?
    Using base 16 with digits and letters
  • What is the process to convert positive integers between binary, hexadecimal, and denary?
    Use specific conversion methods for each
  • How are floating point numbers represented in binary?
    Using representation and normalization
  • What operations can be performed with floating point arithmetic?
    Addition and subtraction of numbers
  • What are bitwise manipulation and masks used for?
    Shifts and combining with AND, OR, XOR
  • How are character sets used to represent text?
    Using ASCII and Unicode standards
  • What is an integer?
    A whole number without a fractional part
  • Why are integers useful?
    For counting things
  • What is a real number?
    A number that can have a fractional part
  • How are real numbers represented?
    Using floating point representation
  • What is a character in computing?
    A single symbol used by a computer
  • What values can a Boolean data type take?
    True and False
  • What is the least significant bit in binary?
    The bit furthest to the right
  • How do you convert binary to decimal?
    Multiply each bit by its place value
  • What is the decimal equivalent of binary 1101?
    13
  • What is the first step to convert decimal to binary?
    Find the largest power of two smaller than the number
  • How do you represent the decimal number 47 in binary?
    As 00101111
  • What are the rules for binary addition?
    Four simple rules to remember
  • What is the result of adding binary 1011 and 1110?
    11001
  • What is sign magnitude representation?
    A method to represent negative numbers
  • How does two's complement work?
    Flipping bits and adding one
  • What is the two's complement of binary 00000111?
    11111001
  • How is subtraction performed using two's complement?
    By adding a negative number
  • What is the hexadecimal representation of decimal 20095?
    4E7F
  • What characters are used in hexadecimal?
    0-9 and A-F
  • How do place values work in hexadecimal?
    Start with 1 and go up in powers of 16
  • What is the decimal equivalent of hexadecimal 4E7F?
    20095
  • What are the main data types in programming?
    • Primitive data types:
    • Integer
    • Real / floating point
    • Character
    • String
    • Boolean
  • What are the methods for representing negative numbers in binary?
    • Sign magnitude
    • Two’s complement
  • What are the steps for converting between binary, hexadecimal, and denary?
    1. Identify the number system
    2. Use appropriate conversion methods
    3. Verify the conversion
  • What are the rules for binary addition?
    1. 0 + 0 + 0 = 0
    2. 0 + 0 + 1 = 1
    3. 0 + 1 + 1 = 10
    4. 1 + 1 + 1 = 11
  • What is the process for converting decimal to binary?
    1. Find the largest power of two smaller than the number
    2. Write place values in powers of two
    3. Place 1s and 0s to sum to the decimal number
  • What is the process for converting binary to decimal?
    1. Identify the least and most significant bits
    2. Multiply each bit by its place value
    3. Sum the results to get the decimal value
  • What is the process for converting binary to hexadecimal?
    1. Group binary digits into sets of four
    2. Convert each group to its hexadecimal equivalent
    3. Combine the hexadecimal digits
  • What is the process for converting hexadecimal to binary?
    1. Convert each hexadecimal digit to a 4-bit binary equivalent
    2. Combine the binary groups
  • What is the process for converting hexadecimal to decimal?
    1. Multiply each digit by its place value
    2. Sum the results to get the decimal value