Memory Address Calculation in an Array Single Dimension Array ISC ICSE

Pubblicato il: 16 aprile 2020
sul canale di: INFINIAN
180
5

Memory Address Calculation in an Array Single Dimension Array ISC ICSE

Array of an element of an array say “A[ I ]” is calculated using the following formula:

Address of A [ I ] = B + W * ( I – LB )

Where,
B = Base address
W = Storage Size of one element stored in the array (in byte)
I = Subscript of element whose address is to be found
LB = Lower limit / Lower Bound of subscript, if not specified assume 0 (zero)

Example:

Given the base address of an array B[1300…..1900] as 1020 and size of each element is 2 bytes in the memory. Find the address of B[1700].

Solution:

The given values are: B = 1020, LB = 1300, W = 2, I = 1700

Address of A [ I ] = B + W * ( I – LB )

= 1020 + 2 * (1700 – 1300)
= 1020 + 2 * 400
= 1020 + 800
= 1820 [Ans]


In questa pagina del sito puoi guardare il video online Memory Address Calculation in an Array Single Dimension Array ISC ICSE della durata di ore minuti seconda in buona qualità , che l'utente ha caricato INFINIAN 16 aprile 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 180 volte e gli è piaciuto 5 spettatori. Buona visione!