Professional Documents
Culture Documents
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
VHDLIMPLEMENTATIONOFFLOATINGPOINTMULTIPLIERBASEDONVEDIC
MULTIPLICATIONTECHNIQUE
PRAGATISACHAN
M.Tech(VLSI)Scholar,ElectronicsandcommunicationEngineering,JayotiVidyapeethWomensUniversityJaipur,
Rajasthan,India,sachanpragati.kgi@gmail.com
ABSTRACT
Inthispaper,IEEEfloatingpointformatwasastandardformatusedinallprocessingelementssinceBinaryfloatingpoint
numbersmultiplicationisoneofthebasicfunctionsusedindigitalsignalprocessing(DSP)application.InthatworkVHDL
implementation of Floating Point Multiplier using ancient Vedic mathematics is presented. The idea for designing the
multiplier unit is adopted from ancient Indian mathematics "Vedas". The Urdhvatriyakbhyam sutra will be used for the
multiplicationofMantissa.Theunderflowandoverflowcaseswillbehandled.Theinputstothemultiplierin32bitformat.
ThemultiplierisdesignedinVHDLorVERILOGandsimulatedusingModelsim.
Keywords:VedicMathematics,Urdhvatriyakbhyamsutra,FloatingPointmultiplier,FPGA.
1.INTRODUCTION
1.1 FLOATING POINT MULTIPLIER FOR IEEE
FORMATE
Multiplication of two nos using Urdhva Tiryakbhyam
sutraisperformedbyverticallyandcrosswise,crosswise
means diagonal multiplication and vertically means
straight above multiplication and taking their sum. The
feature is any multibit multiplication can be reduced
downtosinglebitmultiplicationandadditionusingthis
method. On account of these formulas, the carry
propagationfromLSBtoMSBisreducesduetoonestep
generation of partial product, the efficient use of Vedic
multiplication method in order to multiply two floating
pointnumbers.Thisworkpresentsanimplementationof
a floating point multiplier that supports the IEEE 754
2008binaryinterchangeformat.Basedonthediscussion
made above it is very clear that a multiplier is a very
important element in any processor design and a
processor spends considerable amount of time in
performing multiplication and generally the most area
consuming.Hence,optimizingthespeedandareaofthe
multiplier is a major design issue. An improvement in
multiplication speed by using new techniques can
greatlyimprovesystemperformance.Inthenextstageof
the project the design will be designed using VHDL or
VERILOG and will be simulated using Modelsim
Simulator. The design will be synthesized using Xilinx
ISE 12.1 tool. A test bench will be used to generate the
stimulus and the multiplier operation is to be
verified.The over flow and under flow flags are to
incorporated in the design in order to show the over
flow and under flow cases. The theory states that the
efficient use of Vedic multiplication method in order to
multiplytwofloatingpointnumbers.Thatthehardware
requirement is reduced, thereby reducing the power
consumption. The power consumption upon reducing
affectively may not compromise delay so much.
Multiplicationofthefloatingpointnumbersdescribedin
IEEE754singleprecisionvalid.Floatingpointmultiplier
International Journal of Science, Engineering and Technology- www.ijset.in
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
2.METHODO
OLOGY
2..1VEDICMU
ULTIPLIER
DSPapplicatio
onsessentialllyrequiretheemultiplicationof
mbers. The IE
EEE 754 stan
ndard
biinary floatingg point num
prrovides the format forr representation of Biinary
Flloating poin
nt numbers. The Binary
y Floating point
p
nu
umbers are represented
r
in Single and
d Double form
mats.
Th
heSinglecon
nsistof32bittsandtheDoubleconsistof64
biits. The forrmats are ccomposed off 3 fields; Sign,
Exxponent and
d Mantissa. The Figuree 3.1 showss the
sttructure of Single
S
and D
Double form
mats of IEEE 754
sttandard.IncaaseofSingle,theMantissaaisrepresenttedin
23
3bitsand1 bitisadded totheMSBffornormalizaation,
Exxponentisreepresentedin
n8bitswhich
hisbiasedto
o127,
acctually the Exponent is rrepresented in
i excess 127 bit
fo
ormatandMSSBofSingleiisreservedfforSignbit.W
When
th
he sign bit is 1 that mean
ns the numbeer is negativee and
whenthesign
w
bitis0that meansthenu
umberispossitive.
In
n64bitsform
mattheManttissaisrepreesentedin52bits,
th
heExponentiisrepresenteedin11bitsw
whichisbiasedto
10
023andtheM
MSBofDoublleisreserved
dforsignbit.
2..2.1UrdhvaTriyaKbhya
am(Verticallly&Crossw
wise)
Urdhva tiryak
kbhyam Sutra is a generral multiplication
ormula appliicable to all cases of multiplicatio
on. It
fo
litterally means Vertically and Crossw
wise. To illusstrate
th
his multipliccation scheeme, let us consider the
multiplication
m
of two decimal numbers (5498 23
314).
Th
he conventio
onal method
ds already know
k
to us will
reequire 16 multiplicatio
ons and 15
5 additions.. An
allternative method
m
of m
multiplication
n using Urrdhva
tirryakbhyamSSutraisshow
wninFig.1.1. Thenumbeersto
beemultipliedaarewritteno
ontwoconseccutivesideso
ofthe
sq
quareasshow
wninthefigu
ure.Thesquaareisdivided
dinto
ro
owsandcolumnswhereeeachrow/columncorresp
ponds
to
ooneofthed
digitofeitheramultiplieroramultipliccand.
Th
hus, each digit
d
of the multiplier has
h
a small box
co
ommontoad
digitofthem
multiplicand.T
Thesesmallb
boxes
arre partitioned into two h
halves by thee crosswise lines.
l
Eaach digit off the multip
plier is theen independently
multiplied
m
witth every digiit of the mulltiplicand and
d the
tw
wodigit prod
duct is writteen in the com
mmon box. Alll the
diigits lying on
n a crosswisee dotted line are added to
o the
prreviouscarry
y.Theleastsiignificantdiggitoftheobtaained
nu
umberactsaastheresult digitandtheerestastheccarry
fo
orthenextsttep.Carryforrthefirststeep(i.e.,thedo
otted
lin
neontheextremerightsiide)istakenttobezero.
2..2FLOATING
GPOINTMUL
LTIPLICATIO
ON
915
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
1..0011x24 and
d B = 1.0011
1x23. IEEE representations of
op
perandsare
Man
ntissaCalculattionUnit
Expo
onentCalculaationUnit
Sign
nCalculationU
Unit
ConttrolUnit
The standardforrmatforreprresentationo
offloatingpoiint
mberis
num
(1))S2E(b0b1
1b2bp1)
The biasedexpon
nente=E+12
27,andthefrractionf=b1b2
p1.
bp
The Mantissa Calculation Unit requirres a 24 bit
b
bitsingleIEEE754formattisconsidereed.
multtiplierif32b
In this
t
work we
w propose the
t
efficientt use of Ved
dic
Multtiplication Teechnique for this 24 bit multiplier. The
T
Expo
onent Calculaation Unit is implemented in this pap
per
usin
ng8BITRipp
pleCarryAdd
der.Theadvan
ntagesofripp
ple
carry adder in addition
a
to itts implementtation ease are
a
mplelayout.
lowareaandsim
N,Infinity,zerro,
The ControlUnittraisestheflaagwhenNaN
overflowcaseesaredetecteed.Thecontrrol
undeerflowando
unit raises appro
opriate flag accordingly
a
w
when
the casses
urs.Thevario
ouscasesand
ditsconstitueentflagsare:
occu
Ife=
=255andf0,thenNaN
perandshowsthesignbitt,the
Here,MSBoftthe32bitop
d the
exxponents aree expressed in excess 127 bit and
mantissa
m
is reepresented in
n 23 bit. Sign
n of the resu
ult is
caalculated by XORing sign
n bits of both
h the operan
nds A
an
nd B. In this case sign biit obtained after
a
XORing is 1.
Exxponents of A and B are added to get the resu
ultant
exxponent.Add
ditionofexpo
onentisdoneusing8bitrripple
caarryadderFiggure3.3.
dtoexcess12
27bit
Affteraddition theresultis againbiased
Co
ode.Forthis purpose127
7issubtracteedfromthereesult.
Tw
wos compllement subttraction usiing addition
n is
in
ncorporatedfforthispurpo
ose.IfERistthefinalresu
ultant
exxponentthen
n,
ER
R=EA+EB127
Ife=
=255andf=0,thenInfiniity
If0<
<e<255,theenNumberis(1)s2e127
7(1f)
If e = 0 and f 0, then (1)ss 2126(0 f)
f (demoralizzed
mbers)
num
Ife=
=0andf=0,thenzero.
WhereEAand
W
dEBarethe exponentpartsofoperan
ndsA
an
ndBrespectiively.InthisccaseER=10000110.Man
ntissa
multiplication
m
is done usin
ng the 24 bitt Vedic Multip
plier.
Th
hemantissa isexpressed in23bitwh
hichisnormaalized
to
o 24 BIT by adding
a
a 1 att MSB. The normalized
n
2 bit
24
mantissasare
m
10
00110000000000000000
0000
10
00110000000000000000
0000
Multiplication
M
of two, 24 b
bit mantissa is done usingg the
VeedicMultiplier.Inthiscase48bitresultobtained after
th
hemultiplicattionofmantisssais
10
01101001000000000000
00000000000
00000000000000
00
00
Nowsettingup
pthreeinterm
mediateresu
ultsthefinalrresult
normalizing the mantiissa by elliminating most
(n
significant1)w
weobtainediis:
1101001000
00000000000
000
11000011001
hisresultisd
deducedas
Th
AxxB=19.0x9.5
=
=180.5
=
=1.01101001
1x2134127
916
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
=(10110100.1))2
6bitblockand
dthenfinally
y32x
bllock,8x8bit block,16x16
32
2bitMultiplierasshowniinfigure3.5h
hasbeenmad
de.
=(180.5)10
PROPOSEDD
DESIGN
2.3P
The performanceeofMantissaacalculationU
Unitdominattes
oatingPointM
Multiplier.Th
his
overrallperformaanceoftheFlo
unit requires un
nsigned multtiplier for multiplication of
24BITs.TheVedicMultiplicationtechn
niqueischosen
24x2
forttheimplemen
ntationofthiisunit.Thisttechniquegiv
ves
prom
mising resultt in terms off speed and power [6].T
The
Vediicmultiplicattionsystemiisbasedon1
16Vedicsutrras
orap
phorisms,wh
hichdescribeesnaturalwaaysofsolvingga
who
ole rangeofm
mathematicall problems.O
Out ofthese 16
Vediic Sutras thee Urdhvatriy
yakbhyam su
utra is suitab
ble
fortthispurpose.Inthismeth
hodthepartiaalproductsaare
geneeratedsimulttaneouslywh
hichitselfred
ducesdelayand
mak
kesthismetho
odfast.Them
methodform
multiplicationof
two,, 3 BITs num
mber is show
wn Figure 3.4
4. Consider the
t
num
mbersAandB
BwhereA=aa2a1a0andB
B=b2b1b0.T
The
LSBofAismultip
pliedwiththeeLSBofB:
s0=aa0b0;
Then
na0ismultip
pliedwithb1
1,andb0ism
multipliedwiith
a1andtheresulttsareaddedttogetheras:
1=a1b0+a0b1
1;
c1s1
Hereec1iscarryaands1issum
m.Nextstepisstoaddc1wiith
the multiplicatio
m
n results of a0
a with b2, a1
a with b1 and
a2w
withb0.
c2s2
2=c1+a2b0+aa1b1+a0b2;
Th
hedesignstaartsfirstwith
hMultiplierd
designthatiss2x2
biit multiplier as shown in figure 3.6
6. Here, Urrdhva
Tiiryakbhyam Sutra or Vertically and Crossswise
Allgorithmforrmultiplicatio
onhasbeeneeffectivelyusedto
deevelopdigitaalmultiplieraarchitecture. Thisalgorith
hmis
qu
uite different from tthe traditional method
d of
multiplication,
m
, which is tto add and shift the paartial
prroducts.
To
o scale the multiplier further, Karratsuba Ofman
allgorithmcan beemployed
d.KaratsubaOfmanalgorrithm
isconsideredaasoneoftheefastestwaysstomultiply
ylong
ntegers.Itisb
basedonthed
divideandco
onquerstrateegy.A
in
multiplication
m
of 2n digit integer is reduced
r
to tw
wo n
diigit multipliccations, one ((n+1) digit multiplication
m
, two
n digitsubtracctions,twoleeftshiftoperaations,twon digit
dditionsandtwo2ndigitadditions.
ad
HardwareR
Realizationo
of2x2block
Fig3.6:H
Th
he proposed
d multiplications were im
mplemented using
u
tw
wodifferentccodingtechniiquesviz.,con
nventionalsh
hift&
ad
dd and Ved
dic techniquee for 4, 8, 16, and 32
2 bit
multipliers.
m
Itt is evident that there is
i a considerable
in
ncreaseinspeeedoftheVed
dicarchitectu
ure.
Th
he number of
o LUTs and slices requirred for the Vedic
V
Multiplier
M
is less and due to wh
hich the power
co
onsumptioniisreduced.A
Alsotherepettitiveandreggular
sttructureofth
hemultiplier makesiteasiertodesign.And
th
he time requ
uired for com
mputing multtiplication iss less
th
hantheotherrmultiplicatio
ontechniques.
An
n Overflow or
o Underflow
w case occurss when the result
r
Exxponent is higher than th
he 8 BIT or lower than 8
8 BIT
reespectively.O
Overflowmayyoccurdurin
ngtheadditio
onof
tw
woExponentsswhichcanb
becompensaatedatthetim
meof
su
ubtracting th
he bias from
m the exponeent result. When
W
ov
verflow occu
urs the overfflow flag goees up. The under
u
917
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
flow
w can occur after the subtraction of bias from the
t
expo
onent, it is th
he case when
n the numberr goes below
w 0
andthissituation
ncanbehand
dledbyaddin
ng1atthetim
me
n
n. When the underflow case
c
occur the
t
of normalization
undeerflowflagggoeshigh.
B is Signed Floating
F
Poin
nt Number. Now we hav
ve to
B
co
onvertvalue ofAtobinaaryformataffternormalizzewe
geet1.0000110
00001x2^7th
henwehave toconvertittinto
IE
EE32 floatin
ng point form
mat then we get 0 10000110
00
00011000010000000000
000 then convert
c
it into
heexadecimal format
f
we geet 0x4306100
00. Now we have
to
o convert value of B to b
binary formaat after norm
malize
weget1.001x
w
x2^1thenweehavetoconv
vertitintoIE
EE32
flo
oating poin
nt format tthen we geet 1 10000000
00
01000000000000000000
000 then convert
c
it into
heexadecimal format wee get 0xC
C0100000. After
multiplication
m
using V
Vedic Multiplier we get
0xxC396D200 the value o
of this hexadecimal no. is
30
01.640625figg 3.1 shows the simulatiion result off this
daata.
3.SIIMULATION
NRESULTS
Weh
havetakentw
woinputsAandBasamultiplierand
multtiplicandthessearefloatin
ngpointsigneedvalueweaare
perfformmultiplierusingVedicAlgorithm betweentheese
inpu
utsandwillb
bestoredino
otheroutput portwhichw
we
havee taken as Z all operations are performing
p
on
positiveedgeofcclock.
ke value of A
A is 134.062
25 and value of
For case I we tak
Biss2.25.HereAisunsigneedfloatingpiintnumberand
Fig3.1:Sim
mulationRessultofCaseI
ForccaseIIwetak
kevalueofA
Ais14.5and
dvalueofBiis
0.37
75. Here A iss signed floating pint num
mber and B is
also a signed Flo
oating Point Number. No
ow we have to
vertvalueof Atobinary
yformatafterrnormalizew
we
conv
get 1.1101x2^3
then we hav
ve to convertt it into IEE32
floatting point format then we get 1 10000010
1101
10000000000000000000
0 then con
nvert it in
nto
hexaadecimal form
mat we get 0xC1680000.
0
. Now we haave
to
o convert value of B to b
binary formaat after norm
malize
weget1.1x2^
w
^2thenwe havetoconv
vertitintoIE
EE32
flo
oating poin
nt format tthen we geet 1 01111101
10
00000000000000000000
000 then convert
c
it into
heexadecimal format wee get 0xB
BEC00000. After
multiplication
m
using V
Vedic Multiplier we get
0xx40AE0000tthevalueoftthishexadeciimalno.is5.4
4375
figg3.2showstthesimulation
nresultofthisdata.
918
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
Fig3.2:Sim
mulationResu
ultofCaseIII
to
o convert value of B to b
binary formaat after norm
malize
weget1.1111
w
1x2^3thenw
wehavetoco
onvertitinto
oIEE
32
2 floating point
p
formatt then we get
g 0 10000010
11
11100000000000000000
000 then convert
c
it into
heexadecimal format wee get 0x4
41780000. After
multiplication
m
usingVedic Multiplierw
weget0x42E8800
th
hevalueofth
hishexadecim
malno.is116
6.25fig3.3sh
hows
th
hesimulation
nresultofthissdata.
Fig3.3:Simu
ulationResu
ultofCaseIII
919
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
3.1S
SYNTHESISR
RESULTS
Fig3
3.4showstheeRTLofour code,fig3.5 showsthein
nternalRTLaandfig3.6sh
howsthedeviicesutilizediinourwork. Here
weaattachthesyn
nthesisreporrtofourcode.
g3.4:MainR
RTL
Fig
Fig3
3.5:InternallRTL
Fig3.6
6:DeviceUtillization
PECTS
4.FUTUREEXP
The time taken for multipliccation operattion is reducced
dic
by employing the Vedic algorithms.. Here Ved
multtiplierarchiteectureisproposedforfurrtherreduction
in tiime. Depend
ding on the inputs, the better
b
sutra is
selecctedbytheaarchitectureiitself.Futureeworkcanallso
furth
her extend to increase th
he more speeed and redu
uce
areaa. It can be extended to
o have moree mathematiccal
operrations likee adder/ssubtractor, divider and
International Journal of Science, Engineering and Technology- www.ijset.in
unctions.An im
mprovementt in multiplication
exxponential fu
sp
peed by usin
ng new tech
hniques can greatly imp
prove
sy
ystemperform
mance.
5.CONCLUSIION
Th
his paper named VHDL Implementa
ation of Floa
ating
Po
oint Multip
plier based
d on Vedicc Multiplica
ation
Technique undertook
u
byy the studentt of M.Tech (VERI
(
ARGE SCALE
E INTEGERA
ATION) FOU
URTH SEMESSTER
LA
920
Citation: 10.2348/ijset07150914
Impact Factor- 3.25
REFERENCES
1. Manoranjan Pradhan et al, Speed Comparison of
16x16 Vedic Multipliers International Journal of
ComputerApplications(09758887)Volume21No.6,
May2011.
2. Brian Hickman et al, A Parallel IEEE P754 Decimal
FloatingPoint Multiplier University of Wisconsin
Madison Dept. of Electrical and Computer Engineering
Madison,WI53706
3. IEEE 7542008, IEEE Standard for FloatingPoint
Arithmetic,2008.
4.RekhaKJames,PouloseKJacob,SreelaSasi,Decimal
FloatingPointMultiplicationusingRPSAlgorithm,IJCA
Proceedings on International Conference on VLSI,
CommunicationsandInstrumentation(ICVCI):2011.
5. Brian Hickmann, Andrew Krioukov, and Michael
Schulte,MarkErle,AParallelIEEE754DecimalFloating
Point Multiplier, In 25th International Conference on
ComputerDesignICCD,Oct.2007.
921