Computer Architecture
Computer Architecture
Process Scheduling
Words Used in Process Scheduling:
Arrival Time: The time the process arrives in the ready queue.
Completion Time: The time the process completes its execution time.
Burst time: Time needed by a process for execution.
Turn Around time: The difference between completion time and arrival time.
Waiting Time: The difference between turnaround time and burst time.
Waiting Time=Turn Around Time−Burst Time
Definition of a Process
A process is an instance of a computer program that is being executed by one or more threads. It
contains the program instructions. Depending on the logical design of the system, a process can
comprise of multiple threads of execution.
Process Memory
The process memory is divided into four sections for optimum (efficient) operation:
Text Category: This part is made up of integrated program code, which is read from fixed
storage when the program is launched.
Data Class: This is the component that is made up of global and static variables, distributed
and executed before the main action.
Heap: This component’s purpose is flexible or dynamic memory allocation and is managed
by calls to new, delete, malloc, free, etc.
Stack: This component is the comprised of space that is reserved for local variables.
CPU Utilization
Throughput
Turn Round Time
Waiting Time
Response Time
Interrupts
Definition of an Interrupt
An interrupt is a signal emitted by hardware and software when a process or an event needs
immediate attention. Interrupts inform the processor of a high-priority process requiring
immediate attention by interrupting current working processes.
Types of Interrupts
Software Interrupts
Hardware Interrupts
o Makeable Interrupt
o Spurious Interrupt
When an Interrupt Request (IRQ) occurs:
1) Devices are informed of an Interrupt Request (IRQ).
2) The processor interrupts the program currently being executed.
3) The device sending the request signal is informed the request was sent and recognized
so the device stops the request signal.
4) The requested process is processed (executed).
5) An interrupt is enabled and the interrupted program is resumed.
A more detailed explanation of this process is:
Step 1:- Any time that an interrupt is raised, it may either be an I/O interrupt or a system
interrupt.
Step 2:- The current state comprising registers and the program counter is then stored in
order to conserve the state of the process.
Step 3:- The current interrupt and its handler is identified through the interrupt vector table
in the processor.
Step 4:- This control now shifts to the interrupt handler, which is a function located in the
kernel space.
Step 5:- Specific tasks are performed by Interrupt Service Routine (ISR) which are
essential to manage interrupt.
Step 6:- The status from the previous session is retrieved so as to build on the process from
that point.
Step 7:- The control is then shifted back to the other process that was pending and the
normal process continues.
Triggering Methods:
Level-Trigger
Edge-Trigger
The instruction set can be defined as a group of commands that a microprocessor uses to
perform tasks. This is also the instruction and commands used to develop software.
Process Control Instructions are used to control the order of execution in a program and in
processes. The involve commands to branch, loop and call functions or subroutines.
Note that:
Branching instructions transfer the flow of execution onto certain conditions or
unconditional transfers to the part of the program.
Looping instructions can be used to repeatedly execute a block of code either
conditionally or unconditional.
Subroutine instructions are used to call and return from subroutine to enhance code
modularity and reusability.
Unconditional jumps included in the program flow are the instruction that
unconditionally jump to a predetermined location without taking any condition in to
account.
Conditional jumps a conditional that moves the control flow to a specific address
depending on the truth value of a condition.
Subroutine calls jump commands instructions that are responsible for transferring
control to a subroutine, allowing task execution, while promoting code modularity and
reusability.
Addressing Modes
Addressing modes of computer architecture are the ways of specifying operand(s) of an
instruction. These modes define how the processor finds the data it needs to execute a
command. Examples of the addressing modes in the Intel 8086 include; Immediate Addressing,
Register Addressing, Direct Addressing, Indirect Addressing, Indexed Addressing, Based
Addressing, Based Index Addressing, etc.