# Designing 4-to-2 Simple Encoder

## What is a Simple Encoder

In digital electronic an encoder is the logic device that converts 2^{N} input signals to N-bit coded outputs.
A simple encoder circuit is one-hot to binary converter.
That is, only one of input lines allowed to be in 1, binary code of this 'hot' line is produced a on the N-bit output.

## Defining the Truth Table

Let define the truth table for 4 inputs and 2 outputs simple encoder:

#TABLE: x1,x2,x3,x4 => y1,y2 0001 => 00 0010 => 01 0100 => 10 1000 => 11

## Building the K-Maps

Launch Gorgeous Karnaugh and select “File” — “New” — “From truth table” menu item. In the dialog window that appears, enter the above truth table, then press “Ok” button. The truth table will be accepted and K-Maps will be built:

## Minimizing the K-Maps

Let minimize the K-Maps for Product-of-Sums (by 0):

and get the functions minimal form:

y1 = (x1|x2); y2 = (x1|x3);

Let minimize the K-Maps for Sum-of-Products (by 1):

and get the functions minimal form:

y1 = !x3 !x4; y2 = !x2 !x4;

## Building the Logic Gate Diagrams

In the “Coverage sets” pane select the needed coverage set. Next, select the “Coverages” — “Open Schematic”. In the appeared dialog window select appropriate diagram generation options, and press “Ok” button. After this, you got the logic gate diagram.

Logic gate diagrams for PoS and SoP:

## Checking Logic Gate Diagram in a Simulator

You can use “CEDAR Logic Simulator” program to check how your logic gate diagram works. For this, choose menu item “File” — “Save for CedarLogic” in the Gorgeous Schematic, save the “.CDL” file and open it in the “CEDAR Logic Simulator”.

Note: Not all versions of Gorgeous Karnaugh software supports export logic gate diagrams to CedarLogic. Check you version features here.

## Gorgeous Karnaugh Versions

You can learn about Gorgeous Karnaugh features and compare diferences between Gorgeous Karnaugh versions on the Gorgeous Karnaugh features page.