# Decoder Symbol Examples - University of Wisconsin-Madison

Decoders and Encoders 1 ECE 352 Digital System Fundamentals Decoders Encoders and Priority Encoders Topics Decoders and Encoders Decoders and Encoders 2 Decoders Encoders and Priority Encoders Decoders and Encoders Decoder Converts an n-bit input codeword into a unique m-bit output code (called n-to-m or n:m decoder) n m 2n There may be unused input and output codes Commonly, m = 2n Exactly one output is true (and the others are

false) for any possible input combination Each output represents one of the 2n possible minterms of an n-input function An output is true if the current input values correspond to the minterm for that output 3 Fundamental functional block that is used in Decoders and Encoders Decoder Symbol Examples DEC 1:2 DEC 2:4 DEC 3:8 IN 1 0 2 1 0 1 0

Inputs 4 Outputs 3 2 1 0 7 6 5 4 3 2 1 0 Decoders and Encoders 1:2 Decoder One input, two outputs (2#inputs 21 2) The input value indicates which one of the outputs will be 1 (the other output will be zero) The outputs must be labeled so we know which is output 1 and which is output 0 The top output does not have to be the higher DEC 1:2

DEC 1:2 DEC 1:2 number 0 5 IN 1 0 0 1 1 IN 1 0 1 0 0 IN 0

1 1 0 Pay attention to labels! They explain which output pin is which (same for inputs if multiple inputs) Decoders and Encoders 2:4 Decoder 6 Two inputs, four outputs The input can be interpreted as a binary number, and that number indicates which output will be 1 Inputs/outputs need to be labeled if more than one Pay attention to labels! DEC 2:4 DEC DEC 2:4 You should put them in2:4 an order that makes 1 3 0 0 sense

1 0 3 0 1 1 0 0 0 0 2 0 0 1 2 0 1 0 1 0 1 0 1 1 2 0 0 1 0 0 3 1 Preferred pin order These outputs together say that the input was 01 Decoders and Encoders Decoders 7 Remember: each decoder output corresponds to a minterm of the input set Can use a decoder with an OR gate to implement functions in sum-of-minterms form Example: Use a decoder plus an OR

gate to implement the odd function for 3 variables Decoder Structure Decoders and Encoders Each output is a minterm function that includes every input variable 8 DEC 1:2 IN Y1 Y0 1:2 decoder Can use hierarchy to create a larger decoder from a smaller one... A decoder computes part of each output minterm based on a subset of the inputs Add logic to complete the minterms Enable Signals Decoders and Encoders Some decoders have an additional DEC 1:2 input called an enable 1 IN 1

Many times the names for things are a hint as to what they mean 0 EN 0 0 0 An enabled decoder operates normally the outputs of a disabled decoder are ALL 0 Need to know if enable is active-high or active-low Active-high enable: decoder is enabled when enable is 1 Active-low enable: decoder is enabled when enable is 0 9 Adding an Enable Decoders and Encoders Each output of the decoder is ANDed with the enable signal (for an active-high enable) 10

Topics Decoders and Encoders Decoders and Encoders 11 Decoders Encoders and Priority Encoders Encoder Decoders and Encoders Performs the reverse operation of a decoder Takes up to 2n inputs, produces n-bit output 12 Implies that meaningful inputs have only a single bit set to 1 Multiple 1 bits or no 1 bits would give ENC 8:3 erroneous output values 0 7 2 1 6 1 ENC 4:2 0 5 0 ENC 2:1 0 3 0 0 4 0

0 1 Y 0 1 2 1 1 3 0 1 0 0 1 0 2 0 0 0 1 This says that 0 0 input #0 is a 1 1 1 0 Priority Encoder Decoders and Encoders Can resolve the encoding problem of multiple 1s by assigning each a priority 13 Design encoder so that the output is the code that corresponds to the highest-priority input that is 1 Can prioritize 1s at higher-numbered positions

PRI 4:2 PRI 4:2 PRI 4:2 Output is then the highest input # 3 is11 1 1input 0 3 1 1 0 1 2 0 1 1 2 0 0 0 1 1 1 1 1 0 0 0 0 0 where the 3 1 0 2 0 1 1 0 Decoders and Encoders Priority Encoder w/Value Detect

A variant of the priority encoder has an additional output so that it can also detect all inputs equal 0 PRI 4 0 Method 1: re-number inputs0 0 to start from 1 so an encoder output of all 0s means there0 were no 1s present 4 3 2 1 2 1 0 PRI 4 0 0 0 1 1 0 0

PRI 4 Method 2: output V (valid) 0 3 0 2 is 1 if any 1s on inputs 1 If the valid flag is 0, the other 0 0 0 14 outputs are meaningless The Xs on the output mean the 4 3 2 1 2 1 0 1 0 0 PRI 4 1 0

X X V 0 0 1 0 1 3 2 1 0 1 0 1 0 V 1 Decoders and Encoders X Output

Here we use the X to say that the output value is not specified by the circuits requirements An output labeled as X will actually be a 1 or 0, because those are the only valid options But you shouldnt depend on it to be one of these in particular, because the actual value isnt PRI 4 specified e.g., two different priority encoders may have different output values when all inputs are 0 Generally also means that the circuit design uses dont-cares 15 0 0 0 0 If all inputs are 0, then V=0 but we 3 2 1 0 1 0

X X V 0 Example 4-Input Encoder Behaviors Priority Encoder Decoders and Encoders Encoder D3 D2 D1 D0 Y1 Y0 D3 D2 D1 D0 0 0 0 0 1 0 0 0 0 1

0 0 0 0 0 1 1 0 0 0 others 0 X X 1 0 0 0 0 1 0 1 0 0 1 1 X X 0 0 0 1 X 0 0 1 X X Y1 Y0 V

0 X X 1 0 0 X 0 1 X 1 0 X 1 1 0 1 1 1 1 An X on the input side of a truth table is a wildcard indicating all possible values 16 Valid Flag Decoders and Encoders Decoding, Encoding, Enabling These are all concepts The ideas are more broad than the common examples shown on the previous slides Example: BCD to 7-segment Decoder

17 3 2 1 0 A Inputs 4-bit BCD value B Outputs 7 bits, one per segment C of the display D Decodes the BCD value to determine E which segments are lit F May include an enable to allow turning EN G the display off regardless of the BCD value. Decoders and Encoders Design Example: Codes 18 Toy: 6 Switches

Design Example: Codes Decoders and Encoders Letter tiles that can be placed in the slot have posts on the bottom that press the switches 19 Different letter tiles have different post positions (different codes!) Decoders and Encoders 20 ECE 352 Digital System Fundamentals Decoders Encoders and Priority Encoders

## Recently Viewed Presentations

• Assume 100 proteins in cell. 1g of each protein. Total protein? Ratio of our protein? Purify: Get rid of 50 unwanted proteins. Total protein? Ratio of our protein? Purify: Get rid of 40 remaining unwanted proteins. Total protein? Ratio of...
• Presumptive Color Tests: Spot tests. Often done on a spot plate or in a test tube. Normally destroys the sample. No spot test is specific for a particular drug, so a negative test is a good indicator for ruling something...
• 2011 Consensus Statement. Identified 6 areas for quality improvement, including: "Promotion of training and clinical experience on transition and transfer of youth and young adults (both with and without special needs) for trainees in all medical fields."
• Active moiety UNII. Product Names . Product Type. Dosage Form. Active Ingredient Name . Strength of Active Ingredient. Basis of Strength. DEA Schedule. Route of Adminstration. Marketing Category. Content of labeling text sections (e.g. 12.1 Mechanism of Action) Application Number....
• Title: SCE Assessment Author: Yue Last modified by: SCE Created Date: 1/15/2007 5:25:24 PM Document presentation format: On-screen Show (4:3) Company
• Similarly, if you do central syslogging, or centralized device monitoring and management, or centralized NTP (time service) currently, we assume that you will continue to do those things over IPv4 -- for now, the only things that will be talking...
• Steps Towards Prussian-Led Unification. Economics: Prussian Control of the Zollverein. The Schleswig-Holstein Problem. Austria Between Italy and Germany
• El distrito proporciona señal inalámbrica que tiene protección básica para ayudar a proteger a nuestros alumnos. La contraseña para la conexión inalámbrica es: RUSDlearns El sistema PowerSchool Learning es una aplicación, Sistema de Manejo de Aprendizaje (LMS), para la entrega...