0% found this document useful (0 votes)
27 views15 pages

RISC vs CISC Architecture Explained

Uploaded by

Juned Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views15 pages

RISC vs CISC Architecture Explained

Uploaded by

Juned Khan
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RISC and CISC Architecture


RISC is the way to make hardware simpler whereas CISC is the single
instruction that handles multiple work. In this article, we are going to discuss
RISC and CISC in detail as well as the Difference between RISC and CISC,
Let’s proceed with RISC first.
Reduced Instruction Set Architecture (RISC)
The main idea behind this is to simplify hardware by using an instruction set
composed of a few basic steps for loading, evaluating, and storing operations
just like a load command will load data, a store command will store the data.
Characteristics of RISC
 Simpler instruction, hence simple instruction decoding.
 Instruction comes undersize of one word.
 Instruction takes a single clock cycle to get executed.
 More general-purpose registers.
 Simple Addressing Modes.
 Fewer Data types.
 A pipeline can be achieved.
Advantages of RISC
 Simpler instructions: RISC processors use a smaller set of simple
instructions, which makes them easier to decode and execute quickly. This
results in faster processing times.
 Faster execution: Because RISC processors have a simpler instruction set,
they can execute instructions faster than CISC processors.
 Lower power consumption: RISC processors consume less power than
CISC processors, making them ideal for portable devices.
Disadvantages of RISC
 More instructions required: RISC processors require more instructions to
perform complex tasks than CISC processors.
 Increased memory usage: RISC processors require more memory to store
the additional instructions needed to perform complex tasks.
 Higher cost: Developing and manufacturing RISC processors can be more
expensive than CISC processors.
Complex Instruction Set Architecture (CISC)
The main idea is that a single instruction will do all loading, evaluating, and
storing operations just like a multiplication command will do stuff like loading
data, evaluating, and storing it, hence it’s complex.
Characteristics of CISC
 Complex instruction, hence complex instruction decoding.
 Instructions are larger than one-word size.
 Instruction may take more than a single clock cycle to get executed.
 Less number of general-purpose registers as operations get performed in
memory itself.
 Complex Addressing Modes.
 More Data types.
Advantages of CISC
 Reduced code size: CISC processors use complex instructions that can
perform multiple operations, reducing the amount of code needed to perform
a task.
 More memory efficient: Because CISC instructions are more complex,
they require fewer instructions to perform complex tasks, which can result in
more memory-efficient code.
 Widely used: CISC processors have been in use for a longer time than
RISC processors, so they have a larger user base and more available
software.

Disadvantages of CISC
 Slower execution: CISC processors take longer to execute instructions
because they have more complex instructions and need more time to decode
them.
 More complex design: CISC processors have more complex instruction
sets, which makes them more difficult to design and manufacture.
 Higher power consumption: CISC processors consume more power than
RISC processors because of their more complex instruction sets.
CPU Performance
Both approaches try to increase the CPU performance
 RISC: Reduce the cycles per instruction at the cost of the number of
instructions per program.

CPU Time

 CISC: The CISC approach attempts to minimize the number of instructions


per program but at the cost of an increase in the number of cycles per
instruction.
Earlier when programming was done using assembly language, a need was felt
to make instruction do more tasks because programming in assembly was
tedious and error-prone due to which CISC architecture evolved but with the
uprise of high-level language dependency on assembly reduced RISC
architecture prevailed.
Example:
Suppose we have to add two 8-bit numbers:
 CISC approach: There will be a single command or instruction for this like
ADD which will perform the task.
 RISC approach: Here programmer will write the first load command to
load data in registers then it will use a suitable operator and then it will store
the result in the desired location.
So, add operation is divided into parts i.e. load, operate, store due to which
RISC programs are longer and require more memory to get stored but require
fewer transistors due to less complex command.
RISC vs CISC

RISC CISC

Focus on software Focus on hardware

Uses both hardwired and microprogrammed


Uses only Hardwired control unit
control unit

Transistors are used for storing complex


Transistors are used for more registers
Instructions

Fixed sized instructions Variable sized instructions

Can perform only Register to Register Can perform REG to REG or REG to MEM
Arithmetic operations or MEM to MEM

