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
- Binary (2 bases)
- symbol:{0,1}
- Decimal(10 bases)
- symbol:{0,1,2,3,4,5,6,7,8,9}
- Hexadecimal(16 bases)
- symbol:{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
- Octal(8 bases)
- symbol:{0,1,2,3,4,5,6,7}
- positive values have same representation.
- Negative numbers have different representation.
Three ways to signed integer:
- Sign and magnitude
- 1's complement
- 2's complement
Rules for adding the binary number.
- 0 - 0 = 0
- 1 - 1 = 1
- 1 - 1 = 0
- 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.
- (+A) + (+B) = -C
- (-A) + (-B) = +C
- (+A) - (-B) = -C
- (-A) - (+B) = +C
- 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
Post a Comment