How do computers compare numbers?

500 views

Example: How does a computer know that 8 ist greater than 3?
Because it works in binary, how does it know that 1000 (8) is greater than 0011 (3)?

In: 2

8 Answers

Anonymous 0 Comments

The function for this is built into the computer.

You can build something like this yourself using XNOR logic gates to check whether two given bit inputs have one being 1 and the other 0 or both being 1s or 0s. Once you can do that for a single bit you can chain it together for a number consisting out of more than 1 bits.

You can build a magnitude cooperator out of logic gates that have two bytes as inputs and three bits for greater lesser and equal as outputs.

In modern computers that is part of the many different built in functions in a chip that can be called via machine code at the lowest level.

You are viewing 1 out of 8 answers, click here to view all answers.