Digital Representation.

             Digital representation

ASCII(American Standing Code for Information Interchange)

  • It is 7 bits code.
  • Total 127 different characters are represented by ASCII code.
  • It starts from 0 to 126.
  • The ASCII code is a subset of UTF-8 code.
  • Unicode characters code is a superset of ASCII .
 Types of Number system
  1. Binary (2 bases)
  • symbol:{0,1}
  1. Decimal(10 bases)
  • symbol:{0,1,2,3,4,5,6,7,8,9}
  1. Hexadecimal(16 bases)
  • symbol:{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
  1. Octal(8 bases)
  • symbol:{0,1,2,3,4,5,6,7}

























Number representation - signed
  • positive values have same representation. 
  • Negative numbers have different representation.
Three ways to signed integer:
  1. Sign and magnitude
  2. 1's complement
  3. 2's complement

Rules for adding the binary number.
  1. 0 + 0 = 0
  2. 1 + 0 = 1
  3. 1 + 1 = 10(2 binary)
  4. 1 + 1+ 1 = 11(binary)


Rules for subtracting the binary number.
  1. 0 - 0 = 0
  2. 1 - 1 = 1
  3. 1 - 1 = 0
  4. 0 - 1 = 1(borrow 1)
  • when we subtract 1 from 0, we have to borrow 1 next high digit.

  • Overflow occurs when the magnitude of a number exceeds the range allowed by the size of the bit field.
When adding overflow occurs  if :
  • (+A) + (+B) = -C
  • (-A) + (-B) = +C
when subtracting overflow occurs if:
  • (+A) - (-B) = -C
  • (-A) - (+B) = +C

For signed integer, the leftmost bit is used to indicate the signs:
  • 0 for positive 
  • 1 for negative 
  • Rang: -2^(n-1) to +2^(n-1) - 1
  • 4 bits: -8 to 7(2^3 to 2^(3)-1)




Comments