Chapter 5
Convert the RPN to infix 8 6 + 4 2-/
(8+6)/(4-2)
Give an example of prefix notation.
+XY
What is a con for General-purpose-register architecture?
Because all operands must be named, using registers results in longer instructions, causing longer fetch and decode times.
What is a con for short instructions?
It limits the number of instructions because there must be enough bits in the instruction to specify the number of instructions we need.
Special purpose instructions include what?
string processing, high-level language support, protection, flag control, word/byte conversions, cache management, register access, address calculations, no-ops, and any other instructions that don't fit into the previous categories.
What does Indirect addressing mode do?
the bits in the address field specify a memory address that is used as a pointer.
What does Immediate addressing mode do?
the value to be referenced immediately follows the operation code.
What type of operands can there be?
addresses, numbers, or characters.
What is Expanding opcode?
an ISA with fixed overall instruction length, but allow the number of bits in the operand field to vary as necessary.
What instructions are there for Transfers of Control?
branches, skips, procedure calls, returns, and program terminations.
Addressing modes are important for what?
designing an instruction set.
What addressing modes does MARIE have?
direct and Indirect.
What are the most common numbers of explicit operands per instruction?
0, 1, 2, and 3.
How are ISAs measured?
1) The amount of space a program requires; 2) The complexity of the instruction set, in terms of the amount of decoding necessary to execute an instruction, and the complexity of the tasks performed by the instructions; 3) the length of the instructions; 4)the total number of instructions.
What are two possibilities for a 16 bit instruction format?
1)XXXX XXXX XXXX XXXX opcode Addr1 Addr2 Addr3 2)XXXX XXXXXXXXXXXXX opcode Address one
Convert 10 2 3 +/ to infix
10/(2+3)
Convert 12/(4+2) to postfix.
12 4 2+/
Calculate the number of bit patterns a 15 instruction format with 3 address codes requires
15*2^4*2^4*2^4=15*2^12 = 61440 bit patterns
What are common amount of bits in an operand?
16, 32, and 64.
convert (2+3)-6/3 to post fix
2 3+6 3/-
After byte ordering in memory is determined the hardwire designer must make some decisions on how the CPU should store data. What are the choices?
A Stack architecture An accumulator architecture A general-purpose register architecture.
What are some instructions for arithmetic Operations?
ADD, SUBTRACT, MULTIPLY, DIVIDE, INCREMENT, DECREMENT, AND NEGATE.
What are some instructions for Boolean Logic?
AND, NOT, OR, XOR, TEST, COMPARE.
What is the hex value of 12345678 stored in both big and little endian format?
Address--------> 00, 01, 10, 11 Big Endian 12, 34, 56, 78 Little Endian 78, 56, 34, 12
What is a register-memory classification?
At least one operand is in a register and one is in memory.
If a programmer writes an instrucion to read a nonzero value of the wrong word size, on a ______ machine it is always read as an incorrect value; on a _______ machine it can sometimes result in the correct data being read.
Big endian ; little endian
Machines that store data with the most significant byte first, followed by the least significant byte. What does this refer to?
Big endian machines
What are instructions for Transfer of Control?
Control instructions are used to alter the normal sequence of program execution.
What is a disadvantage for big endian machines?
Conversion from a 32-bit integer address to a 16-bit integers address requires a big endian machine to perform addition.
How does Operand Storage work?
Data can be stored in a stack structure or in registers or both.
What are some instruction types?
Data movement, Arithmetic operations, Boolean Logic Instructions, Bit Manipulation Instructions, Input/Output instructions, Instructions for Transfer of Control Special Purpose instructions Instruction Set Orthogonality
What is the most widely accepted model for machine architectures today?
General-purpose-register architectures
What is an advantage for little endian machines?
High-precision arithmetic on little endian machines is faster and easier. They allow odd address reads and writes, which makes programming on these machines much easier.
How does memory organization affect instruction format?
If memory has, for example, 16- or 32- bit words and is not byte-addressable, it is difficult to access a single character. For this reason, even machines that have 16-, 32-, or 64- bit words are often byte-addressable, meaning every byte has a unique address even though words are longer than 1 byte.
What are some disadvantages of a Stack architecture?
It cannot be accessed randomly, which makes it difficult to generate efficient code. The stack can also become bottlenecked during execution.
What is an Arithmetic Operation?
It includes instructions that use integers and ffloating point numbers.
How does a Stack architecture work?
It uses a stack data structure to execute instructions, the operands are located on the top of the stack.
Some machines store a two-byte integer with the least significant byte first, followed by the most significant byte. What does this refer to?
Little endian machines.
When a byte at a lower address has lower significance it is called?
Little endian.
Give an example of an Accumulator architechture
MARIE, with one operand implicitly in the accumulator, minimizes the internal complexity of the machine and allows for very short instructions.
What are some instructions for Data movement?
MOVE, LOAD, STORE , PUSH, POP, EXCHANGE
What is the contents of memory when LOAD 800 is executed?
Memory R1 800 | 900 800 ... | 900 | 1000 ... | 1000| 500 ... | 1100| 600
What are the 3 classifications of General-purpose-register architecture?
Memory-memory Register-memory Load-store
What is Variable Instruction Length Format?
More complex to decode but saves storage space.
What are some common instruction formats?
OPCODE only (zero address) OPCODE + 1 Address( usually a memory address OPCODE+ 2 address(usually registers, or one register and one memory address.) OPCODE + 3 Addresses (usually registers, or combinations of registers and memory)
In architectures based on stacks, most instructions consist of what?
Opcodes only.
What makes instruction sets differentiated?
Operand storage number of explicit operands per instruction Operand location Operations Type and size of operands
What can be used to speed up a computer?
Pipelining
What are the instructions for bit manipulation?
SHIFT, ROTATE
Big endian machines store integers and strings in the__________
Same order and are faster in certain string operations.
Machine instructions that have no Operands must use a ______ to perform those operations that logically require one or two operands.
Stack
What are Input/Output instructions
The input instruction transfers data from a device or port to either memory or a specific register. The Output instruction transfers data from a register or memory to a specific port or device.
What is the first thing a person should do before anything else when designing a computer architecture?
The instruction set format.
What is Data movement?
The most frequently used instructions. Data is moved from memory to registers, from registers to registers, from regesters to memory.
What are two major instruction set characteristics that divide general-purpose- register architectures?
The number of operands and how the operands are addressed
What does register addressing mode do?
The register is used to specify the operand.
What does Direct addressing mode do?
The value is at a memory location after the operation code.
What is a con of fixed length instruction?
They are a waste of space.
What is a pro for fixed length instruction?
They are easy to decode.
What makes General-purpose-registers architecture so good?
They are faster than memory, easy for compilers to deal with, and can be used very effectively and efficiently. Plus it's cheaper now days.
What is a bit Manipulation instruction?
They are used for setting and resetting individual bits within a given data word.
What is a Memory-memory classification?
They have 2 or three operands in memory, allowing an instruction to perform an operation withough requiring any operand to be in a regist.
What is good about a stack architecture?
They have good code density and a simple model for evaluation of expressions.
What is Boolean Logic Instruction
They perform boolean operations
What is a Load-store architecture classification?
They require data to be moved into registers before any operations on those data are performed.
What is a pro for short instructions?
They take up less space.
What is the result of using Indirect Addressing mode to load 800?
Value loaded into AC is 1000
What is the result of using indexed Addressing mode to load 800?
Value loaded into AC is 700
What is the result of using Immediate Addressing mode to load 800?
Value loaded into AC is 800
What is the result of using Direct Addressing mode to load 800?
Value loaded into AC is 900
What is Fixed Instruction Length format?
Wastes space but is fast and results in better performance when instruction-level pipelining is used
When should you contemplate how many registers to have and what they contain?
When designing an instruction set.
When should you decide how operands should be stored?
When designing an instruction set.
Give an example of infix notation.
X + Y
Give an example of postfix notation.
XY+
What does the term endian refer to?
a computers byte order. or the way the computer stores the buytes of a multiple-byte element.
How do you decode an instruction?
if(leftmost four bits ! =1111) { Execute appropriate three-address-instruction} else if (leftmost seven bits != 1111 111 ) { Execute appropriate two-address instruction} Else if (leftmost twelve bits != 1111 1111 1111) { Execute appropriate one-address instruction} else{ Execute appropriate zero-address instruction }
How does Operand Location differentiate Instruction sets?
instructions can be classified as register-to-register, register-to-memory, or memory-to-memory, which simply refer to the combinations of operands allowed per instruction.
What is an advantage of using Big endian machines?
it is more natural to most people and thus makes it easier to read hex dumps.
Most bitmapped graphics are mapped with a "___________" scheme
most significant bit on the left
What is Pipelining?
overlapping of smaller steps after the fetch decode execute cycle is broken down into the smaller steps.
What is postfix notation also called?
reverse Polish notation
What Operations are included in differentiating instruction sets?
types of operations, and which instructions can access memory and which cannot.
What is good about having the high order byte come first?
you can always test whether the number is positive or negative by looking at the byte at offset zero.