Requires more number of registers Requires less number of registers

Code size is large Code size is small

An instruction executed in a single


Instruction takes more than one clock cycle
clock cycle

Instructions are larger than the size of one


An instruction fit in one word.
word

Simple and limited addressing


Complex and more addressing modes.
modes.
RISC CISC

RISC is Reduced Instruction Cycle. CISC is Complex Instruction Cycle.

The number of instructions are less as The number of instructions are more as
compared to CISC. compared to RISC.

It consumes the low power. It consumes more/high power.

RISC is highly pipelined. CISC is less pipelined.

RISC required more RAM. CISC required less RAM.

Here, Addressing modes are less. Here, Addressing modes are more.

Instruction Formats (Zero, One, Two and


Three Address Instruction)
 instruction
In
encoded
computer
andformats,
organization,
represented
including
ininstruction
machine
zero, one,
language.
formats
two, and
refer
There
three-address
to are
the several
way instructions
instructions.
types of are
Each type of instruction format has its own advantages and disadvantages in
terms of code size, execution time, and flexibility. Modern computer
architectures typically use a combination of these formats to provide a balance
between simplicity and power.
What are the Different Types of Instruction Fields?
A computer performs a task based on the instructions provided. Instructions in
computers are comprised of groups called fields. These fields contain different
information for computers which are all written in 0s and 1s. Each field has a
different significance or meaning, based on which a CPU decides what to
perform. The most common fields are:
 The operation field specifies the operation to be performed, like addition.
 Address field which contains the location of the operand, i.e., register or
memory location.
 Mode field which specifies how operand is to be founded.
An instruction is of variable length depending upon the number of addresses it
contains. Generally, CPU organization is of three types based on the number of
address fields:
 Single Accumulator organization
 General register organization
 Stack organization
In the first organization, the operation is performed using a special register
called the accumulator. In the second, multiple registers are used for the
computation purpose. In the third organization, the work on stack basis
operation due to which it does not contain any address field. We generally see a
blend of various organizations applied
Types of Instructions
Based on the number of addresses, instructions are classified as:
NOTE: We will use the X = (A+B)*(C+D) expression to showcase the
procedure.

Zero Address Instructions


These instructions do not specify any operands or addresses. Instead, they
operate on data stored in registers or memory locations implicitly defined by the
instruction. For example, a zero-address instruction might simply add the
contents of two registers together without specifying the register names.
Zero Address Instruction

A stack-based computer does not use the address field in the instruction. To
evaluate an expression, it is first converted to reverse Polish Notation i.e.
Postfix Notation.
Expression: X = (A+B)*(C+D)
Postfixed : X = AB+CD+*
TOP means top of stack
M[X] is any memory location

PUSH A TOP = A

PUSH B TOP = B

ADD TOP = A+B


PUSH A TOP = A

PUSH C TOP = C

PUSH D TOP = D

ADD TOP = C+D

MUL TOP = (C+D)*(A+B)

POP X M[X] = TOP

One Address Instructions


These instructions specify one operand or address, which typically refers to a
memory location or register. The instruction operates on the contents of that
operand, and the result may be stored in the same or a different location. For
example, a one-address instruction might load the contents of a memory
location into a register.
This uses an implied ACCUMULATOR register for data manipulation. One
operand is in the accumulator and the other is in the register or memory
location. Implied means that the CPU already knows that one operand is in the
accumulator so there is no need to specify it.

One Address Instruction

Expression: X = (A+B)*(C+D)
AC is accumulator
M[] is any memory location
M[T] is temporary location

LOAD A AC = M[A]
LOAD A AC = M[A]

ADD B AC = AC + M[B]

STORE T M[T] = AC

LOAD C AC = M[C]

ADD D AC = AC + M[D]

MUL T AC = AC * M[T]

STORE X M[X] = AC

Two Address Instructions


These instructions specify two operands or addresses, which may be memory
locations or registers. The instruction operates on the contents of both operands,
and the result may be stored in the same or a different location. For example, a
two-address instruction might add the contents of two registers together and
store the result in one of the registers.
This is common in commercial computers. Here two addresses can be specified
in the instruction. Unlike earlier in one address instruction, the result was stored
in the accumulator, here the result can be stored at different locations rather
than just accumulators, but require more number of bit to represent the address.

