0% found this document useful (0 votes)
13 views2 pages

Stack-Based ISA (No Explicit Register) : Structure Operation Example Instruction Sequence Result Storage

The document explains Instruction Set Architecture (ISA), detailing four types of processor architectures: Stack-based, Accumulator-based, Register-Register, and Register-Memory. It outlines how each architecture operates, providing examples and advantages of each type. Additionally, it describes the eight steps a computer follows to execute instructions, using an example of adding two numbers stored in memory.

Uploaded by

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

Stack-Based ISA (No Explicit Register) : Structure Operation Example Instruction Sequence Result Storage

The document explains Instruction Set Architecture (ISA), detailing four types of processor architectures: Stack-based, Accumulator-based, Register-Register, and Register-Memory. It outlines how each architecture operates, providing examples and advantages of each type. Additionally, it describes the eight steps a computer follows to execute instructions, using an example of adding two numbers stored in memory.

Uploaded by

md.munwarasef
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

INSTRUCTION SET ARCHITECTURE

An instruction is a command to the hardware(CPU) for a basic operation.


Instruction Set Architecture (ISA) is a comprehensive specification that defines the fundamental instruction types and
their formats in both low-level and machine code, along with detailed descriptions of operand fields and addressing
modes.
There are 4 types of processors based on Instruction Set Architecture.
1. Stack-based CPU 2. Accumulator-based CPU 3. Register-Register CPU 4. Register-Memory CPU
1. Stack-based ISA(no explicit register)

 Structure: Uses a stack to perform operations, with no explicit registers for general storage.
 Operation: Operands are pushed onto the stack, and operations (like addition or multiplication) use the
top elements.
 Example Instruction Sequence for Z = X * Y + W * U:
o PUSH X, PUSH Y, MULT, PUSH W, PUSH U, MULT, ADD, PUSH Z.
 Result Storage: Results are implicitly stored at the top of the stack.
In a stack-based ISA, the stack acts as both the source of data (where values for operations come from) and the place
where results are stored by default. You don’t need to specify the location for storing the result because it
automatically goes back on top of the stack. This is what we mean by the stack being "implicit" — the processor knows
to use the stack without needing extra instructions for data placement.

2. Accumulator-based ISA

 Structure: Uses a single accumulator (An accumulator register is a special register in a CPU that temporarily holds data for arithmetic and
logic operations, storing results for quick access.) register for all operations.
 Operation: Instructions assume one operand is in the accumulator; the result is also stored in the accumulator.
 Example:
o LOAD X (loads X into ACC),
o ADD Y (adds Y to ACC),
o STORE Z (stores ACC to Z).
 Advantages: Simplifies instruction format but limits flexibility to a single register.

3. Register-Register (Load-Store) Architecture

 Structure: Utilizes multiple general-purpose registers in the CPU, where any register can hold operands
or store results.
 Operation: Only LOAD and STORE instructions access memory; all other operations occur between
registers.
 Restriction: Memory cannot be directly referenced; operands and result locations must be explicitly
defined in registers.
 Example: LOAD R1, X; LOAD R2, Y; ADD R3, R1, R2; STORE Z, R3.
 Advantage: Increases efficiency in data processing by minimizing memory access.

4. Register-Memory Architecture

 Structure: Supports operations between a register and a memory location, allowing one operand to be
directly in memory.
 Operation: Reduces the need for multiple LOAD instructions by accessing memory directly.
 Compatibility: Can support Register-Register architecture, but the reverse is not possible.
 Example: LOAD R2, X; ADD R2, Y; STORE Z, R2.
 Advantage: Fewer instructions needed for accessing memory, though frequent memory access may
slow performance.
How a computer works in 8 specific steps, with a simple example to illustrate each step. Let’s assume the
example is to "Add two numbers stored in memory locations 200H and 201H and store the result in a register."

 1. Load the Address of the First Instruction in the Program Counter (PC) (from a predefined
starting location in memory or sometimes from firmware instructions.)
The CPU starts by setting the Program Counter (PC) to the address of the first instruction in memory, so
it knows where to begin.
 Example: The PC is set to the memory location holding the instruction to load the number at address
200H.

 2. Load the Address from PC into the Memory Address Register (MAR)
The address in the PC is then copied to the Memory Address Register (MAR), which will hold the
memory address of the current instruction.
 Example: The address for the "load number from 200H" instruction is moved to the MAR.

 3. Place Address on the Address Bus and Select the Memory Location
The address in the MAR is placed onto the Address Bus (a pathway for sending addresses) and sent to
memory, selecting the memory location for the instruction.
 Example: The MAR places the "load from 200H" instruction's address on the Address Bus, selecting the
location in memory.

 4. Send Read Signal to Memory and Fetch the Instruction


The Control Unit sends a "Read" signal to memory, retrieving the instruction located at the specified
address. This instruction is then sent back to the CPU through the Data Bus.
 Example: The CPU fetches the instruction "Load the number from 200H" and brings it to the CPU.

 5. Load the Instruction into the Instruction Register (IR)


The fetched instruction is loaded into the Instruction Register (IR), which stores it temporarily so the
CPU can decode and understand it.
 Example: "Load the number from 200H" is placed in the IR.

 6. Increment PC to Point to the Next Instruction


After loading the instruction, the PC is incremented to point to the next instruction's address in memory.
This step prepares the CPU to fetch the next instruction after completing the current one.
 Example: The PC is incremented to the address for the next instruction, "Load the number from 201H."

 7. Decode the Instruction and Generate Control Signals


The Control Unit decodes the instruction in the IR to understand what operation to perform. Based on
this, it sends signals to activate the necessary CPU components.
 Example: The CPU decodes "Load the number from 200H" and signals to load data from 200H into a
register (say Register A).

 8. Execute the Instruction and Store the Result


The CPU executes the instruction, which could involve data movement, arithmetic, or logic operations.
The result is stored in the designated register or memory location.
 Example: The CPU loads the number from 200H into Register A, then repeats the process to load the
number from 201H into Register B. After both values are in registers, the CPU adds them and stores the
result in Register C.

 In Summary
The computer goes through this cycle—fetching, decoding, and executing instructions—to process tasks
step-by-step. For our example, it completes loading numbers, adding them, and storing the result.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy