0% found this document useful (0 votes)
74 views30 pages

9 25 Unit 2

A number system is a method for representing numbers, with common types including decimal, binary, octal, and hexadecimal systems. Positional number systems assign values to digits based on their position, and conversions between these systems can be performed using specific procedures. The document also details how to convert between binary, decimal, and octal systems, including examples and explanations of each process.

Uploaded by

Sid Ra Rajpoot
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)
74 views30 pages

9 25 Unit 2

A number system is a method for representing numbers, with common types including decimal, binary, octal, and hexadecimal systems. Positional number systems assign values to digits based on their position, and conversions between these systems can be performed using specific procedures. The document also details how to convert between binary, decimal, and octal systems, including examples and explanations of each process.

Uploaded by

Sid Ra Rajpoot
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/ 30

UNIT

2 NUMBER SYSTEM
Q.1 What is meant by a number system?
Number System
A system used for representing numbers is called a number system. An example of a
number system is the decimal number system, which consists of 10 digits (0 to 9). The total
number of digits or symbols used in any number system is called its base.
The most commonly used number systems are as follows:
 Decimal number system
 Binary number system
 Octal number system
 Hexadecimal number system

Q.1.1 What is positional number system? Which number systems are positional number
systems?
In a positional number system, the value of each digit of a number depends on its position
in the number. The position of each digit represents a specific power of the base of the
number system. The positions of digits start from the rightmost digit. The position of the
first digit on the right side is 0, the second digit is 1, the third digit is 2, and similarly, it
increases by 1 toward the left. Examples of positional number system are decimal, binary,
octal, and hexadecimal number systems.

Q.2 What is a decimal number system?


Decimal Number System
The base of the decimal number system is 10 because this number system consists of ten
digits (from 0 to 9). This number system is commonly used in our daily life. In the decimal
number system, the position of each digit represents a specific power of 10. The position or place
values of digits start from the rightmost digit, and these values are 10⁰, 10¹, 10², and so on.
4 3 2 1 0 Position
… 104 103 102 101 100 Position’s value
= 10000 = 1000 = 100 = 10 =1
28 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Example: Consider the decimal number 523. The position of each digit of this number is as
follows:
2 1 0 Position
102 101 100 Position’s value
5 2 3
So, the place value of each digit of the number 523 is calculated as:
5 → 5  102 = 500
2 → 2  101 = 20
3 → 3  100 = 3 (100 = 1)
Adding these values:
500 + 20 + 3 = 523

Q.3 What is a binary number system?


Binary Number System
The base of the binary number system is 2 because this number system consists of two
digits: 0 and 1. These digits are called bits or binary digits. The binary number system is used in
digital computers, where all types of data are stored and processed in binary form.
In the binary number system, the position of each digit represents a specific power of 2.
Like the decimal number system, in the binary number system also, the position values of digits
start from the rightmost digit, and these values are 2⁰, 2¹, 2², and so on.
… 5 4 3 2 1 0 Position
… 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1 position’s value

Q.3.1 How is data stored in computers?


Computers work using the binary number system. The circuits inside computers and
other digital electronic devices have two states: ON and OFF. The binary digit '1'
represents the ON state, while the binary digit '0' represents the OFF state. Thus, all types
of data are stored and processed inside the computer in the form of ON and OFF states
(1s and 0s). For example, when you type a letter on the keyboard, the computer first
converts it into a binary code, and then stores it in the form of 1s and 0s.

Q.3.2 Differentiate between binary and decimal number systems.


Binary Number System Decimal Number System
1- The base of the binary number system 1- The base of the decimal number
is 2. system is 10.
2- This number system is used in digital 2- This number system is used in daily
computers to store and process data. life for counting and calculations.
Unit :2  Number System 29

Q.4 Write the procedure to convert a binary number to a decimal number.


Conversion from Binary to Decimal
The following is the procedure to convert a binary number to a decimal number:
1. Determine the position or place value of each digit of the given binary number.
2. Multiply each digit of the binary number by its corresponding place value.
3. Sum all the products obtained in step-2 to get the decimal number.

Example 1: Convert the binary number (11)2 into decimal number.


Solution: The position values of all digits of the binary number (11)2 are as follows:
21 20 Position values
1 1 Binary number
Now, convert the binary number (11)2 to decimal number:
(11)2 = 1  21 + 1  20
= 1  2 + 1 1
=2+1=3
(11)2 = (3)10

Example 2: Convert the binary number (1011)2 into decimal number.


Solution: The position values of all digits of the binary number (1011)2 are as follows:
23 22 21 20 Position values
1 0 1 1 Binary number
Now, convert the binary number (1011)2 to decimal number:
(1011)2 = 1  23 + 0  22 + 1 21 + 1  20
= 1  8 + 0  4 + 1 2 + 1  1
= 8 + 0 + 2 + 1 = 11
(1011)2 = (11)10

Q.5 Write the procedure to convert a decimal number to a binary number.


Conversion from Decimal to Binary
The following is the procedure to convert a decimal number to a binary number:
1. Divide the decimal number by 2 (because the base of the binary number system is 2).
In this step, we obtain the quotient and remainder. Record the remainder which will
be either '0' or '1'.
2. Divide the quotient by 2. In this step also, we obtain the quotient and remainder as a
result. Note the value of the remainder.
3. Repeat step-2 until the value of the quotient becomes ‘0’. Record the remainder in
each step.
4. Write all the remainders in reverse order (from bottom to top). In this way, we get the
binary number of the given decimal number.
30 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Example: Convert the decimal number (83)10 to a binary number.


Solution: Quotient Remainder
83 / 2 = 41 1
41 / 2 = 20 1
20 / 2 = 10 0
10 / 2 = 5 0
5/2 = 2 1
2/2 = 1 0
1/2 = 0 1
The values of remainders are recorded from bottom to top to obtain the result.
Hence, decimal number 83 is equal to 10100110 in binary.
The above steps to convert the decimal number 83 to a binary number, are
graphically shown in the figure below.
2 83 Remainder
2 41 1
2 20 1
2 10 0
2 5 0
2 2 1
2 1 0
0 1

Hence, (83)10 = (1010011)2

Q.6 Write the procedure to convert the fractional part of a real number to a binary.
Conversion of the Fractional Part of a Real Number to Binary
The following is the procedure to convert the fractional part of a real number to a binary
number:
1. Multiply the fractional part of a real number by 2 (base of the binary number
system) and write down the integral part of the result.
2. Repeat step-1 with the new fractional part until the value of the fractional part
becomes zero or until the required number of decimal places is achieved.

Example 1: Convert the decimal number (0.375)10 to a binary number.


Solution: The decimal number (0.3750)10 can be converted to binary as follows:
Result Fractional part Integral part
0.3750  2 = 0.7500 0.7500 0
0.7500  2 = 1.5000 0.5000 1
0.5000  2 = 1.0000 0.0000 1
Hence, (0.3750)10 = (0.011)2
Unit :2  Number System 31

