Hades logoHades applet banner
Priority Encoder (4:2 bits)

applet icon

The image above shows a thumbnail of the interactive Java applet embedded into this page. Unfortunately, your browser is not Java-aware or Java is disabled in the browser preferences. To start the applet, please enable Java and reload this page. (You might have to restart the browser.)

Circuit Description

A 4-bit priority encoder (also sometimes called a priority decoder). This circuit basically converts the 4-bit input into a binary representation. If the input n is active, all lower inputs (n-1 .. 0) are ignored:

x3 x2 x1 x0  y1 y0
------------------
 1  X  X  X   1  1
 0  1  X  X   1  0
 0  0  1  X   0  1
 0  0  0  X   0  0

The circuit operation is simple. Each output is driven by an OR-gate which is connected to the NAND-INV outputs of the corresponding input lines. The NAND gate of each stages receives its input bit, as well as the NAND gate outputs of all higher priority stages. This structure implies that an active input on stage n effectively disables all lower stages n-1 .. 0.

Note that the circuit function as specified here does not depend at all on the least significand input bit.

A common use of priority encoders is for interrupt controllers, to select the most critical out of multiple interrupt requests. Due to electrical reasons (open collector outputs), priority encoders with active-low inputs are also often used in practice.

Print version | Run this demo in the Hades editor (via Java WebStart)
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German)
Impressum http://tams-www.informatik.uni-hamburg.de/applets/hades/webdemos/10-gates/45-priority/priority42.html