Binary arithmetic operations:
1. Binary addition: 0 0=0, 0 1=1, 1 0=1, 1 1=10 (carry to the high bit). When only one of the two added binary bits is 1, the result of the addition is 1; if the two binary bits are all 0, the result of the addition is still 0; and if the two added binary bits are both 1 , then the result is 10 (equivalent to 2 in decimal system), which is the "every 2 enters 1" rule.
2. Binary subtraction: 0-0=0, 0-1=1 (borrow bit from high bit) 1-0=1, 1-1=0 (modulo two addition operation or XOR operation) . When the two added binary bits are both 0 or 1, the result of the subtraction is 0; if the binary bit of the minuend is 1 and the binary bit of the subtrahend is 0, the result of the subtraction is still 1. ; And if the binary bit of the minuend is 0, and the binary bit of the subtrahend is 1, you need to borrow 1 from the high bit, but at this time, 1 is borrowed as 2.
3. Binary multiplication: 0 * 0 = 0, 0 * 1 = 0, 1 * 0 = 0, 1 * 1 = 1;
4. Binary division: 0÷ 0 = 0, 0÷1 = 0, 1÷0 = 0 (meaningless), 1÷1 = 1;
5. Logical operation binary OR operation: when 1 is encountered, 1 is obtained;
6. Binary AND operation: when encountering 0, get 0;
7. Binary NOT operation: negate each bit.
The above is the detailed content of Binary addition operation. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor