CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
03 DATA REPRESENTATION
Data representation
Q. What do you mean by Data representation?
A: Data representation refers to the method used to represent infor-
mation like, text, graphics, sound, video etc., stored internal to a com-
puter.
Q. What do you mean by digital system or digital number system?
A: The process of translating the data feed in a computer in binary
form i.e., 0 and 1, understandable by the computer is termed as digital
system or digital number system.
Q. How data are represented in a digital system?
A: In digital system, all data are represented by equivalent strings of
symbols, where each symbol is called a bit, either 0 or 1.
Q. What are the two main categories of data used in digital com-
puters?
A: i) Numbers, represented by number system, and
ii) Alphanumeric characters represented by character encod-
ing
Q. What do you mean by positional-value system?
A: A positional-value system, also known as a positional numeral
system, is a number system where the value of a digit depends on its
position within the number, with each position representing a power
of the base. E.g., In decimal number system (base 10),
345 = 3 Hundred (300) + 4 Tens (40) + 5 Ones (5)
Note: Number system in course: Decimal, Binary, Octal and Hexadecimal
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Q. What do you mean by LSD and MSD in number system?
A: LSD (Least Significant Digit) is the digit in a number that has the
smallest positional value (e.g., the ones place in decimal numbers),
while, MSD (Most Significant Digit) is the digit in a number that has the
largest positional value (e.g., the leftmost digit in a number).
E.g. in the number 123, the MSD is 1 and the LSD is 3.
Q. How the value of each digit in a number is determined?
A: The value of each digit in a number can be determined using
i) the digit,
ii) the position of the digit in the number and
iii) the base or radix of the number systems.
Q. What do you mean by base or radix of number system?
A: In a number system, the base or radix refers to the number of
unique digits, including zero, used to represent numbers in a positional
numeral system.
Number System Base or Radix Symbol used
i) Decimal 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (10 symbols)
ii) Binary 2 0, 1 (2 symbols)
iii) Octal 8 0, 1, 2, 3, 4, 5, 6, 7 (8 symbols)
iv) Hexadecimal 16 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (10), B (11), C (12), D (13),
E (14), F (15) (16 symbols)
E.g. the decimal number 200 with base 10 can be written in other
form as:
(200)10 = (11001000)2 = (310)8 = (C8)16
Decimal Binary Octal Hexa
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Number System
In computer science, a number system is a method of represent-
ing numbers using a specific base or radix, with the most common
systems being binary (base-2), octal (base-8), decimal (base-10),
and hexadecimal (base-16).
Decimal Number System
The decimal number system, also known as base-10 or decimal
notation, uses ten as its base, meaning each place is a power of 10. It
employs the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Example: (205)10 = 2 × 102 + 0 × 101 + 5 × 100
Binary Number System
The binary number system, a base-2 system, is fundamental to
computers because it uses only two digits (0 and 1) to represent all
data, where each digit is called a bit.
Example: (11001101)2 = (205)10
Octal Number System
The octal system, also known as base-8 or octonary, uses eight as
its base, meaning each place value is a power of 8. It employs only
the digits 0, 1, 2, 3, 4, 5, 6, and 7.
Example: (315)8 = (205)10
Hexadecimal Number System
Hexadecimal is a base-16 number system using digits 0-9 and
letters A-F (representing 10-15) to represent numbers, commonly used
in computer science for its compact representation of binary data.
Example: (CD)16 = (205)10
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CONVERSION - Decimal to Other format
Assume, a decimal number (205.25)10
i) To binary
(205.25)10 = (11001101.01)2
ii) To Octal
(205.25)10 = (315.2)8
iii) To Hexadecimal
(205.25)10 = (CD.4)16
CONVERSION - Binary to Other format
Assume, a binary number (11001101.01)2
i) To Decimal
= 1 2 7 + 1 2 6 + 0 2 5 + 0 2 4 + 1 2 3 + 1 2 2 + 0 2 1 + 1 20
+ 0 2-1 + 1 2-2
= 128 + 64 + 0 + 0 + 8 + 4 + 0 + 1 + 0 + 0.25
= 205 + 0.25
= 205.25
(11001101.01)2 = (205.25)10
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
ii) To Octal
(11001101.01)2 = (315.2)8
iii) To Hexadecimal
(11001101.01)2 = (CD.4)16
CONVERSION - Octal to Other format
Assume, an octal number (315.2)8
i) To Decimal
= 3 82 + 1 81 + 5 80 + 2 8-1
= 192 + 8 + 5 + 0.25
= 205 + 0.25
= 205.25
(315.2)8 = (205.25)10
ii) To Binary (reverse of Binary to Octal)
(315.2)8 = (11001101.01)2
iii) To Hexadecimal
Note: Octal cannot be converted to hexadecimal directly
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
First convert it to binary number i.e.,
(315.2)8 = (11001101.01)2
And then,
(315.2)8 = (CD.4)16
CONVERSION - Hexadecimal to Other format
Assume, an octal number (CD.4)16
i) To Decimal
= C 161 + D 160 + 4 16-1 = 12 16 + 13 + 4 16-1
= 192 + 13 + 0.25 = 205 + 0.25
= 205.25
(CD.4)16 = (205.25)10
ii) To Binary (reverse of Binary to Hexadecimal)
(CD.4)16 = (11001101.01)2
iii) To Hexadecimal Note: Hexadecimal cannot be converted to Octal directly
First convert it to binary number i.e., (CD.4)16 = (11001101.01)2 And then,
(CD.4)16 = (315.2)8
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Alphanumeric Code
Q. What do you mean by alphanumeric codes?
A: It refers to the system that uses a combination of letters (A-Z),
numbers (0-9), and sometimes symbols to represent data, like in the
ASCII or Unicode character sets.
Q. Why alphanumeric codes are important?
A: i) Data Representation : Alphanumeric codes are fundamental
for representing and manipulating data within computer systems.
ii) Communication : They enable computers to communicate
and exchange information by standardizing the representation of
characters.
iii) Programming : Programmers use alphanumeric codes to write
instructions and create software.
iv) Security : Alphanumeric passwords are often used to enhance
security by making them more difficult to guess.
Encoding Scheme - ASCII, ISCII, UTF-8, UTF-16, Unicode
Q. What do you mean by encoding scheme?
A: An encoding scheme is a method of representing characters or
data in a specific format, often using a unique code for each charac-
ter, to allow for efficient storage and transmission in computers or net-
works.
Q. What is the use of encoding schemes?
A: Encoding schemes are used to represent characters (letters, num-
bers, symbols) in a way that computers can understand and process,
enabling the storage and transmission of text data.
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Q. Why encoding schemes are important?
A: i) Standardization: Encoding schemes provide a standardized
way to represent characters, ensuring that different systems can in-
terpret the same text data correctly.
ii) Interoperability: They enable different computer systems and
applications to communicate and exchange text data seamlessly.
iii) Data Storage and Retrieval: Encoding schemes allow com-
puters to store and retrieve text data in a machine-readable format.
Q. What is ASCII?
A: ASCII stands for American Standard Code for Information Inter-
change, is a character encoding standard that uses 7-bit to represent
128 characters, including letters, numbers, punctuation, and control
codes, enabling computers and other devices to exchange data.
Q. What is the significance (importance) of ASCII?
A: i) Establishing a standardized way for computers and devices
to represent and exchange text.
ii) Allows seamless communication
iii) Allows data sharing between different systems, paving the way
for modern computing and the internet.
Q. What is ISCII?
A: ISCII stands for Indian Standard Code for Information Interchange,
a coding scheme developed to represent various writing systems of
India, including the main Indic scripts, including Bengali–Assamese,
Devanagari, Gujarati, Gurmukhi, Kannada, Malayalam, Odia, Tamil, and
Telugu, along with a Roman transliteration.
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Q. What is the significance (importance) of ISCII?
A: Its significance lies in establishing the first standardized coding
scheme for representing various Indian writing systems, including the
main Indic scripts and a Roman transliteration, paving the way for
digital representation of Indian languages.
Q. What is Unicode?
A: Unicode is a universal character encoding standard that assigns
a unique number (code point) to every character, symbol, and script,
ensuring consistent representation across different platforms and lan-
guages.
Q. What is the significance of unicode?
A: i) Multilingual Support : Unicode enables computers to handle
text from various languages, including those with non-Latin alphabets
like Chinese, Arabic, or Thai.
ii) Cross-Platform Compatibility : By using a unified encoding
system, Unicode ensures that text can be displayed and processed
correctly across different operating systems, software, and devices.
iii) Data Exchange : Unicode facilitates seamless data exchange
and communication by providing a standard way to represent text,
allowing different systems to understand and interpret the same data.
iv) Emoji Support : Unicode also includes characters like emojis,
allowing for the representation of a wide range of symbols and icons.
Q. What are the various ways of encoding/representing Unicode?
A: i) UTF-8 (Unicode Transformation Format 8-bit)
ii) UTF-16 (Unicode Transformation Format)
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Q. Write a short note on:
i) UTF-8 (Unicode Transformation Format 8-bit)
A: UTF-8 (Unicode Transformation Format 8-bit) is a character
encoding standard used on WWW that represents characters using
one to four bytes, allowing for the representation of all Unicode char-
acters, including those beyond the ASCII range.
ii) UTF-16
A: UTF-16 is a character encoding standard used by the Windows
API that represents Unicode characters using 16-bit code units (2
bytes), with each character encoded as either one or two 16-bit code
units.
Binary Representation
Q. How integers are represented in binary form?
A: a) Sign and Magnitude
It is a way of representing a binary number, where the most
significant bit (MSB) of a binary number indicates the sign (0 bit for
positive, 1 bit for negative), while the remaining bits represent the mag-
nitude (absolute value) of the number.
Example: In an 8-bit representation:
00001100 represents +12 (sign bit 0, magnitude 00001100 = 12).
100001100 represents -12 (sign bit 1, magnitude 00001100 = 12).
b) one’s complement
In the context of binary numbers, the one's complement is a
method of representing negative numbers. It is obtained by inverting
(flipping) all its bits, changing 0s to 1s and 1s to 0s.
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
C) two's complement
In the context of binary numbers, the two's complement is a
method of representing signed (positive, negative, and zero) integers
in binary, where the most significant bit (MSB) acts as the sign bit (0
for positive, 1 for negative).
Q. What is the use of one's complement in binary representation?
A: i) To represent negative numbers in binary systems.
ii) It's a precursor to two's complement system.
Q. Write the limitations of one's complement.
A: i) Problem of having two representations for zero
ii) This ambiguity is addressed in two's complement.
Q. What is the use of two's complement in binary representation?
A: It simplifies arithmetic operations (addition and subtraction) on
signed numbers.
Binary Representation (Complements of 12)
i) One’s complement
True form (+ve binary form) 1 1 0 0
Invert all the bits (1’s complement) 0 0 1 1
ii) Two’s Complement
True form (+ve binary form) 1 1 0 0
Invert all the bits 0 0 1 1
Add 1 to LSB (+) 1
(2’s complement) 0 1 0 0
Note: 0 + 0 = 0; 0 + 1 = 1; 1 + 0 = 1; 1 + 1 = 0, carry 1 (in binary addition)
====0000====
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint
Try Yourself
Q. Fill in the blanks with equivalent conversion:
i) (200.175)10 = ( ___ )2 = ( ___ )8 = ( ___ )16
ii) ( ___ )10 = (10110.01)2 = ( ___ )8 = ( ___ )16
iii) ( ___ )10 = ( ___ )2 = (310.2)8 = ( ___ )16
iv) ( ___ )10 = ( ___ )2 = ( ___ )8 = (22B.8)16
Q. Complete the following series:
i) (1101001)2 , (1101110)2 , (1110011)2 , _________ , _________ , _________
ii) (62)8 , (74)8 , (106)8
iii) (B4)16 , (B9)16 , (BE)16 , _________ , _________ , _________
Q. Suppose a number system has been designed with radix 8 with symbols (ordered
from small to large) I, J, M, N, O, R, S and T.
Convert (TRITON)8 to its equivalent binary number i.e. base 2.
Q. Assume there exits a number system of radix 10 with symbols A, B, C, D, G, H, I, L,
M and N (small to large).
Convert (INDIA)10 to its equivalent hexadecimal.
Q. The following ASCII-coded message is stored in successive memory locations in a
computer as
1001000 1100101 1101100 1101100 1101111
What is the message?
Q. Write the ASCII - coded binary form for the text CSCA
CSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPointCSIP@TutorialPoint