## Information Representation

__Number System__

**Binary: **Abinary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically, “0” (zero) and “1” (one) where each digit is called a bit.

**Binary to Denary:**

1. Create a table with headings 128/64/32/16/8/4/2/1.

128 | 6 | 32 | 16 | 8 | 4 | 2 | 1 |

0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

2. Insert the binary number into the table.

3. Add up all numbers that correspond with a 1.

**Example**

- 11001101
_{2}= 128 + 64 + 8 + 4 + 1 = 205_{10}

** Denary to Binary:**

1. Create the same table.

2. Place 1s in the columns that add up to make the denary number.

3. Take the empty spaces as 0 and form a binary number.

**Example**

Suppose that you wanted to convert the denary number 210_{10} into binary

- The maximum place value that can go into 210 is 128, so you would set the digit that corresponds to 128 to 1.
- 210 − 128 = 82. The maximum place value that can go into 82 is 64, so you would set the digit that corresponds to 64 to 1.
- 82 − 64 = 18. The maximum place value that can go into 18 is 16, so you would set the digit that corresponds to 16 to 1.
- 2 – 2 = 0. The subtraction process ends. You would now set all remaining digits to 0.
- Therefore,
**210**_{10}= 11010010_{2}

**Hexadecimal:** The hexadecimal numeral system, often shortened to “hex”, is a numeral system made up of 16 symbols (base 16).

**Hexadecimal to Denary:**

4096 | 256 | 16 | 1 |

0 | 0 | 0 | 0 |

1. Create table with headings 4096/256/16/1 in the style shown above.

2. Put hex number in columns from right to left.

3. Multiply each hex digit with the corresponding column.

4. Add the values

**Example**

Converting 2D to denary

- Separate the hex digits into 2 and D and find the equivalent binary numbers (2 = 0010; D = 1101).
- Piece them together to get
**00101101**(0x128 + 0x64 + 1×32 + 0x16 + 1×8 + 1×4 + 0x2 + 1×1 = 45 in denary).

** Binary to Hexadecimal:**

1. Split the binary number into three groups starting from the right.

2. Put each group into a table with 8/4/2/1 columns.

3. Add the columns that correspond with a 1 for each table.

4. Convert all the values into hex format and put them together.

**Example**

1×2^{6}+1×2^{5}+0x2^{4}+1×2^{3}+0x2^{2}+1×2^{1}+0x2^{0}= 64+32+0+8+0+2+0= (106)_{10}Then, convert it into hexadecimal number= (106)_{10}= 6×16^{1}+10×16^{0}= (6A)_{16} which is the answer.

**Two’s Compliment: **Two’s complement is the way most computers represent positive or negative integers.

-128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |

MSB | LSB |

**Negative denary number to binary Two’s Complement:**

- Find the binary equivalent of the denary number
- Add an extra bit before the MSB and turn that into 0
- Shift all 0 to 1 and 1 to 0
- Add 1 to the binary digit

**Example**

Find -4 using two’s complement numbers

- 4 = 100
- Adding 0 to the front becomes 0100
- ‘Inverted’ becomes 1011
- Add 1 = 1100 (-8 + 4 = -4)

**BCD (binary coded decimal):** It is a process for converting decimal numbers into their binary equivalents

**Decimal to BCD:**

1. Separate the decimal number into its weighted digits

2. Write down the equivalent 4-bit BCD code representing each decimal digit

**Example**

- 85
_{10}= 1000 0101 (BCD) - 572
_{10}= 0101 0111 0010 (BCD) - 8579
_{10}= 1000 0101 0111 1001 (BCD)

**BCD to Decimal:**

** **** **1. Divide the binary number into groups of four digits, starting with the least significant digit

2. Write the decimal digit represented by each 4-bit group

3. Add additional zeros at the end if required to produce a complete 4-bit grouping

**Example**

- 1001
_{2}= 1001_{BCD}= 9_{10} - 1000111
_{2}= 0100 0111_{BCD}= 47_{10} - 10100111000.101
_{2}= 0101 0011 0001.1010_{BCD}= 538.625_{10}

__Image Representation__

**Bitmap images: **It is an image file format used to store digital images.

**Vector graphic: **A graphic consisting of components defined by geometrical formulae such as line, color and style

**Picture Element** **(pixel): **The smallest identifiable component of a bitmap image, defined by just two properties: its position in the bitmap matrix and its color

**Image Resolution:** The number of pixels an image contains per inch or per centimeter.

**Screen resolution:** The number of pixels per row by the number of pixels per column

*File Size = Number of pixels x Color Depth*

- The higher the color depth, the better color quality
- The higher the color depth, the larger the file size.

__Sound__

**Analogue to Digital Converter:** converts analogue sound into digital signals which can be stored digitally

**Digital to Analogue Converter**: converts digital signals into analogue sound

**Sampling Rate:** Number of samples taken per second

**Sample resolution: **The sampling resolution is the representation (or size of the numbers) used to write samples in digital sound recording

Higher the sample rate, bigger the file size

**Bit rate:** Number of bits required to store 1sec of sound

*Bit Rate=Sampling Rate x Sampling Resolution*

__Video__

**Lossless compression: **Coding techniques that allow subsequent decoding to recreate exactly the original file

**Lossy compression: **Coding techniques that cause some information to be lost so that the exact original file cannot be recovered in subsequent decoding

**Frame Rate:** Frequency at which frames in a video sequence are displayed on a screen

Higher the frame rate, better the video quality