Chapter 7.1 Representing Information Digitally: Binary, Hexadecimal, and Encoding Standards

Fundamental Principles of Digitizing Information

  • Digitizing Data

    • Digitizing involves more than just representing letters, numbers, and metadata.

    • It encompasses various forms of information categorized as multimedia, including photos, audio, and video.

    • The core principles used to encode letters and numbers into bits are identical to those used for digitizing multimedia.

  • Digitizing Discrete Information

    • To digitize is to represent information using digits, which are normally base 1010 numerals ranging from 00 to 99.

    • The primary advantage of using digits for encoding is that items can be organized in numerical order.

    • When using symbols other than digits, an ordering system known as a collating sequence is required.

    • A collating sequence is a universally agreed-upon order of symbols from the smallest to the largest value.

    • When selecting symbols for encoding, it is essential to consider how those symbols interact with the objects being encoded.

Analog versus Digital Systems

  • Analog Information

    • Analog data is continuous in nature.

    • Examples include sound waves and sound pressure.

    • In a graph of sound pressure over time, analog information appears as a continuous, undulating wave.

  • Digital Information

    • Digital data is discrete, meaning it consists of distinct or separable samples.

    • Digital information exists in a series of many distinct data points rather than a continuous stream.

    • Digital information is stored using PandA (Presence and Absence) representation.

    • All data within a computer system is fundamentally represented in binary.

  • Converting Analog to Digital Sound

    • To digitize an analog sound wave, it must be converted into bits.

    • This is achieved by using binary numbers to record the magnitude of the wave (how far it is above or below the zero line) at specific sampling points on a graph.

Representing Color and Light in Digital Systems

  • Color Scheme (RGB)

    • Computer displays use pixels, which are small points of colored light arranged in a grid.

    • Each pixel is created by combining three primary colored lights: red, green, and blue.

    • This color model is referred to as RGB.

  • Encoding Black and White

    • Black is defined as the total absence of light. In the RGB bit assignment, black is represented by all zero-intensity values:

      • Red: 0000 00000000\,0000

      • Green: 0000 00000000\,0000

      • Blue: 0000 00000000\,0000

      • Full sequence: 0000 0000 0000 0000 0000 00000000\,0000\,0000\,0000\,0000\,0000

    • White is defined as the full intensity of red, green, and blue light. The RGB bit assignment for white uses all full-intensity values:

      • Red: 1111 11111111\,1111

      • Green: 1111 11111111\,1111

      • Blue: 1111 11111111\,1111

      • Full sequence: 1111 1111 1111 1111 1111 11111111\,1111\,1111\,1111\,1111\,1111

The PandA (Presence and Absence) Representation

  • The Intersection of Physical and Logical Worlds

    • The most fundamental patterns in IT occur when physical phenomena meet logical concepts.

    • The basic form of information is the presence or absence of a physical phenomenon, such as:

      • Is matter in a specific place at a specific time?

      • Is light detected at a specific place and time?

      • Is magnetism sensed at a certain spot at a certain time?

    • The specific intensity (brightness of light or strength of magnetism) is irrelevant; only the detection of the state (presence or absence) matters.

  • Logical Implementation

    • Logic, based on the concepts of True and False, is the foundation of both human reasoning and mechanical computing.

    • By associating "True" with the presence of a phenomenon and "False" with its absence, the physical world is used to implement logical systems, creating information technology.

    • This association is termed PandA representation.

  • Characteristics of PandA

    • PandA is a discrete system, meaning values are distinct and separable.

    • It is impossible to transform one value into another through tiny gradations; there are no "shades of gray."

    • Because it relies on only two patterns (present and absent), it is inherently a binary system.

  • Interpretations of Presence and Absence

    • | Present | Absent |

    • | :--- | :--- |

    • | True | False |

    • | 11 | 00 |

    • | On | Off |

    • | Yes | No |

    • | ++ | −- |

    • | Black | White |

    • | For | Against |

  • Units of Representation: The Bit

    • A bit (a contraction of "binary digit") is the unit of PandA representation.

    • It represents a specific place in space and time where a phenomenon can be set and detected.

    • Bit sequences can be interpreted as binary numbers, and groups of bits are used to form symbols.

Bit Storage and Pattern Combinations

  • Computer Memory Arrangement

    • Inside a computer, memory is organized as a long sequence of bits where physical phenomena can be set and detected as present or absent.

    • Sidewalk Memory Analogy: Imagine a sidewalk where each square represents a memory slot (bit). A stone placed on a square represents the value 11 (presence), and an empty square represents the value 00 (absence).

    • Following this analogy, if a sequence of 88 sidewalk squares is "Stone, No Stone, Stone, No Stone, No Stone, No Stone, Stone, No Stone," the PandA symbol is "PAPA AAPA."

  • Alternative physical PandA Encodings

    • Stones on all squares, but using black stones for one state and white for another.

    • Multiple colored stones per square (e.g., more black than white equals 00, more white than black equals 11).

    • Positioning: A stone in the center represents one state, while an off-center stone represents the other.

  • The Binary System and Base 2

    • Computers use base 22 to represent numbers.

    • Counting in binary (base 22) only uses the digits 00 and 11. The sequence of counting is: 0,1,10,11,100,101,110,111,1000,…0, 1, 10, 11, 100, 101, 110, 111, 1000, \dots

    • Eight bits grouped together form a byte.

  • Calculating Possible symbols

    • The number of symbols possible from a sequence of nn bits is calculated as 2n2^n.

    • | nn Bits | 2n2^n Symbols |

    • | :--- | :--- |

    • | 11 | 21=22^1 = 2 |

    • | 22 | 22=42^2 = 4 |

    • | 33 | 23=82^3 = 8 |

    • | 44 | 24=162^4 = 16 |

    • | 55 | 25=322^5 = 32 |

    • | 66 | 26=642^6 = 64 |

    • | 77 | 27=1282^7 = 128 |

    • | 88 | 28=2562^8 = 256 |

    • | 99 | 29=5122^9 = 512 |

    • | 1010 | 210=10242^{10} = 1024 |

