1 / 25

Decoders and Encoders

Decoders and Encoders. Discussion DS-2.1. Decoders and Encoders. Binary Decoders Binary Encoders Priority Encoders. Decoders. 3-to-8 Decoder. A: in STD_LOGIC_VECTOR(2 downto 0); Y: out STD_LOGIC_VECTOR(0 to 7);. Behavior. for i in 0 to 7 loop

ulmer
Download Presentation

Decoders and Encoders

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Decoders and Encoders Discussion DS-2.1

  2. Decoders and Encoders • Binary Decoders • Binary Encoders • Priority Encoders

  3. Decoders

  4. 3-to-8 Decoder A: in STD_LOGIC_VECTOR(2 downto 0); Y: out STD_LOGIC_VECTOR(0 to 7); Behavior for i in 0 to 7 loop if(i = conv_integer(A)) then Y(i) <= ‘1’; else Y(i) <= ‘0’; end if; end loop;

  5. library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_arith.all; use IEEE.STD_LOGIC_unsigned.all; entity decode38 is port( A : in STD_LOGIC_VECTOR(2 downto 0); Y : out STD_LOGIC_VECTOR(0 to 7) ); end decode38; architecture decode38 of decode38 is begin process(A) variable j: integer; begin j := conv_integer(A); for i in 0 to 7 loop if(i = j) then Y(i) <= '1'; else Y(i) <= '0'; end if; end loop; end process; end decode38; 3-to-8 Decoder

  6. 3-to-8 Decoder

  7. Decoder Networks

  8. 4-input tree decoder

  9. Decoder uses

  10. Decoders and Encoders • Binary Decoders • Binary Encoders • Priority Encoders

  11. Binary encoders

  12. A0 = D1 + D3 + D5 + D7 A1 = D2 + D3 + D6 + D7 A2 = D4 + D5 + D6 + D7

  13. Uses of binary encoders

  14. 68000 Interrupt Logic A0 A1 A2 74138 Decoder 68000 IRQA IP0 IP1 IP2 74148 Encoder Peripheral IRQ Data Bus

  15. Decoders and Encoders • Binary Decoders • Binary Encoders • Priority Encoders

  16. 8-to-3 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;

  17. architecture pencoder_arch of pencoder is begin 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;

More Related