I know logical ADD in binary is 0010, and logical AND in binary is 0000. How do I go from this to a full operation?
Asked
Active
Viewed 184 times
0
-
1The diagram has an error with the a-> green arrow extending too far, going right past the inverter; it should look like the b-> green arrow instead, which stops at the inverter and becomes black post inverter. – Erik Eidt Jun 16 '22 at 16:30
1 Answers
2
There's two control lines: Ainvert
, and Bnegate
, which can be used to invert values before combining them.
Use them as needed!
The Bnegate
control line does these two things:
- inverts the bits of the
b
input to~b
, which is then fed to the other circuits as theb
-side/lower input. - and also feeds a 1 into the carry input of the adder,
+
.
The combined effect of Bnegate
with the +
Operation
, will accomplish a + ~b + 1
, which is the same as a-b
and also a + -b
, because in two's complement, -x = ~x+1.
Though we can, we don't have to use the +
with Bnegate
, as others operations are still available.
Given this logic diagram, what are some things that cannot be done?
a + ~b
(though~a + b
can be done)a | -b
a & -b
-a + b

Erik Eidt
- 23,049
- 2
- 29
- 53