0% found this document useful (0 votes)
16 views

Chapter 7-Code Converter

Uploaded by

dynzhaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Chapter 7-Code Converter

Uploaded by

dynzhaa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

ITT270 Digital Electronics

Chapter 7
Code Converter
Outline
• Code Converter
• Encoder
• Priority Encoder
• Priority Encoder IC
• Decoder
• Decoder IC
• Decoder Application
• Display Decoder
Code Converter
• Code converter circuit is a general category of
circuits used to perform the operation of
converting from one code to another.
• Code conversion is performed by encoder,
decoder and code converter circuits.
• Example, code conversion takes place each
time a key is pressed on a computer keyboard,
telephone pad, a microwave oven keypad or
any similar device where input values are
entered into a system for processing.
• Code conversion is required to operate the
electronic displays that show numbers or letters
on calculators and clocks.
Block diagram of a simple calculator
• The input device is a keyboard where you enter
numbers.
• Between the keyboard and the CPU is an
encoder. The encoder translates the decimal
number pressed on the keyboard into a binary
code such as BCD code.
• The CPU performs its operation in binary and
puts out a binary code. The decoder translates
the binary code from the CPU to a display.
Encoder
• Used extensively in keyboard applications where
activation of a single key must produce a
unique binary code to represent its value.
• Encoders have several inputs, but it converts
only one input at a time into a binary code.
• Encoders are usually specified by the number of
inputs to outputs such as 4:2, 8:3 ,10:4 or 16:4
encoders.
Example
• The job of the encoder in the calculator is to translate
a decimal input to a BCD number.
• A block diagram for a decimal-to-BCD or 10:4 encoder
is shown below.
• The encoder has 10 inputs on the left and 4 outputs
on the right.
• The encoder may have one active input and produces
a unique output.
Truth Table For A 10:4 Encoder
• The inputs are normally low. If a decimal input 4 is
activated (active high), the output is 0100.
Encoder Output Expression and
Obtained Logic Circuit
Example 1 - 4:2 Encoder

• Design a 4:2 encoder, where only one


input is active at any one time.
4:2 Encoder

• 4:2 encoder output expressions can be written in full


as follows.
Priority Encoder
• Simple 10:4 encoder has a drawback when more than
one input is activated.
• A modified version of this circuit, called priority
encoder, includes the necessary logic to ensure that
when 2 or more inputs are activated, the output code
will correspond to the highest numbered input.
• For example, when both 3 and 5 are activated, the
output code will be 0101 (5). Similarly if 3, 4, 5 and 8
are activated, the output code will be 1000 (8).
…Priority Encoder
• The 10:4 priority encoder with active-high
inputs is shown below.
…Priority Encoder
• Suppose if any of the input 0, 1 or 2 is activated, the
output is 2. This is shown on the truth table as:
…Priority Encoder
Example 2 – A 4:2 Priority Encoder
A 4:2 Priority Encoder
4:2 Priority Encoder Truth Table

• The expressions can also be


simplified using Karnaugh
Map as:

• The 74147 and 74148 are


two common IC encoders.
74147 IC Encoders
• A 10:4 priority encoder that performs the code
conversion from decimal to BCD.
• Has active-low inputs and active-low outputs.
• Although the 74147 is classified as 10:4 encoder,
the IC itself has only 9 inputs for values 1 to 9.
• The 0 input is assumed when no other keys are
pressed.
74148 IC Encoders
• An 8:3 priority encoder for performing the code
conversion from octal to binary.
• Has 8 input for values 0-7 and 3 outputs A0, A1
and A2.
• Both the inputs and outputs are active-low.
Decoder
• The opposite of an encoder
• A decoder translates from BCD code to decimals.
• The BCD codes form the input and the 10 output
lines.
• Only one output line will be activated at any one
time.
• Example: A BCD 0011 input would activate the
output 3.
Decoder Truth Table
4:10 Decoder
Example

• Design a 2:4 decoder.


• A 2:4 decoder has 2 inputs and 4 outputs.
2:4 Decoder
• The output expressions and the logic
circuit for 2:4 decoder
7442: A BCD-to-Decimal Decoder
• The small bubbles attached to logic symbol indicate
that the outputs are active low.
• They normally float High except when activated. A
BCD 0011 will activate the decimal output 3 to Low
state. The inverter complements this output to a High
state.
Decoder Applications
• We can construct a Boolean expression using a
decoder and logic gates. A two variable Boolean
expression for can be constructed
using a 2:4 decoder and an OR gate.
...Decoder Applications
• A three variable Boolean expression can be
constructed using a 3:8 decoder and an OR gate.
Display Decoder
• A common output device used to display decimal
numbers is the seven-segment display.
• The seven-segments are labelled with standard
letters from a to g.
• For instance, if the segment a, b, c, d and g lights on,
a decimal 3 appears.
Truth Table for Display Decoder
...Display Decoder
• Common seven-segment display decoders are 7446,
7447, 7448 and 7449.
• The 7448 circuit is designed to drive the
common-cathode display. Suppose the inputs to the
decoder are 0011, this will activate the segment a, b,
c, d and g to display the number 3.

You might also like