34
loading...
This website collects cookies to deliver better user experience
D->ALU
control signal to control the inputNEG
signal to select addition or subtractionALU->D
signal to control the outputNEG
signal, but if you tried designing such subtractor you would find that it only differs from the adder by one NOT
gate: the first input is negated before calculating the carry. With this knowledge it is better to add some conditional processing to the adder instead of doubling its size with a separate subtractor.a - b
is just like a + b
but with a
flipped for carry calculation. This sounds like an easy fix, but without access to the interior of an adder I can only flip a
for all operations - both carry and result calculations. Fortunately this is OK, as it results in a flipped subtraction output which can be flipped again to get the correct answer.NEG
signal and the clock. ALU->D
signal is used outside of the ALU, as shown on the diagram above. The circuit has one output, called Q
, which is the result of the operation over the argument and the remembered value.en
signal and connected to the clock. Next, the contents of the register and the argument are passed through the adder/substractor and the result goes to the output Q
. The finished circuit looks like this: