Pertemuan 3

 
1. Terdapat Array float A[5][4] dan lokasi awal terletak di alamat 00F(H) maka lokasi A[3][4] secara kolom dan baris adalah :
Diketahui :
@M[i][j]                = A[3][4]
@M[0][0]              = 00F(H)
i                               = 3
j                               = 4
N                             = 4
L                             = 4
K                             = 5
Jawab : Secara Baris
@M[i][j] = @M[0][0] + {(i – 1)* N + (j – 1)}*L
A[3][4]                   = 00F(H) + {(3 – 1)* 4 + (4 – 1)}*4
                                                = 00F(H) + 44(D)
                                                = 00F(H) + 2C(H)
                                                = 03B(H)
Jawab : Secara Kolom
@M[i][j] = @M[0][0] + {(j – 1)* K + (i – 1)}*L
A[3][4]                   = 00F(H) + {(4 – 1)* 5 + (3 – 1)}*4
                                                = 00F(H) + 68(D)
                                                = 00F(H) + 44(H)  
                                                = 053(H)
 
2. Terdapat Array Long Double A[50][75] dan lokasi awal terletak di alamat 00FF(H) maka lokasi A[48][60] secara kolom dan baris adalah :
Diketahui :
@M[i][j]                = A[48][60]
@M[0][0]              = 00FF(H)
i                               = 48
j                               = 60
N                             = 75
L                             = 10
K                             = 50
                 Jawab : Secara Baris
@M[i][j] = @M[0][0] + {(i – 1)* N + (j – 1)}*L
A[48][60]               = 00FF(H) + {(48 – 1)* 75 + (60 – 1)}*10
                                                = 00FF(H) + 35840(D)
                                                = 00FF(H) + 8C00(H)
                                                = 8CFF(H)
Jawab : Secara Kolom
@M[i][j] = @M[0][0] + {(j – 1)* K + (i – 1)}*L
A[3][4]                   = 00FF(H) + {(60 – 1)* 50 + (48 – 1)}*10
                                                = 00FF(H) + 29970(D)
                                                = 00FF(H) + 7512(H)           
                                                = 7611(H)
 
 
3. Terdapat Array Double A[25][50] dan lokasi awal terletak di alamat 009F(H) maka lokasi A[17][48] secara kolom dan baris adalah :
Diketahui :
@M[i][j]                = A[17][48]
@M[0][0]              = 009F(H)
i                               = 17
j                               = 48
N                             = 50
L                             = 8
K                             = 25
                 Jawab : Secara Baris
@M[i][j] = @M[0][0] + {(i – 1)* N + (j – 1)}*L
A[17][48]               = 009F(H) + {(17 – 1)* 50 + (48 – 1)}*8
                                                = 009F(H) + 6776(D)
                                                = 009F(H) + 1A78(H)
                                                = 1B17(H)
Jawab : Secara Kolom
@M[i][j] = @M[0][0] + {(j – 1)* K + (i – 1)}*L
A[3][4]                   = 009F(H) + {(48 – 1)* 25 + (17 – 1)}*8
                                                = 009F(H) + 9528(D)
                                                = 009F(H) + 2538(H)            
                                                = 25D7(H)
 
4. Deklarasi Array X adalah  Double A[2][4][5] dengan alamat awal index [0][0][0] berada di 0021(H) tentukan berapa alamat Array di [2][2][2] :
Diketahui :
@ [n][m][p]           = A [2][4][5]
M [0][0][0]             = 0021(H)
L                              = 8
Jawab :
@ [n][m][p]           = M[0][0][0] + {((n-1)*(index 1)) + ((m-1)*((index 2)) + ((p-1) * (index 3)}*L
                                = 0021(H) + {((2-1)*(2))+((4-1)*((2))+((5-1)*(2))*8
                                = 0021(H) +  128(D)
                                = 0021(H) + 80(H)
                                = 01A1(H)

Komentar Disini

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s