0% found this document useful (0 votes)
14 views72 pages

Anization

The document provides an overview of computer architecture, focusing on the distinction between architecture and organization, as well as the components of a computer system, including instructions and the compute stack. It discusses the Instruction Set Architecture (ISA), the role of the processor, and how instructions are executed through various tasks such as loading, adding, and storing data. Additionally, it highlights the importance of the Register File for efficient data access and the challenges of implementing ISA in hardware.

Uploaded by

Harshith Puram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views72 pages

Anization

The document provides an overview of computer architecture, focusing on the distinction between architecture and organization, as well as the components of a computer system, including instructions and the compute stack. It discusses the Instruction Set Architecture (ISA), the role of the processor, and how instructions are executed through various tasks such as loading, adding, and storing data. Additionally, it highlights the importance of the Register File for efficient data access and the challenges of implementing ISA in hardware.

Uploaded by

Harshith Puram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

M1 – Introduction

Architecture vs. Organization


Outline

Components of the System

Instructions

Architecture vs. Organization

The Compute Stack
Computer

Programs
– Instructions and Data
Computer

Programs
– Instructions and Data

Computer: An electronic device which is capable
of receiving information (data) and performing a
sequence of operations defined by instructions
(program) to produce a result in the form of
information
Instructions

Tasks that a processor can execute
– eg. add, mul, beq, load, store, call, ...
Instructions

Tasks that a processor can execute
– eg. add, mul, beq, load, store, call, ...

Defined in the “Instruction Set Architecture
(ISA)”
Instructions

Tasks that a processor can execute
– eg. add, mul, beq, load, store, call, ...

Defined in the “Instruction Set Architecture
(ISA)”

Several ISAs exist
– RISC-V, POWER, MIPS, ARM, x86, ...
Instructions

Which instructions to implement?
Instructions

Which instructions to implement?

Desktop publishing vs. Gaming
– Integer operations vs. Floating point operations
Instructions

Which instructions to implement?

Desktop publishing vs. Gaming
– Integer operations vs. Floating point operations

Database program vs. Video processing
– I/O processing vs. Floating point operations
Instructions

Which instructions to implement?

Desktop publishing vs. Gaming
– Integer operations vs. Floating point operations

Database program vs. Video processing
– I/O processing vs. Floating point operations

Some fundamental instructions exist
– Arithmetic, Logic, Memory transfer, Control
statements, Privileged instructions, ...
Instruction Tasks
aa == bb ++ c;
c;


Compiler converts a=b+c into a list of tasks
the processor can accomplish
Instruction Tasks
aa == bb ++ c;
c;


Compiler converts a=b+c into a list of tasks the
processor can accomplish

Inputs: b and c. Output: a. Operation: addition.
Instruction Tasks
aa == bb ++ c;
c;


Compiler converts a=b+c into a list of tasks the
processor can accomplish

Inputs: b and c. Output: a. Operation: addition.

Addition operations is performed in the
Processor
– Arithmetic and Logic Unit
Instruction Tasks
aa == bb ++ c;
c;


Compiler converts a=b+c into a list of tasks the
processor can accomplish

Inputs: b and c. Output: a. Operation: addition.

Addition operations is performed in the Processor
– Arithmetic and Logic Unit

a, b, and c are in the Memory
– Assume: they have to be inside the processor for
addition to begin
Minor
MinorDetour
Detour--
Memory
Memory
The Program in Memory
Simplified View

Last Byte

DATA
DATA

Data begins here


Instructions end here

INSTRUCTIONS
INSTRUCTIONS

Byte 0
The Program in Memory
Simplified View

DATA
DATA

a b c

INSTRUCTIONS
INSTRUCTIONS

a, b, and c identify unique


More details later !
locations in program memory!
Instruction Tasks
aa == bb ++ c;
c;

PROCESSOR
PROCESSOR MEMORY
MEMORY

Interconnect
Interconnect

I/O
I/ODevices
Devices I/O
I/ODevices
Devices I/O
I/ODevices
Devices
Instruction Tasks
aa == bb ++ c;
c;

PROCESSOR MEMORY

Interconnect
Interconnect
1
Instruction Tasks
aa == bb ++ c;
c;

PROCESSOR MEMORY

(1)

Interconnect
Interconnect

(1) Processor requests for value at location ‘b’ from memory


1
Instruction Tasks
aa == bb ++ c;
c;

PROCESSOR MEMORY

(1) (2)

(1) Processor requests for value at location ‘b’ from memory


