A Guide for Understanding Computers
Explaining what a computer is and what is happening inside the computer.
Speed
Computers are simple. They can only do one simple thing at a time.
Because computers use electricity, their speed is the same as the speed of electricity. A computer can do 500 million simple tasks all in one second. Computers doing 500 million simple tasks would vary between computers, so we shouldn’t say how many things a computer could do in one second. Computers are always improving and companies continue to produce new computers that go twice as fast as the old ones. Computers use to be expensive, but now things have been getting faster, smaller, and cheaper.
Computers
Computers show pictures, music, letters you’ve written, and video games, but you wouldn’t find those inside a computer. There is only one thing inside a computer and they are called bits. A bit can only be in one of two possible states. For example, the lock on your front door can either be locked or unlocked. It can’t be something else. A lump of clay isn’t a bit because you could mold it into something else; anything you can dream of.
A bit is either “yes” or “no”.
There are lots and lots of bits and they are arranged and connected in lots of ways.
Logic gate
This is a logic gate. The two wires, A and B, on the left are the inputs, and the wire on the right, Y, is the output. All three of these wires are bits which means they can either be true or false. Each input bit comes from somewhere else and is either on or off depending on the situation.
Simple Variations
There are a lot of logic gates, but I’m only going over the simple variations.
The NOT gate starts with a triangle, which just means a computer takes the input and turns it into an output. The circle means to switch to the opposite.
The AND gate is used a lot in computers. Two input combines into one output.
The NAND gate is made out of the AND and the NOT gate. If all the inputs (a and b) are true, the output would be false. That would be the only case when it’s false, so if a is true while b is false, the output would be true. So just remember that output is only false when a and b are true.
Diagrams
A computer is a machine, but the only thing that moves inside of it is invisible electricity unless we count for the fan. The fan is the only thing that moves, but lets exclude that for now.
A computer begins with a tiny crystal wafer which then is subjected to different kinds of chemicals, heat and vaporized metal, and photographic processes. Everything combines ad the result is a ‘chip’ which has millions of electronic parts on its surface. The chip would get pins coming out of it and are plugged into a board.
This is computer memory. It is made out of four NAND gates.
Here is an example where you can try out inputs and then see the output:
https://www.101computing.net/random-access-memory-using-logic-gates/
Bit
The only thing a bit can actually do is turn the lights on or off. Electricity is either on or off and that’s about it.
But we could use a bit to represent something such as taking a bit and connecting it to a red light and when you say turn on, it means stop, and when you say turn off, it means to go.
This is using code. This is also how you assign meaning to a bit. The bit doesn’t contain any meaning itself other than electricity. Just a yes or no can be a major part of our lives, such as “Do you want fries” or “Will you marry me?”.
But you know not all things can be perfect and there are many things a bit cannot do. Yes and no is a big part of everyday life, but there is more to it than just a simple yes or no. You can’t say yes or no if someone asks for your name unless your name is yes or no.
If we want our computer to do more than a yes or no then we can just add several bits together, and then make up a code to assign meaning to them. Just as a traffic light has three bits, one for red, one for yellow, and one for green. If we only had one bit in a traffic light then well there would be confusion and crashes since nothing would appear at the traffic light.
Other Name
Bits are either on or off, true or false, in or out, but we’re going to use something different. From now I’m going to explain on or off as zero and one. Off is zero and on is one.
Nothing has changed we’re just calling it 0 and 1. There are no new numbers only bits in a computer.
Eight
This is called a byte and it contains 8 bits. A bit can only have two possible states, but if we were to combine them then we would get more states, such as having two bits would therefore give us four possible states.
The order of bits does matter.
Every time you add a bit, you double the number of possible states. So if you have four bits then you would have 16 states. If you have five then you would have 32, six would have 64, seven would have 128, eight would have 256, and so on.
The byte as a whole can be in any one of 256 states at any given time.
Codes
Now that we have a byte of 256 possibilities, we can start adding languages. But since a byte doesn’t hold any shapes or pictures, we would have to use code to associate on one of the possible states that a byte has.
The letter A’ would have to represent by a pattern of 1s and 0s in the bits of a byte.
This is what the people who invented the code came up with.
Each code is unique.
If you want to write your name in binary or just convert text to binary. Check out this link:
https://www.convertbinary.com/text-to-binary/
This is how I would send secret messages.
RAM
Ram is half of what is necessary to build a computer. This is what you use if you want to access the bytes of memory in a random order which is why RAM is called “Random Access Memory”.
RAM uses 257 registers. 256 registers are memory storage locations while the lonely one register is used to select one of the storage locations which is called “Memory Address Register” or “MAR”.
256 bytes is pretty small for a computer's RAM, so in order to get a larger RAM, we have to provide two registers that are used to select a memory storage location.
Numbers
Earlier we saw letters in 0 and 1, now we’re going to look at numbers
0-9 are called decimal systems because ‘dec’ means ten in some ancient language.
0-5 are called senary systems because ‘sen’ means six in some other ancient language.
0 and 1 are called a binary system because ‘bi’ means two, and also because of some other ancient language.
There is also a 0-F system that is called the hexadecimal system because ‘hex’ means six in some other ancient language and ‘dec’ still means ten, so it’s a six-plus-ten system.
Addresses
One of the places we use binary number codes is in the Memory Address Register.
Every house has an address, but on a computer, bytes don’t have any way of identifying information or containing information. When you put a number in the Memory Address Register, a byte just gets selected. The byte gets selected by where it is, and not by any other factor. So a computer address is just a number that makes a certain byte selected when an address is put into the Memory Address Register.
Logic
Logic is where if you have two facts, you may be able to get the third fact from the first two. For example:
Children like candy.
David is a child.
Therefore does David like candy? True or False?
Many computer parts like AND gates, take two bits and make a third bit. The thing that these gates do is known as logic.
There are maybe OR logic, XOR logic, or AND logic, but in general for all of them, we use just logic.
What we described above of doing things to bytes is known as ‘arithmetic and logic’. The Arithmetic and Logic Unit is the heart of the computer where all the action happens.
Clock
Every computer has a special bit. All the other bits in a computer are set on and off by switches, but this one special bit turns on and off all by itself.
This special bit is called the clock. This clock goes well over a billion times per second or several gigahertz. This is how computer companies advertise how great their computer is, they tell you the speed of its clock. The faster it is, the more expensive it is. It is the speed of this single bit that turns on and off.
Instructions
The instruction register contains a byte that tells the Control Section what to do. There are patterns that are put into the register, which is another code called “Instruction Code”.
There are a lot of instruction codes that have been invented for different types of computers. Unless you want to go to a highly technical career where learning instruction codes is required, don’t study them.
All instructions involve moving bytes across the bus. They will go to or from RAM, to or from registers, and sometimes through the ALU.
Outside World
Anything that deals with the outside of a computer are called ‘Input/Output’ or ‘I/O’. Output means that data is coming out of a computer; Input means that data is going into the computer. Some things are input such as a keyboard while some things are output such as a display screen. There are also disks that perform both input and output,
The CPU and RAM are the computers while everything else such as disks, printers, mouse, keyboards, monitors, speakers, and so on, are all capable of accepting bytes of data from the computer or sending bytes of data into the computer.
Final Word on Code
Each code is designed for a specific purpose. They are put in bytes and moved around. Bytes do not know which code was used to choose a pattern they contain.
Bytes only contain patterns of ons and offs, so if a byte contains 0100 0101, and you wanted to print it out, it will print the letter ‘E.’
Once a code has been built, the mind and code are gone. All it does was do the things it was designed to do.
There is no limit to codes that can be invented and programmers invent new codes all the time.
Summary of Computers
Everything a computer does is ADDing, NOTting, Shifting, ANDing, ORing, and XORing of bytes. There are also storing, loading, jumping, and I/O operations, via execution of the instruction code from RAM.
Computers are just machines that are designed exactly what to do, and nothing more.
There are a variety of things a computer can be made to do, and the limitation is only the imagination of people who create the programs that help computers run.
There are computers in everything such as the computer in your car, the computer in your phone, and the computer in a satellite. The things that they all have in common are that they all have CPU and RAM. The differences are the peripherals, such as phones have microphones and speakers while a car has sensors and controls for the engine, and so on.
Hardware and Software
Software means the way bits are set on or off in a computer. The bit is hardware. If you want a computer to do a certain thing for you, then you would have to set those bits on or off according to the pattern that will make a computer do what you want to do. This pattern is called software.
So the difference between hardware and software is that hardware is something you can see, handle, and pick up while the software is the way hardware is set.
Programs
A series of instructions in RAM is called a program. They come in many sizes. A program may be made up of several parts known as ‘routines’. Routines may be made up of subroutines.
Most computers in people’s homes have multiple programs installed in them. These programs are used to do something that the owner wants to do. Application programs are written to solve a problem. There is one program that isn’t an application and that is called the Operating System.
Operating System
An operating system is a large program that has many parts and several objectives.
The first job is to get the computer running when you turn it on.
Another job is to start and end application programs.
An operating system also provides services to programs.
Languages
Writing programs is difficult if you’re just writing ones and zeros since that is the only thing a computer can understand.
A computer language was invented to solve this program. Its purpose was to make it a lot easier to write computer programs.
Every single program has to be written in ones and zeros, but someone remove that hassle and created a compiler.
After the compiler was created, programs were written in easier languages and then translated into Instruction Code by the compiler.
So in order to create a computer language, you need a set of words that make up a language, and a compiler that compiles the written language into computer instruction code.
[END]