Adder Subtractor Mode Control
Hardware reuse is the foundation of ALU design. Dedicated circuits for addition and subtraction waste silicon when a single adder can perform both operations via two's complement arithmetic.
The mode control circuit receives two 4-bit inputs A and B, and a 1-bit mode selector M. It outputs a 4-bit result S and a 1-bit carry-out Cout.
| M | Operation | S | |-----|-----------|---------| | 0 | Addition | A + B | | 1 | Subtraction | A - B |
Subtraction is achieved by converting B to its two's complement representation: inverting all bits of B and adding 1. The control bit M must orchestrate both the conditional inversion of B and the initial addition of the lowest bit.
Constraints
- Use exactly one 4-bit adder.
- Use XOR gates for the conditional inversion of input
B. - Do not use dedicated subtraction blocks.
- Connect the mode control bit
Mdirectly to the carry-in of the adder.
Topics
Solve this problem
Place the gates, wire them up and watch the signals settle. Every submission runs on the same simulation engine that grades it.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.