Pin layout of the 128K RAM chips

                 __                  __      __
     Vcc A15 CE2 WE  A13 A8  A9  A11 OE  A10 CE1 D8  D7  D6  D5  D4
  ____I___I___I___I___I___I___I___I___I___I___I___I___I___I___I___I____
  I  32  31  30  29  28  27  26  25  24  23  22  21  20  19  18  17   I
  I                                                                   I
   \                                                                  I
    I                                                                 I
   /                                                                  I
  I   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16   I
  I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I---I
     NC  A16 A14 A12 A7  A6  A5  A4  A3  A2  A1  A0  D1  D2  D3  Gnd

And this is for the built in 32K chip. In my G it's labeled M5M5256BFP and is located just above the battery case (the left one of the two chips located there before you inserted the HC00).

                 __                  __      __
             VCC WE  A13 A8  A9  A11 OE  A10 CE1 D8  D7  D6  D5  D4
           ___I___I___I___I___I___I___I___I___I___I___I___I___I___I____
           I  28  27  26  25  24  23  22  21  20  19  18  17  16  15  I
           I                                                          I
            \                                                         I
             I                                                        I
            /                                                         I
           I   1   2   3   4   5   6   7   8   9  10  11  12  13  14  I
           I- -I---I---I---I---I---I---I---I---I---I---I---I---I---I--I
              A14 A12 A7  A6  A5  A4  A3  A2  A1  A0  D1  D2  D3  Gnd

As you can see the layout is nearly the same. Not for the pin numbers but for the pin places if the chips are right assigned.
Be sure to isolate everything. I glued some paper to the back side of the RAM chips to keep it away from the shielding. A little sheet of paper between pin 20 of the 32K and it's former connection keeps these pins apart.

Pin layout of a 512k RAM chip

This chip can be used if you want to add more than 256k to your HP48G(X).

Here is the 512k ram pinout:

         |-------\_/-------|
         |                 |
   A18 - | 1            32 | - Vcc
   A16 - | 2            31 | - A15
   A14 - | 3            30 | - A17
   A12 - | 4            29 | - Negative WE
    A7 - | 5            28 | - A13
    A6 - | 6            27 | - A8
    A5 - | 7            26 | - A9
    A4 - | 8            25 | - A11
    A3 - | 9            24 | - Negative OE
    A2 - | 10           23 | - A10
    A1 - | 11           22 | - Negative CS
    A0 - | 12           21 | - D7
    D0 - | 13           20 | - D6
    D1 - | 14           19 | - D5
    D2 - | 15           18 | - D4
   VSS - | 16           17 | - D3
         |                 |
         |-----------------|