Number systems
The natural numbers are a set of numbers containing all positive whole
numbers and zero. (e.g. to count physical items). ℕ = {0, 1, 2, 3…}.
The integers are a set of whole numbers, both positive and negative, and
zero. ℤ = {...-2, -1, 0, 1, 2...} .
Rational numbers (ℚ) can have a fractional part. They can be positive or
negative. (e.g. 4.5, 13/27, -33.1).
Irrational numbers (no sign) cannot be written exactly as a fraction. (e.g π,
√ 2).
Real numbers include all possible real-world quantities. It includes all
spoken above. They are used for measurement.
Ordinal numbers are integers used to describe the numerical positions of
objects (e.g. 1st, 2nd and arrays).
Number bases
Base 10 (Decimal) is used by humans; they are denoted with subscript 10.
And are used as place holders: 10^3, 10^2, 10^1, 10^0.
Binary uses either 1 or 0. High or low current; are denoted with subscript
2.
Hexadecimal uses the digits 0 through to 9 followed by A to F to represent
the decimal numbers 0 to 15. It is a shorthand for binary as it the most
compact, easy to convert
Binary to decimal
128 + 32 + 16 + 2 = 178
Decimal to binary use headers starting from the left-hand side, you place
a one if the value is less than or equal to your number, and a zero
otherwise. Once you’ve placed a one, you must subtract the value of that
position from your number and continue as before.
Binary to hexadecimal
10110010 2 = B2 16
hexadecimal to decimal (by converting from hexadecimal to binary)
, Decimal to hexadecimal
Units
A bit (b) is the fundamental unit- either 0 or 1
A nibble = 4 bits (e.g. 0110)
A byte (B) = 8 bits (e.g.0110 1100)
Kibi (KiB) =1024 bytes
Mebi (MiB) = 1024 kibi
Gigi (GiB) = 1024 mebi
Tebi (TiB) = 1024 gigi
Pepi (PiB) = 1024 tebi
The number of different values that can be represented with n bits is 2n.
For example, with 3 bits, you can represent 2^3=8 different values. These
values can be configured in the following ways: 000, 001, 010, 011, 100,
101, 110, and 111.