Arithmetic Flashcards
Define Algebra
Any special system of notation adapted
to the study of a special system of relationship.
Features of Boolean Algebra
• Simply: AND;NOT; 0; 1
- Distributive: a(b c) == ab ac
- Commutative: a b == b a
- Associative: (a b) c == a (b c)
How is an N-bit Ripple Adder Built?
• An N-bit ripple adder can be
assembled by cascading full-
adders.
• All combinatorial
• Individual bit delays are dif-
ferent, but total delay propor-
tional to N.
• All stages are identical (apart
from LSB).

How are unsigned integers represented in Boolean
• Stores values in [0; 2n 1].
• e.g. The pattern 1101 represents the natural
number 20 + 22 + 23 = 1 + 4 + 8 = 13.

How are signed Integers represented?
Signed integer numbers
- Sign magnitude
- Two’s complement
- One’s complement
- Biased oset
Describe Sign Magnitude
• Stores values in [-2n-1 - 1; 2n-1 - 1].
• The most significant bit (MSB, at n-1) represents
the sign of the integer.
• e.g. The 8-bit pattern 10001101 represents the
integer number -13.

Describe Two’s Complement
• Stores values in [-2n-1; 2n-1 - 1] (no -0).
• Value defined such that X + (-X) = 2n. This is
convenient:
- Addition: An unsigned adder is suitable.
- Negation: Complement each bit and add 1.

Describe One’s Complement
• Stores values in [-2n-1 - 1; 2n-1 - 1] (we lose one
due to -0).
• Value defined such that inverting the bit pattern
returns the negative of the original value.
• Rarely used (Some ADCs use this).

Describe Biased Offset
• Think unsigned but subtract a constant from all
values.
• Range depends on the bias (but we don’t lose one
due to 0).

Describe general floating-point numbers implementation?
• Standard form as you know it: 2:56X 104.
• Value = (-1)S X 1:F X 2E
• The exponential field E is biased such that all
legitimate numbers satisfy E >= 0.

What are the four binary formats?

Binary Formats with Width and Bias

What are the special values of floating-point numbers?

How do special values affect computation?
• Computation must continue under certain special
values - they propagate with certain identities (e.g.
f(NaN)=NaN, 1 + (+infinity) = +infinity)
• Denormalised numbers are susceptible to creeping
underflow: the numbers have decreasing precision
as they get smaller. These numbers are treated
specially: Value = (-1)S X 0:F.
What are the attributes of black box leaf-level operations?
- Static attributes: size, speed
- Dynamic attributes: power, electromagnetic
compatibility (emc)
Describe NAND and AND Gates
- Size is approximately proportional to fan-in.
- AND is bigger than NAND due to extra inversion.

What affects gate delay?
- Transport delay (di erent for 1 → 0 and 0 → 1):
- Depends on the values of other inputs:
- Depends on gate type.
- Depends on signal value.
- Depends on load:
However, we normally combine all this as a single ddelay constant
What is inertia and how does it relate to inertial delay?
if two events occur on an input of the component with an interval time less than the defined delay, the output will not reflect either input event,
Inertia is Indisposition to motion, exertion, or
change
Feature of Cascading Full Adders
- Size proportional to n (good)
- Delay proportional to n (awful)
- NB: Assuming constant delay d

Features of Carry Lookahead Logic
- Size proportional to n2 (awful)
- Delay constant (good)

What are the steps for floating-point addition subtraction?
- Handle NaN and +- infinity propagation.
- Check for zero operands (saves time).
- Subtract exponents such that |EA - EB| = d.
- Align the fractions: right-shift the fraction of the
smaller exponent by d (you should now have two
numbers with the same exponent, but one may not
be in standard form). - Add/Subtract the fraction components.
- Normalise the number (bring it into standard form,
while adjusting the exponent parts). - Rounding, as appropriate.
Unsigned Multiplication
Combinatorial
• Area proportional to n2 (massive)
• Single Cycle

Features of Booth Multiplication
Computes P = A X B, with P starting at zero. Method (repeat n times):
• Add P to (B or 0) depending on the LSB of A.
• Replace P with the sum.
• Right-shift P&A.
Smaller area, but n cycles.

Features of Signed Multiplication
• The right-shift of P&A is arithmetic (i.e. the
left-hand bit loops around), instead of logical.
• Register A is extended one bit to the right.
• +- ALU: Extra circuit is needed.
Steps for Floating Point Multiplication
- Handle NaN and +- infinity propagation.
- Check for zero operands (saves time).
- Evaluate product sign ().
- Fixed-point unsigned multiply/divide the fractions.
- Sum the exponents
- Normalise the number (bring it into standard form,
while adjusting the exponent parts). - Rounding, as appropriate.
What is an ALU?
• A selectable function unit
• Usually two data inputs of equal size, with a
function-select bus. The compiler needs to
know how this bus is coded.
• ALUs typically support logical and arithmetic
operations.