0% found this document useful (0 votes)
7 views26 pages

Data Representation and Number System-1

The document provides a comprehensive tutorial on data representation and number systems, covering topics such as decimal, binary, octal, and hexadecimal systems, as well as number conversions between these systems. It includes detailed methods for converting numbers from one system to another, including examples for clarity. Additionally, it discusses encoding schemes like ASCII, ISCII, and UNICODE.

Uploaded by

somakushwahsoma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views26 pages

Data Representation and Number System-1

The document provides a comprehensive tutorial on data representation and number systems, covering topics such as decimal, binary, octal, and hexadecimal systems, as well as number conversions between these systems. It includes detailed methods for converting numbers from one system to another, including examples for clarity. Additionally, it discusses encoding schemes like ASCII, ISCII, and UNICODE.

Uploaded by

somakushwahsoma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.

com

Chapter- 4 Data Representation and Number System

“ The number one cause of computer problems is computer solution “

You will learn the following topics in this tutorial


S. No. Topics
1 NUMBER SYSTEM

2 1. Decimal 2. Binary 3. Octal 4. Hexadecimal

3 Number Conversions

4 1. Conversion from Decimal to other Number Systems

5 1(a). Decimal to Binary Conversion

6 1(b). Decimal to Octal Conversion

7 1(c). Decimal to Hexadecimal Conversion

8 2) Conversion from other Number Systems to Decimal Number System

9 2(a). Binary Number to Decimal Number

10 2(b). Octal Number to Decimal Number

11 2(c). Octal Number to Decimal Number

12 3) Conversion from Binary Number to Octal/Hexadecimal Number and Vice-


Versa

13 3(a). Convert Octal to binary

14 3(b). Convert binary to Octal

15 3(c). Convert Hexadecimal to Binary

Page 1 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

16 3(d). Convert binary to Hexadecimal Number

17 4) Conversion from Octal to Hexadecimal Number and Vice-Versa

18 4 (a).Convert Hexadecimal to Octal

19 4 (b).Convert Octal to Hexadecimal

20 5) Conversion of a Number with Fractional Part

21 5 (a). Decimal Number with Fractional Part to another Number


System

22 i) Convert Fractional Decimal to Binary

23 ii) Convert Fractional Decimal to Octal

24 iii) Convert Fractional Decimal to Hexadecimal

25 5(b). Non-decimal Number with Fractional Part to Decimal Number


System

26 i) Convert Binary Number to Decimal

27 ii) Convert Octal Number to Decimal

28 iii) Convert Hexadecimal Number to Decimal

29 Encoding Schemes

30 1) American Standard Code for Information Interchange (ASCII)

31 2) Indian Script Code for Information Interchange (ISCII)

32 3) UNICODE

33 MORE EXAMPLES……………

Page 2 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

NUMBER SYSTEM
 A number system is defined as a system of writing to express numbers.
 Every number system has a set of unique characters or literals.
 The count of these literals is called the radix or base of the number
system.
 Number may also have a fractional part similar to decimal numbers
used by us.
Four different number systems:

1. Decimal Number System:


 A decimal number system is a system of base 10 and it has 9 digits (i.e.
0 to 9)
 Every digit in Decimal number system is identified from its position i.e.
from right to left as (for example: 754)

 It means : 7 x 102 + 5 x 101 + 4 x 100 = 345


 7 x 100 + 5 x 10 + 4 x 1 = 7 5 4

