The encoder is usually a simple circuit which has state memory and some feedback logic, normally XOR gates.
From the en.wikipedia.org
This representation of XOR may be found useful when constructing a circuit or network, because it has only one operation and small number of and operations.
From the en.wikipedia.org
Logic operations usually consist of boolean AND, OR, XOR and NAND operations, and are the most basic forms of operations in an electronic circuit.