Untitled Flashcards Set

Two types of ISA

CISC: Complex Instruction Set Architecture

Used in older days, not used in modern computers anymore

RISC: Reduced Set Instruction Set Architecture

Used in modern computers.

*

In the old days, memory (RAM) was very small and expensive, time wasn't. (So, CISC ISA was used)

Not it's the opposite (So, RISC ISA is used now)

Analogy

CISC ISA

CISC focuses on minimizing the size of the program

Why and which ISA CISC uses?

Memory was expensive in the old days --> Program must be short --> Number of instructions per program must be less --> So Which ISA will you use?

Memory - Memory ISA

*

*

CISC Approach (Gareeb Aadmi)

The primary goal of CISC architecture is to complete a task in as few lines of assembly code as possible

RISC ISA

RISC focuses on minimizing the execution time of the program

Why and which ISA RISC uses?

Memory is Cheap --> Fast Execution Needed --> Optimization Needed --> Program must take less time to execute --> Time per Instruction must be less --> Which ISA will you use?

Register-Register ISA

*

Overall RISC Advantage

*

CISC vs RISC

RISC Approach (Ameer Aadmi)

RISC processors only use simple instructions that can be executed within one clock cycle.

Example

CISC

CISC focuses on minimizing program size.

If you have very less ram (1MB), in this situation this CISC is better because only 2 instructions you have to write in assembly for this program.

RISC

We don't have to load B again, saving 1 memory access

Total: Only 5 memory access

Why RISC uses Reg-Reg ISA?

Because Optimization is easy and possible

We can load data from memory into registers and then keep using registers again and again for same data access

From execution POV, CISC is taking 6 memory access and RISC is taking only 5 memory access, so RISC is better.

Questions

*

Complex vs Simple Instruction

*

*

Which instruction is complex?

ADD R1, R2, R3;

This instruction is quite simple

These are registers inside the CPU, in one clock cycle we can execute it and there is no memory access needed.

So this is a simple instruction

ADD A,B,C;

These are memory addresses

Internally, hardware will have to do the work to access the memory from each address

It will first access each of these locations one by one (A,B,C) and then the addition will happen.

This instruction is called complex instruction, which means that hardware internally does a lot of things (3 memory access)

Simple vs Complex

Register-Register instruction is called simple instruction

Because it can be executed in one clock cycle

Memory-Memory instruction is called complex instruction

Because it needs to access main memory for operands

Hence, it will take many clock cycles

*

For Complex Instructions, the hardware has to do a lot of work, so its hardware heav/complicated

Simple instructions are not hardware heavy.

Example 2

Suppose we want to let the computer conduct an operation that calculate the product of two numbers, one stored at location 2 and other at location 5 in main memory, and store the product back at location 2

*

In CISC Processor

Instruction set will contain MUL instruction

Assembly language programmer only has to write one line of code (just use the MUL instruction, and hardware will handle the rest)

*

Internally, the hardware knows how to understand and execute this MUL operation

Emphasis is on hardware

In RISC Processor

Assembly language programmer has to do more work on the RISC computer

*

CISC CPU vs RISC CPU

*

*

Performance Equation: Find program execution time

*

\text{Inst. per program} \times \text{Clock Cycles per inst.} \times \text{Time per clock cycle}

Performance Equation

Series of Questions

Who uses what ISA?

Which architecture uses more number of register?

*

*

Summary Slides

CISC

Summary

Summary

Summary

Pipelines means parallesism

Who has more parallesim?