ETEC 23 Programmable Logic Devices Chapter 8 Functions of Combinational Logic Shawnee State University Department of Industrial and Engineering Technologies Copyright 27 by Janna B. Gallaher
Basic Adders Adders are included in all microprocessors and re needed in many other types of digital systems The Half-Adder Accepts two binary digits on its inputs and produces two binary digits on its outputs, a sum bit and a carry bit. A B Cout
Basic Adders Full-Adder Accepts two input bits and an input carry and generates a sum output and an output carry. A B Cin Cout
Basic Adders Full-Adders (continued) We can also implement Full-Adders using Half-Adder blocks
Parallel Binary Adders Two or more full-adders are connected to form parallel binary adders Note how the Carry Out bit from the Least Significant Bit is propagated to the next Most Significant Bit.
Parallel Binary Adders Four-Bit Parallel Adder Four bits are called a nibble. C = carry in to least significant bit C4 = output carry of the most significant bit - 4 = the sum outputs Truth Table for Each Stage
Parallel Binary Adders 74LS283 4-Bit Parallel Adder Commercially available IC implements a 4-Bit parallel adder.
Parallel Binary Adders Adder Expansion Cascading 4-bit adders provides for 8-bit or 6-bit or more complex adders. To make it work, connect the Cout from the less significant bit to the more significant bit and connect C to ground.
Ripple Carry Versus Look-Ahead Carry Adders The Ripple Carry Adder Full-adders are cascaded => propagation times also cascade Simple, but can be problematic from a propagation delay perspective Note that even though each adder has 8 ns delay, the full delay is 32 ns.
Ripple Carry Versus Look-Ahead Carry Adders The Look-Ahead Carry Adder Attempts to fix the propagation delay time problem of ripple carry adders by incorporating some carry look-ahead logic Carrys happen when: A OR B is with a Carry In A AND B is with no Carry In A AND B is with a Carry In
Comparators Comparators are used to compare two binary quantities to determine the relationship of those quantities. Equality EXOR gates form a simple -bit comparator Multi-bit comparators can be built using the outputs of EXNOR gates ANDED together
Comparators Inequality This IC compares two nibbles (4-bit numbers) and determines if they are equal, if A>B, or if A < B. Inequality is can be determined by ORing the A>B and the A<B outputs together. The 74HC85 4-Bit Magnitude Comparator
Decoders The Basic Binary Decoder Decoders are used for a variety of applications such as data line selectors, in A/D converter systems, etc. They can be made to generate a specific output code on a specific combination of input bits. This example shows that a specific combination or 4-data inputs can be decoded to give an output when the inputs are. Other circuits can be made to decode other combinations.
Decoders The 4-Bit Decoder Commercial ICs are made that decode 4-bits to a -of-6 output. Binary Inputs 74HC54 -of-6 Decoder Outputs A3 A2 A A 2 3 4 5 6 7 8 9 2 3 4 5 2 3 4 5 6 7 8 9 2 3 4 5
Decoders An Application Port Address Decoder Selects output port so that the data bus can be shared Provides expansion of expensive resources
Decoders The BCD-to-Decimal Decoder Converts binary numbers to decimal numbers 4-line-to--line decoder or -of- decoder Note that only one output line goes low on one of the combinations of the 4 input bits. Numbers through 5 are not allowed. (binary through )
Decoders The BCD-to-7-Segment Decoder There are a significant number of instruments and devices that rely on 7segment displays. For these a specific decoder has been devised. 74LS47 BCD-To-7-Segment Decoder/Driver Note that this IC also has driver electronics so that it can directly illuminate the segments.
Encoders The Decimal-to-BCD Encoder Essentially the reverse of a decoder they take a -of-many inputs and turn them into a binary number output. They are especially useful in applications such as keyboards, keypads, and other input devices. 74HC47 Decimal-To-BCD Encoder 74LS48 8-Line-To-3-Line Encoder
Encoders An Application Simplified Keyboard Encoder This scheme can be used in security system number pads, keyboards, or input devices to control systems. The use of dedicated hardware speeds up the system and unloads the microprocessor. But it does add cost and complexity to the system.
Code Converters Dedicated ICs to convert one type of code to another (e.g. BCD to Binary) BCD-to-Binary Conversion Binary-to-Gray and Gray-to-Binary Conversion Gray codes are used in communications, Karnaugh maps, angle measuring devices, etc. 4-Bit Gray-To-Binary Conversion Logic
Multiplexers (Data Selectors) Multiplexers are used to share some resource (data line, bus, etc.) There are several data lines input to the device but only one of them routed to the output at a time. Sometimes these devices are called Data Selectors Typical MUX IC Equivalent Logic Diagram for MUX
Multiplexers (Data Selectors) Two commercial Multiplexers: 74HC57 Quad 2-Input-Data Selector/Multiplexer 74LS5 8-Input Data Selector/ Multiplexer
Multiplexers (Data Selectors) Application 7-Segment Display Multiplexer Note that only one Decoder/driver is needed to create a 2-digit display. The multiplexer enables each of the 7-segment displays in alternately while the decoder applies the appropriate signal. The displays appear to be on constantly since the speed is faster than the persistence of vision.
Demultiplexers Essentially the opposite function of Multiplexers Takes one input and distributes it to -of-n data output lines. Typical Demultiplexing Logic 74HC54 Demultiplexer
Parity Generators/Checkers Parity generators are used to insure that data transmission are intact Parity can be either even or odd or none It is an extra bit added on to the data that is either set or unset to generate the parity Even parity => the total number of s in the code is an even number Odd parity => the total number of s in the code is an odd number Basic Parity Logic The sum (disregarding carries) of an even number of s is always, and the sum of an odd number of s is always. x = (Low) when the number of s on the inputs are even x = (High) when the number of s on the inputs is odd.
Parity Generators/Checkers 74LS28 9-Bit Parity Generator/Checker
Using 74XX Functions is Programmable Logic Quartus II 74XX Devices Xilinx ISE 74XX Devises Standard 74XX Quartus Devices Standard 74XX Xilinx Devices