1
\$\begingroup\$

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.

\$\endgroup\$
5
  • 3
    \$\begingroup\$ If all it does is add, doesn't that prevent it from being an ALU? \$\endgroup\$
    – W5VO
    Commented Oct 28, 2015 at 2:56
  • \$\begingroup\$ Do you know how to make a 1-bit adder? Start there. Your adders will have carry out and carry in lines, so use them. \$\endgroup\$ Commented Oct 28, 2015 at 3:18
  • \$\begingroup\$ @WhatRoughBeast The OP doesn't need to build an adder. His question says he can already use a 4-bit adder as a component. \$\endgroup\$
    – tcrosley
    Commented Oct 28, 2015 at 9:41
  • \$\begingroup\$ I'm I missing something here, or.. you have a 4bit adder, you want to add 4 bit numbers. Connect the 4bit numbers to the 4bit adder and you magically have the result, what else does a 4bit adder do... \$\endgroup\$ Commented Oct 31, 2015 at 1:34
  • \$\begingroup\$ I'll put a link to a video here that explains a lot about adders. This will be what you need. \$\endgroup\$ Commented Oct 31, 2015 at 2:19

2 Answers 2

1
\$\begingroup\$

I'll give you a building block, the full adder, and how it is supposed to work in most cases:


schematic

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?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ The OP is already allowed to use 4-bit full adders as a building block, so showing a single full adder is not much use. \$\endgroup\$
    – tcrosley
    Commented Oct 28, 2015 at 7:48
  • \$\begingroup\$ Well, the point is to use an adder AND a register in s way it acts like ALU and the sum is stored in the register. \$\endgroup\$ Commented Oct 28, 2015 at 15:25
  • \$\begingroup\$ @tcrosley The idea is to give him some intuition on what's happening in the adder. Understanding what the full adder does itself might help him figure it out. \$\endgroup\$
    – OFRBG
    Commented Oct 28, 2015 at 18:02
0
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.