MSD LSD
 Left most digit will be MSD (most significant digit and right most digit
will be LSD (least significant digit)
Page 3 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

2. Binary Number System:


 A Binary number system is a system of base 10 and it has 9 digits (i.e. 0
to 9)
 Every bit in Binary number system is identified from its position i.e.
from right to left.
 The generic format for representing any number in binary number
system is as show below

24 23 22 21 20 2-1 2-2 2-3 2-4 ← Weights

S4 S3 S2 S1 S0 . S-1 S-2 S-3 S-4


↑ ↑ ↑
MSB Binary point LSB
Where,

 MSD i the most significant digit


 LSD is the least significant digit
 S1 ,S2 ,S3 ....Sn are values assigned

For example: ( 1 0 1 1 0 1 )2
1 0 1 1 0 1

MSD LSD

( 1 0 1 1 0 1 ) 2 = 1 x 2 5 + 0 x 2 4 + 1 x 2 3 + 1 x 2 2 + 0 x 2 1 + 1 x 20

= 1 x 32 + 0 x 16 + 1 x 8 + 1 x 4 + 0 x 2 + 1 x 1
= 32 + 0 + 8 + 4 + 0 + 1 = (45)10

Page 4 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

3. Octal Number System:


 Representing larger numbers in binary number system was a difficult
task and hence the other two number systems namely octal number
system and hexadecimal number system were introduced.
 The radix or base in octal number system is 8 since it involves eight
( 8 ) symbols i.e. ( 0 to 7).
 The generic format for representing any number in binary number
system is as show below
84 83 82 81 80 8-1 8-2 8-3 8-4 ← Weights

S4 S3 S2 S1 S0 . S-1 S-2 S-3 S-4


↑ ↑ ↑
MSD Octal point LSD

Where,

 MSD i the most significant digit


 LSD is the least significant digit
 S1 ,S2 ,S3 ....Sn are values assigned
For example: (321)8
3 2 1

MSD LSD

( 321 )8 = 3 x 82 + 2 x 81 + 1 x 80
= 192 + 16 + 1 = (209)10

Page 5 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

4. Hexadecimal Number System:


 The radix or base in hexadecimal number system is 16 since it involves
sixteen (16) symbols i.e. (0 to 9 and A to F).
 The following are the hexadecimal numerals:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
 Letters represents numbers starting from 10
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
 The generic format for representing any number in binary number
system is as show below:
164 163 162 161 160 16-1 16-2 16-3 16-4 ← Weights
S4 S3 S2 S1 S0 . S-1 S-2 S-3 S-4
↑ ↑ ↑
MSD Hexadecimal point LSD
Where,

 MSD i the most significant digit


 LSD is the least significant digit
 S1 ,S2 ,S3 ....Sn are values assigned

For Example: (2 5 A)16

MSD LSD

= 2 x 162 + 5 x 161 + A x 160


= 2 x 256 + 5 x 16 + 10 x 1
= 512 + 80 + 10
= 602
Therefore ( 2 5 A )16 = ( 6 0 2 )10
Page 6 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Number Conversions
 At times, you need to covert a number from one number system to
another.
 Distinct methods have been defined for conversion between each pair
of number systems.

1. Conversion from Decimal to other Number Systems


To convert a decimal number to any other number system (binary, octal
or hexadecimal), use the steps given below.
Step 1: Divide the given number by the base value (b) of the number
system in which it is to be converted
Step 2: Note the remainder
Step 3: Keep on dividing the quotient by the base value and note the
remainder till the quotient is zero
Step 4: Write the noted remainders in the reverse order (from bottom to
top)

Page 7 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

1(a). Decimal to Binary Conversion


Example: (65)10 to ( )2

Step 1: Divide the decimal number by 2.

Remainder Step 2: Write its remainder.


2 65
2 32 1 LSB
2 16 0 Step 3: Keep on dividing the
2 8 0 quotient by the base value 2 and
2 4 0 note the remainder till the
2 2 0 quotient is zero.

2 1 0
0 1 MSB
Answer: (65)10 to (1000001)2
Step 4: Collect the remainders
from bottom to top to get the
binary equivalent.

Page 8 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

1(b). Decimal to Octal Conversion


Example: (125)10 to ( )8

Step 1: Divide the decimal number by 8

Remainder Step 2: Write its remainder.


8 125
8 15 5 LSB Step 3: Keep on dividing the
8 1 7 quotient by the base value 8 and
0 1 MSB note the remainder till the
quotient is zero.

Step 4: Collect the remainders


from bottom to top to get the Answer: (125)10 to (175)8
octal equivalent.

1(c). Decimal to Hexadecimal Conversion


Example: (300)10 to ( )16

Step 1: Divide the decimal number by 16

Remainder Step 2: Write its remainder.


16 300
16 18 12 - C Step 3: Keep on dividing the
16 1 2 quotient by the base value 8 and
0 1 note the remainder till the
quotient is zero.

Step 4: Collect the remainders


from bottom to top to get the Answer: (300)10 to (C21)16
hexadecimal equivalent.

Page 9 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

2) Conversion from other Number Systems to Decimal


