8 Bits BCD Adder Subtractor Circuit

Maram N. Moustafa
6 min readFeb 8, 2024

--

Introduction

In the field of digital circuits and computer architecture, adder and subtractor circuits play a pivotal role in performing fundamental arithmetic operations. One of the simplest yet essential components in this domain is the 4-bit adder and subtractor circuit; designed to perform basic addition and subtraction operations on binary numbers with a length of four bits. Each bit represents a binary digit (0 or 1), allowing for the processing of numbers from 0 to 15.

As we dive into more complex computations and larger data sets, the transition from a 4-bit to an 8-bit adder and subtractor circuit introduces new challenges. The increase in bit length exponentially expands the number of possible combinations and introduces complexities in signal propagation, circuit design, and computational efficiency.

While microprocessors offer a convenient solution for complex computations, this article takes a hands-on approach by steering clear of microprocessor usage. Instead, we will delve into the world of direct circuit design to create an 8-bit adder-subtractor, uncovering the fundamental principles that drive digital computation.

Problems

Here are some problems while encountering the circuit;

• Circuit design complexity:
An 8-bit adder-subtractor involves complex logic operations. It requires the design of a full adder, a 4-bit ripple-carry adder, an 8-bit ripple-carry adder, and finally, the combination of these elements into an 8-bit adder-subtractor. Each of these components adds to the complexity of the overall design[1]. It involves handling binary arithmetic operations, which can be complex to implement. The circuit needs to correctly handle both addition and subtraction operations, and manage carry/borrow propagation across the bits[2].

• Handling overflow and underflow:
When adding or subtracting, the result may exceed the range that can be represented in 8 bits. This overflow or underflow condition needs to be detected and handled appropriately.

• Two’s complement representation:
To perform subtraction, numbers are often represented in two’s complement form. This requires additional logic to convert between positive and negative representations.

Solution and Conclusion

During my pursuit of a methodology for constructing this circuit, I encountered the realization that addition of signed BCD numbers can be performed by using 9’s or 10’s complement methods. A negative BCD number can be expressed by taking the 9’s or 10’s complement. I have got this information from the eeeguide.com article[3]. Nevertheless 10s complement is a method used in mathematics and computer science for performing subtraction operations. This method is based on the
idea of replacing addition with subtraction.

Specifically, adding the 10’s complement of a number to another number is equivalent to subtracting the original number from the other number 2[4]. The 10’s complement of a number is found by subtracting each digit of the number from 9 and then adding 1 to the result. For example, if you have the number 1968, its 10’s complement would be 8032. This is because 10^4–1968 = 8032 2. Therefore, to subtract a number B from another number A, you can add the 10’s complement of B to A.

If the result is greater than A, you subtract 1 from the result to account for the “carry” from the leftmost column during the addition. This gives you the correct result of A — B 2. The use of 10’s complement simplifies the process of subtraction in digital systems, especially when dealing with binary numbers. It provides a straightforward way to implement
subtraction using only addition operations[5].

To create an 8-bit adder/subtractor you might need to use two 10’s complement circuits in this setup is due to the nature of binary arithmetic and the way binary numbers are represented.

8-bit Adder/Subtractor: This is built using two 4-bit adder/subtractors. The outputs of the first adder/subtractor are connected to the inputs of the second, forming a cascading structure. This allows the 8-bit adder/subtractor to handle large numbers 2. In binary arithmetic, the 10’s complement of a number is used to perform subtraction. The first 10’s complement circuit would generate the 10’s complement of the second number (the one to be subtracted), while the second 10’s complement circuit would generate the 10’s complement of the result of the addition (if it was a subtraction operation). This way, the 8-bit adder/subtractor can perform both addition and subtraction operations correctly[5].

A mode is often used to switch between a subtractor and an adder in a binary adder/subtractor circuit. This is typically done through the use of a control line or pin. When the control line is set to 0, the circuit operates as an adder. When it’s set to 1, the circuit operates as a subtractor.

Addition Mode: In this mode, the control line is set to 0. The adder circuit adds the bits of the two input numbers just
like a normal binary adder. The sum of the two input numbers is calculated and the output is the sum.

Subtraction Mode: In this mode, the control line is set to 1. The adder circuit performs subtraction
instead of addition. The second input number is taken as the 10’s complement of the actual number to be subtracted. Then, the adder circuit adds the bits of the two input numbers. The output is the result of the subtraction.

So, the mode essentially determines whether the adder/subtractor should perform addition or subtraction[6].

10’s Complement Diagram

This is an example of 1 + 0 = 1 using mode 1

  1. The very first toggle on the top represent the mode.
  2. The first set of 8 bits is the minuend. In the image it shows that the Minuend is = 0000 0001.
  3. The Second set of 8 bits is the subrahend. It shows that the value is = 0000 0000.

Applying the values should be in Binary Coded Decimals, the first 4 bits represent the tens while the next 4 bits are the units.

Take note that since this is only an 8 bit adder/subtractor so the maximum number of 2 digit per value is 99. Using BCD for 99 + 99 = 198
or 1001 1001 +1001 1001 = 198

The first display on the top shows the units [0–9].
The second display on the middle shows the tens [0–9].
The last display on the bottom shows the units which is [1] and the negative sign [-]. Since the maximum output is 198 it is impossible for the last display to have a display number more than 1.

The components that were used were: 7483, 7404, 7408, 7432, 7486, 7447, 7-Segment displays, and toggles.

In conclusion, the task of creating an 8-bit adder-subtractor without utilizing coding or microprocessors presented a notable challenge in the realm of digital circuit design. The process required a comprehensive grasp of digital logic and circuitry principles. By carefully navigating through these intricacies, we arrived at a functional solution. This undertaking underscores the complexities involved in digital design, highlighting the need for a deep understanding of fundamental concepts. The successful resolution of this challenge contributes to the broader understanding of electronic circuits and their applications, showcasing the practical application of theoretical knowledge in engineering tasks.

References

1 : https://www.cs.unc.edu/~montek/teaching/Comp541-Fall16/Lab2/Lab2.pdf
2 : https://www.geeksforgeeks.org/adders-and-subtractors-in-digital-logic/amp/
3 : https://www.eeeguide.com/bcd-subtraction/ 4 :https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_Languages/Book
5 : 8-Bit 2’s Complement addition and subtraction Circuit | All About Circuits
6: how to automatically switch between adder and subtractor | All About Circuits

Acknowledgments

I would like to express my gratitude to Khaled Eldesoukey for their valuable insights and collaborative effort in formulating the conclusion of this article. Their contributions played a significant role in shaping the final thoughts presented in this work

--

--