NXN Crossbar Design For Barrel Shifter: X-Input Y-Output
NXN Crossbar Design For Barrel Shifter: X-Input Y-Output
NXN Crossbar Design For Barrel Shifter: X-Input Y-Output
Tri-
y0 y1 state y2
buffer
x0
Decoder
Shift
count
x1
…
x2
Decoder
X-input selects
Y-output the shift
amount …
Number of gates: O(N2)
Delay: O(1) 1
Shift and Rotate Hardware
2
Review
3
CS501
Advanced Computer
Architecture
Lecture 36
Delay: O(logN)
Word
Output
Logarithmic Barrel Shifter
5
Number of gates: O(NlogN)
x
OPCODE
n
n
Shift count
CONTROL
MUX MUX
n
Condition
Block diagram of an ALU
codes
6
Z
Floating-point representation
The
Base is 10; fixed for a
Significand or
given representation
Mantissa
7
Floating-Point Representation
A common layout for floating-point number is
s e f
1
me mf
M bits
The Bias or
excess •s=1floating point numbers negative
representation •s=0floating point number is positive
•me = number of bits in exponent field
•mf = number of bits in fraction field
• Value(s,e,f) = (-1)s x f x 2e
8
Continued
Bias representation
• In bias, or excess representation, a number is
added to the exponent so that the result is
always positive
• Biased representation is useful for normalized
numbers
• Instead of bias, two’s complement form can also
be used to represent the exponent
10
IEEE 32 bit single precision format
s e^ f1f2…f23
0 1 8 9 31
Fraction bits of
Positive values
significand including
between 0 to 255
the hidden bit
with bias=127
E^ e VALUE TYPE
255 none none NaN
254 127 (-1)sx(1.f1.f2…)x2127 Normalized
… … …
2 -125 (-1)sx(1.f1.f2…)x2-125 Normalized
1 -126 (-1)sx(1.f1.f2…)x2-126 Normalized
0 -127 (-1)sx(1.f1.f2…)x2-126 Denormalized
12
Range of possible numbers
• Positive underflow
0 to (0.5 x 10-128)
• Negative underflow
(-0.5 x 10-128 ) to 0
13
Floating point Addition and Subtraction
Normalization of Sum:
0.001 2 X 2-1 = 0.0102 x 2-2
= 1.000 2 x 2-4 15
Floating point Add/Sub Hardware
e1 e2 f1 f2
For alignment
Exponent And
Subtractor Swap normalization
Alignment
Shifter
s1 Sign
s2 computation Significand
FA/FS Adder/sub
e1 e2
16
sr er fr
Floating Point
Multiplication and Division
The floating point multiply procedure is as follows
17
Floating Point
Multiplication and Division
The floating point divide procedure is as follows
Apply xor operation to
Unpack sign, exponent signs, subtract Normalize, round
and significands exponents, And shift
divide significands
18