So basically I'm working on a project that's supposed to emulate a betting game about randomly generated numbers... the idea was that if your number is higher than the number of another player, you win.... so I thought that to make that circuit, I would just use a subtractor(using 2's complement)... anyways the win would be decided if there would still be an overflow bit left or not....
I would then use that overflow bit in our next step... the thing was that if I had a stored value, winnings, and also another inputted value, the bet, a new logic circuit would then either add or subtract the two... here's the problem: how the I use the overflow bit to dictate whether the circuit would subtract or add the winnings and the bet.
What I tried doing was doing the 2's complement again... if the overflow bit was a 1, it would convert the bet into a 2's complement form.. However, I cannot do that effectively at all.... So if you actually read the whole thing, helpful suggestions on how to implement this circuit would be very welcome...
note: i think a multiplexer could be just the solution but I'm having trouble visualizing that too. and not to mention that it's not available to us as it was not discussed in our laboratory syllabus
I would then use that overflow bit in our next step... the thing was that if I had a stored value, winnings, and also another inputted value, the bet, a new logic circuit would then either add or subtract the two... here's the problem: how the I use the overflow bit to dictate whether the circuit would subtract or add the winnings and the bet.
What I tried doing was doing the 2's complement again... if the overflow bit was a 1, it would convert the bet into a 2's complement form.. However, I cannot do that effectively at all.... So if you actually read the whole thing, helpful suggestions on how to implement this circuit would be very welcome...
note: i think a multiplexer could be just the solution but I'm having trouble visualizing that too. and not to mention that it's not available to us as it was not discussed in our laboratory syllabus