Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Decimals,Bits and Hexadecimals | A numeral system explained

Decimals,Bits and Hexadecimals | A numeral system explained






Decimals

The decimal numeral system, Is the system we use today to specify an amount in numbers.
It has a 10 as its base meaning that we can specify any amount with only 10 numeral figures (1,2,3,4,5,6,7,8,9,0).
Now you are probably wondering why is he telling me this ? Well this is a bit of theory you have to know for me to properly explain the rest to you.




Bits

A computer works only with 0's and 1's , You most certainly you have heard of this.
It is true, But you won't notice it from the outside of a computer, The keyboard does not have 2 buttons,
And on your screens there are no 0's and 1's but only normal text and normal pictures.

But still a computer solely works with 0's and 1's, In your computer there are millions of little switches(Transistors)
at the position of these switches we assign a value: 0 or 1.
with doing that you can store information. In this thread i will explain you how you can digitize complex information.

The smallest possible piece of information is a bit. A bit has two possible value's, Which we can assign different meanings to.

Yes/No
True/False
1/0
On/Off
Open/Close

When you agree upon which option(0 or 1) has which value, You can use one single bit to store information.
For example regarding gender there are only 2 types : Male or Female. We can imagine this as a bit,
We can agree that 0 stands for "Male" and 1 stands for "Female".

Also answering to Yes and No question is possible with one bit. But most information is not possible to represent with 1 bit,
Because there are only two possible value's then.We can solve this problem by using two or more bits.
When we look at these two bits they have 4 possible values, As shown in the diagram below.

A bit is shown here by turning a light bulb On or Off

[Image: KbzCc11.png]
The possible values of 2 bits


We can also write down the 4 possible values of 2 bits.

[Image: jmecMfj.jpg?1]
In the row scheme above there are two combinations with a 0 and a 1. Not only the number of 0's and 1's counts, But also the place.
Therefore there is a difference between 01 and 10.

With 3 bits we can make eight possible values as shown in the scheme below.

[Image: x8IgrHb.jpg?1]
With every bit we add, The amount of values doubles. You can see this by looking at the eight possible values of three bits.
You can see here two times the possible value of two bits, First with a 0 upfront(000, 001, 010, 011). And then with a 1 upfront(100, 101, 110, 111).


With 4 bits we can make sixteen possible values as shown in the scheme below.

[Image: A9Vm4fA.jpg?1]


With the amount of possible values we keep finding the power of 2. We can mathematically explain this: a group of n bits has 2n possible values.

[Image: ElFDZKd.jpg?1]


Computers rarely work with loose bits. Instead of working with loose bits they always work in groups of eight bits.
A group of eight bits is what we call a byte, A byte can have 256 different values.

The size of files or the storage amount on a computer usually will be shown in kilobyte(KB), megabyte(MB) or gigabyte(GB).
A kilobyte is not 1000 bytes, But 1024 bytes. Also here you can find the power of 2 again,
2 to the power of 10. Calculated in bits a kilobyte had 8192 bits. A megabyte is 1024 times 1024, That is 1048576 bytes, Or 8388608bits.

It is mathematically explainable, But of course it is weird that "kilo" stands for 1024. When in kilometer, kilogram and kilowatt it stands for 1000. In the international standard for sizes is the value of kilobyte changed. A kilobyte now stands for 1000 bytes en the old kilobyte is now called kibibyte. The same goes for the other sizes as shown in the diagram below.

[Image: oUJixxx.jpg]
This system is not used very often. Everyone is used to the old system sizes en keeps going with that. But you can see the new sizes more often in advertisements of certain company's. This also explains why your hard drive capacity is smaller when you buy it these days. When you buy a HDD of 1 TB(new size), It will be 10% smaller than a hard drive of 1 TB with the old size.




Hexadecimal

Except the binair and the decimal numeral system there are also different ones.
Every whole number can be a base for a numeral system, When we would have four instead of five fingers on our hands we would probably have a eight based numeral system.

In the world of computers the hexadecimal numeral system is used a lot.
Hexadecimal means a base of 16. We now need 16 numbers, The numbers 0 to 9 are used the rest is written with alphabetical letters A to F for the numbers 10 to 15.

You can see a scheme of the numbers 0 to 16.
[Image: g7S6Ce8.jpg]


The positions in een number now stands voor the power of 16.
The hexadecimale number 1B7 is 1 time :
16 to the power of 2 (256)
+
Eleven times 16 to the power of 1 (16)
+
7 times 16 to the power of 0 (1)

That is a decimal notation of 439(256+176+7). Hexadecimal notation is only used because translating binair to hexadecimal is fairly easy.
You can write down 4 bits in 1 hexadecimal number, a byte(8 bits) in 2 hexadecimal numbers. 01011110 is in hexadecimal notation 5E.
The first 4 bits make 5, The second 4 bits make E.
Sometimes you will see some Hexadecimal numbers, It is usually used to give text a color in HTML-code.

For example

bgcolor = "#FFFFCC"

The (#) tells you that it's a hexadecimal number.







I will continue this tutorial series on the basics of computers soon, I will then show you how to convert binair to decimal and to hexadecimal and vice versa.
Also I'll be explaining a little bit more about ASCII and UNICODE.

Thanks for reading


Regards VB.
Oh nice, looks like you spent a lot of time making this thread. Nice contribution!


Possibly Related Threads...
Thread / Author Replies Views Last Post
by G33KJan 2, 2024 02:20 AM 3 186 Jan 2, 2024 02:20 AM
Last Post: Scrubspoof
by NjordJan 1, 2024 11:13 PM 5 204 Jan 1, 2024 11:13 PM
Last Post: G33K
by EffexionMar 7, 2019 04:27 AM 2 184 Mar 7, 2019 04:27 AM
Last Post: Effexion