Data Representation

  1. Binary representation
  2. bit: binary digit, 1 or 0
  3. byte: 8 bits

Most Significant Digit (MSD) is the digit with highest place value in the number

Least Significant Digit (LSD) is the digit with the lowest place value in the number

Convert Decimal to another base

  1. Divide the decimal number by the new base continuously and note the remainders until quotient is 0
  2. Arrange the remainders, with the first remainder as the least significant bit and the last remainder as the most significant bit

Convert other base to decimal

  1. Multiply each digit by its place value and sum up the products

Convert binary to hex and vice versa

  1. Binary to Hex
  2. Starting from LSD, sector in groups of 4. Insert dummy 0s when not enough
  3. For each group of 4, calculate decimal value and its digit for hexadecimal

  1. Hexadecimal to binary: convert each digit into binary representation of 4 digits