Example 2: Convert the decimal number (19.250)10 to a binary number.


Solution: The decimal number (19.250)10 can be converted to binary as follows:
Divide (19.250)10 into two separate parts:
(i) (19)10 = (?)2
(ii) (0.250)10 = (?)2

Convert (19)10 to a binary number:


Quotient Remainder
2 19
2 9 1
2 4 1
2 2 0
2 1 0
0 1

(19)10 = (10011)2 ------------------------------------ (i)

Now, convert fractional part (0.250)10 to a binary number:

Result Fractional part Integral part


0.250  2 = 0.500 0.500 0
0.500  2 = 1.000 0.000 1
(0.250)10 = (0.01)2 ------------------------------------ (ii)
Combining (i) and (ii)
(19.250)10 = (10011.01)2

Q.7 What is an octal number system?


Octal Number System
The base of the octal number system is 8 because this number system consists of eight
digits (from 0 to 7). In this number system, the position of each digit represents a specific power
of 8. The position values of digits start from the rightmost digit, and these values are 8⁰, 8¹, 8²,
and so on.

… 5 4 3 2 1 0 Position
… 85 84 83 82 81 80 Position’s value

Each digit of the octal number system represents three binary digits (bits) because the
base of the octal number system is 8, and the base of the binary number system is 2 (23 = 8).
Therefore, each octal digit can be represented by three binary digits (bits). The following table
shows the relationship between octal and binary digits:
32 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Octal-Binary: Table
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111

Example 1: Convert the 9-bit binary number 110101011 to an octal number.


Solution: Make groups of 3 binary digits from right to left.
110 101 011
From the Octal–Binary table:
110 = 6
101 = 5
011 = 3
So, the binary number 110101011 is equal to 653 in octal.
(110101011)2 = (653)8

Example 2: Convert the 8-bit binary number 10010110 to an octal number.


Solution: Make groups of 3 binary digits from right to left. The leftmost group has only
two binary digits. Add one ‘0’ on the left side of this group. The 0s on the
left side do not have any value.
010 010 110
From the Octal–Binary table:
010 = 2
010 = 2
110 = 6
So, the binary number 10010110 is equal to 226 in octal.
(10010110)2 = (226)8

Example 3: Convert the octal number 652 to a binary number.


Solution: From the Octal–Binary table:
6 = 110
5 = 101
2 = 010
So, the octal number 652 is equal to 110101010 in binary.
(652)8 = (110101010)2
Unit :2  Number System 33

Q.7.1 Is the octal number system used in modern computers?


The octal number system is not used in modern computers. It was used in early computer
systems, such as the PDP-8. It was used because conversion between octal and binary is
easier than conversion between decimal and binary.

Q.8 Write the procedure to convert an octal number to a decimal number.


Conversion from Octal to Decimal
The following is the procedure to convert an octal number to a decimal number:
1. Determine the position or place value of each digit of the given octal number.
2. Multiply each digit of the octal number by its corresponding position value.
3. Sum the products obtained in step-2 to get the decimal number.

Example: Convert (157)8 to a decimal number.


Solution: The place values of all digits of the octal number 157 are as follows:
82 81 80 Position values
1 5 7 Octal number
Now, convert the octal number (157)8 to decimal number:
(157)8 = 1  82 + 5  81 + 7  80
= 1  64 + 5  8 + 7  1
= 64 + 40 + 7 = 111
(157)8 = (111)10

Q.9 Write the procedure to convert a decimal number to an octal number.


Conversion from Decimal to Octal
The following is the procedure to convert a decimal number to an octal number:
1. Divide the decimal number by 8. In this step, we obtain the quotient and remainder.
Record the remainder.
2. Divide the quotient by 8. In this step also, we obtain the quotient and remainder as a
result. Note the value of the remainder.
3. Repeat step-2 until the value of the quotient becomes ‘0’. Record the remainder in
each step.
4. Write all the remainders in reverse order, i.e. from bottom to top. In this way, we get
the octal number of the given decimal number.

Example: Convert the decimal number (83)10 to an octal number.


Solution: Quotient Remainder
83 / 8 = 10 3
10 / 8 = 1 2
1/8 = 0 1
34 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

The above steps are graphically shown in the figure below.


8 83 Remainder
8 10 3
8 1 2
2 0 1
Hence, (83)10 = (123)8

Q.10 What is a hexadecimal number system?


Hexadecimal Number System
The base of the hexadecimal number system is 16. This number system consists of 16
digits or symbols with numeric digits from 0 to 9 and the letters A to F. The decimal values of the
letters A to F are 10, 11, 12, 13, 14, and 15, respectively.
In hexadecimal number system, the position of each digit or symbol represents a specific
power of 16. The position values of digits start from the rightmost digit, and these values are 16⁰,
16¹, 16², and so on.
… 5 4 3 2 1 0 Position
… 165 164 163 162 161 160 Position’s value

The hexadecimal number system is not directly used by computers. However, it provides
a shorter way to represent numbers in computers than the octal number system. This makes it
easier to read and write large binary numbers.
Each digit in the hexadecimal number system represents four binary digits. This means
that each hexadecimal digit is equivalent to 4 bits. The following table shows the relationship
between hexadecimal and binary digits:
Hexadecimal-Binary: Table
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Unit :2  Number System 35

Example 1: Convert the hexadecimal number (10A8)16 to a binary number.


Solution: From the Hexadecimal–Binary table, the values of the digits or symbols of the
hexadecimal number 10A8 are as follows:
1 = 0001
0 = 0000
A = 1010
8 = 1000
By combining all the binary values of the digits or symbols of the hexadecimal
number 10A8, we get the following binary number:
(10A8)16 = (0001 0000 1010 1000)2

Example 2: Convert the binary number (1101011010110010)2 to a hexadecimal number.


Solution: Make groups of 4 binary digits from right to left. If the leftmost group has less
binary digits, add extra 0s to the left of this group.
Groups of 4 binary digits:
1101 0110 1011 0010
From Hexadecimal – Binary table:
1101 = D
0110 = 6
1011 = B
0010 = 2
So, the binary number 1101011010110010 is equal to D6B2 in hexadecimal.
(1101011010110010)2 = (D6B2)16

Q.11 Write the procedure to convert a hexadecimal number to a decimal number.


Conversion from Hexadecimal to Decimal
The following is the procedure to convert a hexadecimal number to a decimal number:
1. Determine the position or place value of each digit or symbol of the given
hexadecimal number.
2. Multiply each digit or symbol of the hexadecimal number by its corresponding
position value.
3. Sum the products obtained in step-2 to get the decimal number.

Example: Convert the hexadecimal number (BC7)16 to a decimal number.


