lect3
lect3
Arithmetic
Addition
• Full adder (FA) logic circuit:
adds two bits of the same weight, along
with a carry-in bit, and produces a sum bit
and a carry-out bit
• Ripple-carry adder:
a chain of n FA stages, linked by carry bits,
can add two n-bit numbers
Addition/subtraction circuit
• An n-bit adder with external XOR gates can
add or subtract two operands
• An FA stage produces its outputs
after 2 logic gate delays
• Longest delay path through the
adder/subtractor circuit: 2n gate delays,
assuming a ripple-carry design
Carry-lookahead addition
• Delay reduction: produce carry signals
in parallel using carry-lookahead circuits
• First, form generate and propagate functions
in each stage i
ci+1 = xi yi + xi ci + yi ci
ci+1 = xi yi + (xi + yi)ci
Gi = xiyi Pi = xi + yi
ci+1 = Gi + Pici
Pi can be treated as XOR of xi and yi (Why??)
Carry-lookahead circuits
• A 4-bit adder has four carry-out signals:
c1 = G0 + P0c0
c2 = G1 + P1G0 + P1P0c0
Multiplier Q = 1 1 1 0 1 0
----- ----- -----
M version selected = 0 -1 -2
Multiplier bit-pair recoding
• The full table of multiplicand selection
decisions based on bit-pairing of the
multiplier is shown in the next figure
• Since only one version of the multiplicand
is added into the partial product for each
pair of multiplier bits, only n/2 summands
are added to do an n x n multiplication
Parallelism in adding summands
• Three n-bit summands can be reduced to two
by using n FA blocks, operating
independently and in parallel
• This technique can be applied in the array
multiplier, as shown in the next two
figures
• The technique is called carry-save addition
Carry-save addition
• 3-2 Reducer
• Group summands in threes and reduce each
group to two in parallel
• Repeat until only two summands remain
• Add them in a conventional adder to
generate the final sum
Division
A restoring division example.
A non-restoring division example.
Floating-point (FP) numbers
• IEEE standard 754-2008 defines
representation and operations for
floating-point numbers
+/- 1.M x 2E