in Programming
183 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
in Programming
183 views

1 comment

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

0
0

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