Back to Student Worksheet
CS Grade 9-12 Answer Key

Computer Science: Binary and Data Representation

Representing numbers, text, images, and sound with bits

Answer Key
Name:
Date:
Score: / 15

Computer Science: Binary and Data Representation

Representing numbers, text, images, and sound with bits

CS - Grade 9-12

Instructions: Read each problem carefully. Show your work when doing conversions or calculations.
  1. 1

    Convert the binary number 101101 to decimal. Show the place values you used.

    Write the place values from right to left as 1, 2, 4, 8, 16, and 32.

    The binary number 101101 equals 45 in decimal because 32 + 8 + 4 + 1 = 45.
  2. 2

    Convert the decimal number 58 to binary.

    The decimal number 58 equals 111010 in binary because 58 = 32 + 16 + 8 + 2.
  3. 3

    Convert the binary number 11001010 to hexadecimal.

    Group the binary digits into sets of four starting from the right.

    The binary number 11001010 equals CA in hexadecimal because 1100 is C and 1010 is A.
  4. 4

    Convert the hexadecimal number 3F to decimal.

    The hexadecimal number 3F equals 63 in decimal because 3 × 16 = 48 and F equals 15, so 48 + 15 = 63.
  5. 5

    An unsigned 8-bit integer can store values from 0 to 255. Explain why 255 is the largest value.

    Think about how many total patterns can be made with 8 bits.

    An 8-bit unsigned integer has 8 bits, so it can represent 2^8 = 256 different values. Since counting starts at 0, the largest value is 255.
  6. 6

    Write the decimal value represented by the 8-bit binary pattern 11111111 if it is treated as an unsigned integer.

    The 8-bit binary pattern 11111111 represents 255 as an unsigned integer because all place values from 128 to 1 are included.
  7. 7

    Using 8-bit two's complement, what decimal number is represented by 11111110?

    For a negative two's complement number, invert the bits and add 1 to find the magnitude.

    In 8-bit two's complement, 11111110 represents -2. Inverting the bits gives 00000001, adding 1 gives 00000010, so the magnitude is 2 and the number is negative.
  8. 8

    Using 8-bit two's complement, write the binary representation of -13.

    The 8-bit two's complement representation of -13 is 11110011. Start with 00001101 for 13, invert it to 11110010, and add 1 to get 11110011.
  9. 9

    ASCII uses 7 bits per character, while extended ASCII often uses 8 bits per character. How many more different symbols can be represented with 8 bits than with 7 bits?

    Use 2^n to find how many patterns can be made with n bits.

    Eight bits can represent 256 symbols and seven bits can represent 128 symbols, so 8 bits can represent 128 more symbols than 7 bits.
  10. 10

    The ASCII code for uppercase A is decimal 65. Convert 65 to 8-bit binary.

    The decimal number 65 is 01000001 in 8-bit binary because it uses the 64 place and the 1 place.
  11. 11

    A grayscale image uses 8 bits per pixel. How many different gray levels can each pixel represent?

    Each bit doubles the number of possible values.

    Each pixel can represent 256 different gray levels because 8 bits can make 2^8 = 256 different patterns.
  12. 12

    A small image is 100 pixels wide and 50 pixels tall. Each pixel uses 24 bits for color. How many bytes are needed to store the raw image data, not including metadata or compression?

    Find the number of pixels first, then multiply by bits per pixel and divide by 8.

    The image has 100 × 50 = 5,000 pixels. Each pixel uses 24 bits, so the image uses 120,000 bits, which is 15,000 bytes.
  13. 13

    A color is represented in RGB as (255, 128, 0). Explain what each number means.

    In RGB, 255 is the red intensity, 128 is the green intensity, and 0 is the blue intensity. This color has maximum red, medium green, and no blue.
  14. 14

    A sound file is recorded with a sample rate of 44,100 samples per second, 16 bits per sample, and 2 channels. How many bits are needed for 1 second of uncompressed audio?

    Multiply sample rate by bits per sample by number of channels.

    One second of audio needs 44,100 × 16 × 2 = 1,411,200 bits.
  15. 15

    Explain one advantage and one disadvantage of using compression when storing data.

    One advantage of compression is that it reduces file size, which saves storage space and can make files faster to transmit. One disadvantage is that lossy compression can reduce quality, and some compression requires extra time to encode or decode.
LivePhysics™.com CS - Grade 9-12 - Answer Key