9.2 Binary, Octal, Decimal, Hexadecimal Conversions & File Formats
Key Takeaways
- Digital computing is built upon positional radix number systems: Binary (radix 2: {0,1}), Octal (radix 8: {0-7}), Decimal (radix 10: {0-9}), and Hexadecimal (radix 16: {0-9, A-F}).
- Base conversion algorithms employ successive division (for integer components) and successive multiplication (for fractional components) when transforming decimal values, while bit-grouping (3 bits for octal, 4 bits for hex) enables rapid direct interconversion.
- Data storage hierarchies follow exponential scales where 1 Nibble = 4 bits, 1 Byte = 8 bits, and binary IEC standards ($2^{10} = 1024$: KiB, MiB, GiB, TiB, PiB) diverge mathematically from decimal SI standards ($10^3 = 1000$: KB, MB, GB, TB, PB).
- Multimedia and document file formats utilize lossy compression (JPEG, MP3, MP4) to discard perceptually redundant information for compactness, or lossless compression (PNG, FLAC, SVG, TIFF) to ensure bit-for-bit data preservation.
Binary, Octal, Decimal, Hexadecimal Conversions & File Formats
Quick Answer: Digital computing systems utilize positional number systems with distinct radix bases: Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16, where $A=10$ through $F=15$). Conversions rely on successive division/multiplication for decimal mappings and direct 3-bit (octal) or 4-bit (hexadecimal) binary grouping. Storage capacity scales in binary factors of $2^{10} = 1024$ (Byte, KB, MB, GB, TB, PB, EB, ZB, YB), while multimedia file extensions are governed by lossy or lossless compression standards.
1. Positional Number Systems in Digital Computing
In a positional number system, the value of any digit depends on its face value, its position relative to the radix point, and the base (radix, denoted $r$) of the system. The value of a general number $N$ with integer digits $d_i$ and fractional digits $d_{-j}$ is expressed as:
| Number System | Radix (Base $r$) | Allowed Digits / Symbols | Weight of Positions (Integer $\leftarrow$ Radix Point $\rightarrow$ Fractional) |
|---|---|---|---|
| Binary | 2 | $0, 1$ | $\dots, 2^3 (8), 2^2 (4), 2^1 (2), 2^0 (1) ;.; 2^{-1} (0.5), 2^{-2} (0.25), 2^{-3} (0.125), \dots$ |
| Octal | 8 | $0, 1, 2, 3, 4, 5, 6, 7$ | $\dots, 8^3 (512), 8^2 (64), 8^1 (8), 8^0 (1) ;.; 8^{-1} (0.125), 8^{-2} (0.015625), \dots$ |
| Decimal | 10 | $0, 1, 2, 3, 4, 5, 6, 7, 8, 9$ | $\dots, 10^3 (1000), 10^2 (100), 10^1 (10), 10^0 (1) ;.; 10^{-1} (0.1), 10^{-2} (0.01), \dots$ |
| Hexadecimal | 16 | $0\text{--}9, \text{A, B, C, D, E, F}$ | $\dots, 16^3 (4096), 16^2 (256), 16^1 (16), 16^0 (1) ;.; 16^{-1} (0.0625), \dots$ |
[!NOTE] In Hexadecimal, alphabetic letters represent values from 10 to 15:
$\text{A} = 10, \quad \text{B} = 11, \quad \text{C} = 12, \quad \text{D} = 13, \quad \text{E} = 14, \quad \text{F} = 15$
2. Step-by-Step Conversion Algorithms and Numerical Methods
A. Decimal to Any Base (Successive Division / Multiplication Method)
- Integer Part: Continuously divide the decimal integer by the target base $r$. Record the integer remainder at each stage until the quotient becomes 0. Read remainders from bottom to top (Most Significant Digit [MSD] to Least Significant Digit [LSD]).
- Fractional Part: Continuously multiply the fractional part by the target base $r$. Record the generated integer digit at each step. Multiply only the remaining fractional component until it reaches 0 or achieves desired precision. Read generated integers from top to bottom.
Worked Example 1: Convert $(75.625){10}$ to Binary $(?){2}$
- Integer Conversion ($75 \div 2$):
- $75 \div 2 = 37$, remainder 1 (LSD)
- $37 \div 2 = 18$, remainder 1
- $18 \div 2 = 9$, remainder 0
- $9 \div 2 = 4$, remainder 1
- $4 \div 2 = 2$, remainder 0
- $2 \div 2 = 1$, remainder 0
- $1 \div 2 = 0$, remainder 1 (MSD)
- Reading bottom-up: $(75)_{10} = (1001011)_2$
- Fractional Conversion ($0.625 \times 2$):
- $0.625 \times 2 = \mathbf{1}.25 \rightarrow$ Integer 1
- $0.25 \times 2 = \mathbf{0}.50 \rightarrow$ Integer 0
- $0.50 \times 2 = \mathbf{1}.00 \rightarrow$ Integer 1
- Reading top-down: $(0.625)_{10} = (0.101)_2$
- Combined Result: $(75.625)_{10} = (1001011.101)_2$
B. Direct Grouping Methods (Binary $\leftrightarrow$ Octal $\leftrightarrow$ Hexadecimal)
Because $8 = 2^3$ and $16 = 2^4$, conversions between Binary, Octal, and Hexadecimal bypass decimal arithmetic through direct bit-grouping:
- Binary to Octal: Partition the binary bitstream into groups of 3 bits starting from the radix point (leftward for integers, rightward for fractions, padding with leading/trailing zeros as needed). Replace each 3-bit cluster with its octal equivalent.
- Binary to Hexadecimal: Partition the binary bitstream into groups of 4 bits starting from the radix point. Replace each 4-bit cluster with its hexadecimal digit ($0\text{--}9, \text{A--F}$).
- Octal / Hexadecimal to Binary: Expand each octal digit into its precise 3-bit binary equivalent, or each hexadecimal digit into its 4-bit binary equivalent.
Direct Binary Equivalence Reference Table:
| Decimal | 4-Bit Binary | Octal (3-bit) | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 (000) | 0 |
| 1 | 0001 | 1 (001) | 1 |
| 2 | 0010 | 2 (010) | 2 |
| 3 | 0011 | 3 (011) | 3 |
| 4 | 0100 | 4 (100) | 4 |
| 5 | 0101 | 5 (101) | 5 |
| 6 | 0110 | 6 (110) | 6 |
| 7 | 0111 | 7 (111) | 7 |
| 8 | 1000 | 10 (001 000) | 8 |
| 9 | 1001 | 11 (001 001) | 9 |
| 10 | 1010 | 12 (001 010) | A |
| 11 | 1011 | 13 (001 011) | B |
| 12 | 1100 | 14 (001 100) | C |
| 13 | 1101 | 15 (001 101) | D |
| 14 | 1110 | 16 (001 110) | E |
| 15 | 1111 | 17 (001 111) | F |
Worked Example 2: Convert Binary $(1101011110.1011)_2$ to Hexadecimal and Octal
- Hexadecimal Grouping (4 bits from radix point):
- Integer part:
0011 0101 1110(padded two leading zeros to complete left cluster)0011= $3$,0101= $5$,1110= $\text{E} (14)$
- Fractional part:
1011= $\text{B} (11)$ - Hexadecimal result: $(35\text{E}.\text{B})_{16}$
- Integer part:
- Octal Grouping (3 bits from radix point):
- Integer part:
001 101 011 110(padded two leading zeros)001= $1$,101= $5$,011= $3$,110= $6$
- Fractional part:
101 100(padded two trailing zeros)101= $5$,100= $4$
- Octal result: $(1536.54)_8$
- Integer part:
Worked Example 3: Convert Hexadecimal $(2\text{C}7)_{16}$ to Decimal
(2\text{C}7)_{16} &= 2 \times 16^2 + \text{C} \times 16^1 + 7 \times 16^0 \\ &= 2 \times 256 + 12 \times 16 + 7 \times 1 \\ &= 512 + 192 + 7 = (711)_{10} \end{aligned}$$3. Hierarchy of Digital Data Storage Units
Digital data is quantified in discrete binary units. UGC NET questions frequently test hierarchical sequencing and conversions across both binary (IEC) and decimal (SI) notations:
Elementary Storage Units
- Bit (b): Binary Digit; the fundamental atomic unit of digital information, representing either a
0(low voltage / off) or a1(high voltage / on). - Nibble: A cluster of 4 contiguous bits (or half a byte). One hexadecimal digit precisely maps to one nibble.
- Byte (B): A collection of 8 bits. The universal basic addressable unit of computer memory, capable of representing $2^8 = 256$ distinct values (e.g., one standard ASCII character).
- Word: The natural data width processed by a computer's CPU architecture in a single clock cycle (e.g., 16-bit word = 2 bytes; 32-bit word = 4 bytes; 64-bit word = 8 bytes).
Storage Capacity Hierarchy (Powers of 1024 vs. Powers of 1000)
In computer architecture, data storage scales in powers of 2 ($2^{10} = 1024$), whereas telecommunication bandwidth and commercial drive manufacturers often use decimal SI powers of 10 ($10^3 = 1000$).
| Unit | Abbr. | Binary Equivalent (IEC / Computing Standard) | Exact Bytes ($2^N$) | Decimal Multiple (SI Standard) |
|---|---|---|---|---|
| Kilobyte (Kibibyte) | KB (KiB) | $1024\text{ Bytes} = 2^{10}\text{ B}$ | $1,024\text{ B}$ | $10^3\text{ B} = 1,000\text{ B}$ |
| Megabyte (Mebibyte) | MB (MiB) | $1024\text{ KB} = 2^{20}\text{ B}$ | $1,048,576\text{ B}$ | $10^6\text{ B} = 1,000,000\text{ B}$ |
| Gigabyte (Gibibyte) | GB (GiB) | $1024\text{ MB} = 2^{30}\text{ B}$ | $1,073,741,824\text{ B}$ | $10^9\text{ B} = 10^9\text{ B}$ |
| Terabyte (Tebibyte) | TB (TiB) | $1024\text{ GB} = 2^{40}\text{ B}$ | $1,099,511,627,776\text{ B}$ | $10^{12}\text{ B}$ |
| Petabyte (Pebibyte) | PB (PiB) | $1024\text{ TB} = 2^{50}\text{ B}$ | $2^{50}\text{ B} \approx 1.1259 \times 10^{15}\text{ B}$ | $10^{15}\text{ B}$ |
| Exabyte (Exbibyte) | EB (EiB) | $1024\text{ PB} = 2^{60}\text{ B}$ | $2^{60}\text{ B} \approx 1.1529 \times 10^{18}\text{ B}$ | $10^{18}\text{ B}$ |
| Zettabyte (Zebibyte) | ZB (ZiB) | $1024\text{ EB} = 2^{70}\text{ B}$ | $2^{70}\text{ B} \approx 1.1805 \times 10^{21}\text{ B}$ | $10^{21}\text{ B}$ |
| Yottabyte (Yobibyte) | YB (YiB) | $1024\text{ ZB} = 2^{80}\text{ B}$ | $2^{80}\text{ B} \approx 1.2089 \times 10^{24}\text{ B}$ | $10^{24}\text{ B}$ |
[!TIP] Memory Scale Mnemonic (Ascending Order):
Bit $\rightarrow$ Nibble $\rightarrow$ Byte $\rightarrow$ Kilo $\rightarrow$ Mega $\rightarrow$ Giga $\rightarrow$ Tera $\rightarrow$ Peta $\rightarrow$ Exa $\rightarrow$ Zetta $\rightarrow$ Yotta
(Remember: Kids Make Great Teachers, Polishing Every Zesty Yarn)
4. File Formats, MIME Types & Compression Paradigms
Digital files are encoded using specialized formatting structures and compression algorithms tailored to their respective media categories.
Lossy vs. Lossless Compression
- Lossy Compression: Permanently discards mathematically redundant or perceptually imperceptible information (e.g., frequencies outside human hearing range, subtle color variations). Yields very high compression ratios but prevents bit-for-bit reconstruction of the original file (ideal for web streaming and consumer multimedia).
- Lossless Compression: Reduces file size by identifying and eliminating statistical redundancy using encoding algorithms (e.g., Run-Length Encoding, Huffman Coding, LZW). Allows 100% bit-for-bit reconstruction of original source data upon decompression (mandatory for text, executables, medical imaging, and archival records).
Comprehensive Media Format Classification
| Media Domain | File Extension / Format | Compression Type | Primary Characteristics & Exam Relevance |
|---|---|---|---|
| Audio | MP3 (MPEG-1 Audio Layer III) | Lossy | Standard compressed audio format for web transmission and consumer devices |
| WAV (Waveform Audio) | Uncompressed / Lossless | Standard raw PCM audio format developed by Microsoft & IBM; large file size | |
| AAC (Advanced Audio Coding) | Lossy | Successor to MP3 offering superior audio fidelity at equivalent bitrates | |
| FLAC (Free Lossless Audio Codec) | Lossless | Open-source audio codec that reduces file size by 50–60% with zero quality loss | |
| Image | JPEG / JPG (Joint Photographic Experts Group) | Lossy | Standard 24-bit true color format (16.7M colors) for photographs; no alpha transparency |
| PNG (Portable Network Graphics) | Lossless | Raster image format supporting 24-bit color and 8-bit alpha-channel transparency | |
| GIF (Graphics Interchange Format) | Lossless (8-bit) | Indexed color format restricted to 256 colors; supports frame-by-frame animation | |
| SVG (Scalable Vector Graphics) | Lossless (Vector) | XML-based 2D vector graphic format; infinitely scalable without pixelation | |
| TIFF (Tagged Image File Format) | Lossless / Uncompressed | High-depth raster format used in professional desktop publishing and medical imaging | |
| Video | MP4 (MPEG-4 Part 14) | Lossy | Universal digital multimedia container format utilizing H.264/H.265/HEVC video codecs |
| AVI (Audio Video Interleave) | Lossy / Lossless | Multimedia container format introduced by Microsoft in 1992 | |
| MKV (Matroska Video) | Container | Open-standard container holding unlimited video, audio, picture, and subtitle tracks | |
| MOV (Apple QuickTime Movie) | Lossy | Proprietary multimedia container format developed by Apple | |
| Document | PDF (Portable Document Format) | Lossless / Structured | ISO-standard platform-independent electronic document format developed by Adobe |
| DOCX / XLSX / PPTX | XML Compressed | OpenXML document formats utilizing ZIP-compressed XML architectures (Microsoft Office) | |
| CSV (Comma-Separated Values) | Plain Text | Human-readable delimited plain-text table storing tabular database records |
What is the decimal equivalent of the binary number (101101)₂?
Which of the following binary bitstreams represents the direct hexadecimal equivalent of (4F)₁₆?
Which of the following correctly arranges the digital storage units in strict ascending order of capacity?
Which image file format utilizes an XML-based mathematical vector structure that allows graphics to be scaled infinitely without experiencing raster pixelation?