# Data Representation

## Checkpoint 2.1

#### Question 1

What are the bases of decimal, octal, binary and hexadecimal systems ?

The bases are:

1. Decimal — Base 10
2. Octal — Base 8
3. Binary — Base 2

#### Question 2

What is the common property of decimal, octal, binary and hexadecimal number systems ?

Decimal, octal, binary and hexadecimal number systems are all positional-value system.

#### Question 3

Complete the sequence of following binary numbers : 100, 101, 110, ............... , ............... , ............... .

100, 101, 110, 111 , 1000 , 1001 .

#### Question 4

Complete the sequence of following octal numbers : 525, 526, 527, ............... , ............... , ............... .

525, 526, 527, 530 , 531 , 532 .

#### Question 5

Complete the sequence of following hexadecimal numbers : 17, 18, 19, ............... , ............... , ............... .

17, 18, 19, 1A , 1B , 1C .

#### Question 6

Convert the following binary numbers to decimal and hexadecimal:

(a) 1010

(b) 111010

(c) 101011111

(d) 1100

(e) 10010101

(f) 11011100

(a) 1010

Converting to decimal:

Binary
No
PowerValueResult
0 (LSB)2010x1=0
12121x2=2
02240x4=0
1 (MSB)2381x8=8

Equivalent decimal number = 8 + 2 = 10

Therefore, (1010)2 = (10)10

Grouping in bits of 4:

$\underlinesegment{1010}$

Binary
Number
Equivalent
1010A (10)

Therefore, (1010)2 = (A)16

(b) 111010

Converting to decimal:

Binary
No
PowerValueResult
0 (LSB)2010x1=0
12121x2=2
02240x4=0
12381x8=8
124161x16=16
1 (MSB)25321x32=32

Equivalent decimal number = 32 + 16 + 8 + 2 = 58

Therefore, (111010)2 = (58)10

Grouping in bits of 4:

$\underlinesegment{0011} \quad \underlinesegment{1010}$

Binary
Number
Equivalent
1010A (10)
00113

Therefore, (111010)2 = (3A)16

(c) 101011111

Converting to decimal:

Binary
No
PowerValueResult
1 (LSB)2011x1=1
12121x2=2
12241x4=4
12381x8=8
124161x16=16
025320x32=0
126641x64=64
0271280x128=0
1 (MSB)282561x256=256

Equivalent decimal number = 256 + 64 + 16 + 8 + 4 + 2 + 1 = 351

Therefore, (101011111)2 = (351)10

Grouping in bits of 4:

$\underlinesegment{0001} \quad \underlinesegment{0101} \quad \underlinesegment{1111}$

Binary
Number
Equivalent
1111F (15)
01015
00011

Therefore, (101011111)2 = (15F)16

(d) 1100

Converting to decimal:

Binary
No
PowerValueResult
0 (LSB)2010x1=0
02120x2=0
12241x4=4
1 (MSB)2381x8=8

Equivalent decimal number = 8 + 4 = 12

Therefore, (1100)2 = (12)10

Grouping in bits of 4:

$\underlinesegment{1100}$

Binary
Number
Equivalent
1100C (12)

Therefore, (1100)2 = (C)16

(e) 10010101

Converting to decimal:

Binary
No
PowerValueResult
1 (LSB)2011x1=1
02120x2=0
12241x4=4
02380x8=0
124161x16=16
025320x32=0
026640x64=0
1 (MSB)271281x128=128

Equivalent decimal number = 1 + 4 + 16 + 128 = 149

Therefore, (10010101)2 = (149)10

Grouping in bits of 4:

$\underlinesegment{1001} \quad \underlinesegment{0101}$

Binary
Number
Equivalent
01015
10019

Therefore, (101011111)2 = (95)16

(f) 11011100

Converting to decimal:

Binary
No
PowerValueResult
0 (LSB)2010x1=0
02120x2=0
12241x4=4
12381x8=8
124161x16=16
025320x32=0
126641x64=64
1 (MSB)271281x128=128

Equivalent decimal number = 4 + 8 + 16 + 64 + 128 = 220

Therefore, (11011100)2 = (220)10

Grouping in bits of 4:

$\underlinesegment{1101} \quad \underlinesegment{1100}$

Binary
Number
Equivalent
1100C (12)
1101D (13)

Therefore, (11011100)2 = (DC)16

#### Question 7

Convert the following decimal numbers to binary and octal :

(a) 23

(b) 100

(c) 145

(d) 19

(e) 121

(f) 161

(a) 23

Converting to binary:

2QuotientRemainder
2231 (LSB)
2111
251
220
211 (MSB)
0

Therefore, (23)10 = (10111)2

Converting to octal:

8QuotientRemainder
8237 (LSB)
822 (MSB)
0

Therefore, (23)10 = (27)8

(b) 100

Converting to binary:

2QuotientRemainder
21000 (LSB)
2500
2251
2120
260
231
211 (MSB)
0

Therefore, (100)10 = (1100100)2

Converting to octal:

8QuotientRemainder
81004 (LSB)
8124
811 (MSB)
0

Therefore, (100)10 = (144)8

(c) 145

Converting to binary:

2QuotientRemainder
21451 (LSB)
2720
2360
2180
291
240
220
211 (MSB)
0

Therefore, (145)10 = (10010001)2

Converting to octal:

8QuotientRemainder
81451 (LSB)
8182
822 (MSB)
0

Therefore, (145)10 = (221)8

(d) 19

Converting to binary:

2QuotientRemainder
2191 (LSB)
291
240
220
211 (MSB)
0

