ISRO Computer Science (CSE) 2014 - Question 48

All ISRO Computer Science (CSE) papers | ISRO Computer Science (CSE) 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. 616
  • D. 610

Answer: C. 616

Explanation: Coordinates (x, y) = (6, 10). Row major implies rows are stored sequentially.\nGrid is $0..100$ in x and $0..100$ in y. Width = 101 pixels.\nUsually graphics coordinates: x is column, y is row. Or (row, col)? \nIf (row, col) = (6, 10). Width 101.\nAddress = $6 \times 101 + 10 = 606 + 10 = 616$.\nIf (x, y) means (col, row), then address = $10 \times 101 + 6 = 1016$. \nGiven options 616 and 1016, and (6,10) usually means (x,y) in graphics, but in matrix notation (row, col). The question context 'pixel locations' usually implies (x,y). However, 'Row major' applies to matrices. If we treat (6,10) as (row, col), answer is 616. Key says (a) 1016? \nWait, key for 48 is (a). \nSo it interprets (6, 10) as (x=6, y=10) where y is the row index. Address = $y \times \text{width} + x = 10 \times 101 + 6 = 1016$.

| | All questions of ISRO Computer Science (CSE) 2014