Solution: The place values of all digits or symbols of the hexadecimal number BC7 are as
follows:
162 161 160 Position values
B C 7 Hexadecimal number
36 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Now, convert the hexadecimal number BC7 to decimal number:


(BC7)16 = B  162 + C  161 + 7  160
= 11  256 + 12  16 + 7  1 ( B = 11, C = 12)
= 2816 + 192 + 7 = 3015
(BC7)16 = (3015)10

Q.12 Write the procedure to convert a decimal number to a hexadecimal number.


Conversion from Decimal to Hexadecimal
The following is the procedure to convert a decimal number to a hexadecimal number:
1. Divide the decimal number by 16. In this step, we obtain the quotient and remainder.
Record the remainder.
2. Divide the quotient by 16. In this step also, we obtain the quotient and remainder as a
result. Note the value of the remainder.
3. Repeat step-2 until the value of the quotient becomes ‘0’.
4. Write all the remainders in reverse order (from bottom to top). In this way, we get the
hexadecimal number of the given decimal number.

Example: Convert the decimal number 2297 to a hexadecimal number.


Solution: Quotient Remainder
2297 / 16 = 143 9
143 / 16 = 8 15 → F
8 / 16 = 0 8
The above steps are graphically shown in the figure below.
16 2297 Remainder
16 143 9
16 8 15 → F
0 8

Hence, (2297)10 = (8F9)16

Q.13 Differentiate between octal and hexadecimal number systems.


Octal Number System Hexadecimal Number System
1- The base of the octal number system 1- The base of the hexadecimal number
is 8. system is 16.
2- Each octal digit represents three 2- Each hexadecimal digit represents four
binary bits. binary bits.

Q.14 What are whole numbers (W)? How are they represented inside the computers?
Unit :2  Number System 37

Whole Numbers (W)


Whole numbers are a set of non-negative integers. They include zero and all the positive
integers. Mathematically, the set of whole numbers is represented as:
W = {0, 1, 2, 3, ……}
In computing, whole numbers are often used to represent quantities that cannot be
negative. For example, the age of a person cannot be negative.

Representation of Whole Numbers (W) Inside Computers


In computers, all types of data are represented in binary form (0s and 1s). Computers use
a fixed number of bits to store whole numbers. The commonly used sizes are as follows:
• 1 byte (8 bits)
• 2 bytes (16 bits)
• 4 bytes (32 bits)
A 1-byte whole number uses 8 bits. If all 8 bits are 0 (OFF), it represents the minimum
value “00000000”, which is equal to 0 in decimal. Similarly, if all 8 bits are 1 (ON), it represents
the maximum value “11111111”, which is equal to 255 in decimal. Therefore, a 1-byte can store
values ranging from 0 to 255.
Using 2 or 4 bytes, larger values can be stored. If ‘n’ is the number of bits, the maximum
value “2n-1” can be represented. For example:
• For a 1-byte (8 bits) whole number, the maximum value is 28-1 = 255
• For a 2-byte (16 bits) whole number, the maximum value is 216-1 = 65,535
• For a 4-byte (32 bits) whole number, the maximum value is 232-1 = 4,294,967,295

Q.15 What are integers (Z)? How are positive and negative values represented?
Integers (Z)
Integers are a set of whole numbers that include both positive and negative numbers, as
well as zero. In computer programming, they are often called signed integers. Mathematically,
the set of integers is represented as:
Z = {……,-3, -2, -1, 0, 1, 2, 3, ……}

Representation of Positive and Negative Values


To store both positive and negative values in a computer, one bit is reserved as the sign
bit. The Most Significant Bit (MSB) is used for this purpose, which is the leftmost bit of the
binary number.
• For positive value or number, the sign bit is ‘0’.
• For negative value or number, the sign bit is ‘1’.
For example, in a 1-byte signed integer, the MSB is reserved as the sign bit, while the
remaining 7 bits are used to store the actual value. The representation of integers +19 and -19 in
1-byte binary form will be as follows:
38 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Integer Binary value Representation inside the computer


-19 10011 10010011
+19 10011 00010011

In a 1-byte (8-bit) signed integer, the maximum positive value "(01111111)2" can be
stored, which is equal to (127)10. For an n-bit signed integer, (n−1) bits are used to store a value
(because 1 bit is used as the sign bit). Hence, the maximum value will be “2n-1 – 1”. We can use
this formula to compute the maximum values for 2 and 4 bytes.

Q.16 What is the use of the 2’s complement method? How is the 2’s complement of a
binary number obtained?
2’s Complement
Computers use the 2’s complement method to store negative values in binary form. To
find the 2's complement of a binary number, follow these steps:
1. Invert all the bits of binary number (i.e., change 0s to 1s and 1s to 0s).
2. Add 1 to the Least Significant Bit (LSB).

Example: Find the 2’s complement of decimal number -5.


To find 2’s complement of decimal number -5, follow these steps:
i) Convert decimal number 5 to 8-bit binary number, which is (00000101)2.
ii) Invert all the bits of binary number 00000101, such as 11111010.
iii) Add bit 1 to 11111010.
11111010
1
11111011
So, -5 in 8-bit two's complement is (11111011)2.

Q.16.1 How to find minimum integer value?


To find the minimum value for an 8-bit signed integer, follow these steps:
• Turn ON the sign bit and all other bits. The result will be 11111111.
• Except for the first bit (sign bit), take the 2’s complement of all other bits. The result
will be 10000000, which is equal to (128)₁₀ in decimal.
Thus, the minimum value in a 8-bit (1-byte) signed integer is -128, i.e., -2⁷. The
minimum integer value can be computed using the formula -2ⁿ⁻¹, where n is the total
number of bits. For example:
➢ For 1-byte (8-bit) signed integer, the minimum value is -2⁷ = -128.
➢ For 2-byte (16-bit) signed integer, the minimum value is -2¹⁵ = -32,768.
➢ For 4-byte (32-bit) signed integer, the minimum value is -2³¹ = -2,147,483,648.
Unit :2  Number System 39

Q.17 What are floating-point numbers? How are they represented inside the computers?
Floating-Point Numbers
In computers, real values are called floating-point numbers. A floating-point number
consists of two parts: an integral part and a fractional part. For example, in real number 5.75, ‘5’
is the integral part, while ‘0.75’ is the fractional part.

Floating-Point Numbers Representation