Two Address Instruction

Here destination address can also contain an operand.


Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
MOV R1, A R1 = M[A]

ADD R1, B R1 = R1 + M[B]

MOV R2, C R2 = M[C]

ADD R2, D R2 = R2 + M[D]

MUL R1, R2 R1 = R1 * R2

MOV X, R1 M[X] = R1

Three Address Instructions


These instructions specify three operands or addresses, which may be memory
locations or registers. The instruction operates on the contents of all three
operands, and the result may be stored in the same or a different location. For
example, a three-address instruction might multiply the contents of two
registers together and add the contents of a third register, storing the result in a
fourth register.
This has three address fields to specify a register or a memory location.
Programs created are much short in size but number of bits per instruction
increases. These instructions make the creation of the program much easier but
it does not mean that program will run much faster because now instructions
only contain more information but each micro-operation (changing the content
of the register, loading address in the address bus etc.) will be performed in one
cycle only.

Three Address Instruction

Expression: X = (A+B)*(C+D)
R1, R2 are registers
M[] is any memory location
ADD R1, A, B R1 = M[A] + M[B]

ADD R2, C, D R2 = M[C] + M[D]

MUL X, R1, R2 M[X] = R1 * R2

Advantages of Zero-Address, One-Address, Two-


Address and Three-Address Instructions
Zero-address instructions
 They are simple and can be executed quickly since they do not require any
operand fetching or addressing. They also take up less memory space.
One-address instructions
 They allow for a wide range of addressing modes, making them more
flexible than zero-address instructions. They also require less memory space
than two or three-address instructions.
Two-address instructions
 They allow for more complex operations and can be more efficient than one-
address instructions since they allow for two operands to be processed in a
single instruction. They also allow for a wide range of addressing modes.
Three-address instructions
 They allow for even more complex operations and can be more efficient
than two-address instructions since they allow for three operands to be
processed in a single instruction. They also allow for a wide range of
addressing modes.
Disadvantages of Zero-Address, One-Address, Two-
Address and Three-Address Instructions
Zero-address instructions
 They can be limited in their functionality and do not allow for much
flexibility in terms of addressing modes or operand types.
One-address instructions
 They can be slower to execute since they require operand fetching and
addressing.
Two-address instructions
 They require more memory space than one-address instructions and can be
slower to execute since they require operand fetching and addressing.
Three-address instructions
 They require even more memory space than two-address instructions and
can be slower to execute since they require operand fetching and addressing.

Basic Computer Instructions



Introduction :
Computer organization refers to the way in which the components of a
computer system are organized and interconnected to perform specific tasks.
One of the most fundamental aspects of computer organization is the set of
basic computer instructions that the system can execute.
Basic computer instructions are the elementary operations that a computer
system can perform. These instructions are typically divided into three
categories: data movement instructions, arithmetic and logic instructions, and
control instructions.
Data movement instructions are used to move data between different parts of
the computer system. These instructions include load and store instructions,
which move data between memory and the CPU, and input/output (I/O)
instructions, which move data between the CPU and external devices.
Arithmetic and logic instructions are used to perform mathematical operations
and logical operations on data stored in the system. These instructions include
add, subtract, multiply, and divide instructions, as well as logic instructions
such as AND, OR, and NOT.
Control instructions are used to control the flow of instructions within the
computer system. These instructions include branch instructions, which transfer
control to different parts of the program based on specified conditions, and
jump instructions, which transfer control to a specified memory location.
The basic computer has 16-bit instruction register (IR) which can denote either
memory reference or register reference or input-output instruction.
1. Memory Reference – These instructions refer to memory address as an
operand. The other operand is always accumulator. Specifies 12-bit address,
3-bit opcode (other than 111) and 1-bit addressing mode for direct and
indirect addressing.
Example –
IR register contains = 0001XXXXXXXXXXXX, i.e. ADD after fetching
and decoding of instruction we find out that it is a memory reference
instruction for ADD operation.
Hence, DR ← M[AR]
AC ← AC + DR, SC ← 0
1. Register Reference – These instructions perform operations on registers
rather than memory addresses. The IR(14 – 12) is 111 (differentiates it from
memory reference) and IR(15) is 0 (differentiates it from input/output
instructions). The rest 12 bits specify register operation.

