Following provide a simple introduction about Base10, Binary, Little Endian vs Big Endian and other related topics.
Introduction
People count in 10s, the explanation commonly given for this is that we have 10 fingers on our hands. Counting in 10 means that we have 10 different symbols for numbers i.e. 0-9 (different writing styles in world e.g. Chinese 1-10).
The key thing is that we can start at 1 and count up to 9; and now we have no symbol left with which to represent the next number; PANIC TIMES.
Off course, you know the answer and we make a new column for 1 and put 0 on the right for 10.
Base 10
Following picture shows the column structure for Base 10.

and following shows with more columns added in Base10 for bigger numbers

You can literally picture the numbers as being broken into columns; each column allowed to contain one digit between 0 and 9 and each column being worth 10 times the next column.
The great thing about doing this is that this gives unique representation for each number. This counting is in BASE 10.
The key thing to grasp is that there is nothing special about the Base10. There are historical/anatomical reasons why we use it but there is no mathematical reason to make us count in 10s. If we wanted to, we could count in 7s or BASE 7 i.e. 1, 2, 3, 4, 5, 6.
Base 7
Following picture shows how we can use similar column structure for Base 7

Note: When you change bases, how you view number is very different.
The Number Line
Lets look at the Numbers on number line. What is a number line?
It is a more natural way of representing number. Each number is a point on number line.

- Each successive integer represents a fixed additional distance along the line.
- If we move to the left from 0, you get numbers -1, -2 and so on.
- One thing you notice that number 10 is not much different than number 9 on the line. It is represented differently due to additional column but that’s it. Same goes for number 108. It has very different representation in base 10 and in base 7.
The number line shows us that there really is nothing special about either representation. Neither one is better than the other.
You can think that two representations are just two different views of the same number.
In fact, a very good way to understand numbers is to use the analogy with how user interfaces are often designed.
Think of the number line as the underlying data model and think of BASE-10 representation as a view of that model. And the BASE-7 representation is just another view of the same model.

Off course our brain are so use to only seeing the BASE-10 view that it become second nature to us.
If we see the number written in BASE-10, we immediately, instinctively know how big the number is, whereas seeing the number written in BASE-7 gives us very little idea of what number is without explicitly working it out. But that’s not the problem with base, that’s what we’re used to.
Binary
Computer counts in 2’s; not 10s or 7s.
Why it counts in two, well the answer is to do with technology and economics.
If counted in 10s, each digit would require 10 possible values. That works well with human brain but doesn’t work well in computer circuits.
It turns out, its quite hard to build a simple circuit that can have 10 different states. It’s possible but it’s vastly cheaper and simpler to build an electric circuit that can have just two simple states. A simple switch ON/OFF.
So basic economics of cost means a computer’s equivalent of a digit can have only two states. Thank of that a computer have only two fingers, so it counts in BASE-2.
Terminology
BASE-2 is called Binary. 0 | 1 (bits)
BASE-10 is called Decimal (0-9)
Counting In Binary
We start with available bits i.e. 0, 1 and now we run out of symbols.
So, we need to add a new column just as humans do when reach 10.

Run out of symbol again, introduce another column.

Positive integers are represented in Binary.
Negative and floating are also represented in binary but are more complicated and with some differences (for later).
Binary and Memory Locations
Following picture illustrate how a number 5 will be stored in an 8-bit memory location in binary:

Little Endian vs Big Endian
Memory locations tends to contain 8-bits, but we usually require more bits to represent numbers.
So actual binary representation is spread normally across multiple locations.
The way this is usually done is that the first memory location contains the right-most bits (least significant).

Some hardware reverses little-endian order. This is called big endian.

