CPU, ALU, CU, and Registers

Von Neumann Architecture

屏幕快照 2016-10-01 下午6.36.54.png(Dale & John)

Von Neumann Architecture showed how a computer executes instructions and stores instructions and data in its memory. A scientist called Von Neumann suggested that a computer system should be be split into two parts: a processor module and a memory module.

The processor module is a place where instructions are executed. It is represented as Central Processing Unit which includes Control Unit and Arithmetic/Logic Unit in the diagram.

The memory module is a place where instructions and data are stored. It is represented as Memory unit in the previous diagram. (Dale & John)

Central Processing Unit (CPU)

  • Control Unit
  • Arithmetic/Logic Unit
  • Register

CPU acts like the “brain” of a computer system. It  contains the circuitry to interpret and execute program instructions.

Control Unit (CU)

CU acts like a manager in a computer. CU receives orders from RAM in the form of instruction and decode (break) that instruction down into specific commands for other components inside computer system. It directs the data flow and the operation of the ALU. (Dale & John)

Arithmetic/Logic Unit (ALU)

ALU does all mathematical operations (arithmetic) (+/-/compare) and logical (AND/OR) calculations. Some computers have two ALUs to process two calculations simultaneously. That is called dual core technology. ALUs contain several special storage units called registers. (Dale & John)

Register

Register is a small, very fast storage area inside CPU. It is used to store intermediate values from calculations or instructions that is needed again immediately. For instance, when a ALU is commanded to calculate A*(B+C), ALU needs to calculate B+C first, then ALU need to store the result for a moment and use the result to multiply A. It is faster for ALU to access register than store the data in memory units. There are four types of Register:

  • MAR (memory address register): store memory that currently be accessed inside RAM
  • MDR/MBR (memory data/buffer register): store data from memory
  • Accumulator (A register): a register store immediate result from ALU
  • Program Counter (PC): store the address of the next instruction (Dale & John)

Input Unit

Data and programs from the outside world enter into a computer system through an input unit. 

Output Unit

Output unit is a device that prints or displays data that stored in memory or makes a permanent copy of information which previously stored in memory. (Dale & John)

Buses

  • System bus transfers information between different parts inside computer system.
  • Control bus has two wires, set and enable. When CPU wants to read from RAM, the enable wire will be opened; when CPU wants to save information on RAM, CPU will enable the set wire.
  • Data bus is a two-way bus carry data commute between CPU and RAM.
  • Address bus is a one-way bus carry addresses from CPU to RAM. (John)

How a CPU works?

屏幕快照 2016-10-01 下午7.59.59.png(John)
Watch the video from 9'10'' to 18'25'' on https://www.youtube.com/watch?v=IkdBs21HwF4&feature=youtu.be

Process

  1. CU turn on enable wire of Instruction Address Register(Program Counter) to allow the next Instruction address to flows to RAM.
  2. Instruction address first goes to Memory Address Register which only tells RAM what address the CPU wants next. CU turns on the set wire of MAR, then memory address goes to RAM. CU turns on the enable RAM wire.
  3. Then data goes to Memory Data Register(buffer) from RAM via data bus. Then data (instruction) goes to Instruction Register.
  4. CU turns on the set Instruction Register(store instruction) wire. Instruction goes to CU. CU decodes instruction, tells ALU the type of operation ALU need to perform and stores the input in Temporary registers by turning on the set wire.
  5. ALU operates the instruction. CU turns on the set wire of Accumulator and instructs ALU to store the immediate result in Accumulator (A Register). CU turns on the enable wire of Accumulator to instruct Accumulator to output the result to the system bus.
  6. CU send address to MAR again and points out an address in RAM.
  7. The result stored temporarily in A Register will go to the RAM via data bus.
  8. Data will be stored in the specified address in RAM.
  9. CPU is ready for the next instruction. Repeat steps 1-6. (John)

Works Cited

John, Scott. How A CPU Works. 2013. Web. 1 Oct. 2016.

Dale, Nell and John Lewis. Computer Science Illuminated. Print.

留下评论