Encoder Section 4.10. Outline Review: Sum of Products Encoder Priority Decoder Application of...

Post on 24-Dec-2015

237 views 3 download

Tags:

transcript

Encoder

Section 4.10

Outline

• Review: Sum of Products• Encoder• Priority Decoder• Application of Priority Decoder

Definition of an Encoder

• 2n input lines• n output lines• Performs the inverse operation of a

decoder

Review: 3-to-8 Line Decoder

Convert binary information from n input lines to 2n unique outputlines.

This particular circuit take a binary number and convert it to an octal number.

Review of ES112: Sum of Products

𝑓 1=𝑥 𝑦 𝑧+𝑥 𝑦 𝑧+𝑥𝑦𝑧

Hardware Implementation

Example of 8-to-3 Encoder

Application of 8 x 3 Encoder

The angular or rotary position of a compass is converted into a digital code by an encoder and inputted to the systems computer to provide navigational data

Implementation of an Encoder

• Focus on one output at a time

x=D4+D5+D6+D7

Implementation of an Encoder

• Focus on one output at a time

y=D2+D3+D6+D7

Implementation of an Encoder

• Focus on one output at a time

z=D1+D3+D5+D7

Uncertainty of an Encoder

• What if all the input lines are 0?–Use a valid bit

Model an Encoder in Verilog

input : D, an array of 8 elementsoutput: Y, an array of 3 elementsV, a valid bit to check for 00000000 input.

Module Templatemodule module_name ( , , )

endmodule

Input, outputwiresreg

Program Body

Choosing a Module Namemodule module_name ( , , )

endmodule

Input, outputwiresreg

Program Body

Choosing a Module Namemodule module_name ( , , )

endmodule

Input, outputwiresreg

Program Body

x=D4+D5+D6+D7y=D2+D3+D6+D7z=D1+D3+D5+D7

Or all elements of D

Output File

D={D0,D1,D2,D3,D4,D5, D6,D7}Y={Y0,Y1,Y2} (least significant to most significant}

Output File

The output with a higher subscript has a higher priority than an output with a lower subscript.

Priority Encoding

• What if more than one input line are high?–Use priority—certain bits are more

important than other bits

Priority Encoder

Not a Valid State

Karnaugh Map

1

Karnaugh Map

Circuit Implementation