An Introduction To Computer Architecture
An Introduction To Computer Architecture
Course Instructor(s):
Section A: Dr. Sajid Muhaimin Choudhury, Assistant Professor
Email: [email protected]
Office: ECE222, ECE Building
N.B. the following slides were prepared by Dr. Sajid Muhaimin Choudhury; slight modifications have been made by Dr. Md. Zunaid Baten
1
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
2
EEE 415
Course Information
2
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
3
3
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
4
4
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
5
Introduction to OBE
• In this course, we are going to follow the approach of Outcome
Based Education (OBE)
• Outcome-based education (OBE) is an educational theory that
bases each part of an educational system around goals
(outcomes). By the end of the educational experience, each
student should have achieved the goal
5
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
BUGS EEE - Introducing Outcome Based Education
6
6
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Program Objectives of Dept of EEE BUET
PO1 Engineering Knowledge: Apply knowledge of mathematics, science, and engineering to solve complex electrical and electronic engineering problems. (*K1 to K4).
PO2 Problem Analysis: Identify, formulate, research literature, interpret data, and analyze complex electrical and electronic engineering problems using principles of
mathematical, natural and engineering sciences. (K1 to K4).
PO3 Design/development Solution: Design solutions to complex engineering problems and design systems, components, or processes that meet the needs relevant
to electrical and electronic engineering with appropriate considerations to public health and safety, cultural, societal, and environmental considerations. (K5).
PO4 Investigation: Conduct investigations of complex problems using research-based knowledge and research methods including design of experiments, analysis
and interpretation of data, and synthesis of information to provide valid conclusions. (K8).
PO5 Modern tool usage: Use techniques, skills, and modern engineering tools to solve complex and practical engineering problems related to electrical and
electronic engineering with understanding of the limitations. (K6).
PO6 The Engineer and Society: Apply reasoning to assess societal, health, safety, legal andcultural issues and the consequent responsibilities relevant to
professional engineering practice and solutions to complex engineering problems. (K7).
PO7 Environment and sustainability: Understand and evaluate the sustainability and impact of professional engineering work in the solution of
complex engineering problems in societal and environmental contexts. (K7).
PO8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of engineering practice. (K7).
PO9 Individual work and team work: Function effectively as an individual, and as a member or leader in diverse teams and in multi-disciplinary settings.
Communication: Communicate effectively on complex engineering activities with the electrical and electronic engineering and other inter-disciplinary communities
PO10 and with society at large, such as being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
PO11 Project management and finance: Demonstrate knowledge and understanding of engineering management principles and economic decision-making and
apply these to one's own work, as a member and leader in a team, to manage projects and in multidisciplinary environments.
PO12 Life-long Learning: Recognize the need for, and ability to engage in life-long learning
7
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
BUGS EEE - Introducing Outcome Based Education
8
Course Outcome
• Syllabus of each course needs to be modified to include
specific
Course Outcomes (CO)
• Each Course will have several COs
• Each CO will be mapped with 1 or more PO
• Each CO must be evaluated through assessments (CTs, Term
final Exam questions, Presentation etc)
• Through marks obtained in each exam question, it will be
calculated how much of the COs have each student obtained
• CO-PO mapping will tell how much PO each student has
obtained
8
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
9
Grading Policy:
1. Class Attendance – Class participation and attendance will be recorded in every class. 30 Marks as per university AC
policy
2. Continuous Assessment –
• Assignment and/or (video) presentation
• Class tests
3. Final Examination – A comprehensive term final examination will be held at the end of the Term following the
guideline of the Academic Council
Distribution of Marks
Class Attendance – 10%
Continuous Assessment – 20%
Final Examination – 70%
10
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
11
Textbooks
[Harris] Sarah Harris, David Harris – “Digital Design and Computer Architecture, ARM
Edition, Morgan Kaufmann (2015)
[Patterson] David A. Patterson and John L. Hennessy, “Computer Organization and Design
– The Hardware / Software Interface ARM edition” Morgan Kaufmann
[Zhu] Yifeng Zhu “Embedded Systems with ARM Cortex-M Microcontrollers with
Assembly Language and C”
11
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
This Course
• Microprocessor Part:
• Aims to introduce the key concepts and ideas in computer architecture
• Explores the design of modern microprocessors
• Examines important trends and current and future challenges
12
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
13
4 7-9
6
16-18 Memory Harris 8
13
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
14
Fundamentals of
Microprocessor and
Computer Architecture
14
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Week Content
• What is computer architecture?
• Computer architecture arena and design goals
• Historical performance of computer architecture
• Future trends with multicore processors,
systems on chip (SoCs), and beyond
A system on a chip also written as system-on-a-chip and system-on-chip, is an integrated circuit that integrates all or most components of
a computer or other electronic system. These components almost always include central processing unit (CPU), memory interfaces, on-
chip input/output devices; other components such as radio modems and a graphics processing unit (GPU) – all on a single substrate or
microchip can also exist.
15
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
In the beginning...
Introduction
• The modern computer is less than 100 years old.
• The first electromechanical and valve-based machines
were produced in the 1930s and 1940s.
• Today’s machines are many orders of magnitude faster,
EDSAC replica (2018)1
lower power, more reliable, and cheaper.
The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by ARM. These cores
are optimized for low-cost and energy-efficient integrated circuits, which have been embedded
in tens of billions of consumer devices
1. By Zeptobars, CC BY 3.0
18 2. By Connie Zhou, CC BY-NC 4.0
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Orientation
The internet
Motherboard
19
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Computer Motherboard
Power Power
Memory Memory
20
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
The processors go here…
21
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Processor are Cool!
• Chips are made of silicon
• Aka“sand”
• The most adundant element in the earth’s crust.
• Extremely pure (<1 part per billion)
• This is the purest stuff people make
22
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Building Chips
23
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Building Chips
Photolithography
Mask Mask
Resist Resist
SiO2
Silicon Wafer Silicon Wafer SiO2 SiO2
Grow silicon dioxide Silicon Wafer Silicon Wafer
Apply photo resist Expose to UV
Etch SiO2
SiO2 Me Me
(Or not)
Silicon Wafer Silicon Wafer t t
Etch SiO2
24
EEE 415Patterned resist of EEE, BUET
- Department Silicon Wafer Silicon Wafer
© 2021 Dr. Sajid Muhaimin Choudhury
Deposit metal
Building Blocks:Transistors
25
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Building Blocks:Wires
26
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
The Apple M1 Pro and M1 Max are systems-on-chip (SoC) designed by Apple Inc
State of the Art CPU for the MacBook Pro laptop series and the Mac Studio desktop series, based on
the licensed ARM architecture.
27
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Major Players in the Microprocessor world
28
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Major Players in the Microprocessor world
Advanced RISC Machines
Ltd., now known as ARM
29
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Introducing Abstraction
30
EEE 415 - Department of EEE, BUET © 2021 Dr. Sajid Muhaimin Choudhury
Abstractions of the PhysicalWorld…
This Course
31
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
…for the Rest of the System
CSE
JVM
Processor Software
Compilers Languages
Architectures Abstraction Engineers/
Applications
32
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Levels of Abstraction
• Architecture
• A set of specifications that allows developers to write software and firmware
• These include the instruction set.
• Microarchitecture
• The logical organization of the inner structure of the computer
• Hardware or Implementation
• The realization or the physical structure, i.e., logic design and chip packaging
33
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
34
• It’s cool!
• Microprocessors are among the most sophisticated devices manufactured by people
• How they work (and even that they work) as reliably and as quickly as they do is amazing.
34
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
The Computer Architecture Arena
Computer
architecture
Application
characteristics
Markets
New
applications
Technology
Source: “Early 21st Century Processors,” S. Vajapeyam and M. Valero, IEEE Computer, April 2004
35
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Design Goals
• Functional – hard to correct (unlike software). Verification is perhaps the highest single cost in the design
process. We also need to test our chips once they have been manufactured, again this can be a costly
process and requires careful thought at the design stage
• Performance – what does this mean? No single best answer, e.g., sports car vs. off-road 4x4 vehicle –
performance will always depend on the “workload”
• Power – a first-order design constraint for most designs today. Power limits the performance of most
systems.
• Security – e.g., the ability to control access to sensitive data or prevent carefully crafted malicious inputs
from hijacking control of the processor
• Cost – design cost (complexity), die costs (i.e., the size or area of our chip), packaging, etc.
36
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Markets and Features
Each target market will require a different trade-off in terms of power consumption, cost,
area, performance, security, reliability, etc.
Here are some example processor classes (different families) from Arm:
• Cortex-A: high-performance application processors, e.g., for mobile phones
• Cortex-R: deterministic real-time performance, fault detection, and tolerance.
• Cortex-M: energy-efficient embedded devices (“microcontroller” class cores)
• Neoverse: scalable networks of processors on a single chip
• e.g., 8, 16, 64, or 128 cores. Used in datacenters, edge servers, and storage
The ARM Cortex-A and Cortex-B are groups of 32-bit and 64-bit RISC ARM processor cores licensed by Arm.
The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by ARM.
Arm Neoverse is a server chip microarchitecture that ARM's customers — the big chipmakers of the
world — can design chips around for servers in the big datacenters that power the internet.
37
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Camera
The Smartphone CORTEX-M Sensor hub
Touchscreen & CORTEX-M Power management
sensor hub
CORTEX-M
CORTEX-A
• A single CORTEX-M
smartphone will Flash controller
Apps processor
contain many CORTEX-M
CORTEX-A
different CORTEX-M
processor cores.
GPS
2G/3G/4G/5G CORTEX-M
• Why not use a CORTEX-A
single processor? CORTEX-R
CORTEX-M Bluetooth
CORTEX-M
Wi-Fi
CORTEX-R
CORTEX-M
38
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Architecture
• The Architecture is a contract between the hardware and the software.
• The hardware defines a set of operations,their semantics,and rules for their use.
• The software agrees to follow these rules
39
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
The Stored Program Computer
40
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
From Brain to Bits
Your brain
Brain/
Fingers/
SWE
Programming
Language (C, C++, Java)
Compiler
Assembly language
Assembler
Machine code
(i.e., .o files)
Linker
Executable
(i.e., .exe files)
41
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
C Code
int i;
int sum = 0;
int j = 4;
42
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
In the Compiler
addi $s0, $zero, 0
sum = 0
addi $s1, $zero, 4
j=4
i=0 addi $s2, $zero, 0
false true
true false
...
...
Control flow graph w/high- Control flow graph
43
level instructions w/real instructions
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
17
Out of the Compiler
addi $s0, $zero, 0
addi $s0, $zero, 0 addi $s1, $zero, 4
addi $s1, $zero, 4 addi $s2, $zero, 0
addi $s2, $zero, 0
top:
addi $t0, $zero, 10 addi $t0, $zero, 10
bge $s2, $t0
bge $s2, $t0, after
after:
...
...
44
EEE 415 - Department of EEE, BUET
Assembly language
© 2019 Arm Limited
44
Program Execution
• This is the algorithm for a stored-program computer
• The Program Counter (PC) is the key
45
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Historical Performance
46
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Historical Performance Gains
• The “iron law” of processor performance:
47
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Moore’s Law
• Moore’s Law predicts that the number of
transistors we can integrate onto a chip, for
the same cost, doubles every 2 years.
49
EEE 415 - Department of EEE, BUET Source: Wgsimon, Wikipedia, CC BY-SA 3.0© 2019 Arm Limited
Clocks Per Instruction (CPI)
• Eventually, the industry was also able to fetch and execute multiple instructions per
clock cycle. This reduced CPI to below 1.
• When we fetch and execute multiple instructions together, we often refer to
Instructions Per Cycle (IPC), which is 1/CPI.
• For instructions to be executed at the same time, they must be independent.
• Again, growing transistor budgets were exploited to help find and exploit this
Instruction-Level Parallelism (ILP).
50
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Parallelism and Pipelining
Engine
Chassis Paint
Time Time
A A
B B
C C
51
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
IPC and Instruction Count
• From 1985 to 2002, performance
52
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Slowing Single-core Performance Gains
Sustaining single core performance gains became difficult due to:
• The limits of pipelining
• The limits of Instruction-Level Parallelism (ILP)
• Power consumption
• The performance of on-chip wires
As a result performance gains slowed from 52% to 21% per year for the highest
performance processors.
• Power = alpha* fCV2 where f is the frequency, C is capacitance, V the voltage and alpha the percentage of time
switched;
• Dennard scaling predicted that Power would remain constant if we decrease transistor size. That would have
allowed us to increase f (as V decreases with transistor scaling)
• However in reality short-channel effects and other issues in small transistors increase Power consumption,
therefore limiting the f
53
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Multicore Processors
• Eventually, it made sense to shift from
single-core to multicore designs.
• From ~2005, multicore designs became
mainstream.
• The number of cores on a single chip
increased over time.
• Individual cores were designed to be as
power efficient as possible.
55
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
Specialization
Approach Outcome
Time Early computers Gains from bit-level parallelism
Pipelining + Instruction-level parallelism
+ Thread-level parallelism/data-level
Multicore/GPUs
parallelism
Greater integration (large SoCs),
+ Accelerator-level parallelism
heterogeneity, and specialization
58
EEE 415 - Department of EEE, BUET © 2019 Arm Limited
The Future – The End of Moore’s Law?
• The end of Moore’s Law has been predicted many times.
• Scaling has perhaps slowed in recent years, but transistor density continues to improve.
• Eventually, 2D scaling will have to slow down.
• We are ultimately limited by the size of atoms!
• Where next?
• Going 3D - Future designs may take advantage of multiple layers of transistors on a single chip.
– Note: the gains are linear rather than exponential.
• Better packaging and integration technologies (e.g., chip stacking)
• New types of memory
• New materials and devices
59
EEE 415 - Department of EEE, BUET © 2019 Arm Limited