Digital Principles and Computer Organization: Chapter 1: Fundamentals of Digital Systems and Arithmetic

Integer Arithmetic

1. Addition of Signed Numbers 2. Subtraction of Signed Numbers, 3. Binary Multiplication, 3. Binary Division

Integer Arithmetic


1. Addition and Subtraction of Signed Numbers

• We can relate addition and subtraction operations of numbers by the following relationship :

(A) – (+B) = (A) + (–B) and

(A) − (−B) = ( A) + (+B)

• Therefore, we can change subtraction operation to an addition operation by changing the sign of the subtrahend.

1. Binary Addition

• The addition consists of four possible elementary operations, as shown in Table 1.5.1.


• The first three operations produce a sum whose length is one digit, but when the last operation is performed sum is two digits.

• The higher significant bit of this result is called a carry and lower significant bit is called sum.

• Such a operation is known as half addition.

• The operation which performs addition of three bits (two significant bits and a previous carry) is called a full addition.

• Table 1.5.2 shows the truth table for full addition.


Addition method

1. Add bits column–wise starting from LSB with carry if any.

2. Put the sum at the bottom of the same column.

3. Put the carry, if any, on the top of next column.

Example: 1

Perform addition of (11001100)2 and (11011010)2.

Solution :


In the above example, we have seen the addition of two unsigned binary numbers. In case of the signed numbers, we have to consider the sign of the number and we may require sign extension to avoid possible overflow.

Example: 2

Add (28)10 and (15)10 by converting them into binary.

Solution :

Using decimal to binary conversion technique discussed in section 1.3.8 we have,


(28)10 =  (011100)2 and (15)10 = (01111)2

2. Binary Subtraction

• The subtraction consists of four possible elementary operations, as shown in Table 1.5.3.


• In all operations, each subtrahend bit is subtracted from the minuend bit. In case of second operation the minuend bit is smaller than the subtrahend bit, hence 1 is borrowed.

Subtraction method

1. Subtract bits column–wise starting from LSB with borrow if any.

2. Put the difference at the bottom of the same column.

3. Take the borrow, if required from the next column.

Example: 3

Perform (11101100)2 −(00110010)2

Solution :


Note : (10)2 – (1)2 = (1)2

• However, the subtraction technique we have just seen is difficult to implement in a computer. Thus, computer uses 2's complement representation to implement negative number.

3. Binary Subtraction using 1's Complement Method

• In a 1's complement subtraction, negative number is represented in the 1's complement form and actual addition is performed to get the desired result.

• For example, operation A – B is performed using following steps:

1. Take 1's complement of B.

2. Result← A + 1's complement of B.

3. If carry is generated then the result is positive and in the true form. Add carry to the result to get the final result.

4. If carry is not generated then the result is negative and in the 1's complement form.

Example: 4

Perform subtraction using 1's complement (11010)2– (10000)2.

Solution:


Example: 5

Perform (15)10 – (28)10 using 1's complement representation.

Solution :

(15) 10 = (01111)2

(28) 10 = (11100)2


4. Binary Subtraction using 2's Complement Method

• In a 2's complement subtraction, negative number is represented in the 2's complement form and actual addition is performed to get the desired result.

•  For example, operation A – B is performed using following steps :

1. Take 2's complement of B.

2. Result ← A + 2's complement of B.

3. If carry is generated then the result is positive and in the true form. In this case, carry is ignored.

4. If carry is not generated then the result is negative and in the 2's complement form.

Example: 6

Perform (147–89) using 2's complement binary arithmetic.

Solution :


Example: 7

Using 2's complement perform (42)10 – (68)10.

Solution :

Step 1 :

Convert (42)10 to its binary equivalent.

(42)10 =  (101010)2

Step 2 :

Convert 6810 to its binary equivalent.

6810 = (1000100)2

Step 3 :

Find 2's complement of 68.


Step 4 :

Add (1 0 1 0 1 0)2 and

(0 1 1 1 1 0 0)2


Step 5 :

Find 2's complement of (1100110)2.

Since we have taken 2's complement result is (–26)10.

Since we have subtracted larger number from smaller number result is negative and hence it is necessary to take 2's complement of this result.


 

2. Binary Multiplication

• The multiplication process for binary numbers is similar to the decimal numbers.

• Actually binary multiplication is simple than decimal multiplication since it involves only 1s and 0s.

• Table 1.5.4 shows rules for binary multiplication


Example: 8

Multiply (101.11)2 and (110.01)2 using binary multiplication method.

Solution:


Fractional digits in the final product = Fractional digits in multiplicand + Fractional  digits in multiplier = 2 + 2 = 4

(101.11)2 × (110.01)2 = (100011.1111)2

 

3. Binary Division

• The division process for binary numbers is similar to the decimal numbers.

• In binary division, division by 0 has no meaning.

• Table 1.5.5 shows the rules for binary division


Example: 9

Divide 110110112 by 1102.

Solution :


 

Review Questions

1. Illustrate the rules for binary addition and subtraction using 2's complement arithmetic. Give examples.

2. State the rules for binary multiplication.

3. State the rules for binary division.

 

Digital Principles and Computer Organization: Chapter 1: Fundamentals of Digital Systems and Arithmetic : Tag: Digital, Computer : - Integer Arithmetic


Digital Principles and Computer Organization: Chapter 1: Fundamentals of Digital Systems and Arithmetic



Under Subject


Digital Principles and Computer Organization

CS25C06 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation



Related Subjects


English Essentials II

EN25C02 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation



Linear Algebra

MA25C02 2nd Semester | 2025 Regulation


Applied Physics (CSIE) II

PH25C03 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Digital Principles and Computer Organization

CS25C06 2nd Semester AIDS, CSE, IT, CSE(CY) Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Basic Electrical and Electronics Engineering

EE25C01 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation


Python for Data Science

AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation


Re-Engineering for Innovation

ME25C05 2nd Semester | 2025 Regulation | 2nd Semester 2025 Regulation


Python for Data Science - Laboratory

AD25201 2nd Semester AIDS Dept | 2025 Regulation | 2nd Semester 2025 Regulation