Summary of Principles Of Computer Composition

14 minute read

In computer major postgraduate entrance examination 408, Principles of computer composition plays a decisive position and account 30% of total scores. So, I’d like to spend a little bit time to record some frequent used concepts.

Hierarchy of computer system

Constitution of computer hardware

Constituted by Unit, Controller, Memory, Import and Output. (运算器控制器存储器输入和输出)

The working process of computer

  • The working process of computer is the executing process of instruction.

  • The instruction is constituted by opcode and operand (操作码和操作数): and the opcode shows the operation of the instruction, while address shows the operate target of the instruction.

  • Instructions are stored in memory sequentially(按顺序) according to the address order of the memory.

  • To record the executing process of instruction, a register is required to record the address of the read instruction, called as instruction address register, or program counter(PC). The read of instructions can determine the read instruction according to the instruction address indicated by PC, and because of the instructions are usually stored in the order in which the address is added, after each instruction is read, the PC added one and prepared for reading the next instruction.

  • The executing process of instruction.

    1. Instruction fetch(取指令): fetch the instruction indicated by PC, and PC++;
    2. Instruction decode(指令译码): analyze the opcode decide the operation content, and prepare the operand;
    3. Instruction execution(指令执行): execute the context indicated by opcode.

Performance index of computer

throughput and response time

  • Throughput(吞吐量): the amount of output data in a period of time.
  • Response time(响应时间): the time from the beginning to the end of an event, which also call it execution time.

Base frequency, CPU clock period, CPI, execution time of CPU

  • Base frequency: it shows the work time of CPU, and the common unit is MHZ;
  • CPU clock period, machine cycle and instruction cycle: the reciprocal of base frequency , and machine cycle equal to , instruction cycle equal to ;
  • Cycles per instruction(CPI): the average number of clock cycles per instruction for a program or program fragment. Usually defined as ;
  • Execution Time:

MIPS

MIPS is Million Instruction Per Second, usually defined as

An example in wikipedia

A 400-MHz processor was used to execute a benchmark program with the following instruction mix and clock cycle count:

Instruction TYPE Instruction count Clock cycle count
Integer Arithmetic 45000 1
Data transfer 32000 2
Floating point 15000 2
Control transfer 8000 2

Determine the effective CPI, MIPS (Millions of instructions per second)rate, and execution time for this program.

According to the formula of CPI:

Since:

Therefore:

Numeral system and encoding

Read Tianqin or Wangdao in detail.

Fixed-point number and floating-point number

Read Tianqin or Wangdao in detail.

Arithmetic Logical Unit

Serial adder and parallel adder

  • Serial carry adder(串行进位加法器): if add multiple numbers, we can add in parallel, and carry in serial. For example, there has two four-bit binary numbers A3 A2 A1 A0 adding B3 B2 B1 B0, it can be composed of an integrated circuit consisting of two pieces of full adders which contains two full adders or one piece of full adder which contains four full adders(可以采用两片内含两个全加器或1片内含4个全加器的集成电路组成).The schematic diagram is follow:

    schematic diagram As we can see, the carry signal of each bit is sent to the next bit as input signal, so the add operation of each bit must computed after the operation of the lower-one bit, and we call this way of carry serial carry.

  • Parallel carry adder(并行进位加法器):

    Skip…

Function and mechanism

  • ALU is mainly used to compute various arithmetic and logical operations.
  • General register(通用寄存器): general register is a set of memory with fastest access speeds, used to save the operand and intermediate result that participate the operation. Access register do not require Cache or bus cycles to run, so instructions executing quickly. Almost every instructions need to specify a register as an operand, and some require that the operand be stored in special register.
  • Special register usually used to represent a system state in which CPU is in, ALU has to important state register: PC and FLAGS.

Memory classification

  • Sort by memory medium: semiconductor memory(半导体存储器), magnetic surface memory(磁表面存储器), magnetic core memory(磁芯存储器) and optical disc memory(光盘存储器);
  • Sort by access mode: random access memory(RAM随机存储器), read-only memory(ROM只读存储器) and serial access memory(串行访问存储器);
  • Sort by the role in computer:
  • RAM is RAM, and ROM is ROM its easy to understand.

Memory extension

The capacity of a memory is limited, it’s quilt different from the actual memory requirement in terms of word count or word length, so we need bit extension and word extension.

  • Bit extension: bit extension refers to the expansion of word length with multiple memories. We connected each chips’ address lines by parallel(A0-A0, A1-A1, … A15-A15, …), and then connected to the address bus; Each chip provides a data line that forms part of the data bus(两芯片的地址线分别并接在一起(即A0与A0并接,A1与A1并接,A15与A15并接等等),接至系统地址总线;两芯片的数据线各自提供数据总线的一部分(此例为高4位和低4位),共同组成8位的数据总线);
  • Word extension: word extension refers to the expansion of word count. We connected each chips’ lower address line by parallel, and then connected to the lower address bus; Connected each data line by parallel, and then connected to the data bus; System higher address line, used for transcode, and the output connected to two chips’ chip selection(CS) side.

References

Some essay, blog or question referred above.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.