Very small or very large numbers are represented inside the computers in floating-point
form. The floating-point numbers are represented in a format similar to scientific notation. The
general format to represent a floating-point number in scientific notation is as follows:
Floating-point number = Sign  Mantissa  BaseExponent
In this format:
• Sign: It indicates whether the number is positive or negative. The MSB is used as the
sign bit. A ‘0’ bit represents a positive number, while a ‘1’ bit represents a negative
number.
• Mantissa: It indicates the significant digits of the number (i.e., the main value).
• Base: It indicates the base of the number system. For the binary system, the base is 2.
• Exponent: It indicates how large or small the number is.
For example, the real number -0.000162 can be written in scientific notation as
-1.6210−4. In -1.62  10−4, the sign is ‘-‘, the mantissa is ‘1.62’, the base is ‘10’, and the
exponent is ‘-4’. Similarly, a binary number can be expressed in scientific notation. For example,
the binary number 1000.1101 can be written as 1.0001101  23.
Most digital computers use floating-point format to represent real numbers. In computer
memory, only the mantissa and exponent are stored in binary form.

Q.17.1 Explain the commonly used formats for floating-point numbers representation.
Formats for Floating-Point Representation
There are two commonly used formats or standards for representing floating point
numbers: single-precision (32-bit) and double precision (64-bit).

i) Single Precision (32-bit)


Single precision is a floating-point format in which 32 bits (4 bytes) are used to represent
a floating-point value. The first bit is for sign bit, the next 8 bits are for the exponent, and the
remaining 23 bits are for the mantissa. The structure of single precision is as follows:

1 bit for sign bit 8 bits for Exponent 23 bits for Mantissa

In single precision, the exponent ranges from -126 to +127. In this format, the
approximate range of values that can be represented is from 1.4  10−45 to 3.4  1038.
40 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Example: Represent 17.5 as a 32-bit format


1. Convert the decimal number 17.5 to binary:
(17)10 = (10001)2
(.5)10 = (0.1)2
Hence, (17.5)10 = (10001.1)2
2. Write the binary number 10001.1 in scientific notation:
(10001.1)2 = (1.00011)2  104
3. Represent the number in floating point format:
 Sign bit = 0 (since 17.5 is positive)
 Exponent = 4, it takes 8 bits:
= 00000100
 Mantissa = 1.00011, it takes 23 bits:
= 1.00011000000000000000000
So, the number in floating point 32-bit format is:

Sign bit Exponent Mantissa


0 00000100 00011000000000000000000

The first bit of mantissa and the floating point are not written.

ii) Double Precision (64-bit)


Double precision is a floating-point format in which 64 bits (8 bytes) are used to
represent a floating-point value. The first bit is the sign bit, the next 11 bits are for the exponent,
and the remaining 52 bits are for the mantissa. The structure of double precision is as follows:

1 bit for sign bit 11 bits for Exponent 52 bits for Mantissa

The exponent is stored in a biased form, with a bias of 1023. The bias is the fixed value
(i.e., 1023) added to the actual exponent. The exponent values range from -1022 to +1023. In
double precision, the approximate range to store values is from 4.9  10−324 to 1.8  10308.

Q.17.2 Differentiate between single precision and double precision.


Single Precision Double Precision
1- It uses 32 bits (4 bytes) to represent a 1- It uses 64 bits (8 bytes) to represent a
floating-point value. floating-point value.
2- It uses 8 bits for the exponent, and 23 2- It uses 11 bits for the exponent, and
bits for the mantissa. 52 bits for the mantissa.
3- Its approximate range of values is 3- Its approximate range of values is
from 1.4  10−45 to 3.4  1038. from 4.9  10−324 to 1.8  10308.
Unit :2  Number System 41

Q.18 Explain the binary arithmetic operations.


Binary Arithmetic Operations
Binary arithmetic operations include addition, subtraction, multiplication, and division.
These operations are similar to decimal operations but follow binary rules.

i) Binary Addition
In binary addition, two binary digits (bits) are added. If the sum of two bits is 2, it is
divided by 2, resulting in a remainder and a quotient. The remainder is written as an answer and
the quotient is shifted as a carry to the next higher bit.

Binary Addition Rules


There are four rules for binary addition:
(i) 0+0=0
(ii) 0 + 1 = 1
(iii) 1 + 0 = 1
(iv) 1 + 1 = 0 (with a carry of 1 to the next higher bit).

Example 1: Add the binary numbers (101)2 and (110)2.


Solution: 101
+110
1011
In this example:
• 1 + 0 = 1 (carry 0)
• 0 + 1 = 1 (carry 0)
• 1 + 1 = 0 (carry 1)
Example 2: Add the binary numbers (1101)2 and (1011)2
Solution: 
1101
+1011
11000
In this example:
• 1 + 1 = 0 (carry 1)
• 0 + 1 + 1 (carry) = 0 (carry 1)
• 1 + 0 + 1 (carry) = 0 (carry 1)
• 1 + 1 + 1 (carry) = 1 (carry 1)
Example 3: Add the binary numbers (1100)2 and (1011)2
Solution: 
1100
+1 0 1 1
10111
42 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

ii) Binary Subtraction


In computers, binary subtraction is performed using the 2’s complement method. The
following steps are used to subtract one number (subtrahend) from another (minuend):
1- Find the 2’s complement of the subtrahend (the number to be subtracted).
2- Add the minuend (larger number) and the 2’s complement of the subtrahend.
3- Discard the last carry bit (if any).

Example: Subtract 6 from 9 in binary


Solution: Minuend: (9)10 = (1001)2
Subtrahend: (6)10 = (0110)2
1- Find 2’s complement of subtrahend (0110)2 :
1001 1’s complement
1
1010 2’s complement
2- Add the minuend (1001)2 and the 2’s complement of the subtrahend (1010)2:
1001
1010
10011
3- Discard the last carry bit. The final result is:
(0011)2 = (3)10
So, 9 – 6 = 3

iii) Binary Multiplication


The principles of binary multiplication are similar to decimal multiplication. There are
four rules for binary multiplication:
(i) 00=0
(ii) 01=0
(iii) 10=0
(iv) 11=1

Steps to Multiply Binary Numbers


There are the following steps to multiply binary numbers:
1- Write down the binary numbers, aligning them by the least significant bit (rightmost
bit).
2. Multiply each bit of the second number by each bit of the first number, similar to the
multiplication method in decimal.
3. Shift the partial results one place to the left for each new row, starting from the
second row.
4. Add all the partial results to get the final product.
Unit :2  Number System 43

Example 1: Multiply (101)2 by (10)2


101
 10
000 (This is 1012  02)
101 (This is 1012  12, shifted one place to the left)
1010
So, (101)2  (10)2 = (1010)2

Example 2: Multiply (101)2 by (11)2


101
 11
101
101
1111
So, (101)2  (11)2 = (1111)2

iv) Binary Division


In binary division, one binary number is divided by another binary number. The number
being divided is called the dividend, while the number that divides it is called the divisor. In this
process, we obtain the quotient and remainder. The principles of binary division are similar to
those of decimal division.

Steps of Binary Division


