Convert Binary to decimal/text | A little bit of everything tutorials || HOX FRAMEWORK
In this tutorial we will be converting from BINARY to TEXT and DECIMAL, and the other way around as well.
This is a very simple tutorial, so it is few minutes short, it is easy to understand but a fun thing to know.
So lets start.
In the first example i showed you how to get a letter from a binary number:
First thing you gotta know is you have to use the table:
128 64 32 16 8 4 2 1
But when converting binary to text and oposite we are going to ignore 128, 64 and 32,
those places are going to be used to define what type of characters we are using, as
far as alphabet goes we have:
010 -for a capital letter
011 – for a non-capital letter
(i made a tiny mistake in a video but i think i corrected myself)
Right so when we decided if our letter is going to be capital we can start writing our letter.
Pick a letter and find it in the English alphabet, specifically it’s location,
For example letter F is 6th letter in the alphabet, meaning we need to get number 6
when all the numbers from table are combined.
How do we combine them? well we put one on a number we wanna use ,
if there is more then one “1” then we add them, for example:
010 00110 – is a letter F
010 saying we want a capital letter
and 00110 saying 4+2 is 6 meaning we want 6th letter in the alphabet.
Same method is converting from text to binary.
Now lets jump to decimal.
Remember those first 3 numbers we ignored at binary2text?
Well they are counted now, in fact there can be 8 more numbers in front of them each larger by
a double than the last:
(here can be 6 more numbers)…128 64 32 16 8 4 2 1
an example of one of those 6 is the one after 128 which is 256.
-Anyway lets try adapting this.
Now that we know they are all included and we want to get decimal numbers from it
all we have to do is count them all, and that’s the number we get.
for example:
128 64 32 16 8 4 2 1
0 0 1 1 1 0 0 1
means we will add up 32, and 16, and 8 and 1
which will give us 57.
And there you go, if you wanna do it opposite just do it the same way, use the table.
Also worth mentioning regarding binary2text is that :
00100000 is a space
and
00101110 is a dot ( . )
And there you go, that would be all.
Thank you so much for visiting, have a nice night! 🙂
Converting Binary to decimal and text
Posted in VIDEOS