Practice Bits and Bytes in CS Thinking
Use these practice problems to test your method after reviewing the concept explanation and worked examples.
Quick Recap
A bit is a single binary digit (0 or 1), the smallest unit of digital data. A byte is a group of 8 bits that can represent 256 different values (0 to 255), enough to encode one text character. All digital storage and communication is measured in bits and bytes.
A bit is the smallest piece of data. A byte is enough to store one character.
Example 1
easyHow many different values can be represented with 3 bits? List all possible 3-bit binary patterns.
Example 2
mediumConvert between storage units: (a) How many bytes in 2 kilobytes? (b) A file is 3,145,728 bytes โ how many megabytes is that? (c) How many bits in 1 byte?
Example 3
mediumAn image is 800 ร 600 pixels. Each pixel uses 24 bits (8 bits each for red, green, blue). What is the uncompressed file size in megabytes?
Example 4
hardA colour system uses 4 bits per colour channel (red, green, blue). (a) How many shades can each channel represent? (b) How many unique colours are possible in total? (c) Compare this to standard 8-bit-per-channel colour.