2. Definition and Importance
• Definition: Computer Architecture encompasses the structure and behavior
of a computer system, defining its components and their interactions.
• Importance: Understanding it is crucial for designing efficient systems and
optimizing performance in various applications, from personal computing to
large-scale data centers.
3. Historical Background
• Long ago, people used simple machines like abacuses to do math.
• Then, during World War II, engineers built huge machines called computers
to help with complex calculations.
• After the war, computers became smaller and more powerful.
• This led to the birth of modern computers, like the ones we use today.
4. Computer Hardware
• Computer hardware refers to the physical parts of a computer that you can
touch and see, like the monitor, keyboard, and mouse.
• It also includes the internal components, such as the processor, memory, and
storage devices, which work together to perform tasks and run software on
the computer.
5. Computer Hardware
• Monitor: Displays images and text output from the computer.
• Keyboard: Input device used to type text and commands into the computer.
• Mouse: Pointing device used to navigate and interact with graphical user interfaces.
• Central Processing Unit (CPU): Brain of the computer, performs calculations
and executes instructions.
• Random Access Memory (RAM): Temporary storage that holds data and
instructions that the CPU needs to access quickly.
• Hard Disk Drive (HDD) or Solid State Drive (SSD): Stores data and software
programs permanently on the computer.
6. Computer Hardware
• Graphics Processing Unit (GPU): Specialized hardware for rendering
graphics and images.
• Motherboard: Main circuit board that connects and integrates all the
computer components.
• Power Supply Unit (PSU): Converts electrical power from an outlet into
usable power for the computer.
• Network Interface Card (NIC): Allows the computer to connect to a
network for communication with other devices and the internet.
7. CPU
• The CPU, or Central Processing Unit, is like the brain of a computer. It
processes instructions and performs calculations that make software
programs work.
• It's made up of small electronic components called transistors.
• The CPU's speed and power determine how quickly and efficiently the
computer can run programs and tasks.
8. Main Parts of CPU
• The main parts of CPU are
• ALU (arithmetic logical unit)
• CU(control unit)
• Registers
• Cache Memory
• Clock
9. Main Parts of CPU
• ALU:
• The Arithmetic Logic Unit (ALU) is like the calculator of a computer,
performing math and logic operations.
• It adds, subtracts, compares numbers, and performs logical operations like
AND, OR, and NOT.
• ALU's calculations help the CPU execute tasks and process data, making it a
crucial component for computing operations.
10. Main Parts of CPU
• CU:
• The Control Unit (CU) acts as the manager of the CPU, overseeing the
execution of instructions.
• It fetches instructions from memory, decodes them into signals the computer
can understand, and coordinates the flow of data between the CPU's
components.
• The CU ensures tasks are carried out in the correct sequence, enabling the
CPU to operate efficiently.
11. Registers
• Registers are small, high-speed storage areas within the CPU used to temporarily hold data and
instructions during processing. Some common types of registers include:
• Program Counter (PC): Keeps track of the memory address of the next instruction to be
fetched and executed.
• Instruction Register (IR): Stores the current instruction being executed by the CPU.
• Memory Address Register (MAR): Holds the memory address of data to be fetched or stored
in the main memory.
• Memory Data Register (MDR): Stores the data being transferred to or from the main memory.
• Accumulator (ACC): Stores intermediate arithmetic and logic operation results during
processing. It's commonly used in many arithmetic operations and logical comparisons.
12. Cache Memory
• Cache memory is a high-speed storage located close to the CPU, storing
frequently accessed data and instructions for rapid retrieval.
• It serves as a temporary buffer between the CPU and main memory,
reducing access time and improving system performance.
• Cache memory helps speed up processing by providing quick access to
frequently used information.
13. Clock
• The computer's clock is like its heartbeat, ticking at a constant speed.
• It helps different parts of the computer work together by coordinating when
tasks happen.
• Faster clocks mean quicker processing.
• The clock's speed, measured in Hertz, determines how fast the computer can
do things, like running programs and responding to commands.
14. CPU instruction cycle
• The CPU instruction cycle, also known as the machine cycle, is the sequence
of steps executed by the CPU to fetch, decode, execute, and potentially write
back an instruction from memory.
• It represents the fundamental process through which instructions are
processed and executed within the CPU.
16. CPU instruction cycle
• Fetch: Obtain the next instruction from memory, transferring it to the CPU
for further processing and execution.
• Decode: Interpret the fetched instruction to understand its intended
operation or action within the CPU.
• Execute: Perform the operation or action specified by the decoded
instruction, manipulating data or controlling processes.
• Write back: Store the result of the executed instruction, updating memory
or CPU registers with the outcome of the operation.
17. Understanding the instruction cycle
• Scenario:
• Imagine you have a simple calculator with a display screen. You press the
number "5" followed by the addition sign "+" and then the number "3".
Afterward, you hit the "equals" button "=" to get the result.
• Question:
• Explain how the CPU instruction cycle works using the scenario of using the
calculator. Identify the steps involved in the CPU instruction cycle.
18. Solution to above problem
• Fetch: Imagine you press the number "5". The CPU fetches the instruction related to the number "5" from
memory.
• Decode: The CPU interprets the fetched instruction as "display the number 5".
• Execute: The CPU performs the operation, displaying the number "5" on the calculator screen.
• Fetch: When you press the addition sign "+", the CPU fetches the instruction related to addition.
• Decode: The CPU interprets the fetched instruction as "perform addition".
• Execute: The CPU adds the numbers "5" and "3".
• Fetch: The CPU fetches the instruction for displaying the result.
• Decode: The CPU interprets the fetched instruction as "display the result".
• Execute: The CPU displays the result, which is "8", on the calculator screen.
19. Another example
• Scenario:
• Consider a simple computer program that adds two numbers: 10 and 20. The
program is stored in the computer's memory. The CPU fetches the
instructions, executes the addition, and writes back the result to memory.
• Question:
• Describe the CPU instruction cycle involved in executing the addition of 10
and 20, including the "write back" step.
20. Solution
• Fetch: The CPU fetches the instruction to add two numbers from memory.
• Decode: The CPU deciphers the fetched instruction as an addition
operation.
• Execute: The CPU performs the addition of 10 and 20, resulting in 30.
• Write back: The CPU writes back the result (30) to the specified memory
location for storage or further processing.