Creating a binary calculator

Hello everyone,

I have an assignment due for my c++ class I need help with. I need to create a binary calculator that outputs the operation of subtraction whenever you input 2 4 bit binary numbers. Any help is greatly appreciated!
For example:

If I enter

- 0111

Play around with this online binary calculator

What happens when a smaller number is subtracted from a larger number?
What happens when a larger number is subtracted from a smaller one?
How does carrying work?
Topic archived. No new replies allowed.