Ch3basic Von Neumann Machine (Autosaved)
Ch3basic Von Neumann Machine (Autosaved)
1
Basic organization of the von Neumann machine
• John von Neumann, a Hungarian-American mathematician and physicist, first
proposed the von Neumann architecture in the mid-20th century.
2
Computer Organization | Von Neumann architecture
• Von-Neumann computer architecture design was proposed in 1945.
• It was later known as Von-Neumann architecture.
• Historically there have been 2 types of Computers:
1. Fixed Program Computers – Their function is very specific and they
couldn’t be reprogrammed, e.g. Calculators.
2. Stored Program Computers – These can be programmed to carry out
many different tasks, applications are stored on them, hence the name.
Modern computers are based on a stored-program concept introduced by
John Von Neumann. In this stored-program concept, programs and data are
stored in the same memory.
This novel idea meant that a computer built with this architecture would be
much easier to reprogram. 3
• The basic structure is like this
4
• It is also known as ISA (Instruction set architecture) computer and is
having three basic units:
1. The Central Processing Unit (CPU)
2. The Main Memory Unit
3. The Input/output Device
• 1. Central Processing Unit: The central processing unit is defined
as it is an electric circuit used for the executing the instruction of
computer program.
• It has following major components:
• 1.1 Control Unit(CU)
• 1.2 Arithmetic and Logic Unit(ALU)
5
• Control Unit –
A control unit (CU) handles all processor control signals. It directs all
input and output flow, fetches code for instructions, and controls how data
moves around the system.
• The control unit (CU) in a CPU directs the operation of the processor,
interpreting instructions, coordinating the execution of operations, and
managing the flow of data between the CPU, memory, and peripheral devices.
6
• The CU fetches instructions from memory and decodes them, determining the
sequence of operations needed to execute them.
• Data flow control: It directs the flow of data between the CPU, memory, and
other components, ensuring that data is moved to the correct locations at the
right time.
7
• Control Signals: It generates control signals to manage the operations of the
CPU, such as telling the ALU what operation to perform or when to read data
from memory.
8
• Arithmetic and Logic Unit (ALU) –
The arithmetic logic unit is that part of the CPU that handles all the
calculations the CPU may need, e.g. Addition, Subtraction, Comparisons.
9
10
• Registers – Registers refer to high-speed storage areas in the CPU.
• The data processed by the CPU are fetched from the registers.
1. Accumulator: Stores the results of calculations made by ALU. It holds the intermediate
of arithmetic and logical operations. it acts as a temporary storage location or device.
2. Program Counter (PC): Keeps track of the memory location of the next instructions to
be dealt with. The PC then passes this next address to the Memory Address Register
(MAR).
3. Memory Address Register (MAR): It stores the memory locations of instructions that
need to be fetched from memory or stored in memory.
11
4. Memory Data Register (MDR): It stores instructions fetched from
memory or any data that is to be transferred to, and stored in, memory.
12
• Buses – Data is transmitted from one part of a computer to another,
connecting all major internal components to the CPU and memory, by
the means of Buses. Types:
1. Data Bus: It carries data among the memory unit, the I/O devices,
and the processor.
2. Address Bus: It carries the address of data (not the actual data)
between memory and processor.
3. Control Bus: It carries control commands from the CPU (and
status signals from other devices) in order to control and
coordinate all the activities within the computer.
13
• Input/output Devices – Program or data is read into main memory
from the input device or secondary storage under the control of
CPU input instruction.
14
Instruction set and types(data manipulation, control, I/O)
15
Instruction sets
• A set of codes that can only be understood by a processor of the computer or CPU .
• These codes and machine languages are generally present as 1s and 0s.
• The movements of bits and bytes are controlled by these instruction sets present in the
processor.
1. JUMP – jump instruction set is used to jump to any designated address of RAM.
2. ADD – add instruction set is used to add any two numbers together.
3. LOAD – load instruction set is used to load any required information from the RAM to the
CPU.
16
• Types of instruction set
17
2. Minimal instruction set computers (MISC)
• A few codes and a set of instructions are basic for any processor.
• They also include sub-codes. As a result, they are smaller and faster.
• This is an instruction set that permits microprocessors that help to execute instructions in
parallel software. EPIC intends to give a simpler performance. 18
5. Very long instruction word (VLIW)
• VLIW exploits parallelism at the instruction level. By this set of instructions, instructions are
processed in sequence only in the CPU.
• The instructions that do not include microinstructions are known as ZISC. They are based on
the pattern matching and can be compared to networks of synapses and neurons.
• The OISC set of instructions uses only one instruction for a machine language.
• This set of instructions is used to teach computer architecture and to compute structural
19
computing research.
• Instruction sets category based on their function, including.
1. Data manipulation
I. arithmetic instructions,
21
22
23
• logical and bit manipulation instructions
24
25
• Typical Shift Instructions
26
2. Data movement (I/O)
27
3. Program flow control
• These instructions provide decision making capabilities and change the path taken by the
• Sequential Execution: By default, a program executes instructions in the order they appear in
memory.
• Control Flow Instructions: These instructions alter the normal sequential flow, allowing the
• Program Counter (PC): The PC holds the memory address of the next instruction to be
executed.
• Control flow instructions modify the PC, causing the program to jump to a different address
28 .
• Common Control Flow Instructions:
• Jumps (Unconditional):
• Interrupts: These are special events that can cause the program to jump to a
dedicated interrupt handler, allowing the system to respond to external
events.
• Stack Operations: Instructions that manipulate the stack, which is used for
storing return addresses, function arguments, and other temporary data.
• Machine Control Instructions: Instructions that control the execution of the
processor, such as halting, starting, or setting flags. 30
Control unit; instruction fetch, decode, and execution
31
1. Fetch: In the fetch cycle, the CPU retrieves the instruction from memory. The
instruction is typically stored at the address specified by the program counter
(PC). The PC is then incremented to point to the next instruction in memory.
2. Decode: In the decode cycle, the CPU interprets the instruction and determines
what operation needs to be performed. This involves identifying the opcode and
any operands that are needed to execute the instruction.
3. Execute: In the execute cycle, the CPU performs the operation specified by the
instruction. This may involve reading or writing data from or to memory,
performing arithmetic or logic operations on data, or manipulating the control
flow of the program. 32
• These cycles are the basic building blocks of the CPU’s operation
and are performed for every instruction executed by the CPU.
33
The Instruction Cycle
34
• The Indirect Cycle is always followed by the Execute Cycle.
The Interrupt Cycle is always followed by the Fetch Cycle. For both
fetch and execute cycles, the next cycle depends on the state of the
system.
35
Assembly/machine language programming
• What is Assembly Language?
36
What is High-Level Language?
37
Instruction formats
• In computer architecture, an instruction format defines the layout and structure of a machine-
level instruction.
• It specifies how bits are grouped to indicate the operation to be performed, the location of
operands (data), and how to access them.
• Essentially, it's a blueprint for the CPU to interpret and execute a given instruction.
• Opcode (Operation Code): This field indicates the specific operation the CPU should
perform, such as add, subtract, load, or store.
• Operands: These fields specify the data or memory locations the operation will act
38
upon. Operands can be register addresses, memory addresses, or literal data values.
• Addressing Modes: These fields define how operands are accessed.
• The instruction format directly influences how the CPU fetches, decodes, and
executes instructions, making it a vital concept in computer organization.
39
• Types of Instruction Formats.
• Based on the number of address fields used in the instruction, instruction formats
are classified into zero, one, two, and three-address formats.
• Each has distinct characteristics and uses in different types of instruction formats
in computer architecture.
• 1. Zero-Address Instructions
• The operations are performed on the top of the stack, and the results are also
40
stored on the stack.
41
42
• 2. One-Address Instructions
• It specifies a single operand, typically held in an accumulator.
• The accumulator is an implicit register used in the operation.
• The result can either be stored in the accumulator or another location.
43
44
• 3. Two-Address Instructions
• It allows for two operands to be specified.
• These operands can be registers or memory locations.
• The result can overwrite one of the source operands or can be stored in a
separate location
45
46
• 4. Three-Address Instructions
• It specifies three operands contains two source operands and one destination
operand.
• This format allows for more complex operations and direct representation of
expressions.
47
48
Advantages of Instruction Formats in Computer Organization
51
• Here are common addressing modes found in computer architectures:
1. Immediate Addressing:
• Example: MOV R1, #10 (Move immediate value 10 into register R1).
2. Register Addressing:
52
3. Direct Addressing:
• The memory address of the operand is directly provided in the
instruction.
Example: LOAD R1, 0x1000 (Load the value at memory address
0x1000 into register R1).
4. Indirect Addressing:
- The instruction encodes a memory address that points to the actual
operand.
- Example: LOAD R1, (R2) (Load the value from the memory
address stored in register R2 into register R1).
53
5. Indexed Addressing:
• - An indexed register and an offset are used to calculate the memory
address of the operand.
• - Example: LOAD R1, (R2 + 10) (Load the value at the memory address
obtained by adding the contents of R2 and 10 into register R1).
6. Base Register Addressing:
• - An address is calculated by adding a base register value and an offset.
• - Example: LOAD R1, (R2 + offset) (Load the value at the memory address
obtained by adding the contents of R2 and the offset value into register R1).
7. Auto increment and Auto decrement Addressing:
• - The memory address is automatically incremented or decremented after
the operation.
• - Example: LOAD R1, (R2)+ (Load the value at the memory address stored in
R2 into R1 and increment the value in R2). 54
Subroutine call and return mechanism
• This is achieved by storing the return address (the instruction following the
call) on a stack, jumping to the subroutine's entry point, and then, after the
subroutine completes, popping the return address from the stack to resume
execution.
55
• Here's a more detailed explanation:
• 1.Call: When a subroutine is called, the current instruction pointer (or program counter) is
stored on a stack.
• This pointer indicates the address of the next instruction to be executed after the subroutine
completes.
• The program then jumps to the subroutine's entry point, where the subroutine's code begins.
• 2.Subroutine Execution: It may receive arguments, process data, and potentially return a
value.
• The subroutine may also modify the values of registers or other memory locations, but it
should generally return them to their original state before returning to the caller. 56
• 3. Return: When the subroutine completes its task, it executes a RETURN
instruction (or a similar instruction).
• The return instruction pops the saved return address from the stack.
• The program counter is then set to the retrieved return address, causing
execution to resume at the instruction immediately following the CALL
instruction.
57
• Von Neumann bottleneck
Whatever we do to enhance performance, we cannot get away from the fact that
instructions can only be done one at a time and can only be carried out
sequentially.
• We can provide a Von Neumann processor with more cache, more RAM, or
faster components This architecture is very important and is used in our PCs
and even in Super Computers.
58