Example –
IR register contains = 0111001000000000, i.e. CMA after fetch and decode
cycle we find out that it is a register reference instruction for complement
accumulator.
Hence, AC ← ~AC
1. Input/Output – These instructions are for communication between
computer and outside environment. The IR(14 – 12) is 111 (differentiates it
from memory reference) and IR(15) is 1 (differentiates it from register
reference instructions). The rest 12 bits specify I/O operation.

Example –
IR register contains = 1111100000000000, i.e. INP after fetch and decode
cycle we find out that it is an input/output instruction for inputing character.
Hence, INPUT character from peripheral device.
Essential PC directions are the principal tasks that a PC can perform. These
directions are executed by the focal handling unit (central processor) of a PC,
and they structure the reason for additional perplexing tasks. A few instances of
essential PC directions include:
[Link]: This guidance moves information from the memory to a computer
processor register.
[Link]: This guidance moves information from a computer chip register to the
memory.
[Link]: This guidance adds two qualities and stores the outcome in a register.
[Link]: This guidance deducts two qualities and stores the outcome in a
register.
[Link]: This guidance duplicates two qualities and stores the outcome in a
register.
[Link]: This guidance isolates two qualities and stores the outcome in a
register.
[Link]: This guidance changes the program counter to a predefined address,
which is utilized to execute restrictive and genuine leaps.
[Link]: This guidance changes the program counter to a predefined address.
[Link]: This guidance looks at two qualities and sets a banner
demonstrating the consequence of the examination.
[Link]: This guidance adds 1 to a worth in a register or memory area.
The set of instructions incorporated in16 bit IR register are:
1. Arithmetic, logical and shift instructions (and, add, complement, circulate
left, right, etc)
2. To move information to and from memory (store the accumulator, load the
accumulator)
3. Program control instructions with status conditions (branch, skip)
4. Input output instructions (input character, output character)
Uses of Basic Computer Instructions :
Some of the key uses of basic computer instructions include:
1. Data manipulation: Basic computer instructions are used to manipulate data
stored in the computer system, including moving data between memory and
the CPU, performing mathematical operations, and performing logical
operations.
2. Control flow: Basic computer instructions are used to control the flow of
instructions within the computer system. This includes branching to
different parts of the program based on specified conditions and jumping to
a specific memory location.
3. Input/output operations: Basic computer instructions are used to transfer
data between the computer system and external devices, such as input
devices (e.g. keyboard, mouse) and output devices (e.g. display screen,
printer).
4. Program execution: Basic computer instructions are used to execute
computer programs and run software applications. These instructions are
used to load programs into memory, move data into and out of the program,
and control the execution of the program.
5. System maintenance: Basic computer instructions are used to perform
system maintenance tasks, such as memory allocation and deallocation,
interrupt handling, and error detection and correction.
Issues of Basic Computer Instructions :
1. Complexity: Basic computer instructions can be complex and difficult to
understand, particularly for novice programmers. This can make it
challenging to write efficient and effective code.
2. Limited functionality: While basic computer instructions are versatile and
can perform a wide range of tasks, they are still limited in their
functionality. This can make it challenging to perform more complex
operations and can require programmers to write additional code to
accomplish their goals.
3. Compatibility: Basic computer instructions can be specific to a particular
computer system or architecture, which can make it challenging to write
code that is compatible with different systems. This can require
programmers to write separate code for each system, which can be time-
consuming and inefficient.
4. Security: Basic computer instructions can be vulnerable to security threats,
such as buffer overflows and code injection attacks. This can make it
challenging to write secure code and can require additional measures to be
taken to protect the system.
5. Maintenance: Basic computer instructions can be difficult to maintain,
particularly as systems become more complex and code becomes more
extensive. This can require significant resources to maintain and update the
code, which can be challenging for organizations with limited resources.

