💾

Binary Number System

Jul 11, 2024

Binary Number System

Introduction

  • Computers operate on binary logic (not decimal)
  • Study of binary number system is essential

Basics of Binary Number System

  • Base (radix) = 2
  • Digits available: 0, 1 (bits)

Example of a Binary Number

  • Binary number: 10101
  • Weight of positions:
    • 2^0
    • 2^1
    • 2^2
    • 2^3
    • 2^4
  • Representation:
    • 1 * 2^4 + 0 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0
    • Calculation: 16 + 0 + 4 + 0 + 1 = 21 (decimal equivalent)

Binary Point

  • Binary number example: 10101.11
  • Weights for binary point:
    • 2^0, 2^1, 2^2, 2^3, 2^4
    • 2^-1, 2^-2
  • Representation:
    • 1 * 2^4 + 0 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 + 1 * 2^-1 + 1 * 2^-2

MSB and LSB

  • MSB: Most Significant Bit (leftmost)
  • LSB: Least Significant Bit (rightmost)
  • Example with binary number 10101 (decimal 21)
    • Changing LSB (1 to 0): 10100 (decimal 20)
    • Changing MSB (1 to 0): 00101 (decimal 5)
    • Greater difference when MSB is changed
  • Significance:
    • B0 (rightmost) least significant
    • B4 (leftmost) most significant

Units of Data

  • Bit: smallest unit of data
  • Nibble: 4 bits
    • Represents binary coded decimal (BCD) and hexadecimal numbers
  • Byte: 8 bits
  • Word: 16 bits
  • Double Word: 32 bits
    • 1 word = 2 bytes
    • 1 double word = 4 bytes

Conclusion

  • End of presentation
  • See you in the next one