The 4-bit adder and subtractor circuit can perform addition or subtraction depending on a control signal. This control signal, often referred to as the "mode" or "operation" signal, determines whether the circuit functions as an adder or subtractor. When set to addition mode, the circuit computes the sum of two 4-bit binary numbers but can only produce output of maximum 4-bit binary number so i will make a 5 bit binary to BCD converter for the output of sum soon. In subtraction mode, it calculates the difference between the two numbers by utilizing the concept of two's complement representation with the help of an EX-OR gate to select the mode.
Here various switches are used to select the binary input number. These switches are pulled down using resistors to give the output as low to the basic gates so that they won’t malfunction during the calculation. It is a common problem that if the output is not grounded the value could either be 1 or 0 which is not proper to provide a correct calculation.
Here we have used a common anode 7 segment display and the driver IC 7447 to display the inputs given from the BINARY TO BCD circuits.
INPUT FROM A
INPUT FROM B
Minimized expression for each output:
W = AB + AC (carry decimal)
X = A’B’
Y = A’B + BC
Z = ABC’ + A’C
E = D (first bit)
NOTE: The same is used for the conversion of binary digits to decimal which is getting inputs from the calculator.