请帮我写一个二进制全加器的C ++代码。 [英] please help me to writ a C++ code for a binary Full Adder.
本文介绍了请帮我写一个二进制全加器的C ++代码。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮我写一个二进制Full Adder的C ++代码。
please help me to writ a C++ code for a binary Full Adder.
推荐答案
由于你提供的信息太少,我只能猜到你需要的东西。 br />
我必须做出一些假设:
- 输入:bool a_in,b_in,c_in
- 输出:bool a_out,b_out,c_out
现在你可以轻松地实现全加器真值表中的函数:
- 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)
函数的实现可能是以
的形式 - 布尔表达式
- 查找表
用C ++实现是留给你的练习。
干杯
Andi
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
这篇关于请帮我写一个二进制全加器的C ++代码。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文