Logic Gate

  1. By applying Boolean logic operations to binary inputs, which can be used to conduct arithmetic, comparison, and control operations in a computer’s central processing unit (CPU) and other digital circuits, logic gates can be utilized to execute fundamental computer functions.

  2. While logic gates are actual physical devices or circuits that physically implement these operations by controlling the flow of electricity through them, Boolean operations are abstract mathematical operations that are defined in Boolean algebra. Logic gates are the physical components that carry out boolean operations in digital circuits, whereas boolean operations are abstract notions used to express logical relationships between variables.

Binary Logic

Binary Math

  1. Write the two numerals one above the other, with the subtrahend (the second number) appearing beneath the minuend (the first number). Subtract each digit from its corresponding digit in the minuend, beginning with the subtrahend’s rightmost digit. Borrow 1 from the digit that is next to the left in the minuend if the digit in the subtrahend is larger than the digit in the minuend. Below the corresponding digits of the subtraction, write the outcome of each subtraction. The borrowed digit in the minuend is lowered by 1 if any borrowing occurs in step 2 at all. Until there is no more borrowing, this process is repeated. Create a binary number from the result of the subtraction.

API hacks