2.1 how computers work Flashcards
What do computers do at the most basic level
- At the absolute most basic level a computer adds really well and very quickly. It sees a strings of 1s and 0s and each one has a place value with it
- When there is a zero it ignores the place value when there is a 1 it takes that place value and adds it together
- If it adds up to 100, what 100 means will depend on the software. If it adds to 100 it mean print, but in another part of the software it might mean to save the document.
Numbering systems:
- binary place values
- how humans think
- The 0 and 1 system is called a binary numbering system, they usually come in forms of 8, which all together is called a byte
- Humans are not good at thinking in this binary system, we use a decimal numbering system (1,2,3,4,5,10,100), so we invented hexadecimal to convert decimals into binary then back to decimals
- Computers work with bytes when processing data, one byte for example, compromises one letter in the alphabet. When we add the value of a byte, we need need to determine the place value for any position that has a 1 present. Depending on where that is, the value will be different – a computer adds these place values to arrive at a value for a byte, and each byte has a meaning to the software the computer is running.
- Indeed, the point at which an output each value has (like 65 below) can change depending on the location of the software – it might in some cases mean an upper case A, in others to print a document, it could have hundreds of meanings in different locations
Anatomy of a byte
- what is a byte, bite, nibble
- what are the range values of one byte
(photo on page 16)
- A single 1 or 0 is a bit (e.g., 1)
- Eight 1s and 0s are called a byte (01000001)
- Four bits are called a nibble (0100)
- Each 1 or 0 has a place value twice its neighbour
- Where the 0 is you ignore the place value where the 1 is you add it in
- The low order bit is 1 on the right side – the high order bit is 128 on the left side
- Computers always start counting at 0 – so while I have 5 fingers, a computer counts at 0 and says I have 4 fingers – which still means 5 fingers
- It is important to understand the range of value
o A combination of eight 0s will equal 0
o A combination of one in each place will be 128+64+32+16+8+4+2+1=255
o There are 256 possible values - It is also important that only one combination of 1s and 0s will equal any of the possible byte values – for example, 0100001 will equal 65. There is never ambiguity in the place values that while equal a specific number – this is important because no computer has AI yet which is the Turing test which means that computers have no intuition
o As an example, when you write this bullet the computer puts a strings of 1s and 0s that create this text – if I typed and wrote an uppercase a by accident I would intuitively correct it, but the computer does whatever you program it to do
Anatomy of a nibble
- what’s the point
- high order and low order
- picture on page 17
- Nibbles simplify the math calculations computers do for humans
- Instead of a possible range of 256 values, there is only a range of 16 possible values
- The nibbles convert 128 to 8, 64 to 4, 32 to 2, and 16 to 1
- So we have a high order nimble and low order nibble (8,4,2,1) for both
- Nibbles are just for us, computers still only use binaries
Numbering systems
- decimal (picture on page 18)
- binary
- hexadecimal
- go through pictures and examples
Decimal:
* This is a base 10 numbering system which means that each neighbor is ten times so we have 3 numbers (1, 10, 100)
* If we want to arrive at 231 at the decimal numbering system then we add the following:
Binary:
* This is a base 2 numbering system which means we need two numbers (0 and 1) and each neighbour is two times
* If we want to arrive at 231 in a binary numbering system we add the following:
Hexadecimal:
* This is a sixteen numbering system which means that each place value is 16 times its neighbor so we have place values of 16 and 1. Also means that we need a total of 16 digits
* But each digit can only be one character in length so 1-9 then A=10, B=11, C=12, D=13, E=14, F=15
* In a hexadecimal numbering system, you will always be able to represent the range of 256 possible values in a binary system with exactly 2 digits
* In hexadecimal the first digit is always the high-order nibble, the second-digit is always the low order nibble – see below where how we got E for the first digit and how we got 1 for the second digit
* So if we want to get to 231 in this case we need to do the following:
o E16 + 71
14 times 16 plus 7 times 1
ASCII basics - picture on page 20
- The way we have been learning how computers see binary and place values this is called the American Standard Code for information Exchange
- Every computer in the world utilizes ASCII
- Here is an example:
Computer math primer: 2-byte field - picture on page 21
- What if we need a number larger than 255 in our possible values
- Let’s say we want 65,535 then you have 2-byte fields that can have up to 65,546 values
- Equation: * 256 + the second byte:
o 255 * 256 + 255: 65,535 - There is no ambiguity here too – only one combination here would only ever equal 21,965 for example
- Here are some examples:
Computer math advances: a 4-byte field (picture on page 21)
- What about if you need even more values than a two-byte field then you can use a four-byte field and have a new equation:
o Byte 1 * 256 to the power of 3 (256 x 256 x 256) + byte 2 * 256 to the power of 2 (256 x 256) + byte 3 * 256 + byte 4 - For example, the IP 8.8.8.8 is a dotted IP that equals 134,744,072 which is not dotted but represents the same value
- You can keep enlarging your number by adding another byte then increasing the to the power function – you can keep doing this until you reach a maximum number that you’re computer can go up to
Geek B’s
- In computing notation:
o B = bytes
o b = bits - 1MB = 1 megabyte
- 1Mb = 1 megabit (1/8th the size of a megabyte)
Computing size measurements (picture on page 22)
- Kilobyte, megabyte, gigabyte, terabyte – these represent data sizes of devices such as hard drives, random access memory (RAM), and other technical gear needed to make computers work
Operation system
- The software that makes a computer work – the central component of an operating system is the kernel. The OS and kernel define everything about how a computer functions.
o The GUI (graphical user interface) is the façade the display that the user sees - Some common operating systems are: Microsoft windows, macOS, Linux, Chromebook, Unix, Apple iOS
- There is also linux, but that’s mostly for server platforms, 96% of web servers on the internet run Linux. It is almost used exclusively on IoT devices. Because of the proliferation of IoT devices, Linux will be the most common operating system in the world.
Computer operation: hard drive vs RAM (picture on page 23)
- Every computer has a hard-disk drive: this is where the computer has a permanent storage drive – both software and documents are written to the hard drive and stored there.
- Every computer also has a random access memory (RAM): this is a temporary storage location – you cannot run software purely off the HDD, rather the program is read from the hard drive into the RAM and is stored there while it is running.
- Let’s say you have a MS word on the HDD, there is a binary that is recorded on the HDD. When you click on the word icon, it loads it into the RAM by going through the central processing unit (CPU) which compares the command to the binary saved, and then the CPU loads word it into RAM. When you see and use word, you use the one in RAM.
o Inside of word, let’s say you open a file that contains the words now is the time. When you click open file, the HDD in binary reads now is the time and loads on the RAM.
o When you make changes, your keystrokes are processes by the CPU, and saved in RAM. Those changes aren’t yet saved in the HDD yet.
o At some point once you complete the edits you press the save button, which tells word to run into the HDD and saves it there.
o When you close that file, it is taken out of RAM, and the latest version of it is saved on HDD. - Note: it is vital to remember that software is stored on the hard drive of a computer, but when you execute that software, it is loaded into RAM. All processing on a computer system, without exception occurs in RAM. Thus, there are many things happening in the RAM at once – the antivirus is running while word, powerpoint, and another application are all open – this is why RAM, which is crowded nowadays, is a very important component of a computer.