Learn fundamematls of Computer System
IAS computer consists of:
- Input and output (I/O) equipment operated by the Control Unit.
- A control unit, which interprets the instructions in memory and causes them to be executed.
- An arithmetic-logical unit (ALU) capable of operating on binary data.
- A main memory, which stores both data and instructions.
This is a general depiction of a von Neumann system:
These computers employ a fetch decode-execute cycle to run programs. The control unit fetches the next instruction from memory using the program counter to determine where the instruction is located. The instruction is decoded into a language that the ALU can understand. Any data operands required to execute the instruction are fetched from memory and placed into registers within the CPU. The ALU executes the instruction and places results in registers or memory.
Instruction Fetch and Execute:
At the beginning of each instruction cycle, the processor fetches an instruction from memory. In a typical processor, a register called the program counter (PC) holds the address of the instruction to be fetched next. Unless told otherwise, the processor always increments the PC after each instruction fetch so that it will fetch the next instruction in sequence (i.e., the instruction located at the next higher memory address).
So, for example, consider a computer in which each instruction occupies one 16-bit word of memory. Assume that the program counter is set to location 300.The processor will next fetch the instruction at location 300. On succeeding instruction cycles, it will fetch instructions from locations 301, 302, 303, and so on. The fetched instruction is loaded into a register in the processor known as the instruction register (IR). The instruction contains bits that specify the action the processor is to take. The processor interprets the instruction and performs the required action. In general, these actions fall into four categories:
• Processor-memory: Data may be transferred from processor to memory or from memory to processor.
• Processor-I/O: Data may be transferred to or from a peripheral device by transferring between the processor and an I/O module.
• Data processing: The processor may perform some arithmetic or logic operation on data.
• Control: An instruction may specify that the sequence of execution be altered. For example, the processor may fetch an instruction from location 149, which specifies that the next instruction be from location 182. The processor will remember this fact by setting the program counter to 182.Thus, on the next fetch cycle, the instruction will be fetched from location 182 rather than 150. An instruction’s execution may involve a combination of these actions.
Thanx.. We will learn Memory concept in next chapter.
Next concept How instruction executed by CPU will learn in CPU section where we will learn every concept like Program execution, Program
implementation, Halt, Errors, and Numericals.