#function input not working properly

6 messages · Page 1 of 1 (latest)

still pathBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@gloomy vale

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

gloomy vale
#
void bit8Adder(bool a[8], bool b[8], bool *sum, bool *carryOut, bool *overflow) {
    bool c0 = 0, c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0, c6 = 0, c7 = 0;

    if (b[0]) { std::cout << "true"; } 

    fullAdder(a[0], b[0], 0, &sum[0], &c0);
    fullAdder(a[1], b[1], c0, &sum[1], &c1);
    fullAdder(a[2], b[2], c1, &sum[2], &c2);
    fullAdder(a[3], b[3], c2, &sum[3], &c3);
    fullAdder(a[4], b[4], c3, &sum[4], &c4);
    fullAdder(a[5], b[5], c4, &sum[5], &c5);
    fullAdder(a[6], b[6], c5, &sum[6], &c6);
    fullAdder(a[7], b[7], c6, &sum[7], &c7);

    *carryOut = c7;
    *overflow = c6 != c7;
}
still pathBOT
#

@gloomy vale

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

gloomy vale
#

I'm trying to implement a 8-bit adder but somehow the input doesnt work

#

the input to the bool array b[8] is 00010101