Each addressable storage location in a RAM is, in effect, a register. In a 4K-word RAM there will be 4096 registers. Each register will be 1 word wide. So an 8K x 32-bit memory will have a total of 256K bits.
The confusion is compounded because real-word memories are advertized by their number of bits. Something called a 64K RAM might be organized as 8K x 8 bits, 16K x 4 bits, or 64K by 1 bit.
In reply to this post by Juan Camilo Valencia Espitia
You can think of the RAM as an array of cells (or registers, or boxes). The number of cell that you can have depend on how many bits are in the address: address with k bits can point to 2^k different positions. This is called the "length" of the RAM.
All cells in a single RAM chip are the same size between themselves (width), but it can be different from the address width. For example you can have a RAM chip of 1024 cells, each of which can store 1 byte of information. This will require 10 bits for the address and 8 bits for the data.
You can combine smaller RAM chips to create bigger ones in two different ways:
1. You can "widen" the cells. E.g. if you have two chips like the above one, you can put them in "parallel" to obtain 1 chip which can store 1024 16-bit cells. For that you just store the lower 8 bits in one of the chips and the higher 8 bits in the other. That is, you have 10 address bits and 16 data bits.
2. You can put them in "sequence" to obtain 1 chip which can store 2048 8-bit cells. That would amount to 11 address bits and 8 data bits.
The size of RAM is thus determined by this two numbers: the number of addressable cells and the size of each cell.
One may wonder why not just multiply them and say that we have 8192 bits of RAM. The problem with such approach is, that you loose important information. For example, you can read or write 1 byte in 1024x8 memory chip with a single write, but you'll need 2 operations for a 2048x4 chip.
From the real-world hardware perspective, there are several reasons that memory chips come in various organizations.
The wider the memory is the more pins are required on the chip. An 8-bit wide memory requires 8 pins for data I/O, whereas a 1-bit wide memory only needs a single pin. A chip's pin count dictates it's size; the actual IC is usually much smaller than the packaging.
There are times when memory width needs to be something other than a multiple of 8. For example, memory with parity checking needs one extra bit. Error correcting memory (ECC) requires several extra bits.
Here's an example: a 1M x 9 memory module. The 2 HY514400AJ chips are 1M x 4 memories and the HY531000AJ is 1M x 1.
(In this example, the chips have the same number of physical pins, but the HY531000AJ has 3 electrically unconnected pins. It's easier for the manufacturers if the chips have the same physical form factor.)