SlideShare a Scribd company logo
IT3030E Fall 2024 1
Computer Architecture
Ngo Lam Trung & Pham Ngoc Hung, Hoang Van Hiep
Department of Computer Engineering
School of Information and Communication Technology (SoICT)
Hanoi University of Science and Technology
E-mail: [trungnl, hungpn, hiephv]@soict.hust.edu.vn
IT3030E Fall 2024 2
Chapter 2: Top-level view of Computer Functions
and Interconnection
1. Computer Components
2. Computer Functions
3. Inter-connection Structures
[with materials from Computer Organization and Architecture, 10th Edition,
William Stallings, ©2016, Pearson]
IT3030E Fall 2024 3
Computer Organization
❑ From Chap.1: classic components of a computer
❑ Computer
❑ Input data
❑ Execute stored programs
❑ Output result
IT3030E Fall 2024 4
1. Computer Components
❑ More detailed computer organization
Memory
Link Input/Output
To/from network
Processor
Control
Datapath
Input
Output
CPU I/O
Computer organization with system link
IT3030E Fall 2024 5
Hardware and software approaches
❑ Hardware approach
l For a specific computation:
- Construct the computation function by connecting several basic
logic components: hardwired programming
l New program or new computation → rewiring the hardware
l General computer does not follow this approach
IT3030E Fall 2024 6
Hardware and software approaches
❑ Software approach
l Use a general-purpose hardware taking data and control signals
as input, produce results
l Programing is now much easier, instead of rewiring the
hardware → provide new sequence of codes (instructions)
l Question: where the Data comes from? Where the instructions
come from?
IT3030E Fall 2024 7
Computer components: top-level view
IT3030E Fall 2024 8
CPU (Central Processing Unit)
❑ Control Unit
l Fetch instruction from memory.
l Interpret instruction.
l Control other components to execute instruction.
❑ Datapath: performs arithmetic operations to process data
(i.e., Arithmetic and Logic Unit).
❑ Register file (chapter 3): small and fast data storage for
instruction execution.
❑ Some other dedicated components
IT3030E Fall 2024 9
CPU
❑ Example: Apple A5
IT3030E Fall 2024 10
Memory
❑ Store instructions of the running programs.
❑ Store data that are currently in use.
Further reading: memory technologies
IT3030E Fall 2024 11
Memory
❑ Logical organization
l Array of memory cells
l Each cell holds one byte of data
l Each cell is assigned an unique adress
l Data value can be changed, address is fixed
❑ Data are stored on memory cells
l 8-bit integer requires 1 cell
l 32-bit integer requires 4 cells
l Array requires consecutive cells according to
its size.
l …
IT3030E Fall 2024 12
Input/output
❑ Interfacing computer with physical world/environment.
❑ Types of I/O device
l Input: mouse, keyboard, webcam…
l Output: display, printer, speaker…
l Storage: HDD, SSD, optical, USB drives…
l Communication: WiFi, Ethernet, Bluetooth modules…
IT3030E Fall 2024 13
Link: System interconnection
❑ The fabric to connect all components
❑ Huge number of connection, requires very good design
so that all components function properly
❑ A modern computer motherboard (mainboard) typically
has 4 to 12 layers.
IT3030E Fall 2024 14
2. Computer functions
❑ Executing program
❑ Interrupt
❑ Input/Output
IT3030E Fall 2024 15
2.1 Executing program
❑ ➔ the most basic function of computers.
❑ Program: a set of instructions.
❑ Instruction: a set of binary bits in a predefined format
(usually consist of two main parts: Opcode and
Operands)
❑ Computers execute instructions sequentially.
❑ Instruction cycle: the processing required for a single
instruction execution
l Instruction fetch (fetch cycle): control unit fetches an instruction
from memory
l Instruction execution (execute cycle):
- control unit decodes instruction,
- then “tells” datapath and other components to perform the required
action.
- More details in Chapter 5.
IT3030E Fall 2024 16
Instruction fetch
❑ Questions:
l How does the CPU know which instruction to fetch next?
l Where is the location of the fetched instruction inside CPU?
IT3030E Fall 2024 17
Instruction fetch
❑ Importance
l To get the correct instruction.
l To execute all instructions in a program sequentially.
❑ At the beginning of each instruction cycle the processor
fetches an instruction from memory.
❑ The program counter (PC) holds the address of the
instruction to be fetched.
❑ The processor increases PC after each instruction fetch
so that PC points to the next instruction in sequence.
❑ The fetched instruction is loaded into the instruction
register (IR).
IT3030E Fall 2024 18
Instruction execution
❑ Instruction (fetched and stored in IR) is decoded to get
l The operation that the processor needs to do
l The location to get input data (source operands)
l The location to store output data (destination operand)
❑ Operand address calculation: calculate the address of
operands
❑ Operand fetch: fetch source operands
❑ Data operation: perform the action on source operands
and get result
❑ Operand store: store result into destination operand
IT3030E Fall 2024 19
Types of operation
• The processor may
perform some
arithmetic or logic
operation on data
• An instruction may
specify that the
sequence of
execution be altered
• Data transferred to
or from a peripheral
device by
transferring between
the processor and
an I/O module
• Data transferred
from processor to
memory or from
memory to
processor
Processor-
memory
Processor-
I/O
Data
processing
Control
IT3030E Fall 2024 20
Example
❑ Consider following hypothetical computer
l The computer contains a single register named AC (16 bits)
l Instruction format: 16 bits, 4 bits for the Opcode (representing 16
different opcodes/instructions)
IT3030E Fall 2024 21
Example
❑ What is the value of AC register in step 2, 3, 4, 5, 6?
Elaboration: How to support branching?
IT3030E Fall 2024 22
Example
❑ Solution
IT3030E Fall 2024 23
2.2 Interrupt
❑ What if CPU operates without interrupt?
❑ Fact: most external devices are much slower than CPU
❑ Suppose that CPU is transferring data with a printer
using above instruction cycle scheme
l After each write operator, CPU must wait until the printer
catches up
IT3030E Fall 2024 24
2.2 Interrupt
❑ The mechanism to allow other components (memory,
I/O) interrupt the normal processing of processor.
❑ Servicing interrupt: processor temporarily switch from the
current program to execute a different (rather short)
program, before continuing the original program.
Elaboration: what is the difference
between servicing interrupt and
calling sub-routines?
IT3030E Fall 2024 25
Example
IT3030E Fall 2024 26
Example
IT3030E Fall 2024 27
CPU time consume when I/O operation time is short
❑ Assume the
I/O operation
time is shorter
than
execution time
of instructions
between two
“WRITE”
instructions in
user program
IT3030E Fall 2024 28
CPU time consume when I/O operation time is long
❑ Assume the I/O
operation time is
longer than
execution time of
instructions between
two “WRITE”
instructions in user
program
IT3030E Fall 2024 29
Sources of interrupt
❑ Typical sources of interrupt:
l Software/program: occurs during instruction execution upon
some special condition such as division by 0, arithmetic
overflow… Can also be called exception.
l Timer: generated by system timer inside processor, to provide
timing service, such as for operating system task scheduler
service.
l I/O: generated by I/O modules, to request service from
processor or acknowledge the completion of an operation.
l Hardware failure: generated when error happens with hardware.
❑ Example: detecting keyboard events (key up/key down)
l Method 1: CPU checks keyboard status frequently
l Method 2: keyboard issue interrupt to notify CPU upon key
up/down
l Which is better regarding CPU usage?
IT3030E Fall 2024 30
Interrupt handler/Interrupt service routine (ISR)
❑ Special programs to be executed to service interrupts.
❑ Usually a part of operating system or system software.
❑ Typical operation:
l Determine the nature of interrupt: source and reason of interrupt.
l Perform corresponding operation.
l Return control to the interrupted program.
❑ Structure:
l Interrupt handler ends with a special instruction, to restore
context and value of PC, so that CPU can continue the
interrupted program properly.
IT3030E Fall 2024 31
Servicing interrupts: instruction and interrupt cycle
❑ Interrupt is checked at the end of each instruction cycle
❑ Interrupt cycle if interrupt occurred:
l CPU saves context of current program (current value of PC).
l Address of interrupt handler is loaded to PC.
l CPU continues with new instruction cycles, with new PC.
Interrupt handler will be executed instead of original program.
l At the end of interrupt handler, context will be restored including
PC value. CPU return to the interrupted program.
IT3030E Fall 2024 32
Multiple interrupt procesing
❑ Number of interrupt sources is (always) high.
❑ Interrupts can occur at the same time or overlap.
❑ Sequential vs nested interrupt processing
l Usually priority-based.
l More details in chapter 7.
IT3030E Fall 2024 33
2.3 Input/output
❑ The operation when data is transferred between I/O
modules and CPU/memory.
❑ CPU-controlled data transfer: data is transferred between
CPU and I/O, under the control of CPU.
❑ Direct memory access: data is transferred between
memory and I/O, under the control of special controllers
called DMAC.
IT3030E Fall 2024 34
3. System interconnection
❑ Interconnection model of each component
➔ Need to connect these components
❑ Theoretical bus interconnection scheme
IT3030E Fall 2024 35
System interconnection
❑ Interconnection system for high performance computers:
hierarchical bus
IT3030E Fall 2024 36
End of chapter 2

