Other Instruction Sets, Number Representation
Tom Kelliher, CS 240
Feb. 5, 1999
Collect homework.
Read Sections 4.4, 4.5.
Summary of addressing modes, loop optimization, background of 80x86
architecture.
- 80x86, PowerPC architectures.
- Number representation.
More number representation, addition/subtraction, logical operations, ALU
design.
Basics:
- 32-bit data and address.
- Two-address architecture.
- Operand combinations: register/register, register/immediate,
register/memory, memory/register, memory/immediate.
- 8 32-bit ``general purpose'' registers.
- Several 16-bit registers: code and stack segment pointers, several
data segment pointer.
- Condition codes register. Conditions codes set as a side-effect of
ALU instructions.
Advantage: moves the compare from the branch to the ALU instruction.
Disadvantage: superscalar, OOE.
- Variably-sized instructions: 1 to 17 bytes. Example prefix bytes:
- Override default segment register.
- Lock the memory bus.
- repeat instruction until ECX clears.
Addressing modes:
- Some instructions use postbytes to specify addressing modes.
New addressing modes:
- Register indirect.
Direct MIPS synthesis.
- Base with 8- or 32-bit offset.
- Base with scaled index
- Base with scaled index and 8- or 32-bit offset.
Basics similar to MIPS:
- 32 registers.
- 32-bit instructions.
- Load-Store architecture.
Additional features:
- Indexed addressing: address is sum of two registers.
General applicability?
- Update addressing: similar to base/offset addressing with the
additional wrinkle of automatically incrementing the base register by
sizeof(operandType) after access.
Other strides? ALU conflicts?
- Load/store multiple: load/store upto 32 registers in a single
instruction. Useful for: register save/restore, block memory copying.
Complexity? Can it be done with hardwired control?
- A special loop control register, distinct from the 32 registers and
accessed by a special conditional branch instruction which decrements it
and then tests it ( =0, !=0).
Useful for:
for (i = n; i != 0; --i)
/* code block */;
Not generally useful. What it can lead to.
- Weighted, positional number systems:
- Digit weights.
- Digit positions within a number.
- Conventionally, a base x system uses x numerals (symbols).
Consider decimal. This really isn't the case. Why? How can we make it
so.
- Consider a four bit binary number:
. What does
contribute to the value of the number?
- Hexadecimal: For the sake of brevity, binary numbers are often
written in hexadecimal form, because of a direct conversion between the
two:

Examples: convert 110101 to hex and AE to binary.
- MIPS registers are 32-bits. How do you store 4 in a register?
What is the range of unsigned values representable in the MIPS? In
general, with i-bits, how many unsigned values can we represent?
- What do we do about numbers that are too big? Fractions? The reals?
- What about negative values? How do we represent them?
How do we solve this in the decimal system.
The sign bit. Location within a word.
- Problems with sign-magnitude representation:
- Multiple zero representations.
- Consider the algorithm for a + b:
if a and b are of the same sign
{
sign of sum = sign of a;
magnitude of sum = magnitude of a + magnitude of b;
}
else if magnitude of a > magnitude of b
{
sign of sum = sign of a;
magnitude of sum = magnitude of a - magnitude of b;
}
else
{
sign of sum = sign of b;
magnitude of sum = magnitude of b - magnitude of a;
}
What a mess? Are we stuck with it?
Thomas P. Kelliher
Thu Feb 4 11:09:23 EST 1999
Tom Kelliher