Write the dividend and divisor in binary form and then perform the following steps:
1. Compare: Compare the divisor with the current portion of the dividend.
2. Subtract: Subtract the divisor from the dividend portion if the divisor is less than or
equal to the dividend; otherwise, write 0 in the quotient.
3. Shift: Shift down the next binary digit from the dividend to the remainder.
4. Repeat: Repeat the process until all digits of the dividend are processed.

Example 1: Divide (1100)2 by (10)2


110
10 1100
-1 0 (Compare 10 with 11, subtract 10 from 11: quotient = 1, remainder = 1)
10 (Bring down the next digit 0)
-1 0 (Compare 10 with 10, subtract 10 from 10: quotient = 1, remainder = 0)
0 (Bring down the next digit 0, no more digits left)
Result = (1100)2 / (10) 2 = (110) 2

Example 2: Divide (11100)2 by (11)2


44 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

1001
11 11100
-1 1
100
- 11
01
Result = (11100)2 / (11) 2 = (1001) 2 with remainder 01.

Q.19 Define encoding scheme. Name common text encoding schemes used in computers.
Encoding Scheme
A method or set of rules used to convert data from one form to another is called an
encoding scheme. It enables computers to understand and process data. Some common text
encoding schemes used in computers are ASCII, Extended ASCII, and Unicode.

Q.20 Describe ASCII encoding scheme.


ASCII
ASCII stands for American Standard Code for Information and Interchange. It is a
character encoding standard used to represent text (data) in computers and other digital electronic
systems. ASCII is a 7-bit encoding scheme. So, 128 (27 = 128) characters can be represented in
this coding scheme. Each alphabet, number, or any symbol is given a unique code number
between 0 and 127.
ASCII codes of various characters are shown in the following table:
Table: ASCII Codes
ASCII ASCII ASCII ASCII ASCII
Char Char Char Char Char
Code Code Code Code Code
Space 32 0 48 @ 64 P 80 ‘ 96
! 33 1 49 A 65 Q 81 a 97
“ 34 2 50 B 66 R 82 b 98
# 35 3 51 C 67 S 83 c 99
$ 36 4 52 D 68 T 84 d 100
% 37 5 53 E 69 U 85 -- --
& 38 6 54 F 70 V 86 -- --
‘ 39 7 55 G 71 W 87 y 121
( 40 8 56 H 72 X 88 z 122
) 41 9 57 I 73 Y 89 { 123
* 42 : 58 J 74 Z 90 | 124
+ 43 ; 59 K 75 [ 91 } 125
, 44 < 60 L 76 \ 92 ~ 126
- 45 = 61 M 77 ] 93 DEL 127
. 46 > 62 N 78 ^ 94
/ 47 ? 63 O 79 _ 95
Unit :2  Number System 45

Note that there is a different ASCII code for the uppercase letter ‘A’ and lowercase letter
‘a’. The ASCII code of a character is converted into binary form to store inside the computer or
other devices. In the above ASCII codes table, the decimal value as ASCII code is given for the
corresponding character or symbol. The decimal value (or ASCII code) is converted into binary
form to store and process them in computer.

Example: Encode the name “Pakistan” using ASCII encoding scheme.


Solution: From the ASCII table, the corresponding ASCII codes for each letter of
“Pakistan” are as follows:
• The ASCII code for the uppercase letter ‘P’ is 80.
• The ASCII code for the letter ‘a’ is 97.
• The ASCII code for the letter ‘k’ is 107.
• The ASCII code for the letter ‘i’ is 105.
• The ASCII code for the letter ‘s’ is 115.
• The ASCII code for the letter ‘t’ is 116.
• The ASCII code for the letter ‘a’ is 97.
• The ASCII code for the letter ‘n’ is 110.

Q.21 Briefly describe the Extended ASCII encoding scheme.


Extended ASCII
Extended ASCII is an 8-bit encoding scheme. It is an extended version of 7-bit ASCII. In
extended ASCII, 256 characters can be represented. The first 128 characters are identical to the
standard ASCII. The additional symbols and other characters are also included in Extended
ASCII.

Q.22 Describe Unicode encoding scheme in detail.


Unicode
Unicode is the most popular encoding scheme, used worldwide. It is designed to
represent characters of all languages, various symbols, and graphic characters used in the world's
writing systems. Unicode can represent over a million characters through different encoding
formats such as UTF-8, UTF-16, and UTF-32. UTF stands for Unicode Transformation Format.

i) UTF-8
UTF-8 is a variable-length character encoding scheme. This means that a different
number of bytes (from 1 to 4) can be used in this encoding scheme to represent a
character. UTF-8 is compatible with the older ASCII encoding scheme, meaning it can
understand and use the older ASCII encoding scheme. Therefore, if we have a text file
prepared in ASCII system, it can be used in the UTF-8 system.
46 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Example 1:
In UTF-8, the letter 'A' is represented as U+0041. In binary format, it is 01000001, and it
takes 8 bits (1 byte) of memory.

Example 2:
In UTF-8, the Urdu letter ‘‫ ’ب‬is represented as U+0628. In binary format, it is 11011000
10101000, and it takes 2 bytes of memory.

ii) UTF-16
UTF-16 is also a variable-length character encoding scheme. In this encoding scheme, a
character is represented using either 2 bytes or 4 bytes. Unlike UTF-8, it is not
compatible with ASCII, meaning it cannot directly use encoded text in ASCII.

Example 1:
In UTF-16, the letter A is equal to 00000000 01000001 in binary and equal to 65 in
decimal. It takes 2 bytes of memory.

Example 2:

In UTF-16, the Urdu letter ‘‫ ’ب‬is equal to 00000110 00101000 in binary. It takes 2 bytes
of memory.

iii) UTF-32
UTF-32 is a fixed-length character encoding scheme. In this encoding scheme, every
character is represented using 4 bytes. This encoding scheme is very simple but it
requires more space of memory.

Example:
In UTF-32, the letter 'A' is represented in binary as 00000000 00000000 00000000
01000001. It takes 4 bytes in memory.

Q.23 Explain the difference between ASCII and Unicode.


ASCII Unicode
1- In ASCII, 7 bits are used to 1- In Unicode, variable bits (8 to 32 bits) are used
represent a character. to represent a character.
2- In ASCII, 128 characters can 2- In Unicode, over a million characters can be
be represented. represented.
3- ASCII is primarily used to 3- Unicode is used to represent characters of all
represent English characters languages, various symbols, and graphic
and basic symbols. characters used in the world’s writing systems.
Unit :2  Number System 47

Q.24 How images are stored in computer memory?


Storing Images
Images are made up of tiny dots called pixels. The combination of all these pixels forms
the complete picture. Each pixel has a certain color. Computers store images using numbers
(decimal values) to represent these colors. In a color image, each pixel's color can be represented
by three numbers: Red, Green, and Blue (RGB). Each of these numbers typically ranges from 0 to
255. For example, a pixel with RGB values (255, 0, 0) will be bright red.

Q.24.1 Describe different image file formats.


