Encoders and Decoders: Details and Design Issues

Similar documents
R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

1. True/False Questions (10 x 1p each = 10p) (a) I forgot to write down my name and student ID number.

FUNCTIONS OF COMBINATIONAL LOGIC

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

NORTHWESTERN UNIVERSITY TECHNOLOGICAL INSTITUTE

WINTER 15 EXAMINATION Model Answer

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

MODULE 3. Combinational & Sequential logic

Contents Circuits... 1

Tribhuvan University Institute of Science and Technology Bachelor of Science in Computer Science and Information Technology

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Laboratory Objectives and outcomes for Digital Design Lab

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

Computer Architecture and Organization

Half-Adders. Ch.5 Summary. Chapter 5. Thomas L. Floyd

Digital Electronic Circuits Design & Laboratory Guideline

EEE130 Digital Electronics I Lecture #1_2. Dr. Shahrel A. Suandi

gate symbols will appear in schematic Dierent of a circuit. Standard gate symbols have been diagram Figures 5-3 and 5-4 show standard shapes introduce

Minnesota State College Southeast

Experiment (6) 2- to 4 Decoder. Figure 8.1 Block Diagram of 2-to-4 Decoder 0 X X

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

TIME SCHEDULE. MODULE TOPICS PERIODS 1 Number system & Boolean algebra 17 Test I 1 2 Logic families &Combinational logic

Note 5. Digital Electronic Devices

DIGITAL CIRCUIT LOGIC UNIT 9: MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

Computer Systems Architecture

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

Chapter 3. Boolean Algebra and Digital Logic

Chapter Contents. Appendix A: Digital Logic. Some Definitions

AIM: To study and verify the truth table of logic gates

Combinational Logic Design

UNIVERSITY OF MASSACHUSSETS LOWELL Department of Electrical & Computer Engineering Course Syllabus for Logic Design Fall 2013

DIGITAL ELECTRONICS & it0203 Semester 3

Chapter 4: Table of Contents. Decoders

LESSON PLAN. Sub Code: EE2255 Sub Name: DIGITAL LOGIC CIRCUITS Unit: I Branch: EEE Semester: IV

LAB 3 Verilog for Combinational Circuits

ECE Lab 5. MSI Circuits - Four-Bit Adder/Subtractor with Decimal Output

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

PURBANCHAL UNIVERSITY

Course Plan. Course Articulation Matrix: Mapping of Course Outcomes (COs) with Program Outcomes (POs) PSO-1 PSO-2

Previous Lecture Sequential Circuits. Slide Summary of contents covered in this lecture. (Refer Slide Time: 01:55)

Digital Logic Design: An Overview & Number Systems

Principles of Computer Architecture. Appendix A: Digital Logic

WINTER 14 EXAMINATION

North Shore Community College

EECS 270 Final Exam Spring 2012

Subject : EE6301 DIGITAL LOGIC CIRCUITS

Analogue Versus Digital [5 M]

1. Convert the decimal number to binary, octal, and hexadecimal.

Digital Circuits ECS 371

Lecture 11: Synchronous Sequential Logic

Chapter 9 MSI Logic Circuits

MODU LE DAY. Class-A, B, AB and C amplifiers - basic concepts, power, efficiency Basic concepts of Feedback and Oscillation. Day 1

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

Chapter 8 Functions of Combinational Logic

Logic Design Viva Question Bank Compiled By Channveer Patil

EXPERIMENT 8 Medium Scale Integration (MSI) Logic Circuits

COMP2611: Computer Organization. Introduction to Digital Logic

Digital Circuits I and II Nov. 17, 1999

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Dev Bhoomi Institute Of Technology PRACTICAL INSTRUCTION SHEET EXPERIMENT NO. ISSUE NO. : ISSUE DATE: REV. NO. : REV. DATE : PAGE:

RAO PAHALD SINGH GROUP OF INSTITUTIONS BALANA(MOHINDER GARH)123029

[2 credit course- 3 hours per week]

Logic Devices for Interfacing, The 8085 MPU Lecture 4

BCN1043. By Dr. Mritha Ramalingam. Faculty of Computer Systems & Software Engineering

CHAPTER 4 RESULTS & DISCUSSION

Final Exam review: chapter 4 and 5. Supplement 3 and 4

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

CSE221- Logic Design, Spring 2003

(Refer Slide Time: 1:45)

ELEC 204 Digital System Design LABORATORY MANUAL

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

Where Are We Now? e.g., ADD $S0 $S1 $S2?? Computed by digital circuit. CSCI 402: Computer Architectures. Some basics of Logic Design (Appendix B)

AE/AC/AT54 LINEAR ICs & DIGITAL ELECTRONICS DEC 2014

ME 515 Mechatronics. Introduction to Digital Electronics

CS302 - Digital Logic & Design

Chapter 11 State Machine Design

EECS 140 Laboratory Exercise 7 PLD Programming


Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

ENGG2410: Digital Design Lab 5: Modular Designs and Hierarchy Using VHDL

NAND/NOR Implementation of Logic Functions

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

TYPICAL QUESTIONS & ANSWERS

VU Mobile Powered by S NO Group

UNIT 1: DIGITAL LOGICAL CIRCUITS What is Digital Computer? OR Explain the block diagram of digital computers.

Logic Design II (17.342) Spring Lecture Outline

University of Victoria. Department of Electrical and Computer Engineering. CENG 290 Digital Design I Lab Manual

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

Lesson No Lesson No

CprE 281: Digital Logic

MODULAR DIGITAL ELECTRONICS TRAINING SYSTEM

Sequential logic circuits

Lab #6: Combinational Circuits Design

211: Computer Architecture Summer 2016

UNIVERSITI TEKNOLOGI MALAYSIA

Transcription:

Encoders and Decoders: Details and Design Issues Edward L. Bosworth, Ph.D. TSYS School of Computer Science Columbus State University Columbus, GA 31907 bosworth_edward@colstate.edu Slide 1 of 25 slides Revised August 13, 2010

Review of Binary Codes We now begin a discussion of MSI (Medium Scale Integration) circuits. MSI chips have complete circuits, built from multiple gates, on a single chip. Two classes that we study are: Encoders and Decoders Multiplexers and Demultiplexers These devices are based on binary coded input. We review simple binary codes. 2 bit codes: 00 0 3 bit codes: 000 0 01 1 001 1 10 2 010 2 11 3 011 3 100 4 101 5 110 6 111 7 Slide 2 of 25 slides Revised August 13, 2010

Encoders Encoders typically have 2 N inputs and N outputs. These are called 2 N to N encoders. Typical examples include 4 to 2 encoders (probably not used much) 8 to 3 encoders 16 to 4 encoders Due to the prevalence of decimal arithmetic, we also have 10 to 4 encoders. NOTE: We cannot encode 10 items with 3 bits; we need 4 bits to do this. Slide 3 of 25 slides Revised August 13, 2010

The Truth Table for a 10 to 4 Encoder Input Y3 Y2 Y1 Y0 X0 0 0 0 0 X1 0 0 0 1 X2 0 0 1 0 X3 0 0 1 1 X4 0 1 0 0 X5 0 1 0 1 X6 0 1 1 0 X7 0 1 1 1 X8 1 0 0 0 X9 1 0 0 1 In the table, we label the inputs X0 through X9, inclusive. To produce the equations for the outputs, we reason as follows. Y3 is 1 when either X8 = 1 or X9 = 1. Slide 4 of 25 slides Revised August 13, 2010 Y2 is 1 when X4 = 1 or X5 = 1 or X6 = 1 or X7 = 1. Y1 is 1 when X2 = 1, X3 = 1, X6 = 1, or X7 = 1. Y0 is 1 when X1 = 1, X3 = 1, X5 = 1, X7 = 1, or X9 = 1. These observations lead to the following equations, used to design the encoder. Y3 = X8 + X9 Y2 = X4 + X5 + X6 + X7 Y1 = X2 + X3 + X6 + X7 Y0 = X1 + X3 + X5 + X7 + X9

The Circuit Diagram for the 10 4 Encoder The equations: The diagram: Y3 = X8 + X9 Y2 = X4 + X5 + X6 + X7 Y1 = X2 + X3 + X6 + X7 Y0 = X1 + X3 + X5 + X7 + X9 Slide 5 of 25 slides Revised August 13, 2010

Issues with Encoders In the above encoder, one should note that the input X 0 is not connected to any output. An output of 0000 always implies that button 0 is pushed. Put another way, this circuit does not distinguish between: 1. No input button pushed 2. Button 0 pushed. If we really needed an indicator that a button had been pushed, we would have a number of valid options. What we do is ignore the problem. Slide 6 of 25 slides Revised August 13, 2010

Decoders Decoders are the opposite of encoders; they are N to 2 N devices. Typical examples include 2 to 4 decoders 3 to 8 decoders 4 to 16 decoders Due to the prevalence of decimal arithmetic, we also have 4 to 10 decoders. These are specialized 4 to 16 decoders with six fewer pins. N to 2 N decoders have N inputs, labeled X 0, X 1,., X N 1 2 N outputs, similarly labeled Y 0, Y 1, etc. optionally, an enable line. Decoders come in two varieties: active high and active low. We focus our lectures on active high decoders: the selected output goes to logic 1 the outputs not selected stay at logic 0. Slide 7 of 25 slides Revised August 13, 2010

Description of a 3 to 8 Decoder This decoder has three inputs: X 2, X 1, X 0 eight outputs: Y 0, Y 1, Y 2, Y 3, Y 4, Y 5, Y 6, Y 7 Its functioning is best described by a modified truth table. This gives rise to the equations: X 2 X 1 X 0 Action 0 0 0 Y 0 = 1, all others are 0 0 0 1 Y 1 = 1, all others are 0 0 1 0 Y 2 = 1, all others are 0 0 1 1 Y 3 = 1, all others are 0 1 0 0 Y 4 = 1, all others are 0 1 0 1 Y 5 = 1, all others are 0 1 1 0 Y 6 = 1, all others are 0 1 1 1 Y 7 = 1, all others are 0 Slide 8 of 25 slides Revised August 13, 2010

This follows from the equations. Circuit for a 3 to 8 Decoder Slide 9 of 25 slides Revised August 13, 2010

The Enable Input Again, in the above circuit one output will always be active. Suppose we want to have a decoder with no outputs active. This is the function of the enable input, often denoted as E. In an enabled high decoder, when E = 0 no output is active when E = 1 the selected output is active Here is the circuit diagram for a 2 to 4 decoder with enable input. Slide 10 of 25 slides Revised August 13, 2010

Decoders: Circuit Symbols and Truth Tables We normally draw a decoder as a box, with inputs to the left and outputs to the right. Note that the enable is drawn at the bottom. The truth table for an active high 2 to 4 decoder that is enabled high follows. Enable X 1 X 0 Y 0 Y 1 Y 2 Y 3 0 d d 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 0 0 1 The d indicates that when Enable = 0, all outputs are 0 independent of X 0, X 1 Slide 11 of 25 slides Revised August 13, 2010

What Do the Terms Mean? Consider a two to four decoder, with two inputs (X 1 and X 0 ). 1. Which output becomes active for a given input pattern? This is specified by the definition of a decoder. 2. Does the active output go to logic high or logic low? For TTL, this is +5 volts or 0 volts. 3. How to manage the case in which no output should be active? Slide 12 of 25 slides Revised August 13, 2010

Active High vs. Active Low Here are two decoders. One is active high and one is active low. In each, output 2 has been selected. In both circuits, we imagine each of the four outputs as attached to a LED, which illuminates when it is fed with a logic 1. In the circuit at left, only the selected output illuminates its LED. It is active high. In the circuit at right, every output but the selected output illuminates its LED. It is active low. In many circuits, active low appears to be the preferred mode. Slide 13 of 25 slides Revised August 13, 2010

Active Low, Enabled Low Two to Four Decoder Here is a truth table for this circuit. If Enable = 1, all outputs are 1. Enable X 1 X 0 Y 0 Y 1 Y 2 Y 3 1 d d 1 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 0 1 0 1 1 0 1 0 1 1 1 1 1 0 If Enable = 0, then the input (X 1 X 0 ) selects the output that is enabled. Here are the equations for the circuit. Here the enable is denoted by E. Slide 14 of 25 slides Revised August 13, 2010

Circuit for the Enabled Low, Active Low Two to Four Decoder Here it is. E denotes the enable input, but is not properly labeled as enable low. I wanted the circuit to be a bit simple. Slide 15 of 25 slides Revised August 13, 2010

Where are the Decoders? One will note that the Multi Media Logic tool does not provide a decoder circuit. Fortunately, a 1 to 2 N demultiplexer can be made into an N to 2 N decoder. Look at the circuit to the left. The control signals C1,C0 select the output to receive the input X. This is exactly equivalent to a decoder. In the circuit at right, the selected output gets the input, now called Enable. For the demultiplexers we use, the other outputs get a logic 1. We can fabricate an active low decoder. Slide 16 of 25 slides Revised August 13, 2010

The MUX as an Active Low Decoder Here is the 2 to 4 Demultiplexer as an 2 to 4 active low decoder. Here is an answer to one of the homework problems: use a 2 to 4 decoder for XOR. The function is either (1, 2) or (0, 3). Slide 17 of 25 slides Revised August 13, 2010

Circuit Simulation Results Enabled, Input 2 Not Enabled Here we see a composite of two screen shots from Multimedia Logic. At left, the decoder is enabled and input 2 is selected. The selected output is logic 0. All other outputs are logic 1. At right, the decoder is not enabled. All outputs are logic 1. Slide 18 of 25 slides Revised August 13, 2010

Design with an N to 2 N Decoder An N to 2 N decoder has N inputs, 2 N outputs, and some control lines. We can use such a decoder to implement any Boolean expression of N variables. The two types of decoders are active high and active low. Active high decoders, connected to OR gates, are used to implement Boolean expressions in SOP (Sum of Products) form. Active low decoders, connected to AND gates, are used to implement Boolean expressions in POS (Product of Sums) form. We do not discuss these. Summary: 2 Boolean variables 2 to 4 decoder 3 Boolean variables 3 to 8 decoder 4 Boolean variables 4 to 16 decoder 5 Boolean variables 5 to 32 decoder Slide 19 of 25 slides Revised August 13, 2010

Implementation of SOP Expressions with Active High Decoders These are the two functions that I have been using for quite some time. With the decoder approach, it is best to design from the list expression. If one has a truth table or canonical SOP expression, it is easier to first convert to the list and then proceed with the design. Here are F1 and F2. F1 = (1, 2, 4, 7) and F2 = (3, 5, 6, 7) Just connect the numbered outputs into an OR gate and get the function. Slide 20 of 25 slides Revised August 13, 2010

Active Low Decoders First, let s use 3 to 8 decoders to describe the difference between active high and active low. In the active high decoder, the active output is set to +5 volts (logic 1), while the other outputs are set to 0 volts (logic 0). In the active low decoder, the active output is set to 0 volts (logic 0), while the other outputs are set to +5 volts (logic 1). Slide 21 of 25 slides Revised August 13, 2010

Enabled Low, Active Low Decoders All commercial decoders have an enable input; most are enabled low. Since the decoder is enabled low, when the input signal E = 1, none of the decoder outputs are active. Since the decoder is active low, this means that all of the outputs are set to logic 1 (+5 volts). Since the decoder is enabled low, when the input signal E = 0, the decoder is enabled and the selected output is active. Since the decoder is active low, this means that the selected output is set to logic 0, and all other outputs are set to logic 1. Slide 22 of 25 slides Revised August 13, 2010

Why Active Low / Enabled Low? This is a conjecture, but it makes sense to me. The active high decoder is providing power to the device it enables. The active low decoder is just providing a path to ground for the device it enables. It is likely that this approach yields a faster circuit. Slide 23 of 25 slides Revised August 13, 2010

Back To Active High: A Look At F2 Seeking a gate that outputs 1 if at least one of its inputs is 1, we are led to the OR gate. Slide 24 of 25 slides Revised August 13, 2010

Active Low: F2(X, Y, Z) = (0, 1, 2, 4) F2 is 1 if and only if none of the outputs Y 0, Y 1, Y 2, or Y 4 are selected. Specifically, each of those outputs must be a logic 1. This leads to an AND gate implementation. Slide 25 of 25 slides Revised August 13, 2010