Arithmetic Operations in Digital Circuits

In this tutorial, you will learn the basics of arithmetic operators, including their types, roles in digital circuits, and rules for performing binary arithmetic. You will also explore key operations like addition, subtraction, multiplication, and division in binary and octal systems. Additionally, you will understand the differences between arithmetic, logical, and assignment operators, and learn how computers use basic division algorithms to perform operations efficiently.

Contents:

  1. Introduction to Arithmetic Operators
  2. Importance of Arithmetic Operations in Digital Circuits
  3. Binary Addition of Two Numbers
  4. Binary Subtraction of Two Numbers
  5. Steps to Perform Binary Multiplication
  6. Binary Division
  7. Addition of Two Octal Numbers
  8. Rules of Binary Division and Similarities to Decimal Divisions
  9. Basic Division Algorithms Used in Computers
  10. Properties of Addition and Multiplication
  11. Steps to Perform Addition of BCD Numbers
  12. Arithmetic Vs Logical Vs Assignment Operators

Introduction to Arithmetic Operators

Arithmetic operators are essential tools in digital circuits and computer systems, enabling various mathematical operations. These operators play a key role in basic arithmetic tasks such as addition, subtraction, multiplication, and division. Let’s explore these operators in detail:

  • Addition Operator (+): This operator performs the addition of two or more numbers. It can be applied across any number system. For instance, in the decimal system, 10 + 13 equals 23.
  • Subtraction Operator (-): Subtraction allows us to subtract one number from another. Like addition, this operation is valid in any number system. For example, 13 – 10 equals 3 in decimal.
  • Multiplication Operator (×): The multiplication operator is used to multiply numbers. It is applicable to all number systems. For example, 10 × 13 equals 130 in the decimal system.
  • Division Operator (÷): This operator divides one number by another. In the decimal system, 24 ÷ 12 equals 2.

Importance of Arithmetic Operations in Digital Circuits

Arithmetic operations are fundamental in digital circuits for several reasons:

  • Foundation of Mathematics: Arithmetic operations are core to mathematical computations and form the basis of any calculation.
  • Core of ALU (Arithmetic Logic Unit): The ALU, which is the heart of microprocessors, performs all arithmetic operations. Without the ALU, modern computers would be non-functional.
  • Everyday Use: Arithmetic operations are common in daily life, with addition being the most frequently used operation that connects other operations together.
advertisement

Binary Addition of Two Numbers

Binary addition follows simple rules that are similar to decimal addition, with four possible bit combinations:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 0 = 1
  • 1 + 1 = 10 (which is 2 in decimal, with 0 as the sum and 1 as the carry)

For example, the binary addition of (1001)2 and (0101)2 is:

Binary Addition of Two Numbers

Binary Subtraction of Two Numbers

Free 30-Day C Certification Bootcamp is Live. Join Now!

Binary subtraction follows simple rules that are similar to decimal subtraction, with four possible bit combinations:

  • 0 – 0 = 0
  • 0 – 1 = 1 (with a borrow from the next higher bit)
  • 1 – 0 = 1
  • 1 – 1 = 0

Example:

For instance, (1001)2 – (101)2 yields:

Binary Subtraction of Two Numbers

Steps to Perform Binary Multiplication

Binary multiplication follows a method similar to decimal multiplication, but it is simplified due to the binary system only using two digits: 0 and 1. The process involves basic multiplication, shifting, and addition. Below are the steps for performing binary multiplication:

  • Understand Basic Multiplication Rules: In binary, there are only four possible combinations for multiplication:
    • 0 × 0 = 0
    • 0 × 1 = 0
    • 1 × 0 = 0
    • 1 × 1 = 1

    These rules are applied for multiplying individual bits.

  • Multiply, Shift, and Add: Begin by multiplying the least significant bit (LSB) of the multiplier with the multiplicand. This is a straightforward bitwise multiplication, with no borrow or carry involved.
  • Shift the Product: After each multiplication, shift the result of the product one bit to the left for the next bit of the multiplier. This shifting aligns the partial product for proper addition.
  • Repeat for Each Bit of the Multiplier: Continue multiplying each successive bit of the multiplier (from LSB to most significant bit or MSB), shifting the result one bit to the left after each step. For the Nth bit of the multiplier, shift the product by (N-1) bits to the left before adding it to the previously calculated product.
  • Add the Partial Products: After all the individual bit multiplications are completed and shifted accordingly, sum all the partial products together using binary addition rules. This will give the final binary product.

Example: Multiplying (1001)2 by (101)2
Let’s walk through an example to clarify the steps:

Multiplying 10012 (9 in decimal) by 1012 (5 in decimal):

Steps to Perform Binary Multiplication

Binary Division

Binary division follows the same process as decimal division, using four steps: divide, multiply, subtract, and bring down. The main valid operations in binary division are:

  • 1 ÷ 1 = 1
  • 0 ÷ 1 = 0
advertisement

Dividing by zero is invalid, as in decimal arithmetic.

Addition of Two Octal Numbers

Octal addition of two numbers can be explained by the given points.

  • It contains digits from 0 to 7 as its base is 8. So, if any digit sum is greater than 7 then corresponding carry bit is generated by converting the digit sum into its octal equivalent.
  • 1 + 7 in octal is 8 but it is greater than 7. 8 in octal is 10. So, 0 is the sum and 1 is the carry for the next digit addition.
  • For example, addition of (1321)8 + (107)8 = (1430)8
    Addition of Two Octal Numbers

Rules of Binary Division and Similarities to Decimal Divisions

