Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
please help me to writ a C++ code for a binary Full Adder.
Posted
Updated 24-Mar-15 13:30pm
v2
Comments
Richard MacCutchan 24-Mar-15 17:32pm    
You need to show what you have tried first.
BacchusBeale 24-Mar-15 17:38pm    
Read this http://www.egr.msu.edu/classes/ece410/mason/files/Ch12.pdf. Then show your code if you have problems.
Andreas Gieriet 24-Mar-15 18:19pm    
What exactly is the input, what the expected output?
Cheers
Andi

1 solution

With so little information you give, I can only guess what you need.
I have to make some assumptions:
- input: bool a_in, b_in, c_in
- output: bool a_out, b_out, c_out

Now you can easily implement the functions from the truth-table of the full adder:
- a_out = f_a(a_in, b_in, c_in)
- b_out = f_b(a_in, b_in, c_in)
- c_out = f_c(a_in, b_in, c_in)

The implementation of the functions might be in form of
- Boolean expressions
- lookup table

Implementing in C++ is left to you as exercise.

Cheers
Andi
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 1-Apr-15 12:21pm    
5ed.

Andi,

Congratulations with April 1st! :-)

I would like to use the occasion to invite your (and everyone else, of course) to see my new 1 of April publication and have some fun:
Some Programming Approaches to "Neuro-Linguistic Programming".
Participation in this game in Comments and Discussions is especially encouraged.

I always appreciated your expert's answers and comments.

Thank you.
—SA
Andreas Gieriet 1-Apr-15 16:30pm    
Hello Sergey,
I'm glad to come back to read and appreciate your great article in full detail (i.e. following the many links ;-)) in the near future when I'm less "overloaded" - in a different sense as detailed in your April 1 article :-).
Great reading!
Cheers
Andi
Sergey Alexandrovich Kryukov 1-Apr-15 16:52pm    
Thank you, Andi.
Yes, the links, especially many unexpected links are important.
Hope you will have fun with it.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900