Computing component and instruction cycle

This week, we learnt about computing component and the way they execute instructions. I used to have no idea about how computer works, so I think computer is something magic. But having been taught, I think computer is logic that  it follows some of procedures when it is processing. 

I am going to mention following things in the blog post:

  1. IPO model 
  2. Main component of CPU
  3. Memory
  4. Instruction Cycle
  5. Activities
  6. Homework 
  7. Summary

IPO model

IPO is the fundamental model which describes the structure of an information processing program. The further instruction executing process inside CPU also bases on this basic model. Next, I will introduce input, process, output and storage separately. Input means that an input device offers available data to the process component. Process basically means manipulating data, which contains decoding the data into machine language and doing arithmetic or logical calculation in detail. Output means that processing unit sends the result of process, which contains number, graph, and words usually, to the output device. After that, output device demonstrates human then result. Storage can be considered as an extra part of IPO model, it usually means secondary memory (I will introduce it later), that can store data for long time.

Input: keyboard, mouse, scanner, punch cards. Processing: CPU executes the computer program. Output: monitor, printer, fax machine. Storage: hard drive, optical media, diskettes, magnetic tape. Chapter 1 Computer Systems.

Main component of CPU

The main components of CPU actually include ALU, CU, RAM, Cache, and Registers MAR, MDR and so on, which is very complicated.

CPU

CPU is the key component of computing system. It contains the circuitry which can interpret and execute the instructions.

CU, ALU, Register

CU is the acronym of of Control Unit. It decodes the instructions and controls other components of CPU. It can direct the data flow and operate the execution of the ALU.

ALU is the acronym of Arithmetic Logic Unit. It does all the arithmetic (+/-) and logical (AND/OR) calculations. It also referred to as ‘core’ of the CPU.

Registers are small and very fast temporary storage units inside the CPU. MAR and MDR are two kinds of registers, and they are very important in the instruction cycle.

Memory

All kinds of computers have memories to store a huge quantity of data. The memory of computer can be mainly divided into two large types —— primary and secondary memory. They have different properties separately. Primary memory is the only storage that is directly accessible by the CPU, and it always interacts with CPU when computer is executing instructions. Secondary or auxiliary storage is slow but has higher capacity compare with primary memory. People usually intentionally use it to store information for a long time.

Primary memory

According to detailed functions, primary memory contains three main types —— RAM, ROM and cache memory.

RAM is random access memory, it is widely used to contain the data (includes number, instruction, address, and letter), the computer has loaded since starting up and everything the user has opened/loaded. It’s volatile, in other words, its data will lose after people turning off the computer power.

ROM, read only memory, can’t be modified or rewritten by user originally, but currently, some specific ROM like EPROM (Erasable Programmable Read-Only Memory) and EEPROM (Electrically Erasable Programmable Read-Only Memory) can be rewritten. ROM is nonvolatile, that means data won’t be eliminated even if computer is turned off. Because of this property, people store BIOS (Basic Input Output System), the program which allows computer finding the operating system to “boost” computer after the power is restored, in ROM.

Cache memory has a definition: A type of small high-speed memory inside the CPU used to hold frequently used data. Computer can find the data which is frequently used, and store it in cache. When computer is executing instructions, it always finds data which is needed in the process in cache firstly. Only if it doesn’t find the data in cache, it will find data in RAM. Therefore, cache can rise up the working efficiency of computers a lot. People divide cache into different levels according to the using frequency of data. The first level stores the data which is used the most frequently. Chip of level 1 is the fastest, smallest, and is usually set in CPU. The caches of second and third level are usually out of CPU, and they are bigger and slower than that of level 1.

Secondary memory

The ability of primary memory is limited. Users need space to persistently store information like images, audios, videos, and texts in computer. So secondary memory which satisfied this demand is invented. Secondary memory contains HDD, SSD, Flash, CD, and DVD, and they have different properties and ways of storing and reading.

Instruction Cycle

Before learning the instruction cycle of computer, I predicted it should be difficult and complex. But I found that the general structure of instruction cycle is easy to understand after learning. The only difficulty is that some detailed points of executing are complicated and professional. I was confused because I haven’t seen the infrastructure of CPU before, so the knowledge is totally new and abstracted for me.

In order to form the machine instruction cycle, all the components of CPU need to work together, because all of them have different roles and functions in the cycle.

The image above shows the general steps of instruction cycle. People divide the instruction cycle into four parts, according to the purpose. The first part is fetch, it describes the process that CU fetches data from memory. In the process of fetching, data shifts from a component to another for many times, and finally arrives the Control Unit. The second part is decode. Control Unit decodes the data that is just fetched from memory, so the data can be understood by ALU after decoding. The third part is execute. ALU calculates decoded data according to the instruction, and gets and shows the result or output. The four part is store. ALU sends arithmetical results to memory, so the data can be stored. However, sometimes memory needn’t to store data, because if ALU gets a logical result, it will sends the result to CU directly.

Next, I will talk about the components which involve in the instruction cycle and their functions.

PC contains the address of the next instruction to be executed.

MAR(memory address register) contains an address in the main memory that is currently being read or written.

MDR(memory data register) is a two-way register that holds the data fetched from memory (RAM) or data waiting to be stored in memory (RAM).

IR(instruction register) holds the instruction currently being executed or decoded.

Accumulator register stores immediate result from ALU.

Activities

This week, we mainly did two activities. The  first is little man computer. The second is Designing my own PC.

Little man computer programming. 

We develop understanding of assembly language and appreciate the simplicity of assembly language by little man computer.

This is the picture that shows the program for four numbers’ sum. The program could be illustrated by formula sum=(a+b)+(c+d). I did not do well because the length of the code is huge. Actually storage step could be deleted but it would increase the change of making mistakes. 

This is the picture that shows three number’s sum. The program could be illustrated by formula sum=a+b+c.

The two picture above are multiplication and division. They are more complicated than adding task since I could not input two number and multiply them. I have to use loop. A times B equal to the sum of A numbers of B. After each step of adding, the remaining times would minus one. Similar things happen to division, where we could use subtract. 

Design your own computer

This project was held for gaining more understanding about computers because . It did work actually. Our computer is designed for gaming and 3D structuring. 

dav
dav

Reflection

I gain understanding of computer by knowing the component and constructing the computer. Because when I was finding the right choice for the  CPU, GPU, I have to equalize the performance of them to the aim we set. It turned out that 3D structuring do need strong performance and many thread but intel E7 CPU is too much. Besides, the computer also need to be good at playing games, so it need a graphic card. With thoughtful consideration and a mass of investigation, we did construct good computer. 

However, I can do better because I randomly choose a screen for the computer, which seems not to be the best options. If I have another change, I would bet willing to spend more time on choosing a better screen.

Summary

This week was very interesting for me because I learnt a lot about the computer. Computer used to be something magic to me as I did not know how  it works. But now, I know exactly how computers functions. Besides, I gain better understanding about the component of the computer, which is very beneficial.

Leave a comment