Professional Documents
Culture Documents
For example:
MULT R1, R2, R3
This is an instruction of an arithmetic multiplication written in assembly language. It
uses three address fields R1, R2, and R3. The meaning of this instruction is:
R1 <-- R2 * R3
This instruction also can be written using only two address fields as
MULT R1, R2
In this instruction, the destination register is the same as one of the source registers.
This means the operation
R1 <-- R1 * R2
Registers: In this organization, the CPU contains a set of registers, which are small,
high-speed memory locations used to store data that is being processed by the CPU.
The general-purpose registers can be used to store any type of data, including
integers, floating-point numbers, addresses, and control information.
Operand access: The CPU accesses operands directly from the registers, rather than
having to load them from memory each time they are needed. This can significantly
improve performance, as register access is much faster than memory access.
Data processing: The CPU can perform arithmetic and logical operations directly
on the data stored in the registers. This eliminates the need to transfer data between
the registers and memory, which can further improve performance.
Instruction format: The instruction format used in a General Register based CPU
typically includes fields for specifying the operands and operation to be performed.
The operands are identified by register numbers, rather than memory addresses.
Context switching: Context switching in a General Register based CPU involves
saving the contents of the registers to memory, and then restoring them when the
process resumes. This is necessary to allow multiple processes to share the CPU.
The advantages of General register-based CPU organization –
The efficiency of the CPU increases as large number of registers are used
in this organization.
Less memory space is used to store the program since the instructions are
written in a compact way.
The disadvantages of General register based CPU organization –
Care should be taken to avoid unnecessary usage of registers. Thus,
compilers need to be more intelligent in this aspect.
Since a large number of registers are used, thus extra cost is required in
this organization.
The computers which use Stack-based CPU Organization are based on a data
structure called a stack. The stack is a list of data words. It uses the Last In First
Out (LIFO) access method which is the most popular access method in most of the
CPU. A register is used to store the address of the topmost element of the stack
which is known as Stack pointer (SP). In this organization, ALU operations are
performed on stack data. It means both the operands are always required on the
stack. After manipulation, the result is placed in the stack.
The main two operations that are performed on the operators of the stack
are Push and Pop. These two operations are performed from one end only.
1. Push –
This operation results in inserting one operand at the top of the stack and it increases
the stack pointer register. The format of the PUSH instruction is:
PUSH
// Increment SP by 1
SP <-- SP + 1
2. Pop –
This operation results in deleting one operand from the top of the stack and
decreasing the stack pointer register. The format of the POP instruction is:
POP
//transfer the content of SP (i.e, at top most data)
//into specified memory location
(memory address) <-- SP
//Decrement SP by 1
SP <-- SP - 1
It deletes the data word at the top of the stack to the specified address.
The advantages of Stack-based CPU organization –
Efficient computation of complex arithmetic expressions.
Execution of instructions is fast because operand data are stored in
consecutive memory locations.
The length of instruction is short as they do not have an address field.
The disadvantages of Stack-based CPU organization –
The size of the program increases.
Data transfer instructions move data from one place in the computer to another
without changing the data content. The most common transfers are between
memory and processor registers, between processor registers and input or
output, and between the processor registers themselves.
Arithmetic Instructions
PROGRAM CONTROL
https://www.geeksforgeeks.org/types-of-program-control-instructions/
https://www.youtube.com/watch?v=OXz7wKHr0_I
RISC and CISC in Computer Organization
https://www.geeksforgeeks.org/computer-organization-risc-and-cisc/
https://www.youtube.com/watch?v=ZW1gb3h-f9k
Flynn’s taxonomy
Parallel computing is computing where the jobs are broken into discrete parts
that can be executed concurrently. Each part is further broken down into a
series of instructions. Instructions from each piece execute simultaneously on
different CPUs. The breaking up of different parts of a task among
multiple processors will help to reduce the amount of time to run a program.
Parallel systems deal with the simultaneous use of multiple computer
resources that can include a single computer with multiple processors, a
number of computers connected by a network to form a parallel processing
cluster, or a combination of both. Parallel systems are more difficult to
program than computers with a single processor because the architecture of
parallel computers varies accordingly and the processes of multiple CPUs
must be coordinated and synchronized. The difficult problem of parallel
processing is portability.
2. **Decode Stage:**
- Decode the operation to be performed.
3. **Execute Stage:**
- Perform the actual arithmetic operation (addition, subtraction, multiplication,
etc.).
3. **Execution (EX):**
- Execute the operation or calculate the effective address.
- **Increased Throughput:**
- Pipelining allows for the parallel execution of multiple instructions,
improving overall throughput.
- **Resource Utilization:**
- Different stages of the pipeline can work on different instructions
concurrently, making better use of the processor's resources.