(2) Memory sends value at location ‘b’ to the processor
1
Instruction Tasks
aa == bb ++ c;
c; LOAD
LOADbb

PROCESSOR MEMORY

(1) (2)

(1) Processor requests for value at location ‘b’ from memory


(2) Memory sends value at location ‘b’ to the processor
2
Instruction Tasks
aa == bb ++ c;
c; LOAD
LOADcc

PROCESSOR MEMORY

(1) (2)

(1) Processor requests for value at location ‘b’ from memory


(2) Memory sends value at location ‘b’ to the processor
3
Instruction Tasks
aa == bb ++ c;
c;

b
c
+ b+c MEMORY

Add values from ‘b’ and ‘c’


4
Instruction Tasks
aa == bb ++ c;
c; STORE

b+c
+ MEMORY

Processor sends the sum to memory to put in location ‘a’


Instruction Tasks
aa == bb ++ c;
c;


Load value from memory location b

Load value from memory location c

Add these values

Store sum into memory location ‘a’

Load
Loadand
andStore
Storeare
arememory
memorytransfer
transferoperations.
operations.
Add
Addisisan
anALU
ALUoperation
operation
Instruction Tasks
Load
Load bb
Load
Load cc
aa == bb ++ c;
c;
Add
Add
Store
Store aa


Load value from memory location b

Load value from memory location c

Add these values

Store sum into memory location ‘a’
Instruction Tasks

aa == bb ++ c;
c;
dd == bb ++ cc ++ a;
a;
ff == dd ++ aa ++ e;
e;


List the fundamental tasks.

Observations?

Can you improve on the design?
Instruction Tasks

aa == bb ++ c;
c;
dd == bb ++ cc ++ a;
a;
ff == dd ++ aa ++ e;
e;


Loads are repeated – b, c, a.

Store and Load pairs – a, d.
Instruction Tasks

aa == bb ++ c;
c;
dd == bb ++ cc ++ a;
a;
ff == dd ++ aa ++ e;
e;


Loads are repeated – b, c, a.

Store and Load pairs – a, d.

Eliminate repetitive/redundant operations
– Store intermediate results
– Register File (RF)
x0
x1
Register File ...
x31


Fast storage for quick access by the processor
x0
x1
Register File ...
x31


Fast storage for quick access by the processor

Small number of data elements Eg. 32.

Accessed as registers x0, x1, x2, … x31.
x0
x1
Register File ...
x31


Fast storage for quick access by the processor

Small number of data elements Eg. 32.

Accessed as registers x0, x1, x2, … x31.

“load from memory into the processor” = “fetch
data from memory and write into Register File”
x0
x1
Register File ...
x31


Fast storage for quick access by the processor

Small number of data elements Eg. 32.

Accessed as registers x0, x1, x2, … x31.

“load from memory into the processor” = “fetch
data from memory and write into Register File”

Loaded values go in the RF; Results of
computations go into the RF; Values from RF
can be stored into memory
Instruction Tasks
Load x1, b
Load x2, c
aa == bb ++ c;
c; Add x3, x1, x2
Store x3, a
Instruction Tasks
Load x1, b
Load x2, c
aa == bb ++ c;
c; Add x3, x1, x2
Store x3, a


Load value from memory location b into x1

Load value from from memory location c into x2

Add contents of x1 and x2 and save the sum into
x3

Store contents of x3 into memory location ‘a’
The Computer System

+ RF
MEMORY
MEMORY
ALU

Interconnect
Interconnect

I/O
I/ODevices
Devices I/O
I/ODevices
Devices I/O
I/ODevices
Devices
Assembly Level Language

Expression of high level language statements as
their fundamental tasks
Assembly Level Language

Expression of high level language statements as
their fundamental tasks

1-to-1 mapping to the binary code
Assembly Level Language

Expression of high level language statements as
their fundamental tasks

1-to-1 mapping to the binary code

ISA – list of instructions implemented in the
processor
Assembly Level Language

Expression of high level language statements as
their fundamental tasks

1-to-1 mapping to the binary code

ISA – list of instructions implemented in the
processor

Specific to a processor
Assembly Level Language
Assembly Level
High Level Language Statements Binary Code
Language
Statement Load
Loadx1,
x1,bb 10010111000011110000111100001111
10010111000011110000111100001111
Load
Loadx2,
x2,cc 01100011001001001111110000111001
01100011001001001111110000111001
aa==bb++c;
c; 00100100110110011000111100001111
Add
Addx3,
x3,x1,
x1,x2
x2 00100100110110011000111100001111
Store 01001100110000111100010110010111
Storex3,
x3,aa 01001100110000111100010110010111
Instruction Set Architecture