Therefore, (19)10 = (10011)2

Converting to octal:

8QuotientRemainder
8193 (LSB)
822 (MSB)
0

Therefore, (19)10 = (23)8

(e) 121

Converting to binary:

2QuotientRemainder
21211 (LSB)
2600
2300
2151
271
231
211 (MSB)
0

Therefore, (121)10 = (1111001)2

Converting to octal:

8QuotientRemainder
81211 (LSB)
8157
811 (MSB)
0

Therefore, (121)10 = (171)8

(f) 161

Converting to binary:

2QuotientRemainder
21611 (LSB)
2800
2400
2200
2100
251
220
211 (MSB)
0

Therefore, (161)10 = (10100001)2

Converting to octal:

8QuotientRemainder
81611 (LSB)
8204
822 (MSB)
0

Therefore, (161)10 = (241)8

#### Question 8

Convert the following hexadecimal numbers to binary :

(a) A6

(b) A07

(c) 7AB4

(d) BE

(e) BC9

(f) 9BC8

(a) A6

Number
Binary
Equivalent
60110
A (10)1010

(A6)16 = (10100110)2

(b) A07

Number
Binary
Equivalent
70111
00000
A (10)1010

(A07)16 = (101000000111)2

(c) 7AB4

Number
Binary
Equivalent
40100
B (11)1011
A (10)1010
70111

(7AB4)16 = (111101010110100)2

(d) BE

Number
Binary
Equivalent
E (14)1110
B (11)1011

(BE)16 = (10111110)2

(e) BC9

Number
Binary
Equivalent
91001
C (12)1100
B (11)1011

(BC9)16 = (101111001001)2

(f) 9BC8

Number
Binary
Equivalent
81000
C (12)1100
B (11)1011
91001

(9BC8)16 = (1001101111001000)2

#### Question 9

Convert the following binary numbers to hexadecimal and octal :

(a) 10011011101

(b) 1111011101011011

(c) 11010111010111

(d) 1010110110111

(e) 10110111011011

(f) 1111101110101111

(a) 10011011101

Grouping in bits of 4:

$\underlinesegment{0100} \quad \underlinesegment{1101} \quad \underlinesegment{1101}$

Binary
Number
Equivalent
1101D (13)
1101D (13)
01004

Therefore, (10011011101)2 = (4DD)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{010} \quad \underlinesegment{011} \quad \underlinesegment{011} \quad \underlinesegment{101}$

Binary
Number
Equivalent
Octal
1015
0113
0113
0102

Therefore, (10011011101)2 = (2335)8

(b) 1111011101011011

Grouping in bits of 4:

$\underlinesegment{1111} \quad \underlinesegment{0111} \quad \underlinesegment{0101} \quad \underlinesegment{1011}$

Binary
Number
Equivalent
1011B (11)
01015
01117
1111F (15)

Therefore, (1111011101011011)2 = (F75B)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{001} \quad \underlinesegment{111} \quad \underlinesegment{011} \quad \underlinesegment{101} \quad \underlinesegment{011} \quad \underlinesegment{011}$

Binary
Number
Equivalent
Octal
0113
0113
1015
0113
1117
0011

Therefore, (1111011101011011)2 = (173533)8

(c) 11010111010111

Grouping in bits of 4:

$\underlinesegment{0011} \quad \underlinesegment{0101} \quad \underlinesegment{1101} \quad \underlinesegment{0111}$

Binary
Number
Equivalent
01117
1101D (13)
01015
00113

Therefore, (11010111010111)2 = (35D7)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{011} \quad \underlinesegment{010} \quad \underlinesegment{111} \quad \underlinesegment{010} \quad \underlinesegment{111}$

Binary
Number
Equivalent
Octal
1117
0102
1117
0102
0113

Therefore, (11010111010111)2 = (32727)8

(d) 1010110110111

Grouping in bits of 4:

$\underlinesegment{0001} \quad \underlinesegment{0101} \quad \underlinesegment{1011} \quad \underlinesegment{0111}$

Binary
Number
Equivalent
01117
1011B (11)
01015
00011

Therefore, (1010110110111)2 = (15B7)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{001} \quad \underlinesegment{010} \quad \underlinesegment{110} \quad \underlinesegment{110} \quad \underlinesegment{111}$

Binary
Number
Equivalent
Octal
1117
1106
1106
0102
0011

Therefore, (1010110110111)2 = (12667)8

(e) 10110111011011

Grouping in bits of 4:

$\underlinesegment{0010} \quad \underlinesegment{1101} \quad \underlinesegment{1101} \quad \underlinesegment{1011}$

Binary
Number
Equivalent
1011B (11)
1101D (13)
1101D (13)
00102

Therefore, (10110111011011)2 = (2DDB)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{010} \quad \underlinesegment{110} \quad \underlinesegment{111} \quad \underlinesegment{011} \quad \underlinesegment{011}$

Binary
Number
Equivalent
Octal
0113
0113
1117
1106
0102

Therefore, (10110111011011)2 = (26733)8

(f) 1111101110101111

Grouping in bits of 4:

$\underlinesegment{1111} \quad \underlinesegment{1011} \quad \underlinesegment{1010} \quad \underlinesegment{1111}$

Binary
Number
Equivalent
1111F (15)
1010A (10)
1011B (11)
1111F (15)

Therefore, (1111101110101111)2 = (FBAF)16

Converting to Octal:

Grouping in bits of 3:

$\underlinesegment{001} \quad \underlinesegment{111} \quad \underlinesegment{101} \quad \underlinesegment{110} \quad \underlinesegment{101} \quad \underlinesegment{111}$

