Unformatted text preview:

Lecture 7 EGR 270 Fundamentals of Computer Engineering Reading Assignment Chapter 3 in Logic and Computer Design Fundamentals 4th Edition by Mano Combinational Functions and Circuits Functions and fundamental circuits are introduced in this chapter which are useful in designing larger digital circuits These circuits are presented as functional blocks fundamental reusable circuits The focus is to develop the functional blocks such that they are reusable are easily expanded for use with larger functions and are efficiently designed for implementing via VHDL programming Examples of functional blocks to be introduced Decoders Encoders Priority encoders Multiplexers De multiplexers Magnitude Comparators Programmable Logic Chapter 6 1 Lecture 7 EGR 270 Fundamentals of Computer Engineering Combinational Logic Using MSI and LSI devices Although our focus will be more on defining functional blocks that are designed to be reusable and to be implemented using VHDL many of these fundamental circuits are also available as commercially available IC s Commercial devices can perform complex functions using perhaps a single IC thus saving space They are typically faster that equivalent circuits that we might build using discrete logic gates It might be a good idea to browse through a Logic Data Book to see what is available A few devices are listed below Assortment of commercially available combinational logic devices 2 Lecture 7 Decoders EGR 270 Fundamentals of Computer Engineering An N bit decoder has 2N outputs only one of which may be activated at a given time If the device is active HIGH then only one output may be HIGH at any time If the device is active LOW then only one output may be LOW at any time Example A 3 bit decoder might also be called a 3 line to 8 line decoder or a 3x8 decoder The block diagram is shown below Input Code x y z 22 3x8 21 Decoder 20 D0 D1 D2 D3 D4 D5 D6 D7 Only one output is activated HIGH Discuss basic operation the truth table 3 Lecture 7 EGR 270 Fundamentals of Computer Engineering Active LOW versus Active HIGH decoders Enable lines essentially act as ON OFF switches Example Show the truth table and block diagram for an active LOW 2x4 decoder with an enable line E 4 Lecture 7 EGR 270 Fundamentals of Computer Engineering Circuit Design Show that decoder outputs are essentially minterms and draw a circuit for 1x2 decoder no enable active HIGH outputs 2x4 decoder no enable active HIGH outputs 3x8 decoder no enable active HIGH outputs Note the gate input count on the 2x4 and 3x8 decoder circuits 5 Lecture 7 EGR 270 Fundamentals of Computer Engineering Decoder expansion using hierarchy The text introduces a procedure for forming any n x 2n decoder by expanding smaller decoders The result requires only 2 input AND gates rather than n input and inverters This technique is especially useful for building large decoders using reusable fundamental blocks Figure 3 19 below illustrates a 3x8 decoder constructed using this method 6 Lecture 7 EGR 270 Fundamentals of Computer Engineering Implementing Boolean functions using decoders Note that the decoder outputs for active HIGH decoders are simply minterms so F minterms active HIGH decoder outputs Example Implement f A B C 0 3 5 6 using a 3 x 8 decoder with active HIGH outputs Note that the decoder outputs for active LOW decoders are simply maxterms so F maxterms active LOW decoder outputs Example Implement f A B C 0 3 5 6 using a 3 x 8 decoder with active LOW outputs 7 Lecture 7 EGR 270 Fundamentals of Computer Engineering Decoder IC s 74155 Data Sheet dual 2x4 decoder single 3x8 decoder see next page The 74156 is similar to the 74155 except that it has open collector outputs instead of totem pole outputs discuss the advantage of this Show how to connect the 74155 as a 2x4 decoder and also as a 3x8 decoder Show how to use two 74155 s to form a 4x16 decoder 8 Lecture 7 EGR 270 Fundamentals of Computer Engineering 9 Lecture 7 EGR 270 Fundamentals of Computer Engineering Encoder An encoder is essentially the opposite of a decoder An N bit encoder has 2N inputs lines one of which is active and N output lines that carry the binary code corresponding to the active input The 8 x 3 encoder shown below might also be called an octal to binary encoder Only one input is activated active HIGH inputs shown D0 D1 D2 D3 D4 D5 D6 D7 8x3 Encoder 22 21 20 x y z Output Code Example Show an encoder with sample inputs and outputs 10 Lecture 7 EGR 270 Fundamentals of Computer Engineering Note that encoders and decoders perform the opposite functions Example Show an 8x3 encoder followed by a 3x8 decoder with some sample inputs and outputs Example Show a 3x8 decoder followed by an 8x3 encoder with some sample inputs and outputs 11 Lecture 7 EGR 270 Fundamentals of Computer Engineering Basic Encoder Design Draw the truth table for an 8x3 encoder From the truth table determine expressions for the outputs x y and z Valid Output One problem with the encoder design above is that there is no way to indicate that an invalid input occurred This problem can be resolved by using an additional output called a valid line V D0 D1 D2 D3 D4 D5 D6 D7 8x3 Encoder 22 21 20 V x Output y Code z V 1 for a valid code 0 if invalid 12 Lecture 7 EGR 270 Fundamentals of Computer Engineering Decoders and Encoders Applications Decoders can be used to reduce the number of wires needed to control multiple outputs Encoders can be used to reduce the number of wires needed to read multiple inputs These wires might be to external devices or might be within a digital circuit Encoder Example 1 Reading 256 external sensors with a computer Suppose that a computer was used to read the status of 256 sensors in a special application where only one sensor would ever be HIGH at a given time One option would be to find a 256 pin connector to work with the computer good luck A better option would be to use an 256x8 encoder and use an 8 bit connector on the computer The computer could then simply read the code to determine which sensor was activated Encoder Example 2 Reading a keyboard Encoders are also used in keyboards Rather than send over 100 different signals from the keyboard corresponding to the key that has been pressed the keys are encoded using an ASCII code A 7 bit ASCII code is sufficient to represent all keys along with a 128x7 encoder 13 Lecture 7 EGR 270 Fundamentals of Computer Engineering Encoder Example 3 IEEE sponsors competitions for students in electrical and computer


View Full Document
Loading Unlocking...
Login

Join to view Combinational Functions and Circuits and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Combinational Functions and Circuits and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?