Computer Architecture
Computer Architecture
Architecture
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
Purpose: To provide a means for
users to input data and instructions
into the computer system.
Input
Device Function: Input devices like
s keyboards, mice, and scanners
convert user input into a format that
can be processed by the computer.
Control Unit
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
Purpose: To present processed data
and results to the user in a human-
readable format.
Output
Function: Output devices like
Devices
monitors, printers, and speakers
convert machine-readable data into
a format that users can understand.
Control Unit
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
Control Unit
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
ALU
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
Memory Unit
ALU
Input
Registers Output
Device PC
Devices
s
CIR ACC MAR MDR
Memory Unit
Purpose: To store data that the
CPU is actively working with
during computations.
Function: These registers are
Registers
PC
used for various temporary data
CIR ACC MAR MDR storage and manipulation tasks.
They are frequently used for
arithmetic, logical operations,
and holding intermediate results.
Purpose: To keep track of the
memory address of the next
instruction to be fetched and
executed.
ALU
ACC
ALU
ACC
Control
Bus
ALU
ACC
Control Control
Control
Bus Bus
Bus
Control
Processor Control Unit PC CIR
Bus
Control Bus
Purpose: The control bus carries various control signals that
coordinate and manage the operations of the CPU and other
components.
Function: Control signals on the control bus include commands
to read from or write to memory, signals to indicate whether
data transfer is a read or write operation, clock signals for
synchronization, and signals for interrupt requests and other
control functions. These signals help orchestrate the various
activities within the CPU and across the computer system.
Memory unit
MAR MDR
ALU
ACC
Data bus
Data bus
ALU
ACC
ALU
ACC
ALU
ACC
ALU
ACC
Address bus
ALU
ACC
Address bus
CPU
Registers
CPU
Registers
Control Unit
Registers
Registers
Registers
Registers
CIR
ACC Registers PC
MDR MAR
Registers
Accumulator (ACC):
ACC Definition: The Accumulator is a special-purpose
register within the CPU.
Function: The ACC temporarily stores the results
of intermediate arithmetic and logical
operations. It's frequently used for accumulating
results, especially during multi-step calculations.
The ACC holds the output of operations
performed by the ALU and can serve as a source
or destination for data during calculations.
Registers
Program Counter (PC):
PC
ACC
Definition: The Program Counter is a special
register within the CPU that keeps track of the
memory address of the next instruction to be
executed.
Function: The PC is automatically incremented after
each instruction is fetched, ensuring that the CPU
knows where to fetch the next instruction in
memory. It plays a vital role in controlling the flow
of program execution.
Registers
Current Instruction Register (CIR):
CIR
PC
ACC
Definition: The Current Instruction Register is a
temporary register within the CPU.
Function: The CIR holds the instruction that has
just been fetched from memory. It acts as a
holding ground for the instruction, allowing the
control unit to decode and execute it. The CIR
helps the CPU process instructions step by
step.
Registers
Memory Address Register (MAR):
CIR
PC
MAR
ACC
Definition: The Memory Address Register is a
register within the CPU that holds the memory
address of the data or instruction currently being
read from or written to in the computer's main
memory.
Function: The CPU uses the MAR to specify the
location in memory from which it wants to read
data or to which it wants to write data. It helps in
addressing specific memory locations.
Registers
Memory Buffer/Data Register (MBR/MDR):
CIR
PC
MDR
MAR
ACC
Definition: The Memory Buffer Register is a two-way
register within the CPU that serves as an intermediary
between the CPU and memory.
Function: When data is fetched from memory, it is
temporarily stored in the MBR before the CPU can
process it. Similarly, when the CPU wants to write data
to memory, it places the data into the MBR before it's
transferred to memory. The MBR acts as a buffer
during data transfer between the CPU and memory.
Registers
CIR
ACC Registers PC
MDR MAR
Detailed Von
Neumann
Architecture
Memory unit
MAR MDR
ALU
ACC
Address bus
11001111 11001101
11011111 11001110
10011101 11001111
10011011 11001011
Write Operation
1.Data Preparation: First, the CPU prepares the data that it wants to write into memory. This data could be
instructions, variables, or any other information that needs to be stored.
2.Memory Address Specification: The CPU needs to specify the memory address where it wants to write the data.
This address is typically stored in a register called the Memory Address Register (MAR). The CPU loads the desired
memory address into the MAR. For example, if you want to write data to address 11010000, you load this address
into the MAR.
3.Data Transfer: The CPU then places the data that it wants to write into memory into another register known as
the Memory Data Register (MDR). This is where the actual data to be written is temporarily stored.
4.Write Signal: The CPU sends a write signal to the memory unit, indicating that it wants to write data into the
specified memory address.
5.Data Transfer to Memory: When the memory unit receives the write signal, it retrieves the data from the MDR
(Memory Data Register) and writes it into the memory location specified by the address stored in the MAR (Memory
Address Register). In this case, it writes the data into the address 11010000.
6.Completion: Once the data has been successfully written to memory, the CPU can continue with its operations
Address Dataor
execute subsequent instructions as needed. 11001110 11001100
11001111 11001101
11011111 11001110
10011101 11001111
10011011 11001011
Read Operation
1. Memory Address Specification: The CPU needs to specify the memory address from which it wants to read data.
This address is typically stored in a register called the Memory Address Register (MAR). The CPU loads the desired
memory address into the MAR. For example, if you want to read data from address 11010000, you load this address
into the MAR.
2. Read Signal: The CPU sends a read signal to the memory unit, indicating that it wants to retrieve data from the
specified memory address.
3. Data Retrieval: When the memory unit receives the read signal, it looks up the memory location specified by the
address stored in the MAR (Memory Address Register), which in this case is 11010000. It retrieves the data stored at
that memory address.
4. Data Transfer to CPU: The data retrieved from memory is transferred to a register called the Memory Data
Register (MDR). This is where the data is temporarily stored before it is sent to the CPU.
5. Data Availability: The CPU can now access the data from the MDR for further processing or execution of
instructions. It may perform operations on the retrieved data or use it as needed in the program.
6. Completion: Once the data has been successfully read from memory and placed in the MDR, Address
the CPU can continue
Data
with its operations or execute subsequent instructions as required. 11001110 11001100
11001111 11001101
11011111 11001110
10011101 11001111
10011011 11001011
Processor
Data Bus
Address Bus
MAR MDR
PC
CIR
Control
Control Unit
Bus
Other
Registers
Arithmetic
and logic
unit
The fetch-decode-execute cycle
The fetch-decode-execute cycle is the process where the CPU
receives data and instructions from the RAM to the Memory
Unit, decodes the instructions and executes
Execute CIR
Update
instruction Program PC 1
counter
MEMORY
Location Contents THE PROGRAM
The address of
23 14 the first 1 LDA 23
instruction is
53 26 2 ADD 72
copied from the
72 35 PC to the MAR 3 STA 53
REGISTERS
ACC
Check for Fetch
interrupts instruction
MBR LDA 23
from memory
MAR 1
Execute CIR
Update
instruction Program PC 1
counter
MEMORY
Location Contents THE PROGRAM
The first
23 14 instruction is 1 LDA 23
read into the
53 26 2 ADD 72
MBR
72 35 3 STA 53
REGISTERS
ACC
Check for Fetch
interrupts instruction
MBR LDA 23
from memory
MAR 1