Number System
We can use the following steps to convert the given number with base
value b to its decimal equivalent, where base value b can be 2, 8 and 16

Step 1: Write the position number for each alphanumeric symbol in the
given number

Step 2: Get positional value for each symbol by raising its position
number to the base value b symbol in the given number

Step 3: Multiply each digit with the respective positional value to get a
decimal value

Step 4: Add all these decimal values to get the equivalent decimal
number

2(a). Binary Number to Decimal Number


Using the above mentioned steps we can convert a binary number to
its equivalent decimal value as shown below:
Example: Convert the Binary number 1001 to its Decimal equivalent.
Digit 1 0 0 1
Position Number 3 2 1 0
Positional Value 23 22 21 20
= 1 x 23 + 0 x 2 2 + 0 x 2 1 + 1 x 20
Decimal Number
= 8 + 0+ 0 +1 = (10)10

Page 10 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

2(b). Octal Number to Decimal Number


To compute the decimal equivalent of an octal number using base
value 8.
Example : Convert the Octal number 321 to its Decimal equivalent.
Digit 3 2 1

Position Number 2 1 0

Positional Value 82 81 80

= 3 x 82 + 2 x 81 + 01x 80
Decimal Number = 192 + 16+ 1 = (209)10

2(c). Octal Number to Decimal Number


To compute the decimal equivalent of an octal number using base
value 8.
Use decimal value equivalent to alphabet symbol of hexadecimal
number in the calculation as shown in example
Example: Convert the hexadecimal number (2 0 D 0) to its Decimal
equivalent.
Digit 2 0 D(=13) 0

Position Number 3 2 1 0

Positional Value 163 162 161 160


= 2 x 163 + 0 x 162 + 13 x 161 + 0 x 160
Decimal Number = 2 x 4096 + 0 x 256 + 13 x 16 + 0 x 1
= 8192 + 0 + 208 + 0 = 8400

Page 11 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

3) Conversion from Binary Number to Octal/


Hexadecimal Number and Vice-Versa

A binary number is converted to octal or hexadecimal number by making


groups of 3 and 4 bits, respectively, and replacing each group by its
equivalent octal/ hexadecimal digit.

3(a). Convert Octal to binary

1. In the octal to binary conversion method, we will convert each digit


from the given octal number into three bit binary number starting
from the right most octal digit(LSD) to the left most digit(MSD) and at
the end combine each three bit binary number to form the binary
equivalent of given octal number.

2. The steps involved in the octal to binary conversion is explained with


example below:

Example-1: Convert octal number (375)8 to binary number (?)2


Step 1: Write down each digit from the given octal number leaving some
space between each octal digit as shown below

Octal Number -> 3 7 5


Step 2: To find the binary equivalents of each octal digit.

Page 12 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Write down the three bit number below each octal digit as shown below:
Octal Number -> 3 7 5
↓ ↓ ↓
Binary Number -> 011 111 101

Hence, the binary equivalent of the given octal number is (11111101)2

3(b). Convert binary to Octal:-


For this conversion make the group of three digits from right to left
before decimal & left to right after decimal then assign the specific octal
value.
Example-1: Convert binary number (110101000.101010)2 to binary number (?)8
Divide into groups for 3 digits and convert each group to octal digit
Binary Number -> 110 101 000 . 101 010
↓ ↓ ↓ ↓ ↓
Octal Number -> 6 5 0 . 5 2
Hence, the binary equivalent of the given octal number is (650.52)8

3(c). Convert Hexadecimal to Binary:-


To convert a hexadecimal number to a binary number, convert each
hexadecimal digit into a group of 4 binary digits.
Example: Convert the Hexadecimal number (10AF)16 to its Binary equivalent.
Convert the hex digits to binary 1 0 A F
0001 | 0000 | 1010 | 1111
Therefore (10AF)16 = (0001000010101111)2

