<< Chapter < Page Chapter >> Page >
General model of a computer

The basic function of a computer is program execution. When a program is running the executable binary file is copied from the disk drive into memory. The process of program execution is the retrieval of instructions and data from memory, and the execution of the various operations.The cycles with complex instruction sets typically utilize the following stages :

Fetch the instruction from main memory

The CPU presents the value of the program counter (PC) on the address bus. The CPU then fetches the instruction from main memory via the data bus into the Memory Data Register (MDR). The value from the MDR is then placed into the Current Instruction Register (CIR), a circuit that holds the instruction so that it can be decoded and executed.

Decode the instruction

The instruction decoder interprets and implements the instruction.

Fetch data from main memory

Read the effective address from main memory if the instruction has an indirect address. Fetch required data from main memory to be processed and placed into registers.

Execute the instruction

From the instruction register, the data forming the instruction is decoded by the control unit. It then passes the decoded information as a sequence of control signals to the relevant function units of the CPU to perform the actions required by the instruction such as reading values from registers, passing them to the Arithmetic logic unit (ALU) to calculate the result and writing the result back to a register. A condition signal is sent back to the control unit by the ALU if it is involved.

Store results

The result generated by the operation is stored in the main memory, or sent to an output device. Based on the condition feedback from the ALU, the PC is either incremented to address the next instruction or updated to a different address where the next instruction will be fetched. The cycle is then repeated.

The central processing unit (cpu)

You may call CPU as the brain of any computer system. It is the brain that takes all major decisions, makes all sorts of calculations and directs different parts of the computer functions by activating and controlling the operations.

CPU has four key parts

  • Control Unit
  • Arithmetic&Logic Unit
  • Registers
  • Clock

And, of course, wires that connect everything together.

Basic Model of the Central Processing Unit (CPU)

Arithmetic Logic Units (ALU)

The ALU, as its name implies, is that portion of the CPU hardware which performs the arithmetic and logical operations on the binary data .The ALU contains an Adder which is capable of combining the contents of two registers in accordance with the logic of binary arithmetic.

Control Unit

The control unit, which extracts instructions from memory and decodes and executes them, calling on the ALU when necessary.

Registers

Registers are temporary storage units within the CPU. Some registers, such as the program counter and instruction register, have dedicated uses. Other registers, such as the accumulator, are for more general purpose use.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Introduction to computer science. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10776/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to computer science' conversation and receive update notifications?

Ask