Binary
Number
Equivalent
Octal
1117
1015
1106
1015
1117
0011

Therefore, (1111101110101111)2 = (175657)8

## Multiple Choice Questions

#### Question 1

The value of radix in binary number system is ..........

1. 2 ✓
2. 8
3. 10
4. 16

#### Question 2

The value of radix in octal number system is ..........

1. 2
2. 8 ✓
3. 10
4. 16

#### Question 3

The value of radix in decimal number system is ..........

1. 2
2. 8
3. 10 ✓
4. 16

1. 2
2. 8
3. 10
4. 16 ✓

#### Question 5

Which of the following are not valid symbols in octal number system ?

1. 2
2. 8 ✓
3. 9 ✓
4. 7

#### Question 6

Which of the following are not valid symbols in hexadecimal number system ?

1. 2
2. 8
3. 9
4. G ✓
5. F

#### Question 7

Which of the following are not valid symbols in decimal number system ?

1. 2
2. 8
3. 9
4. G ✓
5. F ✓

#### Question 8

The hexadecimal digits are 1 to 0 and A to ..........

1. E
2. F ✓
3. G
4. D

#### Question 9

The binary equivalent of the decimal number 10 is ..........

1. 0010
2. 10
3. 1010 ✓
4. 010

#### Question 10

ASCII code is a 7 bit code for ..........

1. letters
2. numbers
3. other symbol
4. all of these ✓

#### Question 11

How many bytes are there in 1011 1001 0110 1110 numbers?

1. 1
2. 2 ✓
3. 4
4. 8

#### Question 12

The binary equivalent of the octal Numbers 13.54 is.....

1. 1011.1011
2. 1001.1110
3. 1101.1110 ✓
4. None of these

#### Question 13

The octal equivalent of 111 010 is.....

1. 81
2. 72 ✓
3. 71
4. 82

#### Question 14

The input hexadecimal representation of 1110 is ..........

1. 0111
2. E ✓
3. 15
4. 14

#### Question 15

Which of the following is not a binary number ?

1. 1111
2. 101
3. 11E ✓
4. 000

#### Question 16

Convert the hexadecimal number 2C to decimal:

1. 3A
2. 34
3. 44 ✓
4. 43

#### Question 17

UTF8 is a type of .......... encoding.

1. ASCII
2. extended ASCII
3. Unicode ✓
4. ISCII

#### Question 18

UTF32 is a type of .......... encoding.

1. ASCII
2. extended ASCII
3. Unicode ✓
4. ISCII

#### Question 19

Which of the following is not a valid UTF8 representation?

1. 2 octet (16 bits)
2. 3 octet (24 bits)
3. 4 octet (32 bits)
4. 8 octet (64 bits) ✓

#### Question 20

Which of the following is not a valid encoding scheme for characters ?

1. ASCII
2. ISCII
3. Unicode
4. ESCII ✓

## Fill in the Blanks

#### Question 1

The Decimal number system is composed of 10 unique symbols.

#### Question 2

The Binary number system is composed of 2 unique symbols.

#### Question 3

The Octal number system is composed of 8 unique symbols.

#### Question 4

The Hexadecimal number system is composed of 16 unique symbols.

#### Question 5

The illegal digits of octal number system are 8 and 9.

#### Question 6

Hexadecimal number system recognizes symbols 0 to 9 and A to F.

#### Question 7

Each octal number is replaced with 3 bits in octal to binary conversion.

#### Question 8

Each Hexadecimal number is replaced with 4 bits in Hex to binary conversion.

#### Question 9

ASCII is a 7 bit code while extended ASCII is a 8 bit code.

#### Question 10

The Unicode encoding scheme can represent all symbols/characters of most languages.

#### Question 11

The ISCII encoding scheme represents Indian Languages' characters on computers.

#### Question 12

UTF8 can take upto 4 bytes to represent a symbol.

#### Question 13

UTF32 takes exactly 4 bytes to represent a symbol.

#### Question 14

Unicode value of a symbol is called code point.

## True/False Questions

#### Question 1

A computer can work with Decimal number system.
False

#### Question 2

A computer can work with Binary number system.
True

#### Question 3

The number of unique symbols in Hexadecimal number system is 15.
False

#### Question 4

Number systems can also represent characters.
False

#### Question 5

ISCII is an encoding scheme created for Indian language characters.
True

#### Question 6

Unicode is able to represent nearly all languages' characters.
True

#### Question 7

UTF8 is a fixed-length encoding scheme.
False

#### Question 8

UTF32 is a fixed-length encoding scheme.
True

#### Question 9

UTF8 is a variable-length encoding scheme and can represent characters in 1 through 4 bytes.
True

#### Question 10

UTF8 and UTF32 are the only encoding schemes supported by Unicode.
False

## Type A: Short Answer Questions

#### Question 1

What are some number systems used by computers ?

The most commonly used number systems are decimal, binary, octal and hexadecimal number systems.

#### Question 2

What is the use of Hexadecimal number system on computers ?

The Hexadecimal number system is used in computers to specify memory addresses (which are 16-bit or 32-bit long). For example, a memory address 1101011010101111 is a big binary address but with hex it is D6AF which is easier to remember. The Hexadecimal number system is also used to represent colour codes. For example, FFFFFF represents White, FF0000 represents Red, etc.

#### Question 3

What does radix or base signify ?

The radix or base of a number system signifies how many unique symbols or digits are used in the number system to represent numbers. For example, the decimal number system has a radix or base of 10 meaning it uses 10 digits from 0 to 9 to represent numbers.