Hexadecimal System

  • Defining Hexadecimal (Hex)

    • Hex is short for base 1616.

    • It uses the decimal digits 0−90-9 followed by the first six Latin letters: A,B,C,D,E,FA, B, C, D, E, F.

    • Values of Hex letters: A=10,B=11,C=12,D=13,E=14,F=15A=10, B=11, C=12, D=13, E=14, F=15.

  • Utility of Hex

    • Binary sequences are long, tedious, and prone to error when written.

    • Hex is a compact way to represent binary. Each hex digit represents a group of four bits (a nibble).

    • Example Conversion:

      • Binary: 1000 1110 1101 1000 1010 0011 1010 00001000\,1110\,1101\,1000\,1010\,0011\,1010\,0000

      • Separated Nibbles: 1000(8) 1110(E) 1101(D) 1000(8) 1010(A) 0011(3) 1010(A) 0000(0)1000(8)\,1110(E)\,1101(D)\,1000(8)\,1010(A)\,0011(3)\,1010(A)\,0000(0)

      • Hex Result: 8E D8 A3 A08E\,D8\,A3\,A0

Digital Storage Size Measurements

  • Sizes and Capacities

    • Bit: A single 11 or 00.

    • Nibble: 44 bits (represented by 11 hex character).

    • Byte: 88 bits.

    • Kilobyte (KB): 210=1,0242^{10} = 1,024 bytes (approximately one thousand).

    • Megabyte (MB): 220=1,048,5762^{20} = 1,048,576 bytes (approximately one million).

    • Gigabyte (GB): 230=1,073,741,8242^{30} = 1,073,741,824 bytes (approximately one billion).

    • Terabyte (TB): 240=1,099,511,627,7762^{40} = 1,099,511,627,776 bytes (approximately one trillion).

Digitizing Text: ASCII and Unicode

  • Standard ASCII

    • American Standard Code for Information Interchange (ASCII).

    • Originally a 77-bit code, allowing for 27=1282^7 = 128 symbols.

    • It includes 2626 uppercase and 2626 lowercase Roman letters, 1010 Arabic numerals, 1010 arithmetic characters, 2020 punctuation characters (including space), and 33 non-printable control characters (new line, tab, backspace).

    • A total of 9595 printable characters are sufficient for English text.

  • Extended ASCII

    • Introduced by IBM in the mid-1960s to handle non-English text.

    • Uses 88 bits (one byte) per character, allowing for 28=2562^8 = 256 symbols.

    • The first 128128 characters match standard ASCII (with a leading 00 added to the byte). The remaining 128128 slots provide room for Western European languages and other special symbols.

  • Unicode

    • Created in the 1990s to support numerous languages with different character sets.

    • Initially used 22 bytes (1616 bits) to represent over 65,00065,000 characters (2162^{16}).

    • It is backward compatible with 88-bit ASCII (the first 256256 characters are the same).

    • Current standards use more bits to represent over 107,000107,000 characters in 9090 scripts, including ancient scripts like Egyptian hieroglyphics and modern scripts like Kanji, Arabic, Cyrillic, and Hebrew.

  • ASCII Character Listings (Decimal/Hex/Character)

    • 0(00)0 (00): NUL | 1(01)1 (01): SOH | 2(02)2 (02): STX | 3(03)3 (03): ETX | 4(04)4 (04): EOT | 5(05)5 (05): ENQ | 6(06)6 (06): ACK

    • 7(07)7 (07): BEL | 8(08)8 (08): BS | 9(09)9 (09): HT | 10(0A)10 (0A): NL | 11(0B)11 (0B): VT | 12(0C)12 (0C): NP | 13(0D)13 (0D): CR

    • 32(20)32 (20): [Space] | 33(21)33 (21): ! | 34(22)34 (22): " | 35(23)35 (23): # | 36(24)36 (24): $ | 37(25)37 (25): % | 38(26)38 (26): &

    • 48(30)48 (30): 00 | 49(31)49 (31): 11 | 50(32)50 (32): 22 | 51(33)51 (33): 33 | 52(34)52 (34): 44 | 53(35)53 (35): 55 | 54(36)54 (36): 66

    • 65(41)65 (41): A | 66(42)66 (42): B | 67(43)67 (43): C | 68(44)68 (44): D | 69(45)69 (45): E | 70(46)70 (46): F

    • 97(61)97 (61): a | 98(62)98 (62): b | 99(63)99 (63): c | 100(64)100 (64): d | 101(65)101 (65): e | 102(66)102 (66): f

    • 127(7F)127 (7F): DEL

  • Encoding Example: Phone Numbers

    • A phone number like 888 555 1212888\,555\,1212 is stored not as a single large number, but as a string of symbols.

    • Each digit is encoded with its specific ASCII byte:

      • 88 is represented as 0011 10000011\,1000

      • 55 is represented as 0011 01010011\,0101

  • Origin of the Term "Byte"

    • The term was coined by IBM engineers seeking a word for a quantity of memory between a bit and a "word" (usually 3232 bits).

    • They chose "bite" but changed the spelling to "byte" to prevent engineers from accidentally confusing "bite" with "bit" in documentation or typing errors.