COA Chapter 6
COA Chapter 6
Chapter-6
By:
Melkamu D. (M.Sc)
Jun, 2023
MTU, Ethiopia
Mizan-Tepi University
Outline/contents
Introduction
General Register Organization
Stack Organization
Instruction Formats
Addressing Modes
Data Transfer and Manipulation
Program Control
Characteristics of RISC and CISC
Mizan-Tepi University
Introduction
CPU stands for Central Processing Unit.
It is the soul or brain of a computer system .
The CPU along with the memory and the I/O sub-systems establish a strong computer
system.
A CPU includes small layers of hundreds of transistors.
Transistors are microscopic bits of substances that block electricity at one voltage (non-
conductor) and enable electricity to move through them at multiple voltages (conductor).
These slight bits of substantial are the semiconductors that create two electronic inputs and
create multiple outputs when one or both inputs are turned on.
CPU is the most significant in a computer system.
It is the component that regulates all internal and external devices and implements
arithmetic and logic operations to perform the set of instructions saved in the computer’s
memory.
Mizan-Tepi University
Cont.….
CPU is made up of three major parts:
The register set: stores intermediate data used during the execution of the
instructions.
The Arithmetic and Logic unit (ALU): performs the required micro-operations
for executing the instructions.
The control unit: supervises the transfer of information among the registers and
instructs the arithmetic and logic units as to which operation to perform.
The CPU performs a variety of functions dictated by the type of instructions that
are incorporated in the computer.
Computer architecture is sometimes defined as the computer structure and
behavior as seen by the programmer that uses machine language instructions.
This includes the instruction formats, addressing modes, the instruction sets
and the general organizations of the CPU registers
Mizan-Tepi University
Example1: R1 R2 + R3 3 3 3 5
Instruction Format
Mizan-Tepi University
Addressing Modes
Addressing Modes:
Cont.……
Register Mode
Address specified in the instruction is the register address.
- Designated operand need to be in a register
- Shorter address than the memory address
- Saving address field in the instruction
- Faster to acquire an operand than the memory addressing
- EA = IR(R) (IR(R): Register field of IR)
Register Indirect Mode
Instruction specifies a register which contains the memory address of the operand.
-Saving instruction bits since register address is shorter than the memory address.
-Slower to acquire an operand than both the register addressing or memory addressing.
- EA = [IR(R)] ([x]: Content of x)
Mizan-Tepi University
Cont.….
Auto-increment or Auto-decrement features: Same as the Register Indirect, but: When the
address in the register is used to access memory, the value in the register is incremented or
decremented by 1 (after or before the execution of the instruction).
Direct Address Mode: Instruction specifies the memory address which can be used directly to
the physical memory.
- Faster than the other memory addressing modes
- Too many bits are needed to specify the address for a large physical memory space
- EA = IR(address), (IR(address): address field of IR)
Indirect Addressing Mode: The address field of an instruction specifies the address of a
memory location that contains the address of the operand
-When the abbreviated address is used, large physical memory can be addressed with a
relatively small number of bits
-Slow to acquire an operand because of an additional memory access
-EA = M[IR(address)]
Mizan-Tepi University
Cont…
Relative Addressing Modes:
The Address fields of an instruction specifies the part of the address (abbreviated address)
which can be used along with a designated register to calculate the address of the operand.
PC Relative Addressing Mode(R = PC)
- EA = PC + IR(address)
- Address field of the instruction is short.
- Large physical memory can be accessed with a small number of address bits.
Indexed Addressing Mode:
XR: Index Register:
- EA = XR + IR(address)
Base Register Addressing Mode:
BAR: Base Address Register:
- EA = BAR + IR(address)
Mizan-Tepi University
Program Interrupt
Types of Interrupts:
External interrupts
External Interrupts initiated from the outside of CPU and Memory
I/O Device -> Data transfer request or Data transfer complete
Timing Device -> Timeout
Power Failure
Internal interrupts (traps)
Internal Interrupts are caused by the currently running program
Register, Stack Overflow
Divide by zero
OP-code Violation
Protection Violation
Software Interrupts
Both External and Internal Interrupts are initiated by the computer Hardware.
Software Interrupts are initiated by executing an instruction.
- Supervisor Call -> Switching from a user mode to the supervisor mode
-> Allows to execute a certain class of operations which are not allowed in the user mode
Mizan-Tepi University
Cont.….
Advantages of RISC Processor
1. The RISC processor's performance is better due to the simple and limited number of the instruction set.
2. It requires several transistors that make it cheaper to design.
3. RISC allows the instruction to use free space on a microprocessor because of its simplicity.
4. RISC processor is simpler than a CISC processor because of its simple and quick design, and it can
complete its work in one clock cycle.
Cont.…
RISC Architecture
Cont.…
Advantages of CISC Processors
1. The compiler requires little effort to translate high-level programs or statement languages into assembly or machine
language in CISC processors.
2. The code length is quite short, which minimizes the memory requirement.
3. To store the instruction on each CISC, it requires very less RAM.
4. Execution of a single instruction requires several low-level tasks.
5. CISC creates a process to manage power usage that adjusts clock speed and voltage.
6. It uses fewer instructions set to perform the same instruction as the RISC.
Cont.…
Uses of the pipeline are simple in RISC. Uses of the pipeline are difficult in
CISC.
It uses a limited number of instruction that It uses a large number of instruction
requires less time to execute the instructions. that requires more time to execute the
instructions.
It uses LOAD and STORE that are It uses LOAD and STORE instruction
independent instructions in the register-to- in the memory-to-memory interaction
register a program's interaction. of a program.
RISC has more transistors on memory CISC has transistors to store complex
registers. instructions.
The execution time of RISC is very short. The execution time of CISC is longer.
Mizan-Tepi University
Cont.…
RISC RISC
architecture can be used
architecture canwithbehigh-end applications
used with like telecommunication,
high-end CISC architecture image can
processing,
be used videowith
processing, etc.
applications like telecommunication, image low-end applications like home
CISC architecture can be used with low-end applications like home automation, security system, etc.
processing, video processing, etc. automation, security system, etc.
It has fixed format instruction.
The program written for RISC architecture Program written for CISC architecture
needs to take more space in memory. tends to take less space in memory.
Questions ???