An image forming apparatus is provided with a control section which stores detection results of a toner sensor regarding detection patterns. The aim of the invention is to provide an inexpensive method for structuring such an oxide layer. The address includes a first address for selecting any of the groups and a second address for selecting a word line in the selected group.