More Related Content

PPTX
ch 2_Component and function of computer .pptx
PPT
Chapter01 (1).ppt
PPTX
Ch01-OS9e (1).pptx
PPT
Cs intro-ca
PDF
APznzaboj9CF_9DQRT2HR-lWEYeLjr197Vw_ZUktUfDvP5Qqd8SL2ZSNwpIwVoC6MN9lqvglTXM11...
PDF
CMP 416-Architecture and system design.pdf
PPTX
Ch 01 os8e
PPT
Wk 4 top_level_view_of_computer_function_and_interconnection
ch 2_Component and function of computer .pptx
Chapter01 (1).ppt
Ch01-OS9e (1).pptx
Cs intro-ca
APznzaboj9CF_9DQRT2HR-lWEYeLjr197Vw_ZUktUfDvP5Qqd8SL2ZSNwpIwVoC6MN9lqvglTXM11...
CMP 416-Architecture and system design.pdf
Ch 01 os8e
Wk 4 top_level_view_of_computer_function_and_interconnection

Similar to IT3030E-CA-Chap2-Computer System and Interconnection.pdf (20)

PPT
03_Top Level View of Computer Function and Interconnection.ppt
PPT
03. top level view of computer function & interconnection
PPT
03 top level view of computer function and interconnection
PPT
Computer organisation Module 1.ppt
PPTX
Introduction to Computer Architecture and Organization
PPT
Chapter1 Computer System Overview.ppt
PDF
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
PDF
Chapter1-Introduction.pdf
PPTX
introduction COA(M1).pptx
PPT
lecture 1(1).ppt
PPTX
CAO.pptx
PPTX
Chapter 3 caal (1)
PPT
02-archsupport.ppt Architecture Support for OPS
PPTX
Computer Organisation & Architecture (chapter 1)
PPT
Chapter1 Computer System Overview Part-1.ppt
PPT
Report in SAD
PPTX
Chapter01-rev.pptx
PPTX
CH03-COA10e . pptx
PPTX
CH03-COA10 e.pptx
PPTX
IS 139 Lecture 5
03_Top Level View of Computer Function and Interconnection.ppt
03. top level view of computer function & interconnection
03 top level view of computer function and interconnection
Computer organisation Module 1.ppt
Introduction to Computer Architecture and Organization
Chapter1 Computer System Overview.ppt
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
Chapter1-Introduction.pdf
introduction COA(M1).pptx
lecture 1(1).ppt
CAO.pptx
Chapter 3 caal (1)
02-archsupport.ppt Architecture Support for OPS
Computer Organisation & Architecture (chapter 1)
Chapter1 Computer System Overview Part-1.ppt
Report in SAD
Chapter01-rev.pptx
CH03-COA10e . pptx
CH03-COA10 e.pptx
IS 139 Lecture 5
Ad

