In this paper, we are interested in lexicographic codes which are greedily constructed codes. For an arbitrary length , we shall find the basis of quaternary lexicographic codes, for short, lexicodes, with minimum distance . Also, using a linear nim sum of some bases (such a vector is called the testing vector), its decoding algorithm will be found.