Image File Formats
There are different image file formats. The most commonly used image formats are
as follows:
• JPEG (Joint Photographic Experts Group): This format compresses the image to
reduces file size, but might lose the quality of the image.
• PNG (Portable Network Graphics): This format supports transparency and
maintains high quality without losing data.
• GIF (Graphics Interchange Format): This format is used for simple animations
and images with few colors.

Q.25 How audio files are stored in computer memory?


Storing Audio Files
Audio files are stored by capturing sound waves and converting them into digital data.
This process involves sampling and quantization.
➢ Sampling: This is the process of recording the sound wave at regular intervals. The
number of samples recorded per second is called the sampling rate. A higher
sampling rate results in better audio quality.
➢ Quantization: This is the process of converting each sample into a numerical value.
More bits per sample provide more accurate representation of the sound.

Q.25.1 Describe different audio file formats.


Audio File Formats
The commonly used audio file formats are as follows:
• MP3: This is a common audio format that compresses audio to reduce file size, but
might lose the quality of the audio.
• WAV (Wave Audio File Format): This is an uncompressed format that maintains
high quality.
• AAC (Advanced Audio Coding): This format is used by many streaming services
because it efficiently compresses audio while maintaining its quality. A streaming
service is a platform that delivers audio, video, or other media over the Internet in
real-time.
48 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Q.26 How video files are stored in computer memory?


Storing Video Files
Videos are made up of many images shown rapidly in sequence, along with audio. Each
image in a video is called a frame. The number of frames shown per second is called the frame
rate, which is measured in frames per second (FPS). Common frame rates are as follows:
• 24 FPS: It is used in movies.
• 30 FPS: It is used in TV broadcasts.
Higher frame rates result in smoother motion in videos.

Q.26.1 Describe different video file formats.


Video File Formats
The commonly used video file formats are as follows:
• MP4: It is a widely used format that efficiently compresses video while maintaining
quality.
• AVI: It is an older format that may result in larger file sizes.
• MKV: It supports high-quality video and multiple audio tracks or subtitles.

Q.27 How do computers store images, audio, and video files?


Storing Images, Audio, and Video Files
Computers store images, audio, and video files in digital format. It means that they are
represented in the form of 0s and 1s that the computer can understand and process.

Storage Devices
Common storage devices to store images, audio, and video files are as follows:
• Hard Disk Drive (HDD): It uses multiple disks and has a large storage capacity.
• Solid State Drive (SSD): It uses flash memory and has faster access time and better
performance.
• Cloud Storage: It is an online service that provides the facility to store files on
remote servers.

Q.28 How is data size measured?


Measuring Data Size
Data size is measured in terms of bytes and their multiples. A bit is the smallest unit for
measuring data. A byte, which consists of 8 bits, is the basic unit used for storing data. The
multiples of bytes are as follows:
Unit :2  Number System 49

1 Kilobyte (KB) 1024 Bytes


1 Megabyte (MB) 1024 Kilobytes
1 Gigabyte (GB) 1024 Megabytes
1 Terabyte (TB) 1024 Gigabytes
1 Petabyte (PB) 1024 Terabytes
1 Exabyte (EB) 1024 Petabytes
1 Zettabyte (ZB) 1024 Exabytes
1 Yottabyte (YB) 1024 Zettabytes

Short Answers to the Questions


Q.1 What is a number system? See Q.1, first paragraph
Q.2 What is the base of a number system?
The total number of digits or symbols used in a number system is called its base. For
example, the decimal number system uses 10 digits (0, 1, 2, 3, 4, 5, 6,7,8, and 9), so its
base is 10.
Q.3 List different types of number systems.
Different types of number systems are decimal system, binary system, octal system, and
hexadecimal system.
Q.4 What is the decimal number system? See Q.2, first paragraph
Q.5 What is a binary number system? See Q.3, first paragraph
Q.6 Differentiate between binary and decimal number systems. See Q.3.2
Q.7 Convert (10)2 to a decimal number. Solve it with the help of the example-1 in Q.4
Q.8 Convert (27)10 to a binary system. Solve it with the help of the example in Q.5
Q.9 What is an octal number system? See Q.7, first paragraph
Q.10 Differentiate between octal and hexadecimal number systems. See Q.13
Q.11 Why was the octal number system used in early computers?
The octal number system was used in early computers such as PDP-8. It was used
because conversion between octal and binary is easier than conversion between decimal
and binary.
Q.12 Is the octal number system still used in modern computers? See Q.7.1
Q.13 Convert (11)8 to a decimal number. Solve it with the help of the example in Q.8
Q.14 Convert (8)10 to an octal system. Solve it with the help of the example in Q.9
Q.15 What is the hexadecimal number system? See Q.10, first paragraph
Q.16 Convert (A1)16 to a decimal number. Solve it with the help of Example in Q.11
Q.17 Convert (19)10 to a hexadecimal number. Solve it with the help of example in Q.12
50 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

Q.18 What are whole numbers in mathematics and computing? See Q.14, first paragraph
Q.19 What is the range of 1-byte whole numbers to store data?
The range of 1-byte whole numbers to store data is from 0 to 255.
Q.20 How is the maximum value of whole numbers determined in computing?
In computing, the maximum value of whole numbers can be determined using formula
2n −1, where ‘n’ indicates the number of bits. For example, for 8 bits, the maximum value
is 28 −1 = 255.
Q.21 What is the range of values for an unsigned 2-byte integer?
The range of values for an unsigned 2-byte integer is from 0 to 65,535.
Q.22 What are integers in mathematics and computing? See Q.15, first paragraph
Q.23 What is the benefit of using unsigned integers?
Unsigned integers can only store non-negative values, allowing them to represent larger
positive numbers than signed integers of the same size. For example, an 8-bit unsigned
integer ranges from 0 to 255, while an 8-bit signed integer ranges from -128 to 127.
Q.24 Why are whole numbers commonly used in computing for quantities that cannot be
negative?
Whole numbers are used in computing for non-negative quantities because they are easy
to represent in binary.
Q.25 How does the number of bits affect the range of integer values?
The number of bits determines the range of integer values that can be represented. For
unsigned integers, the range is from 0 to 2n −1. For signed integers, the range is from
−2n−1 to 2n−1 −1. For example, the range for an 8-bit unsigned integer is 0 to 255, while
the range of a 16-bit unsigned integer is 0 to 65,535.
Q.26. Explain how a negative integer is represented in binary.
A negative integer is represented in binary using 2's complement method. In this method,
the most significant bit (MSB) is used as the sign bit, where 0 represents positive number
and 1 represents negative number.
Q.27 Differentiate between single precision and double precision. See Q.17.2
Q.28 How is the range of floating-point numbers calculated for single precision?
The range of floating-point numbers is calculated for single precision by the minimum
and maximum values of exponent. The values of exponent can range from -126 to +127.
The approximate range of values that can be represented in single precision is from 1.4 
10−45 to 3.4  1038.
Q.29 How is the exponent stored in double precision?
See Q.17.1, second paragraph of part (ii)
Q.30 Why is it important to understand the limitations of floating-point representation in
computing?
Understanding floating-point limitations is important because they can cause small
rounding errors that affect accuracy in calculations.
Unit :2  Number System 51

