0% found this document useful (0 votes)
2 views

Biostatistics(computer arithmetic)

The document discusses the manipulation of data in digital computers using arithmetic operations such as addition, subtraction, multiplication, and division. It explains the role of the arithmetic processing unit in executing these operations and provides algorithms for binary addition and subtraction with examples. The document emphasizes the importance of algorithms in solving computational problems through well-defined steps.

Uploaded by

ujjwaltyagi2051
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)
2 views

Biostatistics(computer arithmetic)

The document discusses the manipulation of data in digital computers using arithmetic operations such as addition, subtraction, multiplication, and division. It explains the role of the arithmetic processing unit in executing these operations and provides algorithms for binary addition and subtraction with examples. The document emphasizes the importance of algorithms in solving computational problems through well-defined steps.

Uploaded by

ujjwaltyagi2051
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/ 6

Introduction:

Data is manipulated by using the arithmetic instructions


in digital computers. Data is manipulated to produce results
necessary to give solution for the computation problems. The
Addition, subtraction, multiplication and division are the four
basic arithmetic operations. All other operations can be derive by
using these four operations.

: Deepa Anwar
• To execute arithmetic operations there is a separate section
called arithmetic processing unit in central processing unit.
The arithmetic instructions are performed generally on binary
or decimal data. Fixed-point numbers are used to represent
integers or fractions

• Fixed-point addition is the simplest arithmetic operation.

• If we want to solve a problem then we use a sequence of well-


defined steps. These steps are collectively called algorithm. To
solve various problems we give algorithms.

• In order to solve the computational problems, arithmetic


instructions are used in digital computers that manipulate
data. These instructions perform arithmetic calculations.

: Deepa Anwar
Addition and Subtraction :

The algorithms for addition and subtraction are derived from the
table and can be stated as follows (the words parentheses should be
used for the subtraction algorithm)

: Deepa Anwar
Here are some examples of binary addition.

• 10001 + 11101 = 101110: • 101101 + 11001 = 1000110: • 1011001 + 111010 = 10010011:

1 1 1 1 1 1 1 1 1 1
1 0 0 0 1 1 0 1 1 0 1 1 0 1 1 0 0 1
+ 1 1 1 0 1 + 1 1 0 0 1 + 1 1 1 0 1 0
1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 0 1 0 0 1 1

• 1110 + 1111 = 11101: • 10111 + 110101 = 1001100: • 11011 + 1001010 = 1100101:


1 1 1
1 1 1 1 1 1 1 1
1 1 0 1 1
1 1 1 0 1 0 1 1 1
+ 1 0 0 1 0 1 0
+ 1 1 1 1 + 1 1 0 1 0 1
1 1 0 0 1 0 1
1 1 1 0 1 1 0 0 1 1 0 0
: Deepa Anwar
Binary Subtraction :-

Work the columns right to left subtracting in each


column. If you must subtract a one from a zero, you need to
“borrow” from the left, just as in decimal subtraction.

: Deepa Anwar
Here are some examples of binary subtraction.
• 1011011 − 10010 = 1001001: • 1010110 − 101010 = 101100: • 1000101 − 101100 = 11001:

0 0 0 1 1
× 1 × 1 × ×
1 0 1 1 0 1 1 1 1 0 × 1
1 0 1 0 1 1 1 0 1
1 0
− 1 0 0 1 0 − 1 0 1 0 1 0 0 0
1 0 0 1 0 0 1 1 0 1 1 0 0 − 1 0 1 1 0 0
1 1 0 0 1
• 100010110 − 1111010 = 10011100: • 101101 − 100111 = 110:
1
0 1 1 1 1
0 0
0
× × ×
× × 1 × × 1
1 1 1 1 1 0 1 0 1
1 1 0 1 1 0
0 0 0
− 1 0 0 1 1 1
− 1 1 1 1 0 1 0
1 1 0
1 0 0 1 1 1 0 0
: Deepa Anwar

You might also like