What exactly is the question asking?
|
(I assume this is some sort of home/course work, so I'm just going to give some hints...)
First, think about what a full adder is, and how it relates to the three inputs.
Then, look at the outputs required from the full adder (hint: write out the truth table; always a good starting point).
Finally, work out how to create those outputs by using the appropriate output bits of the decoder.
haha nevermind, i just searched google and i got my question done =)
but now, im having another problem with another question,
what is it asking?Create a C++ function that returns an increment of the input by 1. You may use loops or recursion for this question.
my teacher says i cant use variable++; or variable=variable+1; or variable+=1;
how else can i do it?
so, im guessing
and loops... am i supposed to use them? i don think i even need to use them to increment a value by 1................Code:float increment1 (float increasedby1 ) { do something that increases the input value by 1 thats not 'variable++;' or 'variable=variable+1;' or 'variable+=1;' return increasedby1; }
Well, I suppose that is one way of not learning anything. It would be more efficient to just drop out of school.
Hah! That's a good one. I'm not going to give you any clues (because I can't think how to, without giving too much away ... <cough>loop<cough>).but now, im having another problem with another question,
u trying to tell me to loop?
i used a for loop, but i still don't know of any other way to increment the input by 1 without using input++, input+=1, or input=input+1Code:float increment1 (float increasedby1 ) { for(int plus1=0;plus1==1;plus1++){increasedby1++;} return increasedby1; }
help? thanks![]()
yeah.. tested it and it works,
but i cannot use ++ or += or input+1Code:#include <iostream> using namespace std; float increment1 (float increasedby1 ) {for(int plus1=0;plus1==0;plus1++){increasedby1++;} return increasedby1;} void main(void) {float asd; cin>>asd; cout << increment1 (asd);}
i cant find in google any other way to add 1 to the input!!
subtact -1 ??
Ah I guess if you are learning about binary mathematics, then do it in binary
Start at the right hand bit,
if its 0, change it to 1 , end
if its 1, set it to 0, and carry
Last edited by Isilder; June 4th, 2013 at 04:58 AM.
im referring to this: c++ : binary additionbut the person's code uses i++ and other operators i cant use. and why does his array an integer value type? not bool?
and also, is it possible to modify integers by editing its bitset? how do i go about doing it?
« Why is the C++ random number not generated? | Why do i see "Dns is not authoritative in your zone" when i try to run anyhing through command prompt? » |