Page 13 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Example: Convert the Hexadecimal number (1Α8.Α8)16 to its Binary equivalent.

Convert the hex digits to binary


1 Α 8 . Α 8
↓ ↓ ↓ ↓ ↓
0001| 1010 | 1000 . 1010 | 1000

Therefore (1Α8.Α8)16 = (0001 1010 1000 .1010 1000)2


3(d). Convert binary to Hexadecimal Number

For this conversion make the group of four digits from right to left before
decimal & left to right after decimal then assign the specific Hexadecimal
value.

Example-1: Convert binary number (110101000.101010)2 to binary number (?)8

Divide into groups for 3 digits and convert each group to octal digit
Binary Number -> 0001 1010 1000 . 1010 1000
↓ ↓ ↓ ↓ ↓
Octal Number -> 1 A 8 . A 8

Therefore (110101000.101010)2 = (1 A 8 . A 8)16

Page 14 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

4) Conversion from Octal to Hexadecimal Number and


Vice-Versa

4 (a).Convert Hexadecimal to Octal

To convert Hexadecimal to Octal, Convert each digit of Hexadecimal


Number to it’s binary equivalent and write them in 4 bits. Then, combine
each 3 bit binary number and that is converted into octal.
Example 1: Convert the Hexadecimal number (A42)16 to its Octal
equivalent.
Step 1: Convert the hex digits to binary
Hex Number -> A 4 2
↓ ↓ ↓
Binary Number -> 1010 0100 0010
We get binary number (1010 0100 0010)2

Step 2: Divide the getting binary number from step 1 into groups for 3
digits and convert each group to octal digit
Binary Number -> 101 001 000 010
↓ ↓ ↓ ↓
Octal Number -> 5 1 0 2
Hence, the Octal equivalent of the given hexadecimal number is (5102)8
Page 15 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

4 (b). Convert Octal to Hexadecimal

To convert Octal to hexadecimal, convert each digit of Octal Number to


it’s binary equivalent and write them in 3 bits. Then, combine each 4 bit
binary number and that is converted into hexadecimal.
Example 1: Convert the Octal number (762)8 to its hexadecimal
equivalent.
Step 1: Convert the octal digits to binary
Hex Number -> 7 6 2
↓ ↓ ↓
Binary Number -> 101 110 010
Binary number is 101110010

Step 2: Divide the getting binary number from step 1 into groups for 4
digits and convert each group to hexadecimal digit
Binary Number -> 0001 0111 0010
↓ ↓ ↓
Hex Number -> 1 7 2

Hence, the binary equivalent of the given octal number is (172)16

Page 16 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

5) Conversion of a Number with Fractional Part

5 (a). Decimal Number with Fractional Part to another

Number System

 Repeatedly multiply the fractional part by the base value b till the
fractional part becomes 0.
 Use integer part from top to bottom to get equivalent number in that
number system.
i) Convert Fractional Decimal to Binary
Example: Convert (0.675)10 to binary.
Integer part
0.675 × 2 = 1.350 1
0.350 × 2 = 0.700 0
0.700 × 2 = 1.400 1
0.400 × 2 = 0.800 0
0.800 × 2 = 1.600 1
0.600 × 2 = 1.200 1
0.200 × 2 = 0.400 0
Since the fractional part (.400) is the repeating value in the calculation,
the multiplication is stopped. Write the integer part from top to bottom
to get binary number for the fractional part.
Therefore, (0.675)10= (0.1010110)2

Page 17 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Example: Convert (45.625)10 to binary.


Let us convert (45)10 to binary number
Remainder
2 45
2 22 1 LSB
2 11 0
2 5 1
2 2 1
2 1 0
0 1 MSB

So, (45)10 = (101101)2


Now, convert (0.625)10 to a binary fraction.

Integer part
0.625 × 2 = 1.250 1
0.250 × 2 = 0.500 0
0.500 × 2 = 1.000 1

So, (0.625)10 = (0.101)2

Hence,
(45.625)10 = (101101. 101) 2

