02+Number+Systems+II

Computer Architecture and Number Systems Overview

  • In computer architecture, hardware registers and memory cells are grouped into fixed bit-widths to store numerical data.

  • Most standard computer architectures utilize 8-bit8\text{-bit} cells (bytes) as the fundamental baseline unit of storage.

  • Larger data types and higher memory capacities are formed by grouping multiple cells together, such as 16-bit16\text{-bit}, 32-bit32\text{-bit}, or 64-bit64\text{-bit} words.

  • Numerical values stored in memory are broadly categorized into unsigned binary representations (which handle strictly non-negative quantities) and signed binary representations (which handle both positive and negative quantities using systems such as Sign and Magnitude, 1's Complement, and 2's Complement).

Unsigned Binary Representation

  • An unsigned binary number system represents strictly non-negative numbers (00 and positive integers).

  • Because no bits are allocated to store a sign, all available bit positions contribute directly to the magnitude of the number.

  • Generalization of Unsigned Bit Range:

    • For a given cell size of nn bits, the smallest representable value is always 00 (represented as nn consecutive zeros).

    • The largest representable value occurs when all nn bits are set to 11, which equals 2n−12^n - 1.

    • The total number of distinct numerical values that can be stored using nn bits is 2n2^n

    • For an 8-bit8\text{-bit} cell (n=8n = 8):

    • Smallest value: 000000002=01000000000_2 = 0_{10}

    • Largest value: 111111112=27+26+25+24+23+22+21+20=128+64+32+16+8+4+2+1=2551011111111_2 = 2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255_{10}

    • Total unique combinations: 28=2562^8 = 256

    • Complete numerical range: 0100_{10} to 25510255_{10}

  • Conversion Examples between Decimal and Unsigned Binary:

    • Example 1: Convert 78.1251078.125_{10} to Binary

    • Integer part (781078_{10}):

      • 78/2=3978 / 2 = 39 remainder 00

      • 39/2=1939 / 2 = 19 remainder 11

      • 19/2=919 / 2 = 9 remainder 11

      • 9/2=49 / 2 = 4 remainder 11

      • 4/2=24 / 2 = 2 remainder 00

      • 2/2=12 / 2 = 1 remainder 00

      • 1/2=01 / 2 = 0 remainder 11

      • Reading remainders bottom-to-top gives $$10