0% found this document useful (0 votes)
60 views5 pages

C.) Write Code For Stencil Pattern (A) Where One Value Approximates All The Other 8 Values of The Tile. A.)

This document contains summaries of multiple topics: 1) An explanation of faulty bits in a 754 single-precision floating point representation and methods to address it, including replacing bits or shifting on read/write. 2) Sample code for approximating values in a stencil pattern where the center tile value approximates surrounding tiles. 3) An analysis of iterative information strategies for converging points to within a threshold, comparing a baseline strategy to a convergence-based strategy. 4) A comparison of refreshing partial rows of DRAM vs all rows simultaneously, finding partial refreshing saves energy. 5) An analysis of the correctness of sum and carry bits in three approximate adders for summing values.

Uploaded by

Tanishq Varshney
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views5 pages

C.) Write Code For Stencil Pattern (A) Where One Value Approximates All The Other 8 Values of The Tile. A.)

This document contains summaries of multiple topics: 1) An explanation of faulty bits in a 754 single-precision floating point representation and methods to address it, including replacing bits or shifting on read/write. 2) Sample code for approximating values in a stencil pattern where the center tile value approximates surrounding tiles. 3) An analysis of iterative information strategies for converging points to within a threshold, comparing a baseline strategy to a convergence-based strategy. 4) A comparison of refreshing partial rows of DRAM vs all rows simultaneously, finding partial refreshing saves energy. 5) An analysis of the correctness of sum and carry bits in three approximate adders for summing values.

Uploaded by

Tanishq Varshney
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1

21565019

P.SAI VIKAS

1.)GIVEN IS THE 754 SINGLE PRECISION REPRESENTATION OF {Q = 54.56002426147460937}.counting starts


from 0 to 31 where 0 is the left most [most significant].FAULTY INDEX OF BITS IS (3 AND 9);THE
SOLUTION IS AS FOLLOWS:

A.)REPLACE [0 TO 1] AND [1 TO 0] AT BITS 3 AND 9 WHICH ARE FAULTY,WHICH RESULTS IN


{Q’= 1.65614043136e+11} WHOSE BINARY REPRESENTATION CHANGES TO
01010010000110100011110101110111. AND THE ABSOLUTE ERROR IS [Q-Q'] = {165,614,043,081}

B.)USING INEXACT HARDWARE TECHNIQUE, SHIFT RIGHT BY “K” BITS at the time of writing .Here we
shift by 10 bits of LSB and bring it to the starting . Therefore it results in value of
[1.91426060164e+18],this is stored as Q.

SIMILARLY ,if we shift left by “K” BITS at the time of reading.Here we shift by 10 bits of
MSB and bring it to the ending point.Therefore it returns in value of [9.28849365512e+24],this is stored
as Q’’.AND THE ABSOLUTE ERROR IS [Q-Q'’] = {ERROR APPROXIMATELY RESULTS IN X.XXXXXe+6} which
is reduced from intially faulty result of {XXXXXe+11}

2.)

C.) Write code for stencil pattern (a) where one value approximates all the
other 8 values of the tile.
A.)SAMPLE CODE IS AS FOLLOWS:where center tile approximates all the 8 tiles
for(i = 1; i < N-1; ++I) {

for(j = 1; j < N-1; ++j) {

A[i][j] = (B[i ][j ] + B[i ][j-1]

+ B[i ][j+1] + B[i-1][j ]

+ B[i-1][j-1] + B[i-1][j+1]
+ B[i+1][j ] + B[i+1][j-1] + B[i+1][j+1]); }

for(i = 1; i < N-1; ++i) {

for(j = 1; j < N-1; ++j) {

B[i][j] = A[i][j];

}
2

3.)ITERATIVE INFORMATION STRATEGY ,ON 6 POINTS WHOSE INTIAL ERRORS as [80,40,30,100,15,160]

Each iteration ,the error REDUCES TO HALF.A point converges when the eroor is less than or equal to 1.

A.)BASELINE STRATEGY: WHEN ALL THE POINTS HAVE CONVERGED:

1) FOR 80 ,the iteration is as follows which is {40,20,10,5,2.5,1.125 , 0.5625 } which amounts to


“7” ITERATIONS.

2.)FOR 40 ,the iteration is as follows which is {20,10,5,2.5,1.125, 0.5625 } which amounts to

