I need some help designing a simple ALU that only can add (4-bit) numbers. For the design I can only use 4-bit full adders and 4-bit edge-triggered flip-flops.
I am stuck as I do not even know where to start. Thanks for any help.
I need some help designing a simple ALU that only can add (4-bit) numbers. For the design I can only use 4-bit full adders and 4-bit edge-triggered flip-flops.
I am stuck as I do not even know where to start. Thanks for any help.
I'll give you a building block, the full adder, and how it is supposed to work in most cases:
simulate this circuit – Schematic created using CircuitLab
Now, what we are showing there is that the Sum
voltage will be logic \$1\$ if only two out of three inputs are 1's. For the Carry
, it outputs a 1 when at least 2 inputs are 1's. How would you make a chain of Full Adders to get the addition of the n-th bit and send its carry to the next unit?
Assuming that an ALU doesn't include the registers used to store the values involved (e.g. https://en.wikipedia.org/wiki/File:CPU_block_diagram.svg ), I think you'll find that the full adder is almost everything you need. Play around with this if you have access to a simulator, the actual hardware, or programmable chips. If not, consider working through successive states of your proposed circuit using paper and pencil.