What is a code? A code is a way to represent information in a different way than its original presentation. The different representation can be used to make it so only those that know how to decode the message can understand the information. A code also can be changing the way information is presented to make it more readable to other people or systems. Louis Braille generated a code that allowed blind people to read books. The sight book are encoded into different bumps on paper that allow the blind to read the information. This encoding is known as braille.
Encoding Examples
Braille is one form of encoding. Letters and Arabic numerals are another form of encoding. Changing a text from one language to another such as French to Italian would be another example of encoding the same information in different ways so others can read it or to prevent those who don’t know how to decode the message from reading it.
Many of the examples I have given are examples of how people send encode and decode messages. Computers are machines. A machine like an engine are generally built for one purpose, like making the wheels on the car turn allowing us to drive down the road. Computers are built for a purpose as well, math, logic and data operations which I discussed in my previous article.
How do machines store information? Much like a printing press stores different letters in a book. The book would be the memory. The printing press writes each letter and the information is transferred to the hard copy, a book.
The way computers store information is much the same. Computers have many different technologies and mechanism and different types of memory but at the basic level they store information with light switches (figuratively speaking). If a light switch is turned on, it is represented as a 1. If a light switch is turned off, it is represented as a 0. This allows us to store two representations which is called binary. Computers speak in binary and other encodings like we speak in English or other languages like Chinese or Spanish. So how would one represent a number like 7 or 3 in binary? Binary only has two values which are 0 and 1 which makes this a bit confusing. Much like we can add numbers in the front of 7 to say make 17, or 27, or 37 we can add values in front of binary to represent greater values.
What are some examples of binary encoding?
| Normal Decimal Number | Binary |
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
From the table above we can see that 0 and 1 have the same values in decimal as they do in binary. Binary can represent those two numbers without having to add a greater value. Binary can’t represent 2 or 3 in just 0s and 1s so it needs to add a greater value, so to represent a 2 it adds 1 to the front.
In decimal we represent each digit progressing left as a multiple of 10. That is why decimal encoding is considered base 10. In binary we represent each value in multiples of 2, that is why we consider it base 2.
| Binary Number | Decimal Number |
| 0 | 0 |
| 1 | 1 |
| 10 | 2 |
| 100 | 4 |
| 1000 | 8 |
The way to convert a binary number to decimal is we need to look at the position of the 1. We generally ignore 0s as they represent values we don’t have to add. When considering position the first position is considered position 0. So at position 0 for binary 1 or 0 we just add that value.
Position 1 in binary is where we have to multiply by 2. So if the binary encoding is 10 then we multiply the 1 in Position 1 by 2. So 10 is represented as 2. Further 11 is represented as 2 (from the first position) + 1 = 3.
Further representations are the same way. If we look at 100 we take then its Position 2. We find the decimal number by 1 multiplied by 2 to the exponent of the position. Generally in computer programming we represent exponent operand as ^.
100 = (1)*2^2 + (0)*2^1 + (0)*2^0 = (1)*4 + (0)*2 + (0)*1 = 4
More examples
101 = (1)*2^2 + (0)*2^1 + (1)*2^0 = (1)*4 + (0)*2 + (1)*1 = 4 + 0 + 1 = 5
110 = (1)*2^2 + (1)*2^1 + (0)*2^0 = (1)*4 + (1)*2 + (0)*1 = 4 + 2 + 0 = 6
111 = (1)*2^2 + (1)*2^1 + (1)*2^0 = (1)*4 + (1)*2 + (1)*1 = 4 + 2 + 1 = 7
These are examples of decoding binary numbers into decimal numbers. Examples of encoding from decimal into binary is similar except we use division and look at the remainders instead of multiplication. Below is a useful link that shows the longhand division.
| Decimal number | Conversion | Binary |
| 0 | 0/1 would give no remainder | 0 |
| 1 | 1/2 would give a remainder of 1 | 1 |
| 2 | 2/2 = 0 remainder and 2/1 would give remainder 1, flip this to 10 | 10 |
| 3 | 3/2 = 1 remainder and 2/1 would give remainder 1, flip this to 11 | 11 |
| 4 | 4/2 = 0 remainder and 2/2 would give 0 remainder, 2/1 would give remainder 1, flip this to 100 | 100 |
Other computer encodings:
| Decimal number (Base 10) |
Binary (Base 2) |
Oct (Base 8) |
Hexadecimal (Base 16) |
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 100 | 1100100 | 144 | 64 |
| 1000 | 1111101000 | 1750 | 3E8 |
This article will be a precursor to hopefully some other articles on base 64 encoding and then encryption.
Ethics of Encoding
All technology can be used for good purposes and bad purposes. Intelligent people know they can create associations with certain things in peoples mind. They can tie colors or numbers to different things in society. They can use this to break down communication between families, cities, and states. Many times those that create encodings such as these don’t understand the full ramifications of all their actions.
These encodings can be used to teach bullies a lesson or they can be the instrument of bullies themselves. Street names or other companies names could be taken out of context. Through this they can derail companies or societies themselves. It is a bit of a chicken and an egg problem. Did the company know their name would be taken out of context or did others leverage their name to bankrupt the company. A little bit of knowledge goes a long way. I don’t understand any different human languages and not being able to pick up on puns or other types of encoding in other languages or multiple languages might be a blessing in disguise. The idea that we should all think better of other people doesn’t only help them, it generally helps us. When a group of people builds mistrust in any person it can make them question who is on the level and who is not.
Important to understand that mixed with different types of drugs these encodings and associations can be leveraged to manipulate people in to acting in certain ways, both good and bad. Also sad to say that health problems and other issues that are no fault of the person can be leveraged by others for this same purpose. This is why we need vigilant people to be able to understand what is going on at different times. We also need to watch closely that some master plan isn’t unfolding right between our eyes. Disrupting this encoding can be important at times.
It is sometimes difficult to know which side of the fence a person is on, so telling this to people might let you know your onto them. Yet not telling someone this can make them appear to be a certain way that they are not. Others might prefer to orchestrate someone else telling them because they are too afraid to say so themselves, definitely understand both sides of the coin on that one.
People use encodings as well, through non verbal communication. Things that might be obvious to others might not be so obvious to someone else. Proceeding with a level of caution with all human beings is extremely wise. We don’t know what the other person has been through, nor what health problems they have. This can change on a daily basis which can make this even more difficult. Add in drugs and alcohol and it can be a recipe for disaster. All that said, many of us don’t hear this, or we don’t understand in the way it was communicate to us. Maybe someone would try but because of other issues they weren’t able to listen, or maybe the people that should have said something didn’t have the capacity at the time. This is why grace is important, it not only helps others but also frees ourselves down the line from paying for things we didn’t understand at the time. That said people that understand this might be less likely to take chances going forward, the probabilities and possibilities of failure can be overwhelming to the point they choose not to act and fail to speak up when necessary.
I generally try to look at the motivations behind a persons actions, though even this can be deceptive. Some people might want to make others take pity on you by being mean. I consider this a bit of a failed logic. Others might just want to spar a bit but it would be wise to make sure both are at capacity for a fair fight and people aren’t actually getting hurt. The main point from above being that people can encode information in different ways and that others don’t always understand the information encoded which can result in miscommunication.
This is also why living in cities can be difficult. There are more interactions and less time to deal with those interactions in a graceful way. People in cities might have just experienced 100 problems that are out of our control, if they sound like a jerk, it might not be because of us. We would like to be able to expect they will treat us with kindness and treat us as we would like to be treated, but at that point in time, they just might not have the capacity. Giving a person who seams mean or unhappy the benefit of the doubt and trying to do right by them the best we can might not make things better with our interaction, but it might help ease their burden or prevent problems down the line. Excessive pressure on any person, organization, or society can cause it to collapse. I don’t want to clean up the mess, so hears to hoping I will have the capacity to give others the grace they need. Remember also that others can reverse this process to try and destroy people, then use it as an excuse to go to war.
Links to similar articles