Recently uploaded (20)

PPTX
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
PDF
-DIGITAL-INDIA.pdf one of the most prominent
PPT
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
PPTX
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PPTX
ATL_Arduino_Complete_Presentation_AI_Visuals.pptx
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PDF
Smarter Security: How Door Access Control Works with Alarms & CCTV
PPTX
quadraticequations-111211090004-phpapp02.pptx
PPTX
title _yeOPC_Poisoning_Presentation.pptx
PPTX
Embeded System for Artificial intelligence 2.pptx
PPTX
Syllabus Computer Six class curriculum s
PDF
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
PPTX
code of ethics.pptxdvhwbssssSAssscasascc
PPTX
ERP good ERP good ERP good ERP good good ERP good ERP good
PPTX
material for studying about lift elevators escalation
PPTX
Lecture-3-Computer-programming for BS InfoTech
PPTX
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
PPTX
Fundamentals of Computer.pptx Computer BSC
PPTX
executive branch_no record.pptxsvvsgsggs
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
-DIGITAL-INDIA.pdf one of the most prominent
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
"Fundamentals of Digital Image Processing: A Visual Approach"
ATL_Arduino_Complete_Presentation_AI_Visuals.pptx
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
Smarter Security: How Door Access Control Works with Alarms & CCTV
quadraticequations-111211090004-phpapp02.pptx
title _yeOPC_Poisoning_Presentation.pptx
Embeded System for Artificial intelligence 2.pptx
Syllabus Computer Six class curriculum s
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
code of ethics.pptxdvhwbssssSAssscasascc
ERP good ERP good ERP good ERP good good ERP good ERP good
material for studying about lift elevators escalation
Lecture-3-Computer-programming for BS InfoTech
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
Fundamentals of Computer.pptx Computer BSC
executive branch_no record.pptxsvvsgsggs
Ad