#### Question 4

What is the use of encoding schemes ?

Encoding schemes help Computers represent and recognize letters, numbers and symbols. It provides a predetermined set of codes for each recognized letter, number and symbol. Most popular encoding schemes are ASCI, Unicode, ISCII, etc.

#### Question 5

Discuss UTF-8 encoding scheme.

UTF-8 is a variable width encoding that can represent every character in Unicode character set. The code unit of UTF-8 is 8 bits called an octet. It uses 1 to maximum 6 octets to represent code points depending on their size i.e. sometimes it uses 8 bits to store the character, other times 16 or 24 or more bits. It is a type of multi-byte encoding.

#### Question 6

How is UTF-8 encoding scheme different from UTF-32 encoding scheme ?

UTF-8 is a variable length encoding scheme that uses different number of bytes to represent different characters whereas UTF-32 is a fixed length encoding scheme that uses exactly 4 bytes to represent all Unicode code points.

#### Question 7

What is the most significant bit and the least significant bit in a binary code ?

In a binary code, the leftmost bit is called the most significant bit or MSB. It carries the largest weight. The rightmost bit is called the least significant bit or LSB. It carries the smallest weight. For example:

$\begin{matrix} \underset{\bold{MSB}}{1} & 0 & 1 & 1 & 0 & 1 & 1 & \underset{\bold{LSB}}{0} \end{matrix}$

#### Question 8

What are ASCII and extended ASCII encoding schemes ?

ASCII encoding scheme uses a 7-bit code and it represents 128 characters. Its advantages are simplicity and efficiency. Extended ASCII encoding scheme uses a 8-bit code and it represents 256 characters.

#### Question 9

What is the utility of ISCII encoding scheme ?

ISCII or Indian Standard Code for Information Interchange can be used to represent Indian languages on the computer. It supports Indian languages that follow both Devanagari script and other scripts like Tamil, Bengali, Oriya, Assamese, etc.

#### Question 10

What is Unicode ? What is its significance ?

Unicode is a universal character encoding scheme that can represent different sets of characters belonging to different languages by assigning a number to each of the character. It has the following significance:

1. It defines all the characters needed for writing the majority of known languages in use today across the world.
2. It is a superset of all other character sets.
3. It is used to represent characters across different platforms and programs.

#### Question 11

What all encoding schemes does Unicode use to represent characters ?

Unicode uses UTF-8, UTF-16 and UTF-32 encoding schemes.

#### Question 12

What are ASCII and ISCII ? Why are these used ?

ASCII stands for American Standard Code for Information Interchange. It uses a 7-bit code and it can represent 128 characters. ASCII code is mostly used to represent the characters of English language, standard keyboard characters as well as control characters like Carriage Return and Form Feed. ISCII stands for Indian Standard Code for Information Interchange. It uses a 8-bit code and it can represent 256 characters. It retains all ASCII characters and offers coding for Indian scripts also. Majority of the Indian languages can be represented using ISCII.

#### Question 13

What are UTF-8 and UTF-32 encoding schemes. Which one is more popular encoding scheme ?

UTF-8 is a variable length encoding scheme that uses different number of bytes to represent different characters whereas UTF-32 is a fixed length encoding scheme that uses exactly 4 bytes to represent all Unicode code points. UTF-8 is the more popular encoding scheme.

#### Question 14

What do you understand by code point ?

Code point refers to a code from a code space that represents a single character from the character set represented by an encoding scheme. For example, 0x41 is one code point of ASCII that represents character 'A'.

#### Question 15

What is the difference between fixed length and variable length encoding schemes ?

Variable length encoding scheme uses different number of bytes or octets (set of 8 bits) to represent different characters whereas fixed length encoding scheme uses a fixed number of bytes to represent different characters.

## Type B: Application Based Questions

#### Question 1

Convert the following binary numbers to decimal:

(a) 1101

Binary
No
PowerValueResult
1 (LSB)2011x1=1
02120x2=0
12241x4=4
1 (MSB)2381x8=8

Equivalent decimal number = 1 + 4 + 8 = 13

Therefore, (1101)2 = (13)10

(b) 111010

Binary
No
PowerValueResult
0 (LSB)2010x1=0
12121x2=2
02240x4=0
12381x8=8
124161x16=16
1 (MSB)25321x32=32

Equivalent decimal number = 2 + 8 + 16 + 32 = 58

Therefore, (111010)2 = (58)10

(c) 101011111

Binary
No
PowerValueResult
1 (LSB)2011x1=1
12121x2=2
12241x4=4
12381x8=8
124161x16=16
025320x32=0
126641x64=64
0271280x128=0
1 (MSB)282561x256=256

Equivalent decimal number = 1 + 2 + 4 + 8 + 16 + 64 + 256 = 351

Therefore, (101011111)2 = (351)10

#### Question 2

Convert the following binary numbers to decimal :

(a) 1100

Binary
No
PowerValueResult
0 (LSB)2010x1=0
02120x2=0
12241x4=4
1 (MSB)2381x8=8

Equivalent decimal number = 4 + 8 = 12

Therefore, (1100)2 = (12)10

(b) 10010101

Binary
No
PowerValueResult
1 (LSB)2011x1=1
02120x2=0
12241x4=4
02380x8=0
124161x16=16
025320x32=0
026640x64=0
1 (MSB)271281x128=128

Equivalent decimal number = 1 + 4 + 16 + 128 = 149

Therefore, (10010101)2 = (149)10

(c) 11011100

