Numbers and Arithmetic
Internally, computers work using binary, or base two, numbers. The digits used in binary numbers are 0 and 1, which correspond to the state of individual switches (off or on). By using circuits made of logic gates, computers are able to perform basic arithmetic.
There are 3 fundamental arithmetic operations that a computer needs to be able to perform: adding, shifting, and complementing. By combining these operations in the proper order, computers can add, subtract, multiply, divide, and carry out other basic mathematical operations. To understand how the computer is able to do math using only a limited number of low-level operations, we need to start by examining how binary numbers work. From there, we can understand how computers do math, using both integers and floating-point numbers.
Learning Materials
- Counting on Your Fingers
- Counting with Robot Hands
- Number Bases
- Signed Integers
- Arithmetic
- Floating-Point Numbers
- IEEE 754 Standard