Writing memory is similar to reading:
address is presented to the decoder
correct word line is asserted
WE is asserted as well
bits Di[2:0] are written into the three gated D-latch that corresponds to the selected horizontal word line.