Binary Code

Binary code
Binary Code
Binary Code

Binary code is a system of representing numbers, letters, commands, images and sounds. Amazingly, it uses only two types of information to do this – 1 and 0. The strings of 1’s and 0’s that make up binary code may seem random, but of course they’re not.
Binary code is at the absolute heart of anything that goes on inside a computer – and yet it’s something that most code tutorials don’t cover. 
A binary code represents text, computer processor instructions, or other data using any two-symbol system, but often the binary number system's 0 and 1. The binary code assigns a pattern of binary digits (bits) to each character, instruction, etc. For example, a binary string of eight bits can represent any of 256 possible values and can therefore represent a variety of different items.
In computing and telecommunications, binary codes are used for various methods of encoding data, such as character strings, into bit strings. Those methods may use fixed-width or variable-width strings. In a fixed-width binary code, each letter, digit, or other character is represented by a bit string of the same length; that bit string, interpreted as a binary number, is usually displayed in code tables in octal, decimal or hexadecimal notation. There are many character sets and many character encodings for them.
A bit string, interpreted as a binary number, can be translated into a decimal number. For example, the lower case a, if represented by the bit string 01100001 (as it is in the standard ASCII code), can also be represented as the decimal number 97.
Here’s an explanation of the fundamentals of binary. At the end you should have a basic idea of what all those 1s and 0s mean. 
The binary number system is a base-two system, meaning it uses two distinct digits – 0 and 1. The decimal number system we’re all familiar with is a base-ten system, meaning it uses ten distinct digits – 0 and 1, but also 2, 3, 4, 5, 6, 7, 8 and 9.
Counting in the decimal system, when all ten digits have been exhausted, the next number is represented as ’10’. In the binary system, it’s the exact same. After 0 and 1 comes 10. In fact, here are the first 15 numbers expressed in binary:
As you can see, the binary system counts up in a logical order, and whenever a number made up of entirely 1’s is reached, an extra digit is added. This is exactly the same thing that happens in the decimal system when a number made up of entirely 9’s is reached.
As you can also see, there are 16 distinct numbers that can be represented in 4 digits or less (1 through 15 as well as 0). This can be calculated because 16 = 24.
However, binary numbers in a computing context are always represented in 8 digits or less – 8 binary digits forming one byte. The total quantity of distinct numbers that can be represented in 8 digits is 28 = 256. 1 through 255 as well as 0.
So 255 in binary is 11111111.

No comments