La
solution la plus simple pour coder les huit états du codeur
consiste à affecter l'un des bits du registre d'état
à la sortie du codeur.
Un exemple de codage peut être :
SIGNAL sreg : bit_vector (2 DOWNTO 0);
CONSTANT
pun0 : bit_vector (2 DOWNTO 0) :="110" ;
CONSTANT
pun1 : bit_vector (2 DOWNTO 0) :="111" ;
CONSTANT
pzero0 : bit_vector (2 DOWNTO 0) :="001" ;
CONSTANT
pzero1 : bit_vector (2 DOWNTO 0) :="101" ;
CONSTANT
zun0 : bit_vector (2 DOWNTO 0) :="010" ;
CONSTANT
zun1 : bit_vector (2 DOWNTO 0) :="011" ;
CONSTANT
zzero0 : bit_vector (2 DOWNTO 0) :="000" ;
CONSTANT
zzero1 : bit_vector (2 DOWNTO 0) :="100" ;
Avec le bit 2 choisi comme sortie du codeur :
sligne
<= sreg(2);