Ch6 - CODE CONVERSION PDF

Title Ch6 - CODE CONVERSION
Course Digital Electronics
Institution Universiti Teknologi MARA
Pages 13
File Size 894.3 KB
File Type PDF
Total Downloads 39
Total Views 148

Summary

CODE CONVERSION
Objectives :
Encoder and decoder
Priority Encoder
Display decoder
Application of decoder
...


Description

CHAPTER 6 CODE CONVERSION Objectives 

Encoder and decoder



Priority Encoder



Display decoder



Application of decoder

80

Code Conversion

6.1 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. For example, code conversion take 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. Consider the 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 seven-segment display.

6.2 Encoder Encoders are 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 or 10:4 encoders. 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.

81

Code Conversion

The diagram show below is a truth table for a 10:4 encoder, with active- high inputs, which means that they are normally low. If decimal input 4 is activated, the output in BCD is 0100.

We can write the output expressions and obtained the logic circuit as shown below.

Example 1: Design a 4:2 encoder, where only one input is active at any one time.

82

Code Conversion

The 4:2 encoder truth table can be written in full as follows. We may consider an output X, for inputs other than 0000, 0100, 0010 and 0001.

The output expressions are

6.3 Priority Encoder The simple 10:4 encoder in 6.2 identifies a drawback when more than one input is activated at one time. If the input 3 and 5 are activated simultaneously, the output is a BCD 0111 (7), which is not a correct output for either activated input. 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). The 10:4 priority encoder with active-high inputs is shown below.

83

Code Conversion

As an example, suppose any of the input 0, 1 or 2 is activated, the output is a BCD 0010. This is shown on the truth table as: 0 X

1 X

2 1

3 0

4 0

5 0

6 0

7 0

8 0

9 0

5 0 0 0 0

6 0 0 0 0

7 0 0 0 0

8 0 0 0 0

9 0 0 0 0

A 0

B 0

C 1

D 0

A 0 0 0 0

B 0 0 0 0

C 1 1 1 1

which represent 0 0 0 1 1

1 0 1 0 1

2 1 1 1 1

3 0 0 0 0

4 0 0 0 0

The output expressions can be written as:

This can be further simplified as:

D 0 0 0 0

84

Code Conversion

Example 2: Design a 4:2 priority encoder.

From the truth table, the expressions can be written as

This can be simplified using Boolean algebra

The 4:2 priority encoder truth table can be written in full as follows.

85

Code Conversion

The expressions can be simplified using Karnaugh Map as:

The 74147 and 74148 are two common IC encoders. The 74147 is a 10:4 priority encoder that performs the code conversion from decimal to BCD. The 74147 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. The 74148 is an 8:3 priority encoder for performing the code conversion from octal to binary. It has 8 input for values 0 through 7 and 3 outputs A0,A1 and A2. Both the inputs and outputs are active-low.

6.4 Decoder A decoder may be thought of as the opposite of an encoder. To reverse the process in section 6.2 would produce a decoder that translate from the BCD code to decimals. The BCD codes form the input on the left of the decoder, and the 10 output lines are on the right. Only one output line will be activated at any one time. A BCD 0011 input would activate the 3 output.

86

Code Conversion

We can write the output expressions and obtained the logic circuit as shown below.

87

Code Conversion

Example 1: Design a 2:4 decoder. A 2:4 decoder has 2 inputs and 4 outputs.

The output expressions and the logic circuit is shown below.

The 7442 is 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.

88

Code Conversion

6.5 Decoder Applications We can construct a Boolean expression using a decoder and logic gates. A two variable Boolean expression for a 2:4 decoder and an OR gate.

can be constructed using

A three variable Boolean expression can be constructed using a 3:8 decoder and an OR gate.

6.6 Display Decoder A common output device used to display decimal numbers is the seven-segment display. The seven-segments are labeled with standard letters from a to g. For instance, if the segment a, b, c, d and g light, a decimal 3 appears.

89

Code Conversion

Each segment contains a light emitting diode (LED). The LEDs can be connected either common-cathode or common-anode. In the common-cathode display, all the cathodes of the LEDs are connected together. The cathodes are then connected to 0 volt or ground.

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.

90

Code Conversion

6.7 Exercises 1. The diagram show below is a 4:2 encoder.

Prove that output expressions are:

A=2+3 B=1+3

2. a. Derive the 8:3 encoder (Octal-to-binary encoder). b. Write the output expressions.

3. The diagram shown below is a 4:2 priority encoder.

Prove that the output expressions are: A= 2+3

91

Code Conversion

4. The expressions for a 4:2 priority encoder are:

Simplify the expression using Boolean algebra. 5. a. Derive the 3:8 decoder truth table. b. Derive the output expression.

6. Draw the following expressions using a decoder and an OR gate. a. b....


Similar Free PDFs