Q # 1 What Is Machine Cycle in Computer and How It Works?
Q # 1 What Is Machine Cycle in Computer and How It Works?
The machine cycle also called processer cycle or instruction cycle, is the basic operation
performed by a central processing unit (CPU). Machine cycle is consisting of three steps that a
computers processor executes and whenever it receives a machine language instruction. They are
fetch, decode and execute. In some cases, store is also incorporate into the cycle.
Fetch:
The control unit requests instructions from the main memory that is stored at a memories
location as indicated by the program controller. (Instruction Counter)
Decode:
Received instructions are decoded in the instruction register. This process involves breaking the
operand files into its components based on the instruction’s operation code. (Opcode)
Execute:
The instructions opcode as it specifies the CPU operation required. The program counter
indicated the instruction sequence from computer. Machine language also called machine code,
refers to instructions coded in patterns of bits i.e.; zero and one that is directly readable and
executable by CPU.
Comment:
Starting from fetch cycle, control units looks at the program counter register (PR) to get the
memory address of the next instruction. It then requests this instruction from main memory
and places it in the instruction register after this control unit checks the instruction that is now
stored within the instruction register. It looks at the instruction which is just a sequence of 0s
and 1s and decides what to be done. The control unit interprets the binary instructions to
answer questions now, the control unit sends the signals that tell the ALU, memory and other
components signals to cause them to perform the correct work.
Q#2
Pipeline does not decrease the time from individual instruction execution. Instead, it increases
instruction throughput.
Pipeline stages are hooked together, all the stages must be ready to proceed at the time. We call
the time required to move an instruction one step further in the pipeline a machine cycle. The
length of the machine cycle is determined by the time required for the slowest pipe stage.
Comment:
Pipeline system is like a modern-day assembly line setup in factories. For example, in a car
manufacturing industry, huge assembly lines are setup and at each point, there are robotic arms
to perform a certain task, and then the car moves on ahead to the next arm.
2 Types of Pipeline:
Arithmetic Pipeline
Instruction Pipeline
Arithmetic Pipeline:
This pipeline is usually found in most computers. They are used for floating point operations,
multiplication of fixed-point numbers etc.
Instruction Pipeline:
A stream of instructions can be executed by overlapping fetch, decode and execute phase of an
instruction cycle. This type of technique is used to increase the throughput of the computer
system. Pipeline will be more efficient if the instruction cycle is divided into segments of equal
duration.