Download ch2-1 - waynewolf.us

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Instruction sets
Computer architecture taxonomy.
Assembly language.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
von Neumann architecture
Memory holds data, instructions.
Central processing unit (CPU) fetches
instructions from memory.
Separate CPU and memory distinguishes
programmable computer.
CPU registers help out: program counter
(PC), instruction register (IR), generalpurpose registers, etc.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
CPU + memory
address
memory
200
PC
data
CPU
200
ADD r5,r1,r3
© 2008 Wayne Wolf
ADD IR
r5,r1,r3
Overheads for Computers as
Components 2nd ed.
Harvard architecture
address
data memory
data
address
program memory
© 2008 Wayne Wolf
data
Overheads for Computers as
Components 2nd ed.
PC
CPU
von Neumann vs. Harvard
Harvard can’t use self-modifying code.
Harvard allows two simultaneous memory
fetches.
Most DSPs use Harvard architecture for
streaming data:
greater memory bandwidth;
more predictable bandwidth.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
RISC vs. CISC
Complex instruction set computer (CISC):
many addressing modes;
many operations.
Reduced instruction set computer (RISC):
load/store;
pipelinable instructions.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
Instruction set
characteristics
Fixed vs. variable length.
Addressing modes.
Number of operands.
Types of operands.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
Programming model
Programming model: registers visible to
the programmer.
Some registers are not visible (IR).
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
Multiple implementations
Successful architectures have several
implementations:
varying clock speeds;
different bus widths;
different cache sizes;
etc.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
Assembly language
One-to-one with instructions (more or
less).
Basic features:
One instruction per line.
Labels provide names for addresses (usually
in first column).
Instructions often start in later columns.
Columns run to end of line.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.
ARM assembly language
example
label1 ADR
LDR
ADR
LDR
SUB
© 2008 Wayne Wolf
r4,c
r0,[r4] ; a comment
r4,d
r1,[r4]
r0,r0,r1 ; comment
Overheads for Computers as
Components 2nd ed.
Pseudo-ops
Some assembler directives don’t
correspond directly to instructions:
Define current address.
Reserve storage.
Constants.
© 2008 Wayne Wolf
Overheads for Computers as
Components 2nd ed.