Eroxl's Notes
Binary Number
aliases
Base 2 Notation

A binary number is a number expressed using the base-2 number system. It uses only two symbols for representing numbers a 1 and a 0. Typically each digit of a binary number is referred to as a bit. Binary is the most widely used number system in modern computing for its ease of implementation using logic gates. Counting in binary is the same as in other number systems. To represent negative numbers usually two's complement

Examples

Non-Fractional Value

Where and represent that a number is in base and respectively.

Fractional Value

Arithmetic

Addition

The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying. Adding two "1" digits produces a digit "0", while 1 will have to be added to the next column. This is similar to what happens in decimal when certain single-digit numbers are added together; if the result equals or exceeds the value of the radix (10), the digit to the left is incremented.

Example

Add and

Subtraction

To subtract two numbers first convert the second to a negative using two's complement and then add them together using normal addition, however truncate the length of the result to largest number of digits in the original number.

Example

Subtract from

Firstly convert to a negative number using two's complement

Now add both together

Now truncate the answer to the length of the original numbers