The rules of binary division are:

  • It has only two valid bit division operations. First rule is 1 ÷ 1 = 1 and another is 0 ÷ 1 = 0. These are quite similar to decimal division rules where if any number is divided by 1 it results the same number.
  • 1 ÷ 0 and 0 ÷ 0 are the invalid bit division operations because division by zero is not possible. Even in decimal number system, division by zero is not a valid operation.
  • It follows the four steps of division similar to decimal number system. Divide, multiply, subtract and bring down.

Basic Division Algorithms Used in Computers

There are two basic division algorithms used in computers. They are slow division and fast division.

Slow Division:

  • In this algorithm initially divisor is subtracted from dividend. The result of the subtraction is compared with the divisor. If it is larger then again divisor is subtracted from it. This process is repeatedly done until the divisor is larger than the result of the subtraction.
  • The total number of subtraction in this process will represent the quotient value and the last result of subtraction will be the remainder.
  • For example, to perform division of 21 ÷ 5 by slow division method:
    21 – 5 = 16 and 16 > 5
    16 – 5 = 11 and 11 > 5
    11 – 5 = 6 and 6 > 5
    6 – 5 = 1 and 1 < 5
    Total number of subtraction operation performed = 4. So, quotient is 4 and result of last subtraction is 1 so, remainder is 1.

Fast Division:

  • This division process uses binary multiplication with addition operation. In this process a fractional number is multiplied with the dividend and the divisor in such a way that the divisor becomes 1, then automatically the dividend part will be the quotient.
  • Dividend × F → Quotient
    Divisor × F → 1
    F is the appropriate fractional number needed to perform this operation. This process is faster than slow division process.

Properties of Addition and Multiplication

The properties of addition and multiplication operations are listed below:

  • Commutative Property: It states that interchanging the positions of operands doesn’t change the result i.e.,
    X + Y = Y + X and X × Y = Y × X
  • Associative Property: It states that grouping of operands to perform an operation of two or more operands doesn’t affect the result.
    X + (Y + Z) = (X + Y) + Z and (X × Y) × Z = Y × (X × Z)
  • Distributive Property: It states that if an operand is multiplied with a sum of two or more operands in parenthesis then it is similar to multiplying each of the operands by the multiplier operand without parenthesis and summing them.
    (X + Y) × Z = X × Y + X × Z
  • Inverse Property: It contains additive and multiplicative inverse. Additive inverse of an element X is the element which produces 0 when added with X. Multiplicative inverse of an element Y is the element which produces 1 when multiplied with Y.
    X + (- X) = 0 and Y × (1/Y) = 1
  • Additive inverse of X is (- X) and multiplicative inverse of Y is (1/Y).
  • Identity Property: Additive identity of an element X is the element which doesn’t change the value of X when added with X. Multiplicative identity of an element Y is the element which doesn’t change the value of Y when multiplied with Y.
    X + 0 = X and Y × 1 = Y
  • Identity element for addition is 0 and identity element for multiplication is 1.

Steps to Perform Addition of BCD Numbers

The following steps should be used to perform addition of BCD numbers:

  • Initially, add BCD numbers similar to addition of two pure binary numbers. Then compare the resultant with 1001 (decimal value 9). If the resultant is equal or less than 1001 then it will be a valid BCD resultant.
  • If the resultant is greater than 1001 or there is a carry bit out of MSB, then it is an invalid BCD number. For this add 0110 (decimal value 6) to the resultant. This operation will change it to a valid BCD number.
  • For carry bit out of MSB, it is added to the next 4-bit BCD number. These steps are repeatedly followed for each group of BCD bits till MSB is reached. All valid BCD numbers together will represent the final resultant of the addition.

Arithmetic Vs Logical Vs Assignment Operators

The differences among arithmetic, logical and assignment operators are explained below:

  • Arithmetic operators are mainly used to perform mathematical calculations on numbers whereas logical operators are used to compare the values.
  • Whenever an arithmetic operation is performed on two or more numbers using arithmetic operators, it produces a new number as a result. A logical operation using logical operators never produces a new number as a result.
  • Commonly used arithmetic operators are ‘+’, ‘-‘,’×’, ‘÷’ and commonly used logical operators are ‘>’, ‘<’. 9 + 8 arithmetic operation results a new number ‘17’ and 9 > 8 logical operation returns “true” because 9 is always greater than 8.
  • Assignment operators are used to assign values to a variable whereas arithmetic operators are used to calculate values. They basically use ‘ =’ sign for their operations. For example X= 9, here 9 is being assigned to the variable X.

Key Points to Remember

Here is the list of key points we need to remember about “Arithmetic Operations in Digital Circuits”.

  • Basic arithmetic operators include addition, subtraction, multiplication, and division, and they can be applied across various number systems such as binary, octal, and decimal.
  • Binary arithmetic operations follow straightforward rules, using only the digits 0 and 1, with specific conditions for carrying in addition and borrowing in subtraction.
  • Arithmetic operations are crucial in digital circuits, especially within the Arithmetic Logic Unit (ALU), which handles all mathematical computations in microprocessors.
  • When performing BCD addition, results exceeding 1001 (9 in decimal) must be corrected by adding 0110 (6 in decimal) to ensure valid BCD numbers.
  • Arithmetic operators calculate numerical results, logical operators compare values without creating new numbers, and assignment operators assign values to variables using symbols like “=”.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
I’m Manish - Founder and CTO at Sanfoundry. I’ve been working in tech for over 25 years, with deep focus on Linux kernel, SAN technologies, Advanced C, Full Stack and Scalable website designs.

You can connect with me on LinkedIn, watch my Youtube Masterclasses, or join my Telegram tech discussions.

If you’re in your 40s–60s and exploring new directions in your career, I also offer mentoring. Learn more here.