Decoders and Encoders Discussion D4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.

Slides:



Advertisements
Similar presentations
5.5 Encoders A encoder is a multiple-input, multiple-output logic circuit that converts coded inputs into coded outputs, where the input and output codes.
Advertisements

Encoders Module M9.3 Section 6.3. Encoders Priority Encoders TTL Encoders.
Demultiplexers Module M6.4 Section 6.4. Demultiplexers YIN 1 x 4 DeMUX d0d1 Y0 Y1 Y2 Y3 Y0 Y1 Y2 Y3 d1d0 0 0 YIN YIN YIN
Anurag Dwivedi.  Verilog- Hardware Description Language  Modules  Combinational circuits  assign statement  Control statements  Sequential circuits.
1 Lecture 13 VHDL 3/16/09. 2 VHDL VHDL is a hardware description language. The behavior of a digital system can be described (specified) by writing a.
Quad 2-to-1 and Quad 4-to-1 Multiplexers Discussion D2.4 Example 7.
Decoders Discussion D9.5 Example 25. Decoders 3-to-8 Decoder decoder38.vhd library IEEE; use IEEE.STD_LOGIC_1164.all; use IEEE.STD_LOGIC_unsigned.all;
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
Decoders and Encoders Lecture L4.2. Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders.
1 CS 140 Lecture 12 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego.
Introduction to VHDL VHDL Tutorial R. E. Haskell and D. M. Hanna T1: Combinational Logic Circuits.
CS 140 Lecture 11 Professor CK Cheng 5/09/02. Part III - Standard Modules Decoder, Encoder, Mux, DeMux, Shifter, Adder, Multiplexer Interconnect: Decoder,
Communicating With Devices Interrupts Lecture 10.4 Section 10.6.
CS 140 Lecture 12 Professor CK Cheng 11/07/02. Part III - Standard Modules Decoder, Encoder, Mux, DeMux, Shifter, Adder, Multiplexer Interconnect: Decoder,
Multiplexers Module M6.1 Section 6.4. Multiplexers A 4-to-1 MUX TTL Multiplexer A 2-to-1 MUX.
2-to-1 Multiplexer: if Statement Discussion D7.1 Example 4.
Decoders Module M9.1 Section 6.3. Decoders TTL Decoders.
Logic Design Fundamentals - 2 Lecture L1.2. Logic Design Fundamentals - 2 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Decoders and Encoders Sections 3-5, 3-6 Mano & Kime.
Introduction to VHDL Multiplexers Discussion D1.1.
ECE 331 – Digital System Design
Binary-to-BCD Converter
Generic Multiplexers: Parameters Discussion D7.5 Example 8.
Multiplexers Lecture L6.6v Section 6.2. Multiplexers A Digital Switch A 2-to-1 MUX A 4-to-1 MUX A Quad 2-to-1 MUX The Verilog if…else Statement TTL Multiplexer.
Quad 2-to-1 Multiplexer Discussion D7.4 Example 7.
VHDL Examples Subra Ganesan Reference: Professor Haskell’s Notes,
EE 367 – Logic Design Lecture #17
Engineering 100 Section 250 Combinational Logic -- Examples 9/13/2010.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
Binary-to-BCD Converter
A.7 Concurrent Assignment Statements Used to assign a value to a signal in an architecture body. Four types of concurrent assignment statements –Simple.
Lecture # 11 University of Tehran
ENG241 Digital Design Week #4 Combinational Logic Design.
L26 – Datapath ALU implementation
Main Project : Simple Processor Mini-Project : 3-bit binary counter (using 7400 series) Memory By Oluwayomi B. Adamo.
CWRU EECS 318 EECS 318 CAD Computer Aided Design LECTURE 5: AOIs, WITH-SELECT-WHEN, WHEN-ELSE Instructor: Francis G. Wolff Case Western.
ECE 331 – Digital System Design Multiplexers and Demultiplexers (Lecture #13)
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
4-to-1 Multiplexer: Module Instantiation Discussion D2.2 Example 5.
2/10/07DSD,USIT,GGSIPU1 BCD adder KB3B2B1B0CD3D2D1D
9/9/2006DSD,USIT,GGSIPU1 Concurrent vs Sequential Combinational vs Sequential logic –Combinational logic is that in which the output of the circuit depends.
CS/EE 3700 : Fundamentals of Digital System Design
 Seattle Pacific University EE Logic System DesignMux-Decoder-1 Multiplexers Two alternative forms for a 2:1 Mux Truth Table Functional form Logical.
Lecture 8 Review Combinational Devices –Decoder –Multiplexor (Bhasker p-81) –Shifter –Barrel Shifter (Bhasker p-303)
Slide 1 3.VHDL/Verilog Description Elements. Slide 2 To create a digital component, we start with…? The component’s interface signals Defined in MODULE.
Lecture #17 Page 1 ECE 4110–5110 Digital System Design Lecture #17 Agenda 1.MSI Multiplexers 2.MSI Encoders Announcements Test 1 closed book, Wednesday.
Combinational logic circuit
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Describing Combinational Logic Using Processes
UNIT 8: Synthesis Basics
ENG2410 Digital Design “Combinational Logic Design”
ECE 4110–5110 Digital System Design
Combinational Circuits Using VHDL
Advanced Digital design
CSE 140 Lecture 11 Standard Combinational Modules
Logic Design Review – 2 Basic Combinational Circuits
HDL Programming Fundamentals
VHDL (VHSIC Hardware Description Language)
VHDL Structural Architecture
Concurrent vs Sequential
Fibonacci Sequence Lecture L4.1 Lab 3.
ECE 331 – Digital System Design
UNIT 6: Mixed-Type Description
Combinational circuits design
4-Input Gates VHDL for Loops
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
CSE 140 Lecture 11 Standard Combinational Modules
(Sequential-Circuit Building Blocks)
Presentation transcript:

Decoders and Encoders Discussion D4.2

Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders

Decoders

3-to-8 Decoder Behavior input [2:0] A ; wire [2:0] A ; output [0:7] Y ; reg [0:7] Y ; for(i = 0; i <= 7; i = i+1) if(A == i) Y[i] = 1; else Y[i] = 0;

3-to-8 Decoder module decode38 ( A, Y ); input [2:0] A ; wire [2:0] A ; output [0:7] Y ; reg [0:7] Y ; integer i; for(i = 0; i <= 7; i = i+1) if(A == i) Y[i] = 1; else Y[i] = 0; endmodule decode38.v

3-to-8 Decoder

TTL Decoders GND Vcc1G 1A 1B 1Y0 1Y1 1Y2 1Y3 2G 2A 2B 2Y0 2Y1 2Y2 2Y3 74LS139 Y0 Y1 Y2 Y3BA G 1 X X Dual 2-4 Decoder

TTL Decoders GND VccA B C G1 Y7 Y0 Y1 Y2 Y3 Y4 Y5 Y6 !G2A !G2B 74LS138 ABC Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7 G1 G2 G2 = G2A # G2B X = don't care X 1 X X X X X X X to-8 Decoder

Decoder Networks

4-input tree decoder

8-input Coincident Decoder

Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders

Binary encoders

Encoders A B I0 I1 I2 I3 4-to-2 Encoder I0 I1 I2 I3 B A

Encoders I0 I1 I2 I3 B A Assume only 1 input can be high at any time. A = I1 + I3 B = I2 + I3 I1 I2 I3 I0 B = I2 + I3 A = I1 + I3

8-to-3 Encoder I0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y0 Y2 = I7 + I6 + I5 + I4 Y1 = I7 + I6 + I3 + I2 Y0 = I7 + I5 + I3 + I1

Uses of binary encoders

Decoders and Encoders Binary Decoders Binary Encoders Priority Encoders

Priority Encoder X X X X X X X X X X X X X X X X X X X X X X X X X X X X I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y 1 Y 0

Priority Encoder X X X X X X X X X X X X X X X X X X X X X X X X X X X X Y 2 = L 7 + L 6 + L 5 + L 4 L 7 = I 7 L 6 = I 7 'I 6 L 5 = I 7 'I 6 'I 5 L 4 = I 7 'I 6 'I 5 'I 4 I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y 1 Y 0

Priority Encoder X X X X X X X X X X X X X X X X X X X X X X X X X X X X Y 1 = L 7 + L 6 + L 3 + L 2 I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y 1 Y 0 L 7 = I 7 L 6 = I 7 'I 6 L 3 = I 7 'I 6 'I 5 'I 4 'I 3 L 2 = I 7 'I 6 'I 5 'I 4 'I 3 'I 2

Priority Encoder X X X X X X X X X X X X X X X X X X X X X X X X X X X X I 0 I 1 I 2 I 3 I 4 I 5 I 6 I 7 Y 2 Y 1 Y 0 Y 0 = L 7 + L 5 + L 3 + L 1 L 7 = I 7 L 5 = I 7 'I 6 'I 5 L 3 = I 7 'I 6 'I 5 'I 4 'I 3 L 1 = I 7 'I 6 'I 5 'I 4 'I 3 'I 2 'I 1

TTL Priority Encoder GND Vcc A2 A1 E1 E0 GS 0 A0 74LS148 1 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X EI A2 A1 A0 GS EO Priority Encoder

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

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; 8-to-3 Priority Encoder

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;