CPU and Computing Language

This week’s Computer Science class was both entertaining and informative.

CPU

We started off with a video called “Inside Your Computer”. It was a short, comprehensive clip about how a computer works, and in particular, how the CPU interacts with the other components of a computer. 

The CPU (short for Central Processing Unit) is the figurative brain of the computer. The CPU is responsible for carrying out a series of stored instructions (called a program). The computer receives an input through an input device, such as a mouse, and the CPU will in turn carry out the corresponding program, process the input, and output the result(s) through an output device, such as the computer display.

Now, saying that  the CPU will “carry out the program” and “process the input” somewhat oversimplifies this process, as there are several components that participate in it. The main components of the CPU are the CU (Control Unit), the ALU (Arithmetic Logic Unit), the Registers and the Bus.The CU makes decisions and sends commands to other parts of the CPU. The ALU carries out arithmetic (calculatation) and logic (decision) functions. The Registers provide temporary memory storage locations within the CPU. The “Bus”, as the name implies, transports information and commands from one part to another part within the CPU.

Once the CPU receives the input, the CU decides what to do with it. It’ll use the Bus to transfer commands to the ALU and send temporary data for the Registers to store. The ALU will follow the CU’s commands and calculate. Once done, the Bus will send the ALU’s calculations back to the CU, and the CU will once again make decisions on what to do with it. In the end, once the processing of the data is done, the CU will output the processed info via Bus to the output device.

Components-of-CPU-Processor-and-its-Work
A simple diagram of the CPU

To help us gain a better understanding of how the CPU and its components work together, we did role-playing of a CPU. The class was separated into different groups, and within a group, every single person had to act as a part of the CPU. Three people each represented the CU, the ALU, and the Bus, while there were two other people who represented the display and the CPU clock. The display is not part of the CPU, but is an output device that can show the processed data from the CPU. The CPU clock help keeps a record of total work times of all the other components. The clock helps us keep track of how much progress the CPU had made.

The role-playing activity was great because through interaction, we were able to dig deep and really understand how the CPU runs. We also realized that the CPU can only follow instructions. It cannot correct any mistakes unless told how to do so in the instructions. We also saw how the different parts of the CPU have to work together for it to run.

Binary Representation

The binary system is the language of the computer. It is represented using only zeroes and ones. Reading from right to left, if a digit is zero, it has a numerical (decimal) value of zero. If a digit is one, it has a numerical (decimal) value of 2^(n-1), with n representing which place the digit is in from right to left. For example, in 11111, going from right to left, the individual 1s respectively equal 1, 2, 4, 8, 16. The numerical value of a group of numbers is the sum of the value of each individual digit. For example, 11111=1+2+4+8+16=31.  101100=0+0+4+8+0+32=44. If every digit in a group of numbers is 1, then the decimal value of that entire group of numbers is 2^(n)-1, with n representing the total number of digits in that group of numbers. With the binary system, the computer can represent any whole non-negative decimal number. In computer science terminology, a bit is one digit in binary code. For example, a system with 5 zeros or ones (capable of having numbers such as 10010) is 5-bit.

BINARY
Examples of how the binary system works.

Obviously, this concept is a little hard to explain with only words. So, Mr. Pete had us once again do interactive activities to understand a concept.

To start with, he had five volunteers go in front of the class and gave each person a card; each card had a decimal value within the range of 1-16 and was a power of 2 (1,2,4,8,16). The cards were given in order from greatest to smallest, with the greatest number (16) being on the left. Mr. Pete would give us a number, and we would try to represent only with the cards and the powers of 2. Cards that were flipped down equaled zero, while cards that were raised up had a decimal value equal to the decimal value on the card. In actuality, this activity was basically the same thing as the binary system, just with cards face up and down instead of ones and zeroes. This activity helped us understand how the binary system works and how to use the binary system to understand decimal values.

Then, we did another few activities. One was where people were divided into pairs and every pair was given 5 cards just like the cards that were given to the volunteers. We were tasked with representing every whole nues.mber from 1-31.  Another activity we did was one where lights being on and off respectively were equivalent to ones and zeroes in the binary system, while different decimal values corresponded to different letters of the alphabet. Using this system, we created a message that said, “Help, I’m trapped.”

Finally, Mr. Pete gave us a homework sheet that had different decimal values on it. Our job was to use binary code to represent every single different decimal value listed.

ASCII & Unicode

ASCII, which stands for American Standard Code for Information Interchange, is the most common text file format for computers. In an ASCII file, each character is represented with a certain binary number in a 7-bit binary system, with their being a total 128 possible different characters.

ASCII
How to write out the Latin alphabet with ASCII.

Unicode is an international computing standard for texts from different writing systems around the world. It has over 137,000 different characters. Unicode has different encoding formats, with UTF-8 being the most dominant one and accounting for 92.3% of all web pages.

UNICODE SYMBOLS
Some examples of the many Unicode symbols.

ASCII and Unicode are very different from each other. ASCII is a subset of Unicode. ASCII is programmed to be used for the English language, while Unicode is international and meant to be used for not only texts from different languages around the world, but it can also be used for some special symbol sets and emojis. Obviously, Unicode has many more possible characters and bytes than ASCII.

In a Nutshell…

We learned about CPU, binary representation, ASCII and Unicode. One major way we learned was through interactive activities, which were fun, informative, and by allowing us to participate, were able to provide a deeper level of understanding for all the different concepts we learned.

Leave a comment