Q.31 Add the binary numbers: (1110111) 2 + (1001)2


Solve it with the help of Binary Addition examples in Q.18
Q.32 Solve the following:
(1010)2 - (0011)2
Solution:
1- Find 2’s complement of subtrahend (0011)2:
1100 1’s complement
1
1101 2’s complement
2- Add the minuend (1010)2 and the 2’s complement of the subtrahend.
1010
1101
10111
3- Discard the carry bit. The final result is:
0111
Q.33 Solve (1000)2 - (0110)2 Solve it with the help of above Q.32
Q.34 Solve (1110)2 - (0100)2 Solve it with the help of above Q.32
Q.35 What is the primary purpose of the ASCII encoding scheme?
The primary purpose of the ASCII encoding scheme is to represent data (text data) in
devices such as computers and similar electronic systems. ASCII encoding scheme
enables different computers and other devices to exchange text information.
Q.36 How does Unicode handle characters from different languages?
Unicode handles characters from different languages through different encoding formats
such as UTF-8, UTF-16, and UTF-32.

Multiple Choice Questions – MCQs


01) The base of the binary number system is:
(a) 2 (b) 8 (c) 10 (d) 16
0
02) The value of 10 is equivalent to:
(a) 0 (b) 1 (c) 10 (d) 2
03) The number of digits in an octal number system is:
(a) 2 (b) 8 (c) 10 (d) 16
04) The number of digits in a binary number system is:
(a) 2 (b) 8 (c) 10 (d) 16
05) The number of digits in a hexadecimal number system is:
(a) 2 (b) 8 (c) 10 (d) 16
06) In a hexadecimal number system, the value of E is:
(a) 5 (b) 12 (c) 14 (d) 16
07) The value of the hexadecimal digit A is:
(a) 65 (b) 10 (c) 11 (d) 15
52 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

08) What is the binary value of (10)10 ?


(a) (1010)2 (b) (0011)2 (c) (1100)2 (d) (01101)2
09) The decimal equivalent of (10)2 is:
(a) (3)10 (b) (2)10 (c) (10)10 (d) (1)10
10) The binary equivalent of (F)16 is:
(a) (1010)2 (b) (1110)2 (c) (0111)2 (d) (1111)2
11) The hexadecimal number (10)16 is equal to:
(a) (10)10 (b) (100)10 (c) (16)10 (d) All
12) bit stands for:
(a) Binary digit (b) Byte digit (c) Basic digit (d) Base digit
13) One bit is a/an:
(a) 1 or 2 (b) 0 or 1 (c) 2 or 3 (d) 0 or 2
14) A byte is equal to:
(a) 2 bits (b) 4 bits (c) 8 bits (d) 1024 bits
15) One Kilobyte (1KB) is equal to:
(a) 1024 bytes (b) 1000 bytes (c) 8 bytes (d) 1024 bits
16) One Petabyte (1PB) is equal to:
(a) 1024 KB (b) 1024 MB (c) 1024 TB (d) 1024 GB
17) One Yottabyte (1YB) is equal to:
(a) 1024 ZB (b) 1024 EB (c) 1024 PB (d) 1024 TB
18) Which of the following is not a binary number?
(a) 101 (b) 1001 (c) 1021 (d) 100
19) (1001)2 is equal to:
(a) (6)10 (b) (7)10 (c) (8)10 (d) (9)10
20) The range of a 1-byte unsigned whole number is:
(a) 0 to 127 (b) 0 to 255 (c) -128 to 127 (d) -255 to 255
21) The binary value of +19 in a 1-byte signed integer is:
(a) 11110011 (b) 00010011 (c) 10010011 (d) 11111111
22) The maximum value that can be represented in a 2-byte signed integer is:
(a) 4,294,967,295 (b) 127 (c) 32,767 (d) 65,535
23) Which part of a floating-point number represents the main value?
(a) Exponent (b) Mantissa (c) Base (d) Sign
24) How many bits does single precision (32-bit) use for the exponent?
(a) 23 bits (b) 1 bit (c) 8 bits (d) 52 bits
25) In single precision, how many bits are allocated for the mantissa?
(a) 1 (b) 23 (c) 8 (d) 52
26) The exponent range for single precision (32-bit) is:
(a) -1022 to +1023 (b) -126 to +127 (c) -128 to +128 (d) 0 to 255
27) In double-precision, how many bits (64-bit) are used for the exponent?
(a) 8 (b) 11 (c) 1 (d) 52
28) The bias value used in the exponent of double precision is:
(a) 127 (b) 1023 (c) 255 (d) 512
29) The result of binary adding 1 + 1 is:
Unit :2  Number System 53

(a) 1 (b) 0 (c) 10 (d) 11


30) (11)2 + (1)2 =
(a) (10)2 (b) (111)2 (c) (100)2 (d) (101)2
31) The result of dividing 1100₂ by 10₂ is:
(a) 111₂ (b) 1100₂ (c) 110₂ (d) 1000₂
32) How many characters can the standard ASCII scheme represent?
(a) 128 (b) 256 (c) 512 (d) 64
33) How many characters can Extended ASCII represent?
(a) 128 (b) 256 (c) 512 (d) 1024
34) Which encoding scheme uses variable-length size of characters, ranging from 1 to 4
bytes?
(a) Extended ASCII (b) UTF-16 (c) UTF-32 (d) UTF-8
35) Which of the following is the correct binary value for the letter 'A' in UTF-8?
(a) 01000001 (b) 01000000 (c) 00000001 (d) 10000001
36) The length of the encoding for the Urdu letter ‘‫ ’ب‬in UTF-8 is:
(a) 1 byte (b) 2 bytes (c) 3 bytes (d) 4 bytes
37) How many bytes are used in UTF-8 to represent the letter 'A'?
(a) 1 (b) 2 (c) 3 (d) 4
38) Which encoding scheme uses 2 bytes or 4 bytes per character?
(a) UTF-8 (b) UTF-16 (c) UTF-32 (d) ASCII
39) Which of the following is true about UTF-32?
(a) It uses 1 byte per character (b) It uses 2 bytes per character
(c) It uses 4 bytes per character (d) It is variable-length
40) Which encoding scheme is compatible with ASCII?
(a) UTF-8 (b) UTF-16 (c) UTF-32 (d) None
41) The range of values for each color of a pixel in RGB is:
(a) 0 to 128 (b) 0 to 255 (c) 0 to 1024 (d) 0 to 512
42) The frame rate commonly used in movies is:
(a) 60 fps (b) 24 fps (c) 30 fps (d) 15 fps
43) Which of the following is a widely used video file format?
(a) .txt (b) .jpg (c) .mp4 (d) .zip
44) Which video file format is known for high-quality video and multiple audio tracks
or subtitles?
(a) AVI (b) MKV (c) MP4 (d) MOV

