This circuit performs 4-bit addition and subtraction. A dedicated input pin acts as a control signal. When the reset pin is set to low (0), the circuit behaves as an adder. When set to high (1), it becomes a subtractor by converting the second input to its two's complement before adding.
To test the circuit, provide two 4-bit numbers as inputs using the designated input pins. Use the separate control pin to switch between addition (low) and subtraction (high). The result of the operation will be displayed in binary on the output pins.
The binary output is converted to a decimal format using a BCD (Binary Coded Decimal) to 7-segment display decoder. The resulting decimal number is then shown on a 7-segment display for easy reading.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | IN0 | OUT0 | |
1 | IN1 | OUT1 | |
2 | IN2 | OUT2 | |
3 | IN3 | OUT3 | |
4 | IN4 | OUT4 | |
5 | IN5 | OUT5 | |
6 | IN6 | OUT6 | |
7 | IN7 | OUT7 |