Ch 5 Flashcards
Little Endian
Least significant bit first. High-precision arithmetic on these types of machines if faster & easier.
Big Endian
Most significant bytes at the lower addresses. More natural to most people & thus makes it easier to read hex dumps. These types of machines store integers & strings in the fame order.
Stack Architecture
Uses a ____ to execute instructions.
The operands are found on top of the stack.
Accumulator Architectures
One operand implicitly in the _______, minimize the internal complexity of the machine an allow for very short instructions. Because the _______ is only temporary storage, memory traffic is very high.
General-Purpose Register Architectures
Uses sets of ______-_______ registers
Memory-Memory Architectures
May have two or three operands in memory, allowing an instruction to perform an operation without requiring any operand to be in a register.
Register-Memory Architectures
Require a mix, where at least one operand is in a register and one is in memory.
Load-Store Architecture
Requires data to be moved into registers before any operations on those data are performed.
Fixed length
Wastes space bus is fast and results in better performance when instruction-level pipelining is used.
Variable Length
More complex to decode but saves storage space.
Opcode Only (zero address)
In architectures based on stacks. Need push and pop instructions.
PUSH X places the data value found at memory location X onto the stack.
POP X removes the top element in the stack and stores it at location X.
Reverse Polish Notation (RPN)
This representation places the operator after the operands in what is known as postfix notation. Every operator follows its operands in any expression. If the expression contains more than one operation, the operator is given immediately after its second operand.
12 / (4 + 2) = 1 2 4 2 + /
(2 + 3) - 6 / 3 = 2 3 + 6 3 / -
Three Operands Allowed
When 3 operands are allowed, at least one operand must be a register, and the first operand is normally the destination.
Given this expression, Z = (X * Y) + (W * U)
We get this code:
Mult R1, X, Y
Mult R2, W, U
Add Z, R2, R1
Two Operands Allowed
When using two-address instructions, normally one address specifies a register. The other operand could be either a register or a memory address.
Given this expression, Z = (X * Y) + (W * U)
We get this code:
Load R1, X
Mult R1, Y
Load R2, W
Mult R2, U
Add R1, R2
Store Z, R1
*Note that it is important to know whether the first operand is the source or the destination.
One Operand Allowed
We must assume a register is implied as the destination for the result of the instruction. Given this expression, Z = (X * Y) + (W * U) We get this code: Load X Mult Y Store Temp Load W Mult U Add Temp Store Z
Zero Operands Allowed
Stack-based architectures use no operands for instructions such as Add, Subt, Mult, or Divide. WE need a stack and two operations on that stack: Push and Pop
Push places the operand on top of the stack.
Pop removes the stack top and places it in the operand.
Given this expression, Z = (X * Y) + (W * U)
We get this code:
Push X
Push Y
Mult
Push W
Push U
Mult
Add
Pop Z
Expanding Opcodes
Represent a compromise between the need for a rich set of opcodes and the desire to have short opcodes.
Data Movement
These instructions are the most frequently used instructions. Data is moved from memory into registers, from registers to registers, and from registers to memory, and many machines provide different instructions depending on the source and destination.
Arithmetic Operations
These include those instructions that use integers and floating point numbers. Many instruction sets provide different arithmetic instructions for various data sizes.
Boolean Logic Instructions
These instructions perform ______ operations, much in the same way that arithmetic operations work. These instructions allow bits to be set, cleared, and complemented. Commonly used to control I/O devices.
Bit Manipulation Instructions
Used for setting and resetting individual bits within a given data word. Includes both arithmetic and logical SHIFT instructions and ROTATE instructions, each to the left and to the right.