Binary
No
PowerValueResult
0 (LSB)2010x1=0
02120x2=0
12241x4=4
12381x8=8
124161x16=16
025320x32=0
126641x64=64
1 (MSB)271281x128=128

Equivalent decimal number = 4 + 8 + 16 + 64 + 128 = 220

Therefore, (11011100)2 = (220)10

#### Question 3

Convert the following decimal numbers to binary:

(a) 23

2QuotientRemainder
2231 (LSB)
2111
251
220
211 (MSB)
0

Therefore, (23)10 = (10111)2

(b) 100

2QuotientRemainder
21000 (LSB)
2500
2251
2120
260
231
211 (MSB)
0

Therefore, (100)10 = (1100100)2

(c) 145

2QuotientRemainder
21451 (LSB)
2720
2360
2180
291
240
220
211 (MSB)
0

Therefore, (145)10 = (10010001)2

(d) 0.25

Multiply=ResultantCarry
0.25 x 2=0.50
0.5 x 2=01

Therefore, (0.25)10 = (0.01)2

#### Question 4

Convert the following decimal numbers to binary:

(a) 19

2QuotientRemainder
2191 (LSB)
291
240
220
211 (MSB)
0

Therefore, (19)10 = (10011)2

(b) 122

2QuotientRemainder
21220 (LSB)
2611
2300
2151
271
231
211 (MSB)
0

Therefore, (122)10 = (1111010)2

(c) 161

2QuotientRemainder
21611 (LSB)
2800
2400
2200
2100
251
220
211 (MSB)
0

Therefore, (161)10 = (10100001)2

(d) 0.675

Multiply=ResultantCarry
0.675 x 2=0.351
0.35 x 2=0.70
0.7 x 2=0.41
0.4 x 2=0.80
0.8 x 2=0.61

