446 views
0 votes
0 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

1 Answer

0 votes
0 votes

Answer: (D) 616

Starting address(base address) for pixel location = 0, and given that pixel size = 1 bit.

Number of rows (r) = 100 – 0 + 1 = 101, Number of columns (c) = 100 – 0 + 1 = 101

In row-major-order fashion, address of element (i, j) = B + [(i – lr)*c + (j – lc)]*S

where B = Base address,

c = number of columns,

lr = row start index of 2D matrix,

lc = column start index of 2D matrix,

S = size of each element,

So, in row-major-order fashion, address of pixel (6, 10) = 0 + [(6-0)*101 + (10-0)]*1 = 616

Related questions

6 votes
6 votes
0 answers
1
V pandey asked Oct 8, 2022
3,017 views
Consider a multi-dimensional array A [90][30]40] with base address start at 1000, calculate the address of A[10][20][3] in row major order and column major order. Assume ...