Decoders and Encoders Sections 3-5, 3-6 Mano & Kime

Preview:

Citation preview

Decoders and Encoders

Sections 3-5, 3-6 Mano & Kime

Decoders and Encoders

• Binary Decoders

• Binary Encoders

• Priority Encoders

Decoders

3-to-8 Line Decoder

A 2-to-4-Line Decoder

Implementing a Binary Adder Using a Decoder

S(X,Y,Z) = m(1,2,4,7)

C(X,Y,Z) = m(3,5,6,7)

Decoder Networks

4-input tree decoder

Decoder uses

Decoder uses

Decoders and Encoders

• Binary Decoders

• Binary Encoders

• Priority Encoders

Binary encoders

A0 = D1 + D3 + D5 + D7

A1 = D2 + D3 + D6 + D7

A2 = D4 + D5 + D6 + D7

Uses of binary encoders

Decoders and Encoders

• Binary Decoders

• Binary Encoders

• Priority Encoders

Maps of Priority Encoder

Logic Diagram of a4-Input Priority Encoder

Uses of priority encoders

VHDL Example:8-input priority encoder

entity pencoder is

port (

x: in STD_LOGIC_VECTOR (7 downto 0);

E: in STD_LOGIC;

y: out STD_LOGIC_VECTOR (2 downto 0);

A: out STD_LOGIC

);

end pencoder;

architecture pencoder_arch of pencoder isbegin pe: process(x,E) variable k: integer; begin y <= "000"; A <= '0'; if E = '1' then for j in 0 to 7 loop if x(j) = '1' then

y <= conv_std_logic_vector(j,3); A <= '1'; end if; end loop; end if; end process pe;end pencoder_arch;

Recommended