“6” ITERATIONS.

3.)SIMILARLY FOR 30 ,it takes {15 ,7.5 ,3.75 ,1.875 ,0.9375 } which is “5” ITERATIONS

4.)for 100 ,it takes {50,25,12.5 ,6.25,3.125,1.5625,0.781} which has “7” ITERATIONS

5.)FOR 15 , it takes {7.5,3.75,1.875,0.9375} which has 4 ITERATIONS

6.) FOR 160 ,it takes {80 ,40,20,10,5,2.5,1.125,0.5625} which has “8” ITERATIONS.

BUT IT STOPS ONLY WHEN ALL THE POINTS HAVE CONVERGED .SO THE TOTAL NUMBER OF ITERATIONS
IS “[8*6 =48]” TOTAL ITERATIONS WHICH IS THE MAXIMUM VALUE TILL WHICH EVERY POINT HAS TO
WAIT

B.)COVERGENCE_BASED_STRATEGY: where a point gets excluded after coverging .so here we take sum
of the individual iterations and add those . ON A WHOLE IT HAS [7+6+5+7+4+8 = 37] ,”37” TOTAL
ITERATIONS ARE IN THIS STRATEGY.
3

4.) AS THE DRAM CONSISTS OF “65536” ROWS : AND EACH ROW TAKES ‘E’ nJ of energy in REFRESHING

A)¼ rth meant “16384” rows which consumes 64ms; Therefore for a total of 5120ms it leads to
80 iterations.Hence total energy is (80*16384) E nano joules,so it sums upto 1.31 E milli joules

B)Similarly ¾ rth meant 49152 rows which consumes 128ms;Therefore for a total of 5210ms it leads
40 iterations.Hence total energy is (40*49152) E nano joules , so it sums upto 1.966 E milli joules

C)On a whole it is (1.31 + 1.966 ) = 3.276 E milli joules of energy is consumed

D)WITH BASELINE if all rows are refreshed at 64ms ,it takes (80*65536) E nano joules which is given
as 5.24 milli joules is consumed

E)CONCLUSION IS ENERGY IS SAVED IF WE REFRESH CRITICAL DATA AT HIGH REFRESH RATE


AND LEAVE NON CRITICAL DATA AT NORMAL PACE WHICH IS BENEFICIAL FOR US.

5.)Consider sum of X ,Y WITH Cin.Here 3 approximate adders.

A.) ADDER 1 :
SUM BIT CARRY BIT
OUTPUT OUTPUT
S Cout
0 0
1 0
0 1
1 0
0 1
1 0
0 1
1 1
:OUT OF 8 ROWS IN THE “SUM” COLUMN , ONLY 4 ARE CORRECT.INDEX NO : [ 1 ,2 ,7,8 which are same]

:OUT OF 8 ROWS IN THE “Cout” COLUMN ,ONLY 4 ARE CORRECT.INDEX NO: [1,2,7,8 which are same]
4

B.)ADDER 2:
SUM BIT CARRY BIT
OUTPUT OUTPUT
S Cout
1 0
1 0
0 0
0 1
0 0
0 1
1 1
1 1
:OUT OF 8 ROWS IN THE “SUM” COLUMN ,ONLY 4 ARE CORRECT.INDEX NO: [2,4,6,8 which are same]

:OUT OF 8 ROWS IN THE “Cout” COLUMN ,ALL 8 ARE CORRECT.

C.)ADDER 3:
SUM BIT CARRY BIT
OUTPUT OUTPUT
S Cout
0 0
1 0
0 0
0 1
0 0
0 1
0 1
1 1
:OUT OF 8 ROWS IN THE “SUM” COLUMN ,ONLY 6 ARE CORRECT.INDEX NO :[1,2,4,6,7,8which are same]

:OUT OF 8 ROWS IN THE “Cout” COLUMN ,ALL 8 ARE CORRECT

7.) See Kmeans_Final.cpp.

We discussed that “in clustering algorithm, only relative distances matter, not
absolute distances.”
In function "int getIDNearestCenter(Point point)", suppose we replace
min_dist = sqrt(sum); ==> min_dist = sum;
and dist = sqrt(sum); ==> dist = sum;
5

A.)YES ,BECAUSE RELATIVE ORDERING OF DISTANCES DOESNOT GET CHANGED.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy