Welcome!
Last week we stepped into the core of computer. We learnt about how CPU works, functions of CPU, ALU, CU, and registers. We also studied about knowledge associated with CPU. We also learnt to write assembly language last week in order to be familiar with machine instruction cycle. It is a fun week.
Input, Process, Storage, and Output Concept
Input – process – output is the model used by all computers. A computer receives an input, processes the instructions, and then performs an output. It could be described as putting information in the computer, doing something with the information, and exhibits the results. Storage is where data is kept once the computer is turned off. For example, when toasting a slice of bread by a toaster, input is a slice of bread, process is the procedure to cook the bread, and the output is the final toast.
Main components of a CPU
CPU is the main part of a computer. The CPU (Central Processing Unit) sends signals to other part of a computer which works just like a human brain. It is the electricity circuitry within a computer that carries out the instructions of a computer program by performing the basic arithmetic, logical, IPO instructions. ALU (Arithmetic Logic Unit) and CU (Control Unit) are two main parts of CPU. There are also registers in a CPU. ALU is the core of CPU. ALU does all arithmetic and local calculations. CU is responsible for giving commands to all other components in a CPU and decoding instructions. Registers are small, fast, and temporary storage of data embedded in a CPU.

RAM (Random Access Memory) is the physical hardware inside a computer where temporarily stores the operative system, application programs and data in current use since starting up. There are four types of data stored in RAM which are address, number, letter, and instruction. RAM is a volatile memory which means that it will lose data if power is lost.
ROM (Read Only Memory) is a type of non-volatile (permanent) memory which contains programming needed to start a computer—essential for booting-up. ROM is read-only, it could not be changed.
| RAM | ROM |
| Temporary storage | Permanent storage |
| Volatile | Non-volatile |
| Faster | Slower |
| Larger capacity | Smaller capacity |
| Primary memory | Primary memory |
Cache is a small, high-speed access area memory embedded in a computer to hold frequently used data. It is a SRAM (static Radom Access Memory). There are three levels of cache which are Level 1 (L1), Level 2 (L2), Level 3 (L3). L1 is embedded inside a CPU, while L2 and L3 are embedded between CPU and RAM. However, L2 and L3 have larger capacity but longer time to access compared with L1. Cache Hit means that when CPU looks for data, it successfully finds the data inside cache. Under this circumstance, data will be sent to CPU. If CPU does not find data in cache, it will fetch from RAM, then data will be written to the cache and sends back to CPU. This procedure is called Cache Miss.
| RAM | Cache |
| Primary memory | Primary memory |
| Volatile | Volatile |
| Slower | Faster |
| Outside CPU | L1 inside CPU, L2 & L3 between CPU and RAM |
There are different types of registers embedded inside a computer which play important roles. MAR (Memory Address Register) stores addresses that recently be written or read by CPU in main memory. MDR (Memory Data Register) is a two-way register. It stores data fetched from memory and data waiting to be stored in memory. Instruction Register stores instruction fetched from memory that has currently been decoded by CU. Program Counter stores the address of the next instruction. Accumulator holds the immediate result of ALU.
Here is a picture of an exercise we have done during the class in order to be familiar with the components in CPU and each functions. First it was really difficult to remember because there are many similar terms with totally different functions. After practicing several times, it became easier.

Summary of the video
During the class, we also saw a video to have a basic knowledge of computer. Here is the summary of the video.
CPU (central processing unit) is like the brain of a computer. Clock is a particular wire that turns on and off at a steady rate to help keep everything in sync. CPU fits into motherboard. Motherboard permits all the components in a computer to associate with each other.
RAM is on the right of the motherboard which stores information temporarily and could be accessed directly. Normally data is accessed in order, even though it can be accessed randomly when needed. When computer starts to run a program, it sends an address to RAM to retrieve that program. CPU turns on enable wire and then RAM sends all data on that address back to CPU. When it stops the first program, it will sends another address to RAM. When CPU needs to save data to RAM, it outputs an address and some data. Then it turns on set wire. RAM will rewrite the data at that address with new data. Data in RAM could be instructions, numbers, letters, and addresses. There are LOAD, ADD, STORE, COMPARE, JUMP IF, JUMP, IN, and OUT instructions. COMPARE instruction can be very useful when used in conjunction with JUMP IF instructions which checks a certain condition is true, which actualize randomly access data from RAM.
There is control unit inside CPU which receives orders from RAM in the form of an instruction, and it will break it down into commands for other components. One important unit is ALU (arithmetic logic unit) which performs all mathematical operations inside CPU, like addition and subtraction. There are two inputs of ALU. CU receives instruction from RAM and then give commands to ALU about what type of operation to perform. Then ALU will perform the operation and output the result. Flags will tell CU what to do when receive next instruction.
Bus is a group of wires connected multiple components inside a computer. Four registers on the top only store numbers for operations. Instruction register stores the instructions which does not need enable wire. Eventually instruction address will get to RAM but there is an intermediary register called instruction address register. It will tell RAM what the address of next instruction.
The video gives us a hint of how CPU works and the basic functions of each components in a CPU. This video is simple but easy to understand. I highly recommend computer science beginners to watch this video.
Primary and secondary memory

