Digital representation

 ASCII and Unicode

ASCII is a 7-bit code characters code with values from 0 to 127 and Unicode characters is a superset of ASCII that contains the ASCII code with the values from 0 to 10FFFF16.


Representing sound

Sounds are converted into binary form, sound is captured and then converted into digital signal.

Representing number

Numbers are represented by a string of bits called binary number.


Number system

Computers use binary base number system as they are made of binary digital components known as transistors.

Hexadecimal (base 16) and octal (base 8) number systems are used as a compact in representing binary numbers.

  • Decimal (base 10) number system has ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
  • It uses positional notation.
  • Binary (base 2) Number system has two symbols:0 and 1.
  • Hexadecimal (base 16) Number system use 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
  • Each hexadecimal digit is also called a hex digit. Most programming languages accept lowercase 'a' to 'f' as well as uppercase 'A' and 'F'.
  • Octa decimal (base 8) Number system use 8 symbols: 0, 1, 2, 3, 4, 5, 6, and 7.
Number representation
For signed integers:
  • 0 for positive
  • 1 for negative
There are three ways to repeat signed integers:
  1. Sign and magnitude: negative values are represented by changing the most significant bit.
  2. 1's complement: negative values are obtained by complementing each bit of the corresponding positive number.
  3. 2's complement: obtain by forming bit complement of that number then add 1.

Addition rule:
  • 0 + 0 = 0
  • 1 + 0 = 1
  • 1 + 1 = 10
  • 1 + 1 + 1 = 11
Subtraction rule:
  • 0 - 0 = 0 
  • 1 - 0 = 1
  • 1 - 1 = 0
  • 0 - 1 = 1



Comments

Popular posts from this blog

Basic structures of a computer

Client Server Architecture

Fetch, execution and IO