Professional Documents
Culture Documents
Architecture
Instruction sets are differentiated by the following:
•Instruction length
• Whether short, long, or variable
•Number of operands
•Number of addressable registers
•Memory organization
• Whether byte-word addressable
•Addressing modes.
• Choose any or all: direct, indirect or
indexed
Memory Organization
n bits
First word
Second word
..
.
ith word
...
last word
Memory Organization
32 bits
b31 b30 b1 b0
A signed integer
Memory Organization
32 bits
8 bits 8 bits 8 bits 8 bits
Four characters
Memory Organization
•Big endian:
• Is more natural
• The sign of the number can be determined by
looking at the byte at address offset 0
• Strings and integers are stored in the same order
•Little endian:
• Make it easier to place values on non-word
boundaries
• Conversion from a 16 bit integer address to a 32
bit integer address does not require any
arithmetic
•The next consider for architecture design concerns
how the CPU will store data
•We have three choices
• A stack architecture
• An accumulator architecture
• A general purpose register architecture
•In choosing one over the other, the tradeoffs are
simplicity (and cost) of hardware design with
execution speed and ease of use.
•In a stack architecture, instructions and operands
are implicitly taken from the stack
• A stack cannot be accessed randomly
•In an accumulator architecture, one operand of a
binary operation is implicitly in the accumulator
• One operand is in memory, creating lots of bus
traffic
•In a general purpose register (GPR) architecture,
registers can be used instead of a memory,
• Faster than accumulator architecture
• Efficient implementation for compilers
• Results in longer instructions
Memory Operations
• Assembly-Language Notation
• another type of notation to represent
the machine instructions and programs.
• consider the previous example:
Load R2, LOC
More specifically
Load R2, A
Load R3, B
Add R4, R2, R3
Store R4, C
Reduced Instruction Set Computers (RISC)
Store R4, C
Store instruction is of the form
Store source, destination
Complex Instruction Set Computers (CISC)
C = A + B
Move C, B
Add C, A
Complex Instruction Set Computers (CISC)