# Data Representation System In Computer System

Chapter – Data representation

Number System

Number of digits used in a number system is called its base or radix. We can categorize number system as below:

• Binary number system
• Octal Number System
• Decimal Number System

Conversion between number systems can be done easily.

Representation of Decimal numbers

We can normally represent decimal numbers in one of following two ways

• By converting into binary
• By using BCD codes

By converting into binary
Arithmetic and logical calculation becomes easy. Negative numbers can be represented easily.
At the time of input conversion from decimal to binary is needed and at the time of output conversion from binary to decimal is needed.

Therefore this approach is useful in the systems where there is much calculation than input/output.

By using BCD codes
Arithmetic and logical calculation becomes difficult to do. Representation of negative numbers is tricky.
At the time of input conversion from decimal to binary and at the time of output conversion from binary to decimal is not needed. Therefore this approach is useful in the systems where there is much input/output than arithmetic and logical calculation.

Complements

(R-1)’s Complement

(R-1)’s complement of a number N is defined as (r^n-1)-N

Where N is the given number r is the base of number system  ,n is the number of digits in the given number

To get the (R-1)’s complement fast, subtract each digit of a number from (R-1)

Example

•  9’s complement of 83510 is 16410
• 1’s complement of 10102 is 01012(bit by bit complement operation)

R’s Complement

R’s complement of a number N is defined as r^n-N  Where N is the given number

r is the base of number system ,n is the number of digits in the given number

To get the R’s complement fast, add 1 to the low-order digit of its (R-1)’s complement

•  10’s complement of 83510 is 16410 + 1 = 16510
• 2’s complement of 10102 is 01012 + 1 = 01102 #### About the Author: Ashok Nath

Ashok Nath is an Author in Surajchand99.com.np and is pursuing Bachelor's Degree In Computer Engineering From Nepal College Of Information Technology (NCIT) Pokhara University Nepal.