Illustrating Processor Registers in the Fetch-Execution Cycle (CS201)

Verified

Added on  2025/04/14

|6
|648
|72
AI Summary
Desklib provides past papers and solved assignments for students. This report covers processor operations and interrupts.
Document Page
LO3 Demonstrate The principles of processors operations
P5 Illustrate the use of the different processor registers in the fetch-execution cycle
There are a number of registers in Von Neumann architecture. Register are memory circuits
which are very fast. It is responsible to hold the user data for the CPU. This data helps the CPU
in fats fetching, decoding and execution of the instructions. Some of the registers are listed
below:
CIR (Current Instruction Register): Stores the current instruction
PC (Program Counter): Stores the address of upcoming instruction
MDR (memory data register): Stores the data read from RAM and required to write on RAM.
MAR (Memory Address Register): Stores the RAM address
Status registers: stores the information of the previous operation
Index Registers: Required when working with a data block and keep track about the current
piece of data
Interrupt registers: stores the details about interrupt
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
FETCH:
to determine the address of upcoming instruction for the fetching process, CPU reads the
information from PC (program counter). Then this content is put on MAR. Further, this address
is sent to MAR and then to RAM. From RAM the content is moved to MDR. MDR stores the
instruction for execution. After that content is shifted to CIR as MDR should be empty for next
instruction.
DECODE:
CIR contents are divided into ADD parts which are also known as operator and data part is
known as an operand. The operand is puck back to MAR and then put MDR.
EXECUTE:
Instruction can be executed now. The logical and arithmetic operations can be carried out with
the help of accumulator.
To run or execute a program, the code is copied to main memory from secondary memory. To
make this process faster and smoother, various registers are used. They store the information
about a program that will help in fats program execution and fetching.
Knowledge of these registers and fetch-execution cycle will help the Currys PC world company
employees to understand the internal working of computer systems.
P6 Illustrate, with an example, how polling and interrupts are used to allow
communication between processor and peripherals.
CPU uses the fetch-decode-execute cycle to execute the programs. This cycle starts its work as
soon as the computer gets the start. These are helpful to control the flow of the computer.
Interrupts are messages that notify about the occurred errors. This is used by the hardware to
send the signal to CPU. Polling is helpful to check the status of the item. This is to ensure that
everything is going according to the expectations. To provide multitasking and multi-process,
interrupt function is used.
Document Page
M4 creates a low-level program which includes decision making, branching, and I/O
operations.
Selection/Branching statements/ conditional statements decides the statement flow. This can be
done by if if-else or switch statements.
Following is the example:
Document Page
int marks;
printf (enter the grade between 0-100);
scanf (%d, &marks);
if (Marks >= 40 && Marks < 50)
{printf(grade is E);}
Else if (Marks >= 50 && Marks < 60)
{printf(grade is D);}
Else if (Marks >= 60 && Marks < 70)
{printf(grade is C);}
Else if (Marks >= 70 && Marks < 80)
{printf(grade is B);}
if (Marks >=80 && Marks < 99)
{printf(grade is E);}
Else
Printf(you are failed);
OUTPUT:
enter the grade between 1-100
75
grade is B
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
M5 investigate the function of an interrupt handler
Interrupt handler is a piece of code that is initiated by the hardware interrupts, software
expectations or software interrupt instructions. These are used to implement device drivers and
implement service calls. Interrupt handler is responsible to perform following functionalities:
It helps to determine that device is interrupting or not
Rejects the interrupt
Provide the information to the device about being serviced
I/O request related processing is performed by this
It is able to perform other functionalities to prevent another interrupt.
It enables the device polling implementation.
Document Page
chevron_up_icon
1 out of 6
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]