Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Adder–subtractor
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Role in the arithmetic logic unit== {{main|Arithmetic logic unit}} Adders are a part of the core of an [[arithmetic logic unit]] (ALU). The [[control unit]] decides which operations an ALU should perform (based on the [[op code]] being executed) and sets the ALU operation. The ''D'' input to the adder–subtractor above would be one such control line from the control unit. The adder–subtractor above could easily be extended to include more functions. For example, a 2-to-1 multiplexer could be introduced on each ''B<sub>i</sub>'' that would switch between zero and ''B<sub>i</sub>''; this could be used (in conjunction with {{nowrap|1=''D'' = 1}}) to yield the [[two's complement]] of ''A'' since {{nowrap|1=−''A'' = {{overline|''A''}} + 1}}. A further step would be to change the 2-to-1 multiplex on ''A'' to a 4-to-1 with the third input being zero, then replicating this on ''B<sub>i</sub>'' thus yielding the following output functions: * 0 (with both the ''A<sub>i</sub>'' and ''B<sub>i</sub>'' inputs set to zero and {{nowrap|1=''D'' = 0}}) * 1 (with both the ''A<sub>i</sub>'' and ''B<sub>i</sub>'' inputs set to zero and {{nowrap|1=''D'' = 1}}) * ''A'' (with the ''B<sub>i</sub>'' input set to zero) * ''B'' (with the ''A<sub>i</sub>'' input set to zero) * {{nowrap|''A'' + 1}} (with the ''B<sub>i</sub>'' input set to zero and {{nowrap|1=''D'' = 1}}) * {{nowrap|''B'' + 1}} (with the ''A<sub>i</sub>'' input set to zero and {{nowrap|1=''D'' = 1}}) * {{nowrap|''A'' + ''B''}} * {{nowrap|''A'' − ''B''}} * {{nowrap|''B'' − ''A''}} * {{overline|''A''}} (with ''A<sub>i</sub>'' set to invert; ''B<sub>i</sub>'' set to zero; and {{nowrap|1=''D'' = 0}}) * −''A'' (with ''A<sub>i</sub>'' set to invert; ''B<sub>i</sub>'' set to zero; and {{nowrap|1=''D'' = 1}}) * {{overline|''B''}} (with ''B<sub>i</sub>'' set to invert; ''A<sub>i</sub>'' set to zero; and {{nowrap|1=''D'' = 0}}) * −''B'' (with ''B<sub>i</sub>'' set to invert; ''A<sub>i</sub>'' set to zero; and {{nowrap|1=''D'' = 1}}) By adding more logic in front of the adder, a single adder can be converted into much more than just an adder—an [[arithmetic logic unit|ALU]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)