Deprecated: Implicit conversion from float-string "1522907120.140" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1522907120.140" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1522907120.140" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1522907120.140" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1522907120.140" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1523816114.961" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1523816114.961" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1523816114.961" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1523816114.961" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1523816114.961" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1524309309.265" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1524309309.265" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1524309309.265" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1524309309.265" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1524309309.265" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1540191708.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1540191708.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1540191708.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1540191708.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1540191708.407" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1693927358.355" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1693927358.355" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1693927358.355" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1693927358.355" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1693927358.355" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594
ISRO2014-48 / GATE Overflow for GATE CSE
edited by
9,316 views
3 votes
3 votes

A frame buffer array is addressed in row major order for a monitor with pixel locations starting from $(0,0)$ and ending with $(100,100).$ What is address of the pixel $(6,10)?$ Assume one bit storage per pixel and starting pixel location is at $0.$

  1. $1016$
  2. $1006$
  3. $610$
  4. $616$
edited by

4 Answers

Best answer
12 votes
12 votes

Address of pixel (6,10) in row major order is,

= 0 + 1((6 - 0) +101 (10 - 0))

= 1016

(For pixel calculation address in row major order , use logic of how to find address of array element in column major order .)

selected by
1 votes
1 votes

Column Major System:

The address of a location in Column Major System is calculated using the following formula:

Address of A [ I ][ J ] = B + W * [  ( I – Lr ) + M*( J – Lc ) ]

A[6][10] = 0 + 1[(6-0) +100*10] = 1016

Answer is A

edited by
0 votes
0 votes
Let’s imagine the frame buffer to be a matrix of 100x100, so we define this as 2d array in C(or any language for that matter), note that the size of the array should be actually array[101][101] since we need to store 100, this is from the fact that if you need to store a single element in a array you need to declare it as array[1] and not array[0] which would not make sense, right?

Now we have maximum rows = maximum colums = 101. So we can get the address of element by using row-major order.

 

Case 1: Row Major Order

Address = Base Adress + Size of Single Element * (Row * Maximum Row Value) + Column

So, we have,

0 + 1 * (6 * 101) + 10 = 616

 

Case 2: Column Major Order

Address = Base Address + Size of Single Element * (Column * Maximum Column Value) + Row

So, we have,

0 + 1 * (10 * 101) + 6 = 1016

I have no clue what is the answer, some website says it’s 616 and some say it’s 1016. If anyone have any ideas, please comment below. I really would like to know.
Answer:

Related questions

5.3k
views
3 answers
5 votes
ninuarun asked May 31, 2016
5,338 views
How much memory is required to implement $z$-buffer algorithm for a $512 \times 512 \times 24$ bit-plane image?$768$ KB$1$ MB$1.5$ MB$2$ MB
3.7k
views
1 answers
3 votes
go_editor asked Jul 1, 2016
3,672 views
A computing architecture, which allows the user to use computers from multiple administrative domains to reach a common goal is called asGrid ComputingNeutral NetworksPar...
4.4k
views
1 answers
6 votes
go_editor asked Jul 1, 2016
4,448 views
A web client sends a request to a web server. The web server transmits a program to that client ans is executed at client. It creates a web document. What are such web do...
3.3k
views
1 answers
5 votes
go_editor asked Jul 1, 2016
3,329 views
For a software project, the spiral model was employed. When will the spiral stop?When the software product is retiredWhen the software product is released after Beta test...
Total PHP MySQL Other RAM
Time (ms) % Time (ms) % File count Time (ms) % Query count Time (ms) % Amount %
Setup 4.6 8% 3.0 5% 72 1.8 3% 2 0.0 0% 569k 31%
Control 20.4 37% 2.4 4% 5 18.4 33% 12 0.0 0% 533k 29%
View 6.0 10% 6.0 10% 12 0.0 0% 0 0.0 0% 258k 14%
Theme 18.7 34% 6.5 11% 15 12.3 22% 3 0.0 0% 456k 25%
Stats 5.0 9% 0.1 0% 0 4.9 9% 1 0.0 0% 0k 0%
Total 54.6 100% 18.0 32% 104 37.5 68% 18 0.0 0% 1818k 100%