# Binary Numbers

Published in

--

A binary number is a number that is represented in a base-2 system. These binary numbers use only two symbols to represent data, those being 0 and 1. This system uses 0 as a way to represent no value and the symbol 1 as the representation of value. These symbols will be put together to create the total value of the number being represented.

# Bit, Nibble, Byte

One symbol by itself is called a “bit” and can represent only two distinct values (0 or 1). Four bits together are referred to as a “nibble”. With one nibble we are able to represent 2⁴ or 16 distinct values. Finally, if we have two nibbles together we call this a “byte”. One byte is able to represent 2⁸ or 256 distinct values. As a general rule with n bits, we can represent 2 to the power of n (2^n) distinct values.

# Unsigned Integers

Unsigned integers are the most basic of the numbers represented in binary. As the name suggests these numbers have no sign and are always positive. Like the decimal system, binary uses positional notation to represent the unsigned integers. The difference is that in binary the base is 2 and in decimal the base is 10.

If we are given 4 bits, we can represent the value 12 as 1100. This is calculated like this: (1 * 2³) + (1 * 2²) + (0 * 2¹) + (0 * 2⁰).

--

--