Bit, Byte and a Word
Lets learn some basics about bit, byte and other units
| Bit | 0 | 1 |
| 1 BYTE | 8 bits |
| 1 WORD | 16 bits (or set of bytes used as a single unit) |
| 1 DWORD | 32 bits (double word) |
| 1 QWORD | 64 bits |
Q: How many unique values we can store in a WORD?
If we see alphabets, we’ve following situation
ABC…..Z = 26 unique values then abc…….z = another 26 unique values
| 1 bit (can hold two values) | 2 values (0 | 1) |
| 2 bits | 4 values |
| 4 bits | 16 |
| 5 bits | 32 |
| 6 bits | 64 |
| 7 bits | 128 |
| 8 bits | 256 |
| …. | |
| 64 bits | 18 million trillion values. |
Note: Each new bit doubles number of unique values you can store.
Power Notation
Lets start with basics
2x2x2 we can simply write as 23
similarly, 2x2x2x2 we can simply write as 24
For 22, we’ve a special name for it called 2 squared
And we use these terms often e.g. for Area, Volume etc.

following is the power notation structure

So earlier we asked a question and lets try to find its answer using power notation
- In a WORD with
nbits - We can store
2nunique values
Example
A byte contains 28 = 255 values.
A 16-bit word 216= 65536 values
Special Numbers
Lets go back to decimal and write down some numbers
- Ten = 10
- One hundred = 100
- One thousand = 1000
- One million = 1000 000
- One billion = 1000 000 000
- and so on
We often instinctively think of these as round numbers, as in special, because they have such a simple representation in Base10 i.e.
Just a 1 followed by zeros.
And because of that we use them a lot, and we even have special words for them like a million, a billion etc.
And other think we do is use simple multiples of these numbers quite a lot e.g. Population of world = 7 billion i.e. 1 with 9 zeros. Off course, we know its not exactly 7 billion, we usually ignore those and round it off.
If you remember our earlier talk about bases and number-line, that the supposed specialness of these numbers is a bit artificial.
So, what is it about these numbers that makes them so easy to represent in base10?
Answer:
This does
Related to powers of the base. The power of a number are quite deeply related to using that number as a base.
- 100 = 102 = 10 x 10 (10 squared)
- 1000 = 103 (10 cubed)
- 1000 000 = 106 (million is 10 to power six)
- and so on….
Note:
Also, just because a number is special in one base, doesn’t make it special in another base.
Lets take number 100 and as we saw earlier that it is very easy it write in Base10. But that’s not the case for this number when we use Base7 or Binary.
in Base7 = 202
In Binary = 1100100
Which obviously isn’t round numbers in these bases.
So, then what are special numbers in Binary?
Special Numbers in Binary
They’ll be 2 , 22, 23 and so on.
- 2 = 2 = b 10
- 22 = 4 = b 100
- 23 = 8 = b 1000
- and so on…
Looks like, this works. Just a 1 followed by zeros.
In fact, it’s generally true that
If you take any base n and any integer p, then the number np will be represented in base n as 1 followed by p zeros.

And this gives us a simple way of writing powers of 2 in binary. Lets check those
- 24 = 16 = b 10000 (4 zeros)
- 25 = 32 = b 100000 (5 zeros)
- 26 = 64 = b 1000000 (6 zeros)
- 27 = 128
- 28 = 256
- 29 = 512
- 210 = 1024
- …..
These are the numbers that are special to computers in the same way that 10, 100, 1000 are special to human beings.
These numbers are well known in programming languages such as assembly.
Special numbers and Capacity
Another property beside being very simple to write is that special numbers determine data capacity.
To determine let’s go back to decimal and image that we’ve two numbers available and we have value 53, so we can fit it easily in two boxes as shown below:

But if we have number 212, it won’t fit in two boxes.

Highest number we can fit in two boxes is 99
Notice 99 = 102-1
Similarly, if we have 3 digits available, the biggest number we could write would be 999 or 103-1
So 0-999 = 1000 different values or 103
In general
n digits = 10n unique values
Ranging 0 to (10n-1)
Same thing holds in binary.
- p binary bits 2p unique values
- That is numbers for 0 to 2p-1
Thus, if we have 3 binary bits available, by this reasoning the biggest number to store would be
23-1 = 7 = b 111
Next number requires an additional bit i.e. 8 = b 1000 and wont fit in 3-bit space.
This is all for today and let me know if you have some questions and/or comments.

Leave a Reply