Also called “Architecture”

Informally, a list of capabilities of the processor
Instruction Set Architecture

Also called “Architecture”

Informally, a list of capabilities of the processor
– What operations are supported by this processor?
Instruction Set Architecture

Also called “Architecture”

Informally, a list of capabilities of the processor
– What operations are supported by this processor?
– What kind of data does the operation act on?
Instruction Set Architecture

Also called “Architecture”

Informally, a list of capabilities of the processor
– What operations are supported by this processor?
– What kind of data does the operation act on?
– Where does the data for the operation come from?
Instruction Set Architecture

Also called “Architecture”

Informally, a list of capabilities of the processor
– What operations are supported by this processor?
– What kind of data does the operation act on?
– Where does the data for the operation come from?
– Which types of data are valid for an operation.
Instruction Set Architecture

Also called “Architecture”

Defines instructions (operations) the processor
implements (supports)

Input operands – number, size, type

Input from Memory or from Registers

Data Representation – Types/Sizes
ADD x3, x2, x1
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3.

Both input operands are 32b signed integers (x1
and x2)
– vs. ADDU, ADDI
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3.

Both input operands are 32b signed integers (x1
and x2)
– vs. ADDU, ADDI

Both input operands come from the Register File
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3.

Both input operands are 32b signed integers (x1
and x2)

Both input operands come from the Register File

Processor contains hardware to feed the ALU
from the RF
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3.

Both input operands are 32b signed integers (x1
and x2)

Both input operands come from the Register File

Processor contains hardware to feed the ALU
from the RF

ALU contains hardware to add two numbers
(Adder)
ADD x3, x2, x1

Operation: ADD. Input operands: x1, x2. Output
Operand: x3.

Both input operands are 32b signed integers (x1
and x2)

Both input operands come from the Register File

Processor contains hardware to feed the ALU from
the RF

ALU contains hardware to add two numbers (Adder)

Processor contains hardware to connect the ALU to
update the RF with the result
Organization

Also called Microarchitecture
Organization

Also called Microarchitecture

Several Adder circuits exist
– Each with different gate counts and costs
Organization

Also called Microarchitecture

Several Adder circuits exist
– Each with different gate counts and costs

Choosing one adder that fits the space and cost
constraints is an organization challenge
Organization

Also called Microarchitecture

Several Adder circuits exist
– Each with different gate counts and costs

Choosing one adder that fits the space and cost
constraints is an organization challenge

Informally, Organization is the way a given ISA is
implemented in hardware on a processor
Organization

Also called Microarchitecture

Several Adder circuits exist
– Each with different gate counts and costs

Choosing one adder that fits the space and cost
constraints is an organization challenge

Informally, Organization is the way a given ISA is
implemented in hardware on a processor

Architecture describes what the computer does
and organization describes how it does it.
Same Architecture, Different Microarchitectures

AMD Athlon II X4 ●
Intel Atom
– –

David Wentzlaff, ELE 475 – Computer Architecture, Princeton University


Same Architecture, Different Microarchitectures

AMD Athlon II X4 ●
Intel Atom
– X86 Instruction Set, Quad – X86 Instruction Set, Single
Core, Out-of-order, 2.9GHz, Core, In-order, 1.6GHz, 2W
125W – Decode 2 Instructions/Cycle /
– Decode 3 Core
Instructions/Cycle/Core – 32KB L1 I Cache, 24KB L1 D
– 64KB L1 I Cache, 64KB L1 D Cache, 512KB L2 Cache
Cache, 512KB L2 Cache

David Wentzlaff, ELE 475 – Computer Architecture, Princeton University


The Compute Stack

Application

Physics
The Compute Stack

Application

Physics
The Compute Stack

Application

Algorithm

Physics
The Compute Stack

Application

Algorithm
Programming Language

Physics
The Compute Stack

Application

Algorithm
Programming Language
Operating System/Virtual Machines

Physics
The Compute Stack

Application

Algorithm
Programming Language
Operating System/Virtual Machines

Devices
Physics
The Compute Stack

Application

Algorithm
Programming Language
Operating System/Virtual Machines

Circuits
Devices
Physics
The Compute Stack

Application

Algorithm
Programming Language
Operating System/Virtual Machines

Gates
Circuits
Devices
Physics
The Compute Stack

Application

Algorithm
Programming Language
Operating System/Virtual Machines
Instruction Set Architecture
Organization/Microarchitecture
Register-Transfer Level
Gates
Circuits
Devices
Physics
Memory Detour

You might also like