Computer Organization & Architecture - CHAPTER-6.Pdf - 3580
Computer Organization & Architecture - CHAPTER-6.Pdf - 3580
Arithmetic Unit
Shift-add multiplication:
=> multiplication of unsigned numbers.
=> multiplication can be performed by repeated addition of multiplicand and shifting
Contd…
RTL code for shift-add multiplication
Contd…
Example UV <- X x Y; X= 1101 and Y=1011.
Booth Algorithm
Result Verification:
1111100101
Since there is end around carry, we find it’s 2’s complement and place ‘-’ sign before the
equivalent decimal.
i.e. 0 0 0 0 0 1 1 0 1 1
i.e. -27
RTL code for Booth algorithm
T1 = time taken by non-pipelined unit to calculate 1 result. Requires n.T1 time to calculate n results.
Pipelined unit requires k time units, each of duration Tk , to move the first piece of data through the pipeline.
Because, additional data enters the pipeline during every cycle, it will output the remaining n-1 results during next n-1 cycles.
=> thus, the pipelined unit requires (k + n – 1) cycles, each of Tk time, to calculate same results.
The speedup can be calculated by the formula above.
Contd…..
Data enters into a stage of the pipeline, which performs some arithmetic operations on
those data.
The results are then passed to next stage which performs its operation and so on until the
final computation ha been performed.
Each stage performs only its specific function, no need to be capable of performing the task
of any other stage.
A pipeline does not speed up an individual computation. It improves the performance by
overlapping computations where each stage can operate on different data simultaneously.
The net effect is that output appears more quickly than in non-pipeline arithmetic unit,
thereby increasing the throughput.
2. Lookup Tables:
Any combinational circuit can be implemented by ROM is a lookup table.
Inputs to the combinational circuit serve as the address input of the ROM.
Data outputs of the ROM corresponds to the output of the combinational circuit.
ROM is programmed with data such that the correct values are output for any possible
input values.
Consider a 4 x 1 ROM programmed to mimic a two input AND gate.
AND gate
By programming ROM with data shown, it outputs the same values as the AND gate for all
possible values of X and Y.
Contd..(a multiplier implemented using a lookup ROM)
Contd…
To form the final sum, S and C must be added together because carry bits do not propagate
through the adder.
To use a carry save adder to perform multiplication, we first calculate the partial product of
the multiplication and input them to carry save adder.
To represent negative exponents, one possibility is to use two’s complement values, the
prevalent practice is to use biasing.
Assume that XE has four bits, and should be able to represent all exponents from -8 to +7.
To do so, a set bias value is added to the actual exponent and result is stored in XE.
-8 is represented as -8 + bias = -8 +8 = 0(0000).
+7 is represented as +7 + bias = +7 +8 = 15(1111).
IEEE 754 floating point standard
Defines set format and operation modes. Doesn’t specify arithmetic procedures and
hardware to be used.
IEEE 754 standard is used in virtually all CPUs that have floating point capability.
IEEE 754 standard specifies two precisions for floating point numbers.
1. single precision number having 32 bits
2. double precision number having 64 bits
In single precision,
1 bit for sign, 8 bit for exponent & 23 bit for significand
In double precision,
1 bit for sign, 11 bit for exponent & 52 bit for significand
Significand falls in the range 1 ≤ significand < 2.
Exponent uses a bias of 127, having range -126 t0 127.
Exponent values 0000 0000(-127) and 1111 1111(128) are used for special numbers.
Contd…