PowerPC, Number Representation
Tom Kelliher, CS 240
Feb. 8, 1999
80x86 architecture.
- PowerPC architecture.
- Number representation: unsigned and signed representations.
ALU design.
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.
Msb is sign, remaining bits are magnitude.
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;
}
Two 0 representations.
Symmetric range.
Msb is sign bit.
- Positive values have same representation as for unsigned case.
- To compute the inverse, complement all the bits.
- Two 0s.
- Symmetric range.
- Addition may cause wraparound carries.
Again, msb is sign bit.
- Positive values have same representation as for unsigned case.
- To compute the inverse, complement all the bits and add 1.
- One 0.
- Asymmetric range: one more negative value.
To be continued.
Thomas P. Kelliher
Sun Feb 7 16:05:34 EST 1999
Tom Kelliher