The methods for doing the same are described as below.

Textual information like a file or a document comprises of a collection of numbers, characters and special characters for example punctuation marks and symbols. A computer uses the following procedures for the conversion of Text to binary

Decimal numbers are the numbers whose base is 10 i.e. it uses ten digits (0 to 9) to represent the values, while binary is the number system whose base is two, it uses 0's and 1's to represent the numbers.

Each binary bit has a position assigned to it. The zeroeth position is assigned to the least significant position on the right most side. The 0 or 1 at the respective position is then multiplied by the corresponding power of two to obtain its decimal equivalent i.e. A digit at Kth position is multiplied by 2 ^(k-1). For example

Real numbers may be put into binary scientific notation: a x 2^b .The number to the right of decimal part must be multiplied by negative powers two of the corresponding position .The number to the left hand side must be multiplied by the positive powers of two. Mantissa and exponent are then stored .For example

Each and every character, symbol or punctuation mark is mapped to a corresponding decimal number .For example letter K is mapped to number 75, the number is then encoded by using ASCII code to a string of Binary numbers. ASCII stands for American Standard Code for Information Interchange. It is an 8-bit code, which contains in all 128 characters (uppercase and lowercase letters, numbers, punctuation, symbols, and some non-printing characters such as the blank space).

For example, the code for "I am" would be:

73 - 01001001 - code for I

32 - 00100000 - code for space

97 - 01100001 - code for a

109 - 01101101 - code for m

46 - 00101110 - code for period

REPRESENTATION OF IMAGE:

To store an image, like a photograph, in binary form, a computer superimposes a grid on that photograph. Each pixel or grid contains one "dot" of color. In order to store data for that pixel in memory; the information about that pixel's color must somehow be converted to a binary number. There are various ways to do this which serve to map a pixel to binary numbers. Different ways or methods associate different number of bits with each pixel. There are two main formats in which images are stored in the computer - bitmap (or raster) and vector. In vector representation, all components of the image are stored using mathematical formulas. In a bitmap image, the image is stored in memory by recording some piece of binary data corresponding to each pixel of the image. The number of bits used to store each pixel affects both the image quality and the amount of memory that will be needed to store the image. There are various scales for coding the colors, one being grayscale in which 1 represents black and 0 represents white. Each pixel in a grayscale image can be stored using 1 byte (8 bits).

To represent colored images 16-color, 256 color, and RGB color (or true color) color codes are used. Each of the different code requires different
...Show more