# Öncelik Kodlayıcı / Priority Encoder

 Kombinasyonel Mantık Devreleri Kombinasyonel Mantık Devreleri 7 Segment Display Çözücü / Display Decoder İletim Kapısı / Transmission Gate Çoklayıcı / The Multiplexer (MUX) İkili Toplayıcı / Binary Adder Analog Dijital Dönüştürücü Çoğullayıcı / The Demultiplexer Dijital Karşılaştırıcı / Digital Comparator İkili Ağırlıklı DAC Öncelik Kodlayıcı / Priority Encoder İkili Çıkarıcı / Binary Subtractor R-2R Merdiven Tipi DAC / R-2R DAC İkili Kod Çözücü / Binary Decoder BUS Alıcı-Verici / BUS Transceiver

We examined a multiplexer (multiplexer) in our last article that selected a single data input line and then sent this data to a single output line or key. Unlike them, the digital encoder, called a binary encoder, receives all data entries one by one. It then converts them into a single encoded output. Therefore, we can say that the level of logic in the inputs of the binary encoder is a multi-input combinational logic circuit that converts the data "1" into equivalent binary code at the output.

In general, digital encoders produce outputs of 2-bit, 3-bit, or 4-bit codes, depending on the number of data entry lines. An "n-bit" binary encoder has 2n input lines and n-bit output lines with common types that include 4×2, 8×3 and 16×4 line configurations.

The output lines of a digital encoder form the binary equivalent of the input line with a value equal to "1". An input pattern of decimal or hexadecimal is typically a binary or "B. C. D" (binary encoded dex) can be used to encode to exit code.

## 4×2 Bit Binary Encoder

One of the biggest drawbacks of standard digital encoders is that they can generate incorrect output code when there is more than one input at the logic level "1". For example, if we make the D1 and D2 entries high in the logic of "1" at the same time, the resulting output will not be either "01" or "10". However, there will also be an exit binary number "11" that is different from the actual entry.

A simple way to overcome this problem istoprioritize the level of each input pin. Therefore, if there are more than one entry at the logic level "1" at the same time, the actual exit code corresponds only to the entry with the highest priority specified. This type of digital encoder is then commonly known as the priority encoder or P-encoder for short.

## Priority Encoder

The priority encoder resolves the above-mentioned issues by allocating a priority level to each entry. The output of priority encoders corresponds to the current active input, which has the highest priority. Therefore, when there is an entry with a higher priority, all other entries with a lower priority are ignored.

The priority encoder comes in many different ways with an 8-entry priority encoder example with the accuracy table shown below.

## 8×3-Bit Priority Encoder

Priority encoders are available in standard IC form. TTL 74LS148 is a priority encoder with eight active low (logic "0") inputs that provides a 3-bit code for the highest-rated input at the exit.

Priority encoders first extract input from the highest order. For example, if the "D2", "D3" and "D5" input lines are applied at the same time, the exit code will be for the entry "D5" ("101"). Because it has the highest rank of 3 entries. After the "D5" entry is removed, the next highest exit code will be for the "D3" ("011") entry.

The accuracy table for the 8×3-bit priority encoder is as follows:

Where x can be at the "level" level of logic" 0 or at the level of "a logic" 1". This means that it can have both states from this accuracy table, with D0-D7 data entries for the above encoder and The Boolean expression with outputs Q0, Q1, Q2 as follows:

## Priority Encoder Output Expression

In practice, these zero entries will be ignored by allowing the last Boolean expression to be applied for the outputs of the 8×3 priority encoder. Using individual or doors as follows, we can create a simple encoder from the above statement.

## Digital Encoder Applications

### Keyboard Encoder

Priority encoders can be used to reduce the number of cables needed in a given circuit or in an application with multiple inputs. For example, suppose a microcomputer should read the 104 key of a standard QWERTY keyboard, and at any given time only one key will be pressed "high" or "low".

One way would be to connect all 104 wires directly to the computer input from the individual keys on the keyboard, but this will not be practical for a small home computer. Another alternative and a better way would be to connect the keyboard to the PC using a priority encoder.

104 separate buttons or keys can only be encoded in a standard 7-bit (0 to 127 decimal) STANDARD ASCII code to represent each key or character of the keyboard. Then a much smaller 7-bit B. C. can be entered as code d. Keypad encoders such as the 74C923 20-key encoder can be used to do this.

### Positional Encoders

Another common application is magnetic positional control, which is used for applications such as ship navigation or Robotic arm positioning etc. Here, for example, the angular or rotary position of a compass is converted into a digital code by the 74LS148 8×3 line-priority encoder. The system computer is logged in to provide navigation data, and here's an example of a 3-bit output compass encoder from a simple 8 position.