Topic 4

Cards (195)

  • What is the fundamental way data is stored in computers?
    Data is always stored in binary.
  • Why is it essential to use the correct data type when writing a program?

    To ensure the right operations can be performed on the data.
  • What is an integer?

    An integer is a whole number that cannot have a fractional part.
  • What types of numbers are included in integers?
    Integers include zero and negative numbers.
  • What are examples of integers?

    6, 47238, -12, 0, 15.
  • What is a real number?

    A real number can be positive or negative and may have a fractional part.
  • How are real numbers useful?

    They are useful for measuring things.
  • Can integers be classified as real numbers?

    Yes, all integers are real numbers.
  • What is a character in computing?

    A character is a single symbol used by a computer.
  • What types of symbols can be considered characters?

    Letters A to Z, numbers 0 to 9, and various symbols like %, £.
  • What is a Boolean data type?

    A Boolean data type can only take values of True or False.
  • Why are Booleans useful?

    They are useful for recording data that can only take two values.
  • What is the least significant bit in a binary number?

    The least significant bit is the one furthest to the right.
  • What does the most significant bit represent?

    The most significant bit is furthest to the left.
  • How do you calculate the value of a binary number?

    By multiplying each digit by its place value and adding the results.
  • What is the decimal equivalent of the binary number 1101?

    13.
  • What is the first step in converting a decimal number to binary?

    Find the largest power of two smaller than the number.
  • How would you represent the decimal number 47 in binary?

    101111.
  • What do leading zeros in binary representation indicate?

    They do not affect the value of the number.
  • What are the four 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 result of adding the binary numbers 1011 and 1110?

    11001.
  • How do you perform binary addition with carry?

    You place the first digit of the result under the next most significant bit's column if the result is more than one digit.
  • What is sign magnitude representation?

    It represents negative numbers by adding a leading 1 for negative and a leading 0 for positive numbers.
  • How do you convert from sign magnitude to decimal?

    Note the most significant bit, discard it, convert the remaining bits to decimal, and add the sign.
  • What is two's complement?

    It represents negative numbers by flipping all bits of the positive version and adding one.
  • How do you calculate the decimal equivalent of a two's complement number?

    Make the most significant bit negative and calculate the value using the remaining bits.
  • How does two's complement simplify binary subtraction?

    It allows subtraction to be performed as addition of a negative number.
  • What is the hexadecimal base?

    Hexadecimal is base 16.
  • What characters are used in hexadecimal?

    0-9 and A-F.
  • How do place values in hexadecimal work?

    They start with 1 (16<sup>0</sup>) and go up in powers of 16.
  • What is the decimal equivalent of the hexadecimal number 4E7F?

    20095.
  • How do you convert hexadecimal to binary?

    Convert each hexadecimal digit to a decimal digit and then to a binary nybble.
  • What are the main data types in programming?
    • Integer: Whole numbers without fractions.
    • Real: Numbers that can have fractions.
    • Character: Single symbols used by computers.
    • Boolean: Values of True or False.
  • What are the steps for converting decimal to binary?

    1. Find the largest power of two smaller than the number.
    2. Write out place values in powers of two.
    3. Place 1s and 0s to sum to the decimal number.
  • 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 are the methods for representing negative numbers in binary?
    • Sign Magnitude: Leading 1 for negative, leading 0 for positive.
    • Two's Complement: Flip bits and add one.
  • What is the process for converting from hexadecimal to binary?

    1. Convert each hexadecimal digit to decimal.
    2. Convert decimal to binary nybbles.
    3. Combine nybbles to form a binary number.
  • What is the base of the hexadecimal number system?

    16
  • Which characters are used in hexadecimal to represent the values 10-15?
    1. F
  • What is the decimal equivalent of the hexadecimal digits 0-9 and A-F?

    • Decimal 0-9 corresponds to hexadecimal 0-9
    • Decimal 10 corresponds to hexadecimal A
    • Decimal 11 corresponds to hexadecimal B
    • Decimal 12 corresponds to hexadecimal C
    • Decimal 13 corresponds to hexadecimal D
    • Decimal 14 corresponds to hexadecimal E
    • Decimal 15 corresponds to hexadecimal F