DLLec7b Notes
DLLec7b Notes
1 Encoders
• An encoder is a combinational logic circuit that accepts an active level on one of its inputs representing a digit, such
as a decimal or octal digit, and converts it to a coded output, such as BCD or binary.
• Encoders can also be devised to encode various symbols and alphabetic characters.
• The process of converting from familiar symbols or numbers to a coded format is called encoding.
• That is, if there are 2n input lines, and at most only one of them will be high, the binary code of this ’hot’ line is
produced on the n − bit output lines.
E.g. a 4-to-2 simple encoder takes 4 input bits and produces 2 output bits.
1
Priority Encoder
• If more then two inputs are active simultaneously, the output is unpredictable or rather it is not what we expect it to
be.
• This ambiguity is resolved if priority is established so that only one input is encoded, no matter how many inputs are
active at a given point of time.
The priority encoder includes a priority function.
• The operation of the priority encoder is such that if two or more inputs are active at the same time, the input having
the highest priority will take precedence.
• They are often used to control interrupt requests by acting on the highest priority request.
• The input D3 has the highest priority, D2 has next highest priority, D0 has the lowest priority.
• This means output Y2 and Y1 are 0 only when none of the inputs D1, D2, D3 are high and only D0 is high.
D3 D2 D1 D0 Y2 Y1 Y0
0 0 0 0 0 0 0
0 0 0 1 0 0 1
0 0 1 x 0 1 0
0 1 x x 0 1 1
1 x x x 1 0 0
2 Decoders
• A decoder is a device which does the reverse operation of an encoder, undoing the encoding so that the original
information can be retrieved.
• The same method used to encode is usually just reversed in order to decode.
• In digital electronics, a decoder can take the form of a multiple-input, multiple-output logic circuit that converts coded
inputs into coded outputs, where the input and output codes are different.
E.g. n − to − 2n , binary-coded decimal decoders.
• Decoding is necessary in applications such as data multiplexing, 7 segment display and memory address decoding.
2
Example: Address Decoder
• An address decoder is a decoder circuit that has two or more bits of an address bus as inputs and that has one or
more device selection lines as outputs.
• When the address for a particular device appears on the address bus, the address decoder asserts the selection line for
that device.
• A separate single-device address decoder may be incorporated into each device on an address bus, or a single address
decoder may serve multiple devices.