Page 18 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

ii) Convert Fractional Decimal to Octal


Convert (0.675)10 to octal.
Integer part
0.675 × 8 = 5.400 5
0.400 × 8 = 3.200 3
0.200 × 8 = 1.600 1
0.600 × 8 = 4.800 4
0.800 × 8 = 6.400 6
Since the fractional part (.400) is repeating, the multiplication is stopped.
Write the integer part from top to bottom to get octal number for the
fractional part.
Therefore, (0.675)10= (0.53146)8

iii) Convert Fractional Decimal to Hexadecimal


Example 2: Convert (0.182)10 decimal fraction to hexadecimal fraction (?) 16
Integer part Hexadecimal Number
0.182 × 16 = 2.912 2 0.2
0.912 × 16 = 14.592 14 0.2Ε
0.592 × 16 = 9.472 9 0.2Ε9
0.472 × 16 = 7.552 7 0.2Ε97
0.552 × 16 = 8.832 8 0.2Ε978
0.832 × 16 = 13.312 13 0.2Ε978D
Hence, the fractional hexadecimal number of the given decimal fraction (0.182)10 is
(0.2E978D)16.

Page 19 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

5(b). Non-decimal Number with Fractional Part to Decimal


Number System

i) Convert Binary Number to Decimal


Let’s understand with the help of example

Example: Convert (100101.101)2 into decimal.

Digit 1 0 0 1 0 1 . 1 0 1

Fractional Value 25 24 23 22 21 20 . 2-1 2-2 2-3

Decimal Value = 1×25 + 0×24 + 0×23 + 1×22 + 0×21 + 1×20 + 1×2-1 +

0×2-2 +1×2-3

= 32 + 0 + 0 + 4 + 0 + 1 + 0.5 + 0 + 0.125

= 37 + 0.625

Therefore, (100101.101)2= (37.625)10

ii) Convert Octal Number to Decimal


Let’s understand with the help of example

Example : Convert (23.25)8 to decimal


81 80 . 8-1 8-2
2 3 2 5
= (2 x 81) + (3 x 80)+ (2 x 8-1) + (5 x 8-2)
= 16+3+0.25+0.07812 = (19.32812)10

Page 20 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

iii) Convert Hexadecimal Number to Decimal


Let’s understand with the help of example:

Example: Convert ( E F . B 1 )16= ( ? )10


= E x 161 + F x 160 . B x 16-1 + 1 x 16-2
= 14 x 16 + 15 x 1 . 11 x ( 1 / 16 ) + 1 x ( 1 / 256 )
= 224 + 15 . ( 0. 6 8 7 5 ) + ( 0 . 0 0 3 9 0 6 2 5 )
= 239 + 0. 6914
= 239 . 691406
Therefore ( E F . B 1 )16 = ( 2 3 9 . 6 9 1 4 0 6 )10

The following table summarizes the number representation in decimal,


binary, octal and hexadecimal number system:
Conversion Table:

Decimal Binary Octal Hexadecimal


0 0000 0 0
1 0010 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F

Page 21 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Encoding Schemes:
 Encoding scheme maps text into the codes that facilitate
communication among computers. Lets understand with example -
“When the key ‘A’ is pressed, it is internally mapped to a decimal
value 65 (code value), which is then converted to its equivalent
binary value for the computer to understand.
Similarly, when we press alphabet ‘ अ ’ on Hindi keyboard,
internally it is mapped to a hexadecimal value 0905, whose binary
equivalent is 0000100100000101.”
 Textual data is encoded using ASCII, ISCII or Unicode.

1) American Standard Code for Information Interchange (ASCII)

ASCII code is most widely used alphanumeric code used in computers. It


is a 7- bit code, and so it has 27 =128 possible code groups.
It represents all of the standard keyboard characters as well as control
functions such as Return & Linefeed functions.
Table: ASCII code for some printable characters
Character Decimal Value Character Decimal Value Character Decimal Value
Space 32 @ 64 ` 96
! 33 A 65 a 97
» 34 B 66 b 98
# 35 C 67 c 99
$ 36 D 68 d 100
% 37 E 69 e 101
& 38 F 70 f 102
‘ 39 G 71 g 103
( 40 H 72 h 104
) 41 I 73 i 105

Page 22 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Example: Encode the word FACE and convert the encoded value into
binary values which can be understood by a computer.

• ASCII value of F is 70 and its equivalent 7-bit binary code = 1000110


• ASCII value of A is 65 and its equivalent 7-bit binary code = 1000001
• ASCII value of C is 67 and its equivalent 7-bit binary code = 1000011
• ASCII value of E is 69 and its equivalent 7-bit binary code = 1000101
 FACE = 1000110 1000001 1000011 1000101
So the words FACE encoded and convert the encoded value into binary
values which can be understood by a computer.

2) Indian Script Code for Information Interchange (ISCII)

To use the Indian language on computers, ISCII codes are used. It is an 8-


bit code capable of coding 256 characters. ISCII code retains all ASCII
characters and offers coding for Indian scripts also.

3) UNICODE

It is a universal coding standard which provides a unique number for


every character, no matter what the platform, no matter what the
program, no matter what the language. Unicode version 3.1 represented
94,140 characters.
It is a superset of ASCII, and the values 0-128 have the same characters as
in ASCII.
Page 23 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

UTF-8: encoding is a variable sized encoding scheme to represent


Unicode code points in memory.
UTF-16: encoding is a variable byte encoding scheme which uses either 2
bytes or 4 bytes to represent Unicode code points.
UTF-32: encoding is a fixed byte encoding scheme and it uses 4 bytes to
represent all code points.

MORE EXAMPLES……………

Q1. Convert (0.52)10 to its binary equivalent.


Ans. The conversion is:
Remainder
0.52 x 2 = 1.04 1
0.04 x 2 = 0.08 0
0.08 x 2 = 0.16 0
0.16 x 2 = 0.32 0
0.32 x 2 = 0.64 0
0.64 x 2 = 1.28 1
1.28 x 2 = 0.56 0
0.56 x 2 = 1.12 1
Thus (0.52)10 = (.1000101)2
Q2. Determine the hexadecimal equivalent of the following binary
number:
(a)( 101111100001)2
Binary 1011 1110 0001
Hexadecimal B E 1

Page 24 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Thus, (101111100001)2 = (BE1)16


(b) (10101111)2
Binary 1010 1111
Hexadecimal A F

Thus, (10101111)2 = (AF)16


Q3. Convert the following octal numbers to their equivalent binary
number: (a) 36 (b) 426
(a) 36
Octal 3 6
Binary 011 110

Thus, (36)8 = (011110)2


(b) (426)8
Octal 4 2 6
Binary 100 010 110

Thus, (426)8 = (011110)2


Q4. Determine the following (?)
(a) (011001.001110)2 = (?)8
(b) (2AC9)16 = (?)2
(c) (11011101.0111)2 = (?)10

Page 25 of 26
Unit I: Computer Systems and Organization Visit to website: learnpython4cbse.com

Chapter- 4 Data Representation and Number System

Ans. (a) The octal equivalent of (011001.001110)2 is:


The integer part is: (011001) and the decimal part is: (.001110)
Binary 011 001 . 001 110
Octal 3 1 . 1 6
Hence, (011001.001110)2 = (31.16)8

(b) The binary equivalent of (2AC9)16 is:


Hexadecimal 2 A C 9
Binary 0010 1010 1100 1001
Hence, (2AC9)16 = (0010 1010 1100 1001)2
(C)The decimal equivalent of (11011101.0111)2 is:
Integral part (11011101)
=1 x27 + 1 x26 + 0 x25 + 1 x24 + 1 x23 + 1 x22 + 0 x21 + 1 x20
= 27 + 26 + 24 + 23 + 22 + 20 =128 + 64 + 16 + 8 + 4 + 1 = 221
Fractional part (.0111)
= 0 x2-1 + 1 x2-2 + 1 x2-3 + 1 x2-4
= 0.25 + 0.125 + 0.0625 = 0.4375
Thus, (11011101.0111)2
= (221.4375)10

Page 26 of 26

You might also like