This is another very important concept in computer science. Particularly because of how data is represented within machines.
Taking up bit arithmetic as a topic separately, let us initiate with understanding what those terms even mean.
In our customary base-ten system, we have digits for the numbers zero through nine. We do not have a single-digit numeral for “ten”. Yes, we write “10”, but its two digits; we have no single solitary digit that stands for “ten”.
There are 10 digits using which we represent all the numbers. Hence the base 10 system.
Similarily, binary number system or base 2 number system has only 2 digits
0, 1. Hex number system or
base 16 number system has 16 digits (
0, 1, 2 .. 9, A, B, .. F ). In general a N base number system has N digits,
0, 1, ... N-1 ( The digits usually after 9 are represented as A, B and so on ).
Base systems like binary and hexadecimal seem a bit strange at first. The key is understanding how different systems “tick over” like an odometer when they are full.
Base 10, our decimal system, “ticks over” when it gets 10 items, creating a new digit. We wait 60 seconds before “ticking over” to a new minute. Hexadecimal and binary are similar, but tick over every 16 and 2 items, respectively.
In computers, numbers are internally represented in binary number system.
We explore more in next slides.