Paper DSC 103: FUNDAMENTALS OF INFORMATION TECHNOLOGY
UNIT -II:
COMPUTER ARITHMETIC & STORAGE
FUNDAMENTALS
Number
System
The
language we use to communicate with each other is comprised of words and
characters. We understand numbers, characters and words. But this type of data
is not suitable for computers. Computers only understand the numbers.
When
we enter data, the data is converted into electronic pulse. Each pulse is
identified as code and the code is converted into numeric format by ASCII. It
gives each number, character and symbol a numeric value (number) that a
computer understands. So to understand the language of computers, one must be
familiar with the number systems.
Q1)What are the different number systems available
in computer Environment ?Explain in detail?(VIMP)
Ans: Number systems are two types –
non-positional and positional
NON
POSITIONAL NUMBER SYSTEM
In early days, human beings counted on fingers. When counting beyond ten fingers, they used stones , pebbles, or sticks to indicate values. This method of a counting uses an additive approach or non-positional number system. In this system, we have symbols such as I for 1, II for 2, III for 3, IIII for 4, IIIII for 5, etc. Each symbol represents the same value regardless of its position in a number, and to find the value of a number, one has to count the number of symbols present in the number.
POSITIONAL
NUMBER SYSTEM
In
a positional number system, there are only a few symbols called digits. These symbols
represent different values, depending on the position they occupy in a number.
The
value of each digit in such a number is determined by three considerations.
1.
The digit itself,
2.
The position of the digit in the number, and
3.
The base of the number system (where base is defined as the total number of
digits available in the number system).
In our day-to-day life, we use decimal number system. In this system, base is equal to 10 because there are altogether ten symbols or digit (0,1,2,3,4,5,6,7,8, and 9).
The
Number Systems used in computers are:
(a)
Binary
number system
(b)
Octal
number system
(c)
Decimal
number system
(d) Hexadecimal number system
Binary
Number System
·
A
positional number system
·
Has
only 2 symbols or digits (0 and 1). Hence its base = 2
·
The
maximum value of a single digit is 1 (one less than the value of the base)
·
Each
position of a digit represents a specific power of the base (2)
·
This
number system is used in computers
Hence,
in this system, the rightmost position is units (20) position, the
second position from the rights 2’s (21) position, and proceeding in
this way, we have 4’s (22) position, 8’s (23) position,
16’s (24) position, and so on.
Therefore, decimal equivalent of binary number 10101 (written as 10101 ) is :
(1
x 24) + (0 x 23) + (1 x 22) + (0 x 21)
+ (1 x 20)
=
16 + 0 + 4 + 0 + 1
=
21
In
order to be specific about which system we are referring to, it is a common practice
to indicate the base as a subscript. Hence, we write”
101012=2110
Octal
number system
·
A
positional number system
·
Has
total 8 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7). Hence, its base = 8
·
The
maximum value of a single digit is 7 (one less than the value of the base)
·
Each
position of a digit represents a specific power of the base (8)
·
Since
there are only 8 digits, 3 bits (23 = 8) are sufficient to represent
any octal number in binary
Example
20578
= (2 x 83) + (0 x 82) + (5 x 81) + (7 x 80)
= 1024 + 0 + 40 +
7
= 107110
Hexadecimal
Number System
·
A
positional number system
·
Has
total 16 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F).
Hence its base = 16
·
The
symbols A, B, C, D, E and F represent the decimal values 10, 11, 12, 13, 14 and
15 respectively
·
The
maximum value of a single digit is 15 (one less than the value of the base)
·
Each
position of a digit represents a specific power of the base (16)
· Since there are only 16 digits, 4 bits (24 = 16) are sufficient to represent any hexadecimal number in Binary
Example
1AF16
= (1 x 162) + (A x 161) + (F x 160)
=
1 x 256 + 10 x 16 + 15 x 1
=
256 + 160 + 15
= 43110
Decimal
number system
· A
positional number system
· Has
10 symbols or digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). Hence, its base = 10
·The
maximum value of a single digit is 9 (one less than the value of the base)
· Each
position of a digit represents a specific power of the base (10)
· We
use this number system in our day-to-day Life
Example
258610
= (2 x 103) + (5 x 102) + (8 x 101) + (6 x 100)
=
2000 + 500 + 80 + 6
=2586
---O---
Converting from one number
system to another
2.Explain in detail conversion of one number system
to another number system?(VIMP)?
Ans: Converting from Decimal to Another Base
The
Following steps are used to convert a 10 (decimal) number to a number in another base.
Division-Remainder
Method
Step
1 : Divide the decimal number by the value of the new base.
Step
2 : Record the remainder from Step 1 as the rightmost digit (least significant
digit) of the new base number.
Step
3 : Divide the quotient of the previous division by the new base.
Step
4: Record the remainder from Step 3 as the next digit (to the left) of the new number.
Repeat Steps 3
and 4, recording remainders from right to left, until the quotient becomes zero
in Step 3. Note that the last remainder, thus obtained, will be most
significant digit(MSD) of the new base
number.
The remainders are to be read from bottom to top to obtain the binary equivalent.
Other
Base System to Decimal
The
following steps are used to convert a number in any other base to a base 10 (decimal)
number.
Step
1 : Determine the column (positional) value of each digit (this depends on the position
of the digit and the base of the number system).
Step
2 : Multiply the obtained column values (in Step 1) by the digits in the corresponding
columns.
Step
3 : Sum up the products calculated in Step 2. The total is the equivalent value
in decimal.
Example Convert Binary to Decimal
Other
Base System to Non-Decimal(Converting from a Base Other than 10 to Another Base
Other Than 10)
The
following steps are used to convert a number in a base other than 10, to a
number in another base than 10:
Step 1 : Convert the original number to
a base 10 (decimal) number.
Step 2 : Convert
the decimal number obtained in Step 1 to the new base number.
Shortcut
method - Binary to Octal
The
following steps are used in this method:
Step
1 : Divide the binary digits into groups of three ( starting from the right).
Step
2 : Convert each group of three binary digits to one octal digit. Since there
are only 8 digits (0 to 7) in octal number system , 3 bits (23 = 8)
are sufficient to represent any octal number in binary. Moreover, since decimal
digits 0 to 7 are equal to the octal digits 0 to 7, we use binary to decimal
conversion method in this step.
Shortcut method - Octal to Binary
The
following steps are used in this method :
Step
1 : Convert each octal digit to a 3 digit binary number (the octal digits may
be treated as a decimal numbers for this conversion).
Step
2 : Combine all the resulting binary groups (of 3 digits each) into a single binary
number.
Shortcut
method - Binary to Hexadecimal
The
following steps are used in this method:
Step
1 : Divide the binary digits into groups of four (starting from the right).
Step
2 : Convert each group of four binary digits to one hexadecimal digit. Remember
that hexadecimal digits 0 to 9 are equal to decimal digits 0 to 9 and
hexadecimal digits A to F are equal to decimal values 10 to 15. Hence, for this
step, we use binary to decimal conversion procedure and represent decimal
values 10 to 15 as hexadecimal A to F
Shortcut
method - Hexadecimal to Binary
The
following steps are used in this method:
Step
1: Convert the decimal equivalent of each hexadecimal digit to a 4 digit binary
number
Step
2: Combine all the resulting binary groups (of 4 digits each) in a single
binary number
Binary Arithmetic
q.3) Explain the binary arithmetic
system?(VIMP)
Ans: The arithmetic operations—addition,
subtraction, multiplication and division, performed on the binary numbers is
called binary arithmetic. In computer, the basic arithmetic operations performed
on the binary numbers is—
·
Binary
addition
·
Binary
subtraction.
·
Binary
multiplication
· Binary division
Binary
Addition
Binary
addition involves addition of two or more binary numbers. The binary addition
rules are used while performing the binary addition. Table shows the binary addition rules
0
+ 0 = 0
0
+ 1 = 1
1
+ 0 = 1
1
+ 1 = 0 plus a carry of 1 to next higher column
Example
1:
Add binary numbers 1010 and 0101 in binary form
Binary Subtraction
Binary
subtraction involves subtracting of two binary numbers. The binary subtraction
rules are used while performing the binary subtraction. The binary subtraction
rules are shown in Table
0
- 0 = 0
0
- 1 = 1 with a borrow from the next column
1
- 0 = 1
1
- 1 = 0
Example: Subtract binary numbers 0101 from 1010 in binary form
Binary
multiplication
Table
for binary multiplication is as follows:
0
x 0 = 0
0
x 1 = 0
1
x 0 = 0
1
x 1 = 1
Example
Multiply
the binary numbers 1010 and 101
Binary division
Table
for binary division is as follows:
0 ÷ 0 = Divide by zero error
0 ÷ 1 = 0
1 ÷ 0 = Divide by zero error
1 ÷ 1 = 1
As
in the decimal number system (or in any other number system), division by zero
is meaningless
The
computer deals with this problem by raising an error condition called ‘Divide
by zero’ error.
1.
Start from the left of the dividend
2.
Perform a series of subtractions in which the divisor is subtracted from the
dividend
3.
If subtraction is possible, put a 1 in the quotient and subtract the divisor from
the corresponding digits of dividend
4.
If subtraction is not possible (divisor greater than remainder), record a 0 in
the quotient
5.
Bring down the next digit to add to the remainder digits. Proceed as before in
a manner similar to long division
Example: Divide 1010 by
101
---O---
Primary Vs Secondary
Storage
Q4)Explain differences between primary and secondary
storage?(VIMP)
Ans: Storage Unit(Memory):
A
storage unit is that part of the computer system which is used to store the
data and instructions to be processed.
There are two types of storage:
Differences
between primary memory and secondary memory
|
|
||
The memory which is directly
accessible by the CPU for storing and retrieving information is known as
primary memory. |
The memory that is not directly
accessible by the CPU is known as secondary memory. |
||
A computer cannot work without a
primary memory. |
A computer can work without a
secondary memory. |
||
It is also known as main memory. |
It is also known as auxiliary memory or backup memory. |
||
It is internal to CPU. |
It is external to CPU. |
||
It basically stores programs and
data which are currently in use. |
It can store huge amount of data.
|
||
It is
connected to computer through “slots”. It is
classified as volatile (RAM) and non-volatile (ROM) memories. |
It is connected to computer through cables. It is always non-volatile memory. |
||
It acts as the
working memory of computer. |
|
||
|
It holds data even on power failure or system crash. |
||
It is faster than secondary
memory. |
It is slower than primary memory.
|
||
It is expensive. |
It is cheaper. |
||
Examples of primary memory are RAM and ROM. |
Examples of secondary memory are hard disk, CD-ROM, DVD etc. |
https://degreecsa.blogspot.com
No comments:
Post a Comment