1. Please explain figure 5-12 in regards to expanding opcode. Explain
the whole concept of the expanding opcode, and how it benefits the ISA
level.
Can you explain the section on expanding opcodes?
Please explain expanding of opcodes.
-
Expanding opcodes are a way of compromising between the need for a lot
of opcodes and the desire to have short opcodes. The idea is to make
some of them short, but have an indication that more are there when needed.
The IP address scheme does that for network addresses also. Some
are short and some are long. You can tell by looking at the first
few bits how many bits you need to get the whole network address.
-
When the opcode is short, there are a lot of bits left to hold operands.
That is necessary when you want to hold three operands, for example.
When you don't need any space for operands (because you use a stack), it
is ok to use all the bits for the opcode. In between, there are examples
of longer opcodes and fewer operands specified.
If the JVM uses zero registers to store variables, where is the
stack
stored? in cache?
it is said that IP addresses will eventually run out with the number of
users
today. what does the future hold if the ip addresses run out and what
what kind
of new technology will need to be done to solve this?
-
There is a new IP address scheme. It replaced the 32-bit addresses
with 128-bit addresses. That is enough for several million addresses
per square meter of the earth surface. Hopefully, that will last
for a while. The transistion to the new address scheme will keep
network people working long after Y2K is forgotten.
How did you get the nickname Boots?
-
My brothers and sisters (5 of them, the youngest 13 when I was born) refused
to "call a poor, defenseless baby" by the name my parents gave me.
They named me after the cat instead. (My other names come from my
grandmother and my great aunt.) [Reference: my oldest sister.] Actually,
I'm lucky. We got a dog while I was a baby and they named him Crash.
My sons do not have nicknames, unless you count Dave for David, which he
has only tolerated since he became an adult.
What exactly can be considered as an opcode?
-
The opcode is the part of the instruction that says what action is to be
taken. Examples are ADD, Compare, Move, Copy, Load, Store, etc.
Could you please explain further the differences between kernal and user
modes for the ISA level.
-
Some operations are dangerous if misused. To prevent accidental or
deliberate misuse, those operations are restricted to use by the operating
system or other trusted software and are not available for user programs.
The protected instructions prevent one user program from interfering with
another, for example. They also prevent a user program from accessing
the part of memory where the system software is loaded. They restrict
the user access to peripheral devices, so there will not accidently be
a reset signal or something that would put the device into a confused and
unproductive state.
Page 336 talks about self modifying programs. Can you please go
over this in class and explain exactly how this works, why it is needed
and how often it occurs in programming?
-
Self modifying code was an idea popular in the early days of modern computers.
An example would be a reference to an array, where the address specified
in the program would be modified to allow you to step through the array.
Doing that directly in the program code is a bad thing because it is very
difficult to follow and is very prone to errors. The idea of indexed
addressing gives the same ability to move through a sequence of memory
references without actually modifying the code as it executes. That
is the more modern way to accomplish the desired result.
Is it necessary for us to know the different formats of the Pentium
II and UltraSPARC II or should we just be aware that different formats
exist and be able to acknowledge the differences between both?
Are we going to have to know the details for the Pentium II, UltraSPARC
II, and JVM ISA levels or are those just examples in the book?
-
Mostly those are just examples and the full details are not there.
Get the flavor of them, but be sure you understand the concepts well.
how is it counterproductive (p. 327, 2nd full paragraph) to have
the average instruction length minimized? why is alignment so important?
Couold you review the specifics of memory alignment and its implications.
Why do some machines require that the words be aligned? Is it the way
the word is fetched?
-
Did you ever pack a drawer or a closet or a suitcase so efficiently that
every bit of space is used? Did you find it convenient to get things
out and put them back into such thoroughly optimized storage space?
Word boundary alignment is good because of the way the CPU fetches data
from memory. Remember there are a fixed number of bits in the address
specification, and usually the last few bits are set to zero. That
allows access to a larger memory with a smaller number of address lines.
If the machine only fetches 32-bit units of data and the instruction spans
a boundary between two 32-bit words, it will take two fetches to get the
whole instruction. That is not efficient.
Why can't the Pentium II, the UltraSPARC II, and JVM support binary
coded decimal integer data types?
-
They could have but chose not to. BCD is not efficient in the use
of storage and the computations are slower. It is only good if you
really want to do decimal arithmetic. Why might we want to do that?
How can you tell which type of addressing should be used?
-
That is a matter of the machine architecture and the needs of the program.
One of the roles of a compiler is to choose from among the available options.
All register addresses would be fastest, but would probably not meet all
the needs of a program (most must address memory sometimes). Keeping
instructions short makes them easier to decode and easier to load into
the CPU, so stack addressing is good (operand address length = 0).
However, limiting program access to its data to the top of stack only can
be a problem and perhaps cause extra processing to get to the value needed.
These things must be balanced in the context of a particular program and
the architecture on which it is run.
Please explain expanding codes.
Please explain how to convert infix to postfix notation.
Reverse Polish Notation is very confusing, especially figure 5-21,
could you expplain that better than the book does, and is it important
to know?
-
Yes, it is important to know. This is what really happens when your
programs specify arithmetic operations. If the programs you did had
include parentheses and general boolean expressions, you would have needed
to do this.
-
Here is another explanation of the translation from infix to postfix:
-
Scan the input, one symbol at a time
-
If the symbol is a variable, output it
-
If the symbol is (, place it on the stack
-
If the symbol is an operator,
-
If the operator at top of stack has higher precedence than the newly arrived
operator, output the operator at the top of the stack and repeat with new
top of stack
-
Otherwise, place the new operator onto the stack.
-
If the operator is ), pop the stack and output the operators found
until ( appears. Drop both ( and ).
Note that although the reverse Polish notation does not require precedence
of operators, infix notation does. Since we are translating
from infix to postfix (reverse Polish), it is necessary to take precedence
into account.
Please explain how having separate address spaces for instructions and
data is not the same as having a split level 1 cache.
-
Separate address spaces refers to main memory, not the cache. It
is not a matter of separating the most frequently used instructions from
the most frequently used data. It means that all instructions are
in one part of memory and all data is in another part.
What is an auxiliary carry?
-
Give me a page reference, please.
Addressing Modes
-
Immediate Addressing (The operand is actually in the instruction and does
not have to be fetched)
-
Direct Addressing (The address of a memory location is specified in the
instruction)
-
Register Addressing (The number of a register is in the instruction.
That register contains the operand)
-
Register Indirect Addressing (The address of the operand is in a register.
Then only the register number needs to be in the instruction. There must
also be an indication that we are using the address in the register, not
the register itself, as the location of the operand.)
-
Indexed Addressing.(Actual address is sum of a constant and a part that
is stored in a register and can change. Note that the part that is
in the register is the part that can change and allow the program to step
through some number of location references in an orderly way.)
-
Based-indexed Addressing (Two registers are used in calculating the actual
address. One is the base and the other is the offset. You might load
the location of the beginning of the array into one register and the initial
offset, 0, into the other. You would increment the offset register
each time through the loop.)
-
Stack addressing. (No addresses need to be specified because all references
are to the top of the stack. Operations push information onto the
stack, or pop it off the stack. Some operations pop information off
the stack, operate on it, and push a result onto the stack.)