Answers of MCQs
01 (a) 02 (b) 03 (b) 04 (a) 05 (d) 06 (c) 07 (b) 08 (a) 09 (b) 10 (d)
11 (c) 12 (a) 13 (b) 14 (c) 15 (a) 16 (c) 17 (a) 18 (c) 19 (d) 20 (b)
21 (b) 22 (c) 23 (b) 24 (c) 25 (b) 26 (b) 27 (b) 28 (b) 29 (c) 30 (c)
31 (c) 32 (a) 33 (b) 34 (d) 35 (a) 36 (b) 37 (a) 38 (b) 39 (c) 40 (a)
41 (b) 42 (b) 43 (c) 44 (b)
54 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

TEXTBOOK EXERCISE

Multiple Choice Questions (MCQs):


1. What does ASCII stand for?
(a) American Standard Code for Information Interchange
(b) Advanced Standard Code for Information Interchange
(c) American Standard Communication for Information Interchange
(d) Advanced Standard Communication for Information Interchange
2. Which of the following numbers is a valid binary number?
(a) 1101102 (b) 11011 (c) 110.11 (d) 1101A
3. How many bits are used in the standard ASCII encoding?
(a) 7 bits (b) 8 bits (c) 16 bits (d) 32 bits
4. Which of the following is a key advantage of Unicode over ASCII?
(a) It uses fewer bits per character.
(b) It can represent characters from many different languages.
(c) It is backward compatible with binary.
(d) It is specific to the English language.
5. How many bytes are used to store a typical integer?
(a) 1 byte (b) 2 bytes (c) 4 bytes (d) 8 bytes
6. What is the primary difference between signed and unsigned integers?
(a) Unsigned integers cannot be negative
(b) Signed integers have a larger range
(c) Unsigned integers are stored in floating-point format
(d) Signed integers are only used for positive numbers
7. In the single precision, how many bits are used for the exponent?
(a) 23 bits (b) 8 bits (c) 11 bits (d) 52 bits
8. What is the approximate range of values for single-precision floating-point
numbers?
(a) 1.4 x 10-45 to 3.4 x 1038 (b) 3.4 x 10-38 to 1.4 x 1045
-324 308
(c) 4.9 x 10 to 1.8 x 10 (d) 4.9 x 10-308 to 1.8 x 10324
9. What are the tiny dots that make up an image called?
(a) Pixels (b) Bits (c) Bytes (d) Nodes
10. In an RGB color model, what does RGB stand for?
(a) Red, Green, Blue (b) Red, Gray, Black
(c) Right Green, Blue (d) Red, Green, Brown
Answers
01 (a) 02 (b) 03 (a) 04 (b) 05 (c) 06 (a) 07 (b) 08 (a) 09 (a) 10 (a)
Unit :2  Number System 55

Short Questions:
1. What is the primary purpose of the ASCII encoding scheme?
See Q.35 in short answers to the questions.
2. Explain the difference between ASCII and Unicode. See Q.23
3. How does Unicode handle characters from different languages?
See Q.36 in short answers to the questions.
4. What is the range of values for an unsigned 2-byte integer?
See Q.21 in short answers to the questions.
5. Explain how a negative integer is represented in binary.
See Q.15, second paragraph
6. What is the benefit of using unsigned integers?
See Q.23 in short answers to the questions.
7. How does the number of bits affect the range of integer values?
See Q.25 in short answers to the questions.
8. Why are whole numbers commonly used in computing for quantities that cannot be
negative?
See Q.24 in short answers to the questions.
9. How is the range of floating-point numbers calculated for single precision?
See Q.28 in short answers to the questions.
10. Why is it important to understand the limitations of floating-point representation in
scientific computing?
See Q.30 in short answers to the questions.

Long Questions:
1. Explain how characters are encoded using Unicode. Provide examples of characters
from different languages and their corresponding Unicode code points.
See Q.22
2. Describe in detail how integers are stored in computer memory.
See Q.15
3. Explain the process of converting a decimal integer to its binary representation and
vice versa. Include examples of both positive and negative integers.
See Q.5 to Q.7
4. Perform the following binary arithmetic operations:
a. Multiplication of 101 by 11. See answer in an example of Q.18
b. Division of 1100 by 10. See answer in an example of Q.18
5. Add the following binary numbers:
a) 101
+ 110
b) 1100
+ 1011
See answers in examples of Q.18
6. Convert the following numbers to 4-bit binary and add them:
56 PM Series  COMPUTER SCIENCE & ENTREPRENEURSHIP for 9th Class

(a) 7 + (-4)
(b) -5+3
Solution (a):
Convert the decimal numbers 7 and −4 to 4-bit binary numbers, and then add them.
• The decimal number 7 in binary is equal to (0111)2.
• The decimal number -4 is negative, it will be converted to 4-bit binary form as:
o The positive number 4 in binary is equal to (0100)2.
o To represent negative number, we use 2's complement method. The procedure to
represent -4 in binary form, follow these steps:
i) Invert the bits of 0100 (binary value of 4), which gives 1011.
ii) Add 1 to the result: 1011 + 1 = 1100.
o So, −4 in 4-bit binary is 1100.
• Now, add 0111(binary value of 7) and 1100 (binary value of −4):
0111 (7)
+1100 (-4)
10011
Discard the last carry bit, and the result is 0011
• The sum of 7 and −4 in 4-bit binary is 0011, which is 3 in decimal.

Solution (b):
Convert the decimal numbers -5 and 3 to 4-bit binary numbers, and then add them.
• The decimal number -5 is negative, it will be converted to 4-bit binary form as:
o The positive number 5 in binary is equal to (0101)2.
o To represent negative number, we use 2's complement method. The procedure to
represent -5 in binary form, follow these steps:
i) Invert the bits of 0101, which gives 1010.
ii) Add 1 to the result: 1010 + 1 = 1011.
o So, −5 in 4-bit binary is 1011.
• The binary representation of 3 in 4-bit is 0011.
• Now, add 1011 (binary value of -5) and 0011 (binary value of 3):
1011 (-7)
+0011 (3)
1110
The result is 1110.
• The sum of -5 and 3 in 4-bit binary is 1110, which is -2 in decimal.

7. Solve the following:


(a) 11012 - 01002
(b) 10102- 00112
(c) 10002- 01102
(d) 11102- 1002
Solve all parts of this question with help of Example of Binary Subtraction given in Q.18

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy