In-depth Notes on Information Representation and Multimedia
Binary Number System
- Definition: Binary is a two-digit number system utilizing only the digits
0 and 1. - Importance: Understanding binary is crucial for many computer science topics and appears frequently in examinations.
- Example: A binary number is represented as
01001111.
Conversion Between Binary and Decimal
Binary to Decimal
- Each
1 in a binary number contributes to the total value based on its position (powers of 2). - Conversion Method:
- For example, the binary number
1011 is calculated as: - 1 imes 2^3 + 0 imes 2^2 + 1 imes 2^1 + 1 imes 2^0 = 8 + 0 + 2 + 1 = 11
Decimal to Binary
- Conversion Method: To convert a decimal number to binary:
- While the number is greater than zero, divide it by
2. - Record the remainder for each division.
- Read remainders from bottom to top.
- Example: Convert
67 to binary:- Division process: 67 / 2 = 33 R1
- Continue until zero: 33 / 2 = 16 R1, 16 / 2 = 8 R0, 8 / 2 = 4 R0, 4 / 2 = 2 R0, 2 / 2 = 1 R0, 1 / 2 = 0 R1.
- Result:
67 in binary is 1000011.
One's Complement
- Definition: One's complement represents negative numbers by flipping all binary digits (changing
0 to 1 and vice versa). - Example:
- For positive binary
0101 (which equals 5), its one's complement would be 1010 (which equals -5).
- Characteristics:
- Two representations for zero: +0 (
0000) and -0 (1111).
Two's Complement
- Definition: Provides a more efficient representation for negative numbers compared to one's complement.
- Conversion:
- Flip all the bits (like one's complement).
- Add
1 to the least significant bit.
- Example: For binary
0101:- Flip:
1010 - Add 1:
1010 + 0001 = 1011 (which represents -5).
- Advantage: Only one representation for zero.
Binary Addition
- Rules:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (carry 1)
- 1 + 1 + 1 = 11 (carry 1)
Binary Subtraction
- Basic Concept:
- Similar to base-10 with borrowing.
- Method:
- If you need to subtract
1 from 0, borrow from the next left digit, turning 0 into 2 (binary 10). This allows calculations like: - 0 - 1 turns into 2 - 1 = 1$$$.
Data Measurement Units
- Byte: Smallest addressable unit, consisting of
8 bits. - Larger units include:
- Kilobyte (KB) = 1,000 bytes (SI system, base-10), but computers use binary (1 KB = 1024 bytes).
- Megabyte (MB), Gigabyte (GB), etc.
Hexadecimal System
- Definition: A base-16 numbering system that uses characters
0-9 and A-F. - Purpose: Simplifies the representation of binary numbers; one hex digit corresponds to four binary bits.
- Conversion:
- Hexadecimal
A = 1010 binary. - For binary
11010111, group into nibbles: 1101 (D) and 0111 (7), resulting in D7 in hex.
ASCII and Character Sets
- ASCII: Codes characters (letters, numbers, symbols) with binary.
- Character sets:
- Standard ASCII (7-bit, 128 characters)
- Extended ASCII (8-bit, 256 characters)
- Unicode (variable bits, millions of characters).
Bitmap Graphics
- Definition: Composed of pixels, each pixel represented by binary values indicating its color.
- Features:
- Size: Detailed but larger file sizes.
- Editing Difficulty: Changes require pixel-by-pixel edits.
Image Resolution & Bit Depth
- Image Resolution: Total pixels = width × height.
- Bit Depth: Number of bits per pixel.
- More bits = more colors available.
- Example:
- 24-bit image allows for
16.7 million colors.
Vector Graphics
- Definition: Defined by 2D points, allowing for scalable images without quality loss.
- Key Features:
- Editable without pixelation.
- Commonly used for logos and designs.
Sound Representation
- Sound is recorded as amplitude at specific time intervals.
- Sampling Rate: Frequency of measurements taken (Hz). Higher rates yield more accurate representation.
Video Compression
- Video frames are captured and stitched together at a defined frame rate (commonly 25 fps).
- File Compression: Reduces size while aiming to retain quality.
Lossless vs. Lossy Compression
- Lossless: No data loss, original can be perfectly restored (e.g., Run-Length Encoding).
- Lossy: Some data omitted for smaller file size (e.g., MP3, JPEG), not perfect restoration possible.
MP3 Compression
- Reduces size significantly by about
90% using perceptual music shaping. - Examples of bitrate: 80-320 kbps, affecting sound quality.
Run-Length Encoding (RLE)
- A lossless technique compressing data by encoding repeated sequences into counts and values.
- Effective for data with many sequential identical elements, less effective for unique data.
- Image Example: A black and white 8x8 grid can reduce from
64 bytes to 30 bytes using RLE.