Connect with us

Full Adders? Flip Flops? Help!

Discussion in 'Electronics Homework Help' started by TIBITG, Dec 7, 2011.

Scroll to continue with content


    Dec 7, 2011
    I've got an assignment to make a 'simple' calculator, capable of addition / subtraction. Obviously it's an assignment, so I'm not looking for a solution, but I would like help putting a few of the pieces together in my head before I get round to putting it together physically.

    I am supplied with a component that converts keypad input to binary, and then binary back to hexidecimal to output to some display. I've just got to take care of the middle bit.

    I've identified that I'll cascade full adders for the addition. I'll store the result in some register (accumulator) made of cascading flip flops (I think! SR type?). I'll cater for subtraction by just adding the 2s compliment binary (i.e. use cascading full adders again).

    But I'm struggling to picture it.

    The A and B inputs for my full adders will be the two numbers entered into the keypad. The CIN for the 0th bit will be 0, and the CIN for the Nth bit will be the COUT of the N-1th bit.

    I'm not sure where to put the SUM output though... It makes sense to put it input (S) to my SR flip flop, but then what is the other input (R)? The truth table suggests it has to be the opposite of S if I want the flip flop to store S. I'm struggling to find an example of cascaded flip flops. And if the output (Q) goes back to the binary to hexidecimal converter, what happens to the other output (!Q)?

    Basically... Arrrgh! I'm a programmer, and all of this hardware electronics stuff is brand new to me.

    N.B. None of the above will solve my project FOR me, but it'll point me in the right direction I hope. So please, don't hold back! Thanks in advance. :)
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    "simple" may mean a number of things.

    To me it means "It will perform a function, but probably not like a bought one"

    I would look at RPN as it may be easier to implement in hardware. Essentially you have 2 registers, X and Y. You always load data into X, and a particular button copies X into Y. The mathematical operators always work on Y (operator) X.

    So to add 1 and 3 you go

    1 (enter) 3 (add)

    In RPN the output goes to X, and the display normally shows X, so you could do that, but I see no reason why you would have to. a "simple" calculator might display only the result and not the entered numbers.


    Dec 7, 2011
    Thanks for the reply, Steve!

    It's simple in that it's addition / subtraction only, for 7 bit binary numbers... So it's -64 to +63 - anything else is overflow.

    We've been advised to use adders and accumulator(s) because it's got to be designed using basic logic gates: AND, OR, XOR, etc.

    Using registers to record input helps though... I'll look into what you suggested. Hopefully it'll help.

    Thanks again!
  4. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Jan 21, 2010
    Do you have to actually build it? or is it either design only, or simulated?
  5. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    in principle...

    the priinciple of your design could look like this (see image):

    - an input device (given to you) with 7 bit data bus
    - a 7 bit full adder (with 2*7 bit input and 7 bit output) to be designed by you
    - a 7 bit register to store the result (built from FFs, latches or similar), to be designed, too
    - a 7 bit output device (given to you).
    - a manual reset for the register to clear it before start of operation (think of a pushbutton, don't forget debouncing), to be designed
    - a manual clock for the register (pushbutton, debounce) to store the result of an addition into the register, to be designed

    I think with this basic structure you should be able to solve the assignment using standard logic gates. The rest (details) is in the textbooks.


    Attached Files:

Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day