IT3030E-CA-Chap2-Computer System and Interconnection.pdf

  • 1. IT3030E Fall 2024 1 Computer Architecture Ngo Lam Trung & Pham Ngoc Hung, Hoang Van Hiep Department of Computer Engineering School of Information and Communication Technology (SoICT) Hanoi University of Science and Technology E-mail: [trungnl, hungpn, hiephv]@soict.hust.edu.vn
  • 2. IT3030E Fall 2024 2 Chapter 2: Top-level view of Computer Functions and Interconnection 1. Computer Components 2. Computer Functions 3. Inter-connection Structures [with materials from Computer Organization and Architecture, 10th Edition, William Stallings, ©2016, Pearson]
  • 3. IT3030E Fall 2024 3 Computer Organization ❑ From Chap.1: classic components of a computer ❑ Computer ❑ Input data ❑ Execute stored programs ❑ Output result
  • 4. IT3030E Fall 2024 4 1. Computer Components ❑ More detailed computer organization Memory Link Input/Output To/from network Processor Control Datapath Input Output CPU I/O Computer organization with system link
  • 5. IT3030E Fall 2024 5 Hardware and software approaches ❑ Hardware approach l For a specific computation: - Construct the computation function by connecting several basic logic components: hardwired programming l New program or new computation → rewiring the hardware l General computer does not follow this approach
  • 6. IT3030E Fall 2024 6 Hardware and software approaches ❑ Software approach l Use a general-purpose hardware taking data and control signals as input, produce results l Programing is now much easier, instead of rewiring the hardware → provide new sequence of codes (instructions) l Question: where the Data comes from? Where the instructions come from?
  • 7. IT3030E Fall 2024 7 Computer components: top-level view
  • 8. IT3030E Fall 2024 8 CPU (Central Processing Unit) ❑ Control Unit l Fetch instruction from memory. l Interpret instruction. l Control other components to execute instruction. ❑ Datapath: performs arithmetic operations to process data (i.e., Arithmetic and Logic Unit). ❑ Register file (chapter 3): small and fast data storage for instruction execution. ❑ Some other dedicated components
  • 9. IT3030E Fall 2024 9 CPU ❑ Example: Apple A5
  • 10. IT3030E Fall 2024 10 Memory ❑ Store instructions of the running programs. ❑ Store data that are currently in use. Further reading: memory technologies
  • 11. IT3030E Fall 2024 11 Memory ❑ Logical organization l Array of memory cells l Each cell holds one byte of data l Each cell is assigned an unique adress l Data value can be changed, address is fixed ❑ Data are stored on memory cells l 8-bit integer requires 1 cell l 32-bit integer requires 4 cells l Array requires consecutive cells according to its size. l …
  • 12. IT3030E Fall 2024 12 Input/output ❑ Interfacing computer with physical world/environment. ❑ Types of I/O device l Input: mouse, keyboard, webcam… l Output: display, printer, speaker… l Storage: HDD, SSD, optical, USB drives… l Communication: WiFi, Ethernet, Bluetooth modules…
  • 13. IT3030E Fall 2024 13 Link: System interconnection ❑ The fabric to connect all components ❑ Huge number of connection, requires very good design so that all components function properly ❑ A modern computer motherboard (mainboard) typically has 4 to 12 layers.
  • 14. IT3030E Fall 2024 14 2. Computer functions ❑ Executing program ❑ Interrupt ❑ Input/Output
  • 15. IT3030E Fall 2024 15 2.1 Executing program ❑ ➔ the most basic function of computers. ❑ Program: a set of instructions. ❑ Instruction: a set of binary bits in a predefined format (usually consist of two main parts: Opcode and Operands) ❑ Computers execute instructions sequentially. ❑ Instruction cycle: the processing required for a single instruction execution l Instruction fetch (fetch cycle): control unit fetches an instruction from memory l Instruction execution (execute cycle): - control unit decodes instruction, - then “tells” datapath and other components to perform the required action. - More details in Chapter 5.
  • 16. IT3030E Fall 2024 16 Instruction fetch ❑ Questions: l How does the CPU know which instruction to fetch next? l Where is the location of the fetched instruction inside CPU?
  • 17. IT3030E Fall 2024 17 Instruction fetch ❑ Importance l To get the correct instruction. l To execute all instructions in a program sequentially. ❑ At the beginning of each instruction cycle the processor fetches an instruction from memory. ❑ The program counter (PC) holds the address of the instruction to be fetched. ❑ The processor increases PC after each instruction fetch so that PC points to the next instruction in sequence. ❑ The fetched instruction is loaded into the instruction register (IR).
  • 18. IT3030E Fall 2024 18 Instruction execution ❑ Instruction (fetched and stored in IR) is decoded to get l The operation that the processor needs to do l The location to get input data (source operands) l The location to store output data (destination operand) ❑ Operand address calculation: calculate the address of operands ❑ Operand fetch: fetch source operands ❑ Data operation: perform the action on source operands and get result ❑ Operand store: store result into destination operand
  • 19. IT3030E Fall 2024 19 Types of operation • The processor may perform some arithmetic or logic operation on data • An instruction may specify that the sequence of execution be altered • Data transferred to or from a peripheral device by transferring between the processor and an I/O module • Data transferred from processor to memory or from memory to processor Processor- memory Processor- I/O Data processing Control
  • 20. IT3030E Fall 2024 20 Example ❑ Consider following hypothetical computer l The computer contains a single register named AC (16 bits) l Instruction format: 16 bits, 4 bits for the Opcode (representing 16 different opcodes/instructions)
  • 21. IT3030E Fall 2024 21 Example ❑ What is the value of AC register in step 2, 3, 4, 5, 6? Elaboration: How to support branching?
  • 22. IT3030E Fall 2024 22 Example ❑ Solution
  • 23. IT3030E Fall 2024 23 2.2 Interrupt ❑ What if CPU operates without interrupt? ❑ Fact: most external devices are much slower than CPU ❑ Suppose that CPU is transferring data with a printer using above instruction cycle scheme l After each write operator, CPU must wait until the printer catches up
  • 24. IT3030E Fall 2024 24 2.2 Interrupt ❑ The mechanism to allow other components (memory, I/O) interrupt the normal processing of processor. ❑ Servicing interrupt: processor temporarily switch from the current program to execute a different (rather short) program, before continuing the original program. Elaboration: what is the difference between servicing interrupt and calling sub-routines?
  • 25. IT3030E Fall 2024 25 Example
  • 26. IT3030E Fall 2024 26 Example
  • 27. IT3030E Fall 2024 27 CPU time consume when I/O operation time is short ❑ Assume the I/O operation time is shorter than execution time of instructions between two “WRITE” instructions in user program
  • 28. IT3030E Fall 2024 28 CPU time consume when I/O operation time is long ❑ Assume the I/O operation time is longer than execution time of instructions between two “WRITE” instructions in user program
  • 29. IT3030E Fall 2024 29 Sources of interrupt ❑ Typical sources of interrupt: l Software/program: occurs during instruction execution upon some special condition such as division by 0, arithmetic overflow… Can also be called exception. l Timer: generated by system timer inside processor, to provide timing service, such as for operating system task scheduler service. l I/O: generated by I/O modules, to request service from processor or acknowledge the completion of an operation. l Hardware failure: generated when error happens with hardware. ❑ Example: detecting keyboard events (key up/key down) l Method 1: CPU checks keyboard status frequently l Method 2: keyboard issue interrupt to notify CPU upon key up/down l Which is better regarding CPU usage?
  • 30. IT3030E Fall 2024 30 Interrupt handler/Interrupt service routine (ISR) ❑ Special programs to be executed to service interrupts. ❑ Usually a part of operating system or system software. ❑ Typical operation: l Determine the nature of interrupt: source and reason of interrupt. l Perform corresponding operation. l Return control to the interrupted program. ❑ Structure: l Interrupt handler ends with a special instruction, to restore context and value of PC, so that CPU can continue the interrupted program properly.
  • 31. IT3030E Fall 2024 31 Servicing interrupts: instruction and interrupt cycle ❑ Interrupt is checked at the end of each instruction cycle ❑ Interrupt cycle if interrupt occurred: l CPU saves context of current program (current value of PC). l Address of interrupt handler is loaded to PC. l CPU continues with new instruction cycles, with new PC. Interrupt handler will be executed instead of original program. l At the end of interrupt handler, context will be restored including PC value. CPU return to the interrupted program.
  • 32. IT3030E Fall 2024 32 Multiple interrupt procesing ❑ Number of interrupt sources is (always) high. ❑ Interrupts can occur at the same time or overlap. ❑ Sequential vs nested interrupt processing l Usually priority-based. l More details in chapter 7.
  • 33. IT3030E Fall 2024 33 2.3 Input/output ❑ The operation when data is transferred between I/O modules and CPU/memory. ❑ CPU-controlled data transfer: data is transferred between CPU and I/O, under the control of CPU. ❑ Direct memory access: data is transferred between memory and I/O, under the control of special controllers called DMAC.
  • 34. IT3030E Fall 2024 34 3. System interconnection ❑ Interconnection model of each component ➔ Need to connect these components ❑ Theoretical bus interconnection scheme
  • 35. IT3030E Fall 2024 35 System interconnection ❑ Interconnection system for high performance computers: hierarchical bus
  • 36. IT3030E Fall 2024 36 End of chapter 2