Primary memory is the memory that is directly accessed by the CPU to store and retrieve information, like ROM, RAM, Virtual memory, and Cache. Secondary memory is a storage device that is not accessible directly by the CPU and used as a permanent storage device that retains data even after the power is turned off, like DVD/CD, HDDs/ SSDs, Flash. Virtual memory allows a computer to compensate for physical memory shortages by temporarily transferring data from random access memory to disk storage.
In order to memorize the difference between primary memory and secondary memory, we also did an activity during the class.

The key to improving computer processing speed is to allow data to flow through the processor as fast as possible. Cache needs less amount of time the processor spends waiting for data in order to reach the goal. If cache hits occur, it will reduce the amount of time to fetch data. The larger cache memory of L2 and L3 are the faster CPU can fetch data because it will minimize cache misses.
The need for persistent memory
Primary memory is temporary memory and it is volatile which means that data will lose if the power is off. While secondary memory is permanent memory, it is non-volatile. Without persistent memory, there will be constant data loss. Without secondary memory, the computer could only process basic operations which could input data every time when used. As a result, the computer could not operate properly with only primary memory, and persistent memory is needed.
Little Man Computer (LMC) and programming in Assembly Language
As mentioned in the previous blogpost, assembly language is a low level programming language that consists of instructions that are mnemonic codes for corresponding machine language instructions. Assembler is a program that reads and translates assembly language to machine language. We also practiced to program in assembly language. We also did an interesting activity called Little Man Computer. This is the first time we tried to program in the course, even though the instructions we wrote were really simple. By doing the activity, we also understood how machine instruction cycle works.
A + B+ C

(A + B) + B + C

Machine Instruction Cycle

The machine cycle is a 4 process cycle that includes reading and interpreting machine language, executing the code and store the data. The first step is fetch — to retrieve instructions from the memory. The second step is decode — CU translate the retrieved instruction into a series of computer commands. The third step is execute — ALU will execute the instructions. The last step is store — ALU will send and write the results back in the memory. We also drew the block diagram during the class.







Gates could be combined into circuits through using output of one logic gate as the input of another logic gate. Gradually it could form complex circuits to accomplish more difficult task.
































The primary memory device was a magnetic drum whose data was recorded through read or write head. By the end of the first generation, magnetic tape drives had been developed. Storage device external to the computer memory was auxiliary storage devices.
From “






This week is project week. We are Group 11 and we focus on stress management. Everyone in our group needs to find one proposed guiding question. This is the question that I have found which is ” what are the signs and symptoms of stress overload?”

There are five intervals of BMI index which are “<18.5”, “18.5-22.9”, “23-24.9”, “25-29.9”, “>30”. I got the information form Internet. BMI index in different intervals means different fatness degree. After calculating BMI index of each adults, we used simple function like MIN, MAX, AVERAGE to find the minimum, maximum BMI index among the adults. We also find the average among them.

We used complex IF function to give them report and suggestion. The output is the report and suggestion to give adults by calculating their BMI index. 
We also used CONCATENATE function to combine the report and suggestion. We drew a graph to show the data more clearly. We also write a story to let people to pay more attention on their health state.
From the spreadsheet project, I learnt a lot. I also found that BMI index can reflect a lot. Having a good health state is really significant. People should keep a health diet and do exercise. Spreadsheet has many different functions which can be used in different way. I learnt how to use different function in spreadsheet to solve problems in daily lives. Spreadsheet is a general purpose software which has many different functions. Computer science provides convenience to people’s lives in many aspects. There still a lot of information of spreadsheet need us to develop.


Function






ROUNDUP(number; places) Roundup is to round a number up, away from zero, to a certain precision. When a factory buy ingredients of a substance, they will roundup the amount of ingredients they need. 


ABS(number) ABS is to return the absolute value of a number. When a factory the same kinds of products, there must be considerably small differences between acceptable products and products they make. The factory could use ABS function to find which products they make accord to the acceptable products.







A library program is also a sequence of instructions that a computer can interpret and execute. For example, Oracle software use library program called RAC.
Utilities are programs that have a very special task to do with the computer. It is designed to help analyze, configure, optimize or maintain a computer. For example, anti-virus program and disk checker.



Bespoke application software is tailor-made software for a specific purpose. It is an exact satisfy with the client’s requirements,. This kind of software is built for particular purpose. Content Management system, Business Process Automation system are examples of bespoke application software.
