# Notes on Computer Data Representation

By Vijay Kumar|Updated : July 5th, 2016

As you know Computer is very important section to get a good score for Bank Exam 2016. Today we are covering the study material on data representation that will help you succeed in the upcoming exam for Bank.

There are two basic types (character and number)of data, which are stored and processed by the computer.

Data Representation: It refers to the internal method used to represent various types of data stored on a computer. Computers use different types of numeric codes to represent various forms of data, such as text, number, graphics and sound.

To know data representation in computer we must know following number system

• Decimal number system (Base=10):- 0,1,2,3,4,5,6,7,8,9.
• Binary number system (Base=2):- 0,1.
• Octal number System (Base=8):- 0,1,2,3,4,5,6,7.
• Hexa Decimal System(Base =16):- 0,1,2,3,4,5,6,7,8,9,A(10),B(11),C(12),D(13),E(14),F(15).

A repeated division and remainder algorithm can convert decimal to binary, octal, or hexadecimal.

• Divide the decimal number by the desired target radix (2, 8, or 16).
• Append the remainder as the next most significant digit.
• Repeat until the decimal number has reached zero.

The decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value. In contrast, the binary (base two) numeral system has two possible values represented as 0 or 1 for each place-value.

• Example of using repeated division to convert 1792 decimal to binary: Decimal to Octal:

• Example of using repeated division to convert 1792 decimal to octal: • Example of using repeated division to convert 1792 decimal to hexadecimal: The only addition to the algorithm when converting from decimal to hexadecimal is that a table must be used to obtain the hexadecimal digit if the remainder is greater than decimal 9. For example, 48879 decimal converted to hex is: Octal To Binary

Converting from octal to binary is as easy as converting from binary to octal. Simply look up each octal digit to obtain the equivalent group of three binary digits. When converting from octal to hexadecimal, it is often easier to first convert the octal number into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex:

[According to previous example] Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101

Then, look up the groups in a table to convert to hexadecimal digits. Octal to Decimal

Converting octal to decimal can be done with repeated division.

1. Start the decimal result at 0.
2. Remove the most significant octal digit (leftmost) and add it to the result.
3. If all octal digits have been removed, you’re done. Stop.
4. Otherwise, multiply the result by 8.
5. Go to step 2. The conversion can also be performed in the conventional mathematical way, by showing each digit place as an increasing power of 8.

345 octal = (3 * 82) + (4 * 81) + (5 * 80) = (3 * 64) + (4 * 8) + (5 * 1) = 229 decimal

Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal. Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits. When converting from hexadecimal to octal, it is often easier to first convert the hexadecimal number into binary and then from binary into octal. For example, to convert A2DE hex into octal:

(from the previous example)

 Hexadecimal = A 2 D E Binary = 1010 0010 1101 1110 = 1010001011011110 binary

Binary: 1010001011011110 = 001 010 001 011 011 110

Then, look up each group in a table: Binary = 001 010 001 011 011 110 Octal = 1 2 1 3 3 6 = 121336 octal

Therefore, through a two-step conversion process, hexadecimal A2DE equals binary 1010001011011110 equals octal 121336.

Converting hexadecimal to decimal can be performed in the conventional mathematical way, by showing each digit place as an increasing power of 16. Of course, hexadecimal letter values need to be converted to decimal values before performing the math. = ((A) * 163) + (2 * 162) + ((D) * 161) + ((E) * 160)
= (10 * 163) + (2 * 162) + (13 * 161) + (14 * 160)
= (10 * 4096) + (2 * 256) + (13 * 16) + (14 * 1)
= 40960 + 512 + 208 + 14
= 41694 decimal

Arithmetic operation in Binary Systems

Rules for carrying out binary Additions are :

0 + 0 = 0

0 + 1 = 1

1 + 0 = 1

1 + 1 = 0 with one (1) carry over.

Example

1. For adding 1011102 and 1111012

Thus 1101011 in binary system is equivalent to 107 in decimal system.

Subtraction

Rules for carrying out binary subtraction are :

1. 0 – 0 = 0
2. 0 – 1 = 1 with one borrow
3. 1 – 0 = 1
4. 1 – 1 = 0

Examples

1. For subtracting 101110 from 1111012

Thus 001111 in binary system is equivalent to 15 in decimal system.

Multiplication

The rules for the multiplication are :

Example:

Multiplying 111101 with 1110

Division

The rules for division are same in binary system as those in decimal number system.

This is same as division of decimal 36 with 6.

Thanks, GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com