How tf does binary code work.

608 views

it’s just a bunch of 0’s and 1’s.. like I can just put a bunch of them and somehow make a sentence??? like what does this mean -> 010100101001010010 (i legit just spammed 0’s and 1’s)

In: 0

26 Answers

Anonymous 0 Comments

Binary is just a number system with two instead of 10 digits.

If you look at a decimal number lie 189. The value of a digit depen on the position. The digits farthers to the right t is 10^0 =1 the next is 10^1= 10 the 10^2 =100

So 189 mean 1 * 10^2+ 8* 10^1 +9 * 10^0 =1 * 100 + 8* 10 +9 * 1

Binary works the same but the base is 2 instead of 10

So the value of binary digit expressed in decimal starting from the left is 2^0?=1, 2^1=2, 2^2 =4, 2^3=8 and so on

the binary number 10111101 would be if we convert ti to deimal

1* 2^7 + 0* 2^6 + 1* 2^5 + 1* 2^4 + 1* 2^3 + 1* 2^2 + 0 * 2^1 + 1* 2^0

= 1*128 + 0*64 + 1*32 + 1*16 + 1*8 + 1*4 + 0*2 + 1*1 =128 + 32 + 16 + 8 + 4+ 1 = 189

So binary is just another way to store numbers. What the number means depends on what standard you use to encode data.

Lets use a format where we use 3 decimal digit for a letter and a=097, b=098… z=122 What number we use for the digits are arbitrary, the one that create and the one that read the message just need to agree

We can now write the message 114101100100105116. We know there is 3 digits per letter sp we split it to 114 101 100 100 105 116. If you use the system above you can convert it to “reddit”

We can also write is as a binary number. We can use a table with 8 binary digits that represent the decimal number 0 to 255. The message above now becomes

011100100110010101100100011001000110100101110100

and split in groups of 8 digits

01110010 01100101 01100100 01100100 01101001 01110100

This is just another way to write

114 101 100 100 105 116

To understand the meaning you need the way we encoded the message it was a=097, b=098… z=122

To select those numbers might look strange but is a fact how the test is encoded in the ASCII standard. It at the extension to it is how the regular test is encoded
You can look up the values in binary and decimal for the character at https://en.wikipedia.org/wiki/ASCII#Printable_characters

The values make sense in binary. There is a table for when 7 digits were use just att one 0 to the front. https://en.wikipedia.org/wiki/File:USASCII_code_chart.png

The values are picked so A is a 1 with 0100 in front and a is 1 with 0110 in front. You can just flip a digit to change from an upper case letter to confirm it to a lower case.

The short variants binary is just another way to write numbers. How you interpreted the number requires an external definition just like if you store information with a decimal number

You are viewing 1 out of 26 answers, click here to view all answers.