Frame buffer array is addressed in row major order for
2014
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.
- A.
1016
- B.
1006
- C.
610
- D.
616
Attempted by 10 students.
Show answer & explanation
Correct answer: D
First, determine the width of the frame buffer. Since pixel locations range from 0 to 100 inclusive, the width is 100 - 0 + 1 = 101 pixels. In row-major order, the address of a pixel at (row, column) is calculated as (row × width) + column. For pixel location (6, 10), the row is 6 and the column is 10. Substituting these values: (6 × 101) + 10 = 606 + 10 = 616.