# Creating a decoder (Graycode to Binary) using 4 nands

• Engineering
• rugerts
In summary, the conversation discusses using a demux datasheet to determine how to use NAND gates to generate binary bits. It is suggested to use the BOUTLx_L signals as inputs and apply DeMorgan's theorem to simplify the logic. The final solution only requires 3 NAND gates with 4 inputs each.
rugerts
Homework Statement
Shown below as a picture.
Relevant Equations
No equations. There's a data sheet that I've provided as a link below.

These are the two questions.Here's a datasheet for the demux I've been using: https://ecee.colorado.edu/~mcclurel/sn74ls138rev5.pdf

Here's my work:
If you need to see how I got these sum functions, here's the work for that:

Now, if you look at the datasheet for the demux (linked above), you'll see its logic diagram. I'm confused as to how I can apply this to my situation to answer the second question about using 4 nand's when the logic diagram shown in the sheet uses 8 nands.

I'm hazarding a guess here, but I think that if you write out the logical expressions using 8 not-ands, you may be able to combine common terms to reduce it to 4 not-ands.

I'm not sure I understand the problem correctly because you haven't indicated what "Experiment 3.2.2" is. But I'm assuming that you are supposed to ultimately generate the original binary bits (not Gray code) from the outputs of the decoder/demux.

You need to use the 7 different BOUTL0_L to BOUTL7_L as inputs to your NAND gates, not the G0, G1, and G2 signals.

Start by filling the remaining elements of the table. (In the table below, the BOUTLx_L are denoted by $\overline{O_x}$ to save space.)

$$\begin{array}{|c | c | c | c | c | c | c | c | c | c | c | c | c | c |} \hline G_2 & G_1 & G_0 & \overline{O_7} & \overline{O_6} & \overline{O_5} & \overline{O_4} & \overline{O_3} & \overline{O_2} & \overline{O_1} & \overline{O_0} & B_2 & B_1 & B_0 \\ \hline 0 & 0 & 0 \\ \hline 0 & 0 & 1 \\ \hline 0 & 1 & 1 \\ \hline 0 & 1 & 0 \\ \hline 1 & 1 & 0 \\ \hline 1 & 1 & 1 \\ \hline 1 & 0 & 1 \\ \hline 1 & 0 & 0 \\ \hline \end{array}$$

Then use the appropriate BOUTLx_L signals (denoted as $\overline{O_x}$ here for short) as the inputs to your NAND gates.

Hint: No Karnaugh maps are necessary. If you find yourself making a K-map, you're making it too complicated. If done correctly, the answer is easy.

Another hint: Don't forget DeMorgan's theorem. A NAND gate not only functions as an AND gate with inverted output, it also functions as an OR gate with inverted inputs.

Also, to be clear, you need a total of 3 NAND gates (not 4), where each gate has 4 inputs.

Last edited:

## 1. How does a Graycode to Binary decoder work?

A Graycode to Binary decoder uses a combination of NAND gates to convert a Graycode input into a binary output. The NAND gates are connected in a specific way to produce the desired output based on the input.

## 2. What is the purpose of creating a Graycode to Binary decoder?

The purpose of creating a Graycode to Binary decoder is to convert a Graycode input, which is a form of binary code with only one bit changing at a time, into a binary output, which is a standard form of binary code. This conversion is useful in various digital applications, such as computer memory and communication systems.

## 3. How many NAND gates are needed to create a 4-bit Graycode to Binary decoder?

A 4-bit Graycode to Binary decoder requires a total of 4 NAND gates. Each NAND gate is connected to two inputs and one output, and they are arranged in a specific way to produce the desired binary output.

## 4. Can a Graycode to Binary decoder be used for larger bit inputs?

Yes, a Graycode to Binary decoder can be extended to larger bit inputs by adding more NAND gates. For every additional bit, 2 more NAND gates are needed to maintain the same functionality.

## 5. What are the advantages of using a Graycode to Binary decoder?

One advantage of using a Graycode to Binary decoder is that it eliminates the possibility of errors during the conversion process. This is because only one bit changes at a time in Graycode, making it easier to decode compared to other binary codes. Additionally, the use of NAND gates allows for a simple and efficient design of the decoder.

• Engineering and Comp Sci Homework Help
Replies
4
Views
4K
• Engineering and Comp Sci Homework Help
Replies
18
Views
6K
• Engineering and Comp Sci Homework Help
Replies
1
Views
2K
• Engineering and Comp Sci Homework Help
Replies
1
Views
1K
• Engineering and Comp Sci Homework Help
Replies
9
Views
3K
• Engineering and Comp Sci Homework Help
Replies
23
Views
35K
• Engineering and Comp Sci Homework Help
Replies
1
Views
4K
• Engineering and Comp Sci Homework Help
Replies
1
Views
5K
• Engineering and Comp Sci Homework Help
Replies
1
Views
4K
• Engineering and Comp Sci Homework Help
Replies
2
Views
4K