edited by
9,167 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 votes
5 votes
3 answers
1
ninuarun asked May 31, 2016
5,289 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 votes
3 votes
1 answer
2
go_editor asked Jul 1, 2016
3,656 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...
6 votes
6 votes
1 answer
3
go_editor asked Jul 1, 2016
4,443 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...
5 votes
5 votes
1 answer
4
go_editor asked Jul 1, 2016
3,304 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...