(We stop after 5 iterations if fractional part doesn't become 0)

Therefore, (0.675)10 = (0.10101)2

#### Question 5

Convert the following decimal numbers to octal:

(a) 19

8QuotientRemainder
8193 (LSB)
822 (MSB)
0

Therefore, (19)10 = (23)8

(b) 122

8QuotientRemainder
81222 (LSB)
8157
811 (MSB)
0

Therefore, (122)10 = (172)8

(c) 161

8QuotientRemainder
81611 (LSB)
8204
822 (MSB)
0

Therefore, (161)10 = (241)8

(d) 0.675

Multiply=ResultantCarry
0.675 x 8=0.45
0.4 x 8=0.23
0.2 x 8=0.61
0.6 x 8=0.84
0.8 x 8=0.46

Therefore, (0.675)10 = (0.53146)8

#### Question 6

Convert the following hexadecimal numbers to binary:

(a) A6

Number
Binary
Equivalent
60110
A (10)1010

(A6)16 = (10100110)2

(b) A07

Number
Binary
Equivalent
70111
00000
A (10)1010

(A07)16 = (101000000111)2

(c) 7AB4

Number
Binary
Equivalent
40100
B (11)1011
A (10)1010
70111

(7AB4)16 = (111101010110100)2

#### Question 7

Convert the following hexadecimal numbers to binary:

(a) 23D

Number
Binary
Equivalent
D (13)1101
30011
20010

(23D)16 = (1000111101)2

(b) BC9

Number
Binary
Equivalent
91001
C (12)1100
B (11)1011

(BC9)16 = (101111001001)2

(c) 9BC8

Number
Binary
Equivalent
81000
C (12)1100
B (11)1011
91001

(9BC8)16 = (1001101111001000)2

#### Question 8

Convert the following binary numbers to hexadecimal:

(a) 10011011101

Grouping in bits of 4:

$\underlinesegment{0100} \quad \underlinesegment{1101} \quad \underlinesegment{1101}$

Binary
Number
Equivalent
1101D (13)
1101D (13)
01004

Therefore, (10011011101)2 = (4DD)16

(b) 1111011101011011

Grouping in bits of 4:

$\underlinesegment{1111} \quad \underlinesegment{0111} \quad \underlinesegment{0101} \quad \underlinesegment{1011}$

Binary
Number
Equivalent
1011B (11)
01015
01117
1111F (15)

Therefore, (1111011101011011)2 = (F75B)16

(c) 11010111010111

Grouping in bits of 4:

$\underlinesegment{0011} \quad \underlinesegment{0101} \quad \underlinesegment{1101} \quad \underlinesegment{0111}$

Binary
Number
Equivalent
01117
1101D (13)
01015
00113

Therefore, (11010111010111)2 = (35D7)16

#### Question 9

Convert the following binary numbers to hexadecimal:

(a) 1010110110111

Grouping in bits of 4:

$\underlinesegment{0001} \quad \underlinesegment{0101} \quad \underlinesegment{1011} \quad \underlinesegment{0111}$

Binary
Number
Equivalent
01117
1011B (11)
01015
00011

Therefore, (1010110110111)2 = (15B7)16

(b) 10110111011011

Grouping in bits of 4:

$\underlinesegment{0010} \quad \underlinesegment{1101} \quad \underlinesegment{1101} \quad \underlinesegment{1011}$

Binary
Number
Equivalent
1011B (11)
1101D (13)
1101D (13)
00102

Therefore, (10110111011011)2 = (2DDB)16

(c) 0110101100

Grouping in bits of 4:

$\underlinesegment{0001} \quad \underlinesegment{1010} \quad \underlinesegment{1100}$

Binary
Number
Equivalent
1100C (12)
1010A (10)
00011

Therefore, (0110101100)2 = (1AC)16

#### Question 10

Convert the following octal numbers to decimal:

(a) 257

Octal
No
PowerValueResult
7 (LSB)8017x1=7
58185x8=40
2 (MSB)82642x64=128

Equivalent decimal number = 7 + 40 + 128 = 175

Therefore, (257)8 = (175)10

(b) 3527

Octal
No
PowerValueResult
7 (LSB)8017x1=7
28182x8=16
582645x64=320
3 (MSB)835123x512=1536

Equivalent decimal number = 7 + 16 + 320 + 1536 = 1879

Therefore, (3527)8 = (1879)10

(c) 123

Octal
No
PowerValueResult
3 (LSB)8013x1=3
28182x8=16
1 (MSB)82641x64=64

Equivalent decimal number = 3 + 16 + 64 = 83

Therefore, (123)8 = (83)10

(d) 605.12

Octal
No
PowerValueResult
58015x1=5
08180x8=0
682646x64=384
##### Fractional part
Octal
No
PowerValueResult
18-10.1251x0.125=0.125
28-20.01562x0.0156=0.0312

Equivalent decimal number = 5 + 384 + 0.125 + 0.0312 = 389.1562

Therefore, (605.12)8 = (389.1562)10

#### Question 11

Convert the following hexadecimal numbers to decimal:

(a) A6

Number
PowerValueResult
616016x1=6
A (10)1611610x16=160

Equivalent decimal number = 6 + 160 = 166

Therefore, (A6)16 = (166)10

(b) A13B

Number
PowerValueResult
B (11)160111x1=11
3161163x16=48
11622561x256=256
A (10)163409610x4096=40960

Equivalent decimal number = 11 + 48 + 256 + 40960 = 41275

Therefore, (A13B)16 = (41275)10

(c) 3A5

Number
PowerValueResult
516015x1=5
A (10)1611610x16=160
31622563x256=768

Equivalent decimal number = 5 + 160 + 768 = 933

Therefore, (3A5)16 = (933)10

#### Question 12

Convert the following hexadecimal numbers to decimal:

(a) E9

Number
PowerValueResult
916019x1=9
E (14)1611614x16=224

Equivalent decimal number = 9 + 224 = 233

Therefore, (E9)16 = (233)10

(b) 7CA3

Number
PowerValueResult
3 (11)16013x1=3
A (10)1611610x16=160
C (12)16225612x256=3072
716340967x4096=28672

Equivalent decimal number = 3 + 160 + 3072 + 28672 = 31907

Therefore, (7CA3)16 = (31907)10

#### Question 13

Convert the following decimal numbers to hexadecimal:

(a) 132

16QuotientRemainder
161324
1688
0

Therefore, (132)10 = (84)16

(b) 2352

16QuotientRemainder
1623520
161473
1699
0

Therefore, (2352)10 = (930)16

(c) 122

16QuotientRemainder
16122A (10)
1677
0

Therefore, (122)10 = (7A)16

(d) 0.675

Multiply=ResultantCarry
0.675 x 16=0.8A (10)
0.8 x 16=0.8C (12)
0.8 x 16=0.8C (12)
0.8 x 16=0.8C (12)
0.8 x 16=0.8C (12)

(We stop after 5 iterations if fractional part doesn't become 0)

Therefore, (0.675)10 = (0.ACCCC)16

#### Question 14

Convert the following decimal numbers to hexadecimal:

(a) 206

16QuotientRemainder
16206E (14)
1612C (12)
0

Therefore, (206)10 = (CE)16

(b) 3619

16QuotientRemainder
1636193
162262
1614E (14)
0

Therefore, (3619)10 = (E23)16

#### Question 15

Convert the following hexadecimal numbers to octal:

(a) 38AC

Number
Binary
Equivalent
C (12)1100
A (10)1010
81000
30011

(38AC)16 = (11100010101100)2

Grouping in bits of 3:

$\underlinesegment{011}\medspace\underlinesegment{100}\medspace\underlinesegment{010}\medspace\underlinesegment{101}\medspace\underlinesegment{100}$

Binary
Number
Equivalent
Octal
1004
1015
0102
1004
0113

(38AC)16 = (34254)8

(b) 7FD6

Number
Binary
Equivalent
60110
D (13)1101
F (15)1111
70111

(7FD6)16 = (111111111010110)2

Grouping in bits of 3:

$\underlinesegment{111}\medspace\underlinesegment{111}\medspace\underlinesegment{111}\medspace\underlinesegment{010}\medspace\underlinesegment{110}$

Binary
Number
Equivalent
Octal
1106
0102
1117
1117
1117

(7FD6)16 = (77726)8

(c) ABCD

Number
Binary
Equivalent
D (13)1101
C (12)1100
B (11)1011
A (10)1010

(ABCD)16 = (1010101111001101)2

Grouping in bits of 3:

$\underlinesegment{001}\medspace\underlinesegment{010}\medspace\underlinesegment{101}\medspace\underlinesegment{111}\medspace\underlinesegment{001}\medspace\underlinesegment{101}$

Binary
Number
Equivalent
Octal
1015
0011
1117
1015
0102
0011

(ABCD)16 = (125715)8

#### Question 16

Convert the following octal numbers to binary:

(a) 123

Octal
Number
Binary
Equivalent
3011
2010
1001

Therefore, (123)8 = ($\bold{\underlinesegment{001}}\medspace\bold{\underlinesegment{010}}\medspace\bold{\underlinesegment{011}}$)2

(b) 3527

Octal
Number
Binary
Equivalent
7111
2010
5101
3011

Therefore, (3527)8 = ($\bold{\underlinesegment{011}}\medspace\bold{\underlinesegment{101}}\medspace\bold{\underlinesegment{010}}\medspace\bold{\underlinesegment{111}}$)2

(c) 705

Octal
Number
Binary
Equivalent
5101
0000
7111

Therefore, (705)8 = ($\bold{\underlinesegment{111}}\medspace\bold{\underlinesegment{000}}\medspace\bold{\underlinesegment{101}}$)2

#### Question 17

Convert the following octal numbers to binary:

(a) 7642

Octal
Number
Binary
Equivalent
2010
4100
6110
7111

Therefore, (7642)8 = ($\bold{\underlinesegment{111}}\medspace\bold{\underlinesegment{110}}\medspace\bold{\underlinesegment{100}}\medspace\bold{\underlinesegment{010}}$)2

(b) 7015

Octal
Number
Binary
Equivalent
5101
1001
0000
7111

Therefore, (7015)8 = ($\bold{\underlinesegment{111}}\medspace\bold{\underlinesegment{000}}\medspace\bold{\underlinesegment{001}}\medspace\bold{\underlinesegment{101}}$)2

(c) 3576

Octal
Number
Binary
Equivalent
6110
7111
5101
3011

Therefore, (3576)8 = ($\bold{\underlinesegment{011}}\medspace\bold{\underlinesegment{101}}\medspace\bold{\underlinesegment{111}}\medspace\bold{\underlinesegment{110}}$)2

(d) 705

Octal
Number
Binary
Equivalent
5101
0000
7111

Therefore, (705)8 = ($\bold{\underlinesegment{111}}\medspace\bold{\underlinesegment{000}}\medspace\bold{\underlinesegment{101}}$)2

#### Question 18

Convert the following binary numbers to octal

(a) 111010

Grouping in bits of 3:

$\underlinesegment{111} \quad \underlinesegment{010}$

Binary
Number
Equivalent
Octal
0102
1117

Therefore, (111010)2 = (72)8

(b) 110110101

Grouping in bits of 3:

$\underlinesegment{110} \quad \underlinesegment{110} \quad \underlinesegment{101}$

Binary
Number
Equivalent
Octal
1015
1106
1106

Therefore, (110110101)2 = (665)8

(c) 1101100001

Grouping in bits of 3:

$\underlinesegment{001} \quad \underlinesegment{101} \quad \underlinesegment{100} \quad \underlinesegment{001}$

Binary
Number
Equivalent
Octal
0011
1004
1015
0011

Therefore, (1101100001)2 = (1541)8

#### Question 19

Convert the following binary numbers to octal

(a) 11001

Grouping in bits of 3:

$\underlinesegment{011} \quad \underlinesegment{001}$

Binary
Number
Equivalent
Octal
0011
0113

Therefore, (11001)2 = (31)8

(b) 10101100

Grouping in bits of 3:

$\underlinesegment{010} \quad \underlinesegment{101} \quad \underlinesegment{100}$

Binary
Number
Equivalent
Octal
1004
1015
0102

Therefore, (10101100)2 = (254)8

(c) 111010111

Grouping in bits of 3:

$\underlinesegment{111} \quad \underlinesegment{010} \quad \underlinesegment{111}$

Binary
Number
Equivalent
Octal
1117
0102
1117

Therefore, (111010111)2 = (727)8

#### Question 20

(i) 10110111 and 1100101

$\begin{matrix} & & \overset{1}{1} & \overset{1}{0} & 1 & 1 & \overset{1}{0} & \overset{1}{1} & \overset{1}{1} & 1 \\ + & & & 1 & 1 & 0 & 0 & 1 & 0 & 1 \\ \hline & \bold{1} & \bold{0} & \bold{0} & \bold{0} & \bold{1} & \bold{1} & \bold{1} & \bold{0} & \bold{0} \end{matrix}$

Therefore, (10110111)2 + (1100101)2 = (100011100)2

(ii) 110101 and 101111

$\begin{matrix} & & \overset{1}{1} & \overset{1}{1} & \overset{1}{0} & \overset{1}{1} & \overset{1}{0} & 1 \\ + & & 1 & 0 & 1 & 1 & 1 & 1 \\ \hline & \bold{1} & \bold{1} & \bold{0} & \bold{0} & \bold{1} & \bold{0} & \bold{0} \end{matrix}$

Therefore, (110101)2 + (101111)2 = (1100100)2

(iii) 110111.110 and 11011101.010

$\begin{matrix} & & \overset{1}{0} & \overset{1}{0} & \overset{1}{1} & \overset{1}{1} & \overset{1}{0} & \overset{1}{1} & \overset{1}{1} & \overset{1}{1} & . & \overset{1}{1} & 1 & 0 \\ + & & 1 & 1 & 0 & 1 & 1 & 1 & 0 & 1 & . & 0 & 1 & 0 \\ \hline & \bold{1} & \bold{0} & \bold{0} & \bold{0} & \bold{1} & \bold{0} & \bold{1} & \bold{0} & \bold{1} & \bold{.} & \bold{0} & \bold{0} & \bold{0} \end{matrix}$

Therefore, (110111.110)2 + (11011101.010)2 = (100010101)2

(iv) 1110.110 and 11010.011

$\begin{matrix} & & \overset{1}{0} & \overset{1}{1} & \overset{1}{1} & 1 & \overset{1}{0} & . & \overset{1}{1} & 1 & 0 \\ + & & 1 & 1 & 0 & 1 & 0 & . & 0 & 1 & 1 \\ \hline & \bold{1} & \bold{0} & \bold{1} & \bold{0} & \bold{0} & \bold{1} & \bold{.} & \bold{0} & \bold{0} & \bold{1} \end{matrix}$

Therefore, (1110.110)2 + (11010.011)2 = (101001.001)2

#### Question 21

Given that A's code point in ASCII is 65, and a's code point is 97. What is the binary representation of 'A' in ASCII ? (and what's its hexadecimal representation). What is the binary representation of 'a' in ASCII ?

Binary representation of 'A' in ASCII will be binary representation of its code point 65.

Converting 65 to binary:

2QuotientRemainder
2651 (LSB)
2320
2160
280
240
220
211 (MSB)
0

Therefore, binary representation of 'A' in ASCII is 1000001.

16QuotientRemainder
16651
1644
0

Therefore, hexadecimal representation of 'A' in ASCII is (41)16.

Similarly, converting 97 to binary:

2QuotientRemainder
2971 (LSB)
2480
2240
2120
260
231
211 (MSB)
0

Therefore, binary representation of 'a' in ASCII is 1100001.

#### Question 22

Convert the following binary numbers to decimal, octal and hexadecimal numbers.

(i) 100101.101

Decimal Conversion of integral part:

Binary
No
PowerValueResult
12011x1=1
02120x2=0
12241x4=4
02380x8=0
024160x16=0
125321x32=32

Decimal Conversion of fractional part:

Binary
No
PowerValueResult
12-10.51x0.5=0.5
02-20.250x0.25=0
12-30.1251x0.125=0.125

Equivalent decimal number = 1 + 4 + 32 + 0.5 + 0.125 = 37.625

Therefore, (100101.101)2 = (37.625)10

Octal Conversion

Grouping in bits of 3:

$\underlinesegment{100} \quad \underlinesegment{101} \quad \bold{.} \quad \underlinesegment{101}$

Binary
Number
Equivalent
Octal
1015
1004
..
1015

Therefore, (100101.101)2 = (45.5)8

Grouping in bits of 4:

$\underlinesegment{0010} \quad \underlinesegment{0101} \medspace . \medspace \underlinesegment{1010}$

Binary
Number
Equivalent
01015
00102
.
1010A (10)

Therefore, (100101.101)2 = (25.A)16

(ii) 10101100.01011

Decimal Conversion of integral part:

Binary
No
PowerValueResult
02010x1=0
02120x2=0
12241x4=4
12381x8=8
024160x16=0
125321x32=32
026640x64=0
1271281x128=128

Decimal Conversion of fractional part:

Binary
No
PowerValueResult
02-10.50x0.5=0
12-20.251x0.25=0.25
02-30.1250x0.125=0
12-40.06251x0.0625=0.0625
12-50.031251x0.03125=0.03125

Equivalent decimal number = 4 + 8 + 32 + 128 + 0.25 + 0.0625 + 0.03125 = 172.34375

Therefore, (10101100.01011)2 = (172.34375)10

Octal Conversion

Grouping in bits of 3:

$\underlinesegment{010} \quad \underlinesegment{101} \quad \underlinesegment{100} \quad \bold{.} \quad \underlinesegment{010} \quad \underlinesegment{110}$

Binary
Number
Equivalent
Octal
1004
1015
0102
..
0102
1106

Therefore, (10101100.01011)2 = (254.26)8

Grouping in bits of 4:

$\underlinesegment{1010} \quad \underlinesegment{1100} \medspace . \medspace \underlinesegment{0101} \medspace \underlinesegment{1000}$

Binary
Number
Equivalent
1100C (12)
1010A (10)
.
01015
10008

Therefore, (10101100.01011)2 = (AC.58)16

(iii) 1010

Decimal Conversion:

Binary
No
PowerValueResult
02010x1=0
12121x2=2
02240x4=0
12381x8=8

Equivalent decimal number = 2 + 8 = 10

Therefore, (1010)2 = (10)10

Octal Conversion

Grouping in bits of 3:

$\underlinesegment{001} \quad \underlinesegment{010}$

Binary
Number
Equivalent
Octal
0102
0011

Therefore, (1010)2 = (12)8

Grouping in bits of 4:

$\underlinesegment{1010}$

Binary
Number
Equivalent
1010A (10)

Therefore, (1010)2 = (A)16

(iv) 10101100.010111

Decimal Conversion of integral part:

Binary
No
PowerValueResult
02010x1=0
02120x2=0
12241x4=4
12381x8=8
024160x16=0
125321x32=32
026640x64=0
1271281x128=128

Decimal Conversion of fractional part:

Binary
No
PowerValueResult
02-10.50x0.5=0
12-20.251x0.25=0.25
02-30.1250x0.125=0
12-40.06251x0.0625=0.0625
12-50.031251x0.03125=0.03125
12-60.0156251x0.015625=0.015625

Equivalent decimal number = 4 + 8 + 32 + 128 + 0.25 + 0.0625 + 0.03125 + 0.015625 = 172.359375

Therefore, (10101100.010111)2 = (172.359375)10

Octal Conversion

Grouping in bits of 3:

$\underlinesegment{010} \quad \underlinesegment{101} \quad \underlinesegment{100} \quad \bold{.} \quad \underlinesegment{010} \quad \underlinesegment{111}$

Binary
Number
Equivalent
Octal
1004
1015
0102
..
0102
1117

Therefore, (10101100.010111)2 = (254.27)8

Grouping in bits of 4:

$\underlinesegment{1010} \quad \underlinesegment{1100} \medspace . \medspace \underlinesegment{0101} \medspace \underlinesegment{1100}$

Binary
Number
Equivalent