Common questions

Powered by AI

Three-address instructions in processor design allow greater flexibility and complexity by specifying three operands or addresses, which can be memory locations or registers. They enable more complex operations and facilitate efficient data handling by directly designating destination and operand sources, leading to shorter programs by reducing the need for additional load/store instructions. However, they require more memory space due to the increased instruction length, which encompasses more address bits. This can also mean slower execution compared to simpler formats because additional data fetching is needed . In contrast, zero-address instructions, typically used in stack architectures, simplify operations by avoiding explicit operand addressing, which facilitates quick execution and memory efficiency but limits functionality and flexibility . One-address instructions strike a balance by typically involving an accumulator, providing a mid-point in complexity and space usage, yet they rely on more load/store operations than three-address formats . Thus, while three-address instructions offer programming ease and reduced code length, they do so at the cost of increased memory requirements and potentially slower performance.

The CPU performance goals of RISC and CISC architectures diverge significantly, especially in applications demanding high-speed processing. RISC architectures focus on reducing the number of cycles needed per instruction by simplifying the instruction set, enabling faster execution of individual instructions and facilitating effective pipelining . This approach is beneficial for high-speed processing applications where rapid execution and low power consumption are critical, such as in real-time systems and mobile devices . In contrast, CISC architectures aim to reduce the number of instructions needed per program by using complex instructions that combine multiple operations. This strategy minimizes code size and improves memory efficiency, which can be advantageous for applications constrained by memory and those requiring sophisticated computations . However, the greater complexity in instruction decoding and execution typically results in a higher number of cycles per instruction and increased power consumption, posing challenges for high-speed processing applications. Thus, while RISC provides advantages in speed and energy efficiency, CISC offers benefits in code compactness and programming simplicity, influencing their application suitability based on specific performance requirements.

Instruction pipelining in RISC architectures enhances CPU performance by allowing multiple instruction stages (fetch, decode, execute) to occur simultaneously for different instructions. This parallelism minimizes idle CPU cycles and maximizes instruction throughput, leading to significant improvements in processing speed . Unlike traditional execution models, where each instruction is processed sequentially through these stages before the next one begins, pipelining in RISC reduces the delay between instructions, allowing new instructions to start execution before the previous ones have finished. This is possible because RISC's simpler instruction set and fixed-size instructions make it easier to predict the operation path and reduce data hazard conflicts during execution . Thus, pipelining effectively utilizes RISC's architecture to boost overall computational efficiency and speed.

The control unit design plays a crucial role in differentiating between RISC and CISC processor architectures. In RISC architectures, the control unit is predominantly hardwired to execute a small set of simple instructions rapidly, which streamlines instruction processing and minimizes the complexity typically associated with instruction decoding . This aids in achieving rapid execution cycles and efficient pipelining by reducing control unit complexity and ensuring predictability during operation . In contrast, CISC architectures often use a combination of hardwired and microprogrammed control units to manage their more extensive and complex instruction sets. The microprogrammed control units allow for flexibility in instruction execution by enabling the processor to simulate multiple, complex operations through a single command, thus simplifying programming but at the cost of increased hardware design complexity and slower instruction decoding . This fundamental difference in control unit design reflects the broader architectural priorities of RISC's speed and simplicity versus CISC's complexity and programmability.

RISC and CISC architectures handle arithmetic operations differently, mainly through their instruction formats and execution approaches. RISC processors typically use a fixed instruction format where operations, such as register-to-register arithmetic, are broken down into simpler, more uniform instructions (like 'load', 'operate', 'store'). This results in longer programs with more individual instructions but allows faster execution per instruction and simpler pipelines . In contrast, CISC architectures utilize variable-sized instructions that often perform multiple operations in one command. For arithmetic operations, CISC instructions can include loading operands from memory, performing the operation, and storing results back in memory in a single instruction, which reduces code size but increases the complexity and time for decoding and execution . Thus, while RISC focuses on simple, frequently used instructions for faster execution, CISC bundles complexity into multifaceted instructions to minimize overall program length.

Choosing RISC over CISC architecture has significant implications for hardware, particularly in power consumption and execution speed. RISC architectures use a smaller set of simpler instructions, which leads to easier instruction decoding and the ability to execute instructions faster. This efficiency generally results in lower power consumption, making RISC processors ideal for portable devices and applications requiring high-speed data processing . The simplicity of RISC instructions also facilitates more effective pipelining, a technique that can significantly enhance execution speed by overlapping the execution of multiple instructions . In contrast, CISC architectures, with their more complex instructions, have higher power consumption because they require more clock cycles to execute single instructions and include more complex circuitry for their control units . Although CISC designs are typically more memory efficient because fewer instructions are needed for complex tasks, the increased complexity and slower instruction execution impact power efficiency and overall speed.

A developer might prefer a CISC processor over a RISC processor in scenarios where memory efficiency and minimal programming complexity are prioritized. CISC processors are advantageous when the goal is to minimize code size due to their complex instructions that can execute tasks traditionally requiring multiple RISC commands. This is beneficial in environments with limited memory resources or when programming simplicity is crucial, such as legacy systems or when compatibility with a broad set of software is needed . Furthermore, CISC's ability to effectively manage complex addressing modes and a larger variety of data types can benefit applications where these features are intensively used. However, these advantages come with trade-offs in terms of slower execution speed and higher power consumption, which are drawbacks when performance and energy efficiency are more critical, as typically addressed by RISC architectures .

RISC (Reduced Instruction Set Computer) architecture simplifies hardware by implementing an instruction set with simple steps for operations like loading, evaluating, and storing. This results in simpler instruction decoding and execution, potentially in a single clock cycle, with more general-purpose registers and simpler addressing modes . RISC designs focus on software optimization, using a hardwired control unit, and generally require more instructions per complex task, increasing memory usage and instructions required but offer benefits in power consumption and execution speed, especially suited for applications that rely heavily on pipelining . On the other hand, CISC (Complex Instruction Set Computer) architecture uses more complex instructions that handle multiple operations, such as loading, evaluating, and storing, in one go, reducing overall code size and making programming simpler at a high level . Complex instruction sets increase memory efficiency and reduce the total number of instructions needed, albeit at the cost of slower execution per instruction and higher power consumption due to their complexity . Additionally, CISC architectures typically feature more sophisticated control units, including microprogramming, which adds further design complexity . Therefore, while RISC optimizes execution speed and power usage, CISC reduces code size and complexity at a higher development cost in both execution time per instruction and power consumption.

Addressing modes in RISC and CISC architectures significantly affect their computational efficiency and flexibility. RISC architectures typically employ fewer and simpler addressing modes, which simplifies instruction decoding and enhances execution speed. This straightforwardness facilitates predictable, low-overhead instruction pipelines, boosting overall efficiency in executing repetitive, simple tasks quickly . However, this simplicity can limit flexibility in accessing diverse memory layouts, requiring software solutions to manage more complex data representations . Conversely, CISC architectures offer a wide range of complex addressing modes, enabling more direct manipulation of diverse data structures and more efficient encoding of certain operations within fewer instructions, thereby reducing overall program size and memory footprint . However, the complexity of these addressing modes can increase execution time and complicate pipeline design due to the heavier processing required to decode and execute such instructions, potentially reducing computational efficiency in terms of speed and power consumption . Thus, RISC and CISC trade off flexibility for speed in distinct ways influenced by their addressing modes.

The choice between RISC and CISC architectures is influenced by the evolution of programming languages due to how instructions are processed and coded. Historically, CISC architecture evolved to simplify programming by minimizing the number of instructions through complex operations, which was beneficial when programming was assembly language-centric, making the process less tedious and error-prone . However, as high-level programming languages became prevalent, the direct coding of assembly became less significant, and software flexibility and execution speed gained priority. This shift favored the RISC architecture, which emphasizes simplicity and rapid execution of individual instructions, better leveraging the compiling capabilities of high-level languages to manage the software layer . Hence, the rise of high-level languages and their compilers bypasses the need for manually compacting code, aligning more with RISC's software focus rather than CISC's hardware-centric design.

You might also like