code converter that converts 4-bit binary to 4-bit gray code

Thread Starter

PauAgGiron

Joined Oct 27, 2014
8
Hi guys so I am stuck in this question. I am supposed to convert a 4-bit binary to 4-bit gray code and do the following.

1) Give out the truth table for the code converter (GOT IT!)
2) Perform two implementations: a decoder plus OR gates (GOT IT!) , and a decoder plus an encoder. That is basically to remap the minterm of binary code to the corresponding minterm of gray code.

I am stuck trying to figure out how to draw the decoder plus an encoder part. Any ideas??

Thank yo in advance :)
 

WBahn

Joined Mar 31, 2012
29,978
I don't know what you mean by "a decoder plus OR gates"?

Are you supposed to implement two circuits, an encoder to go from binary to gray and a decoder to go from gray to binary?

Note that there is no single gray code -- a gray code is merely any sequence of states in which only a single bit changes between any two adjacent states. What you are probably working with is what is known as a "reflected gray code", although there are more ways to construct that than just a single way. So you need to provide a description of the specific gray code sequence you are working with.
 

Thread Starter

PauAgGiron

Joined Oct 27, 2014
8
I don't know what you mean by "a decoder plus OR gates"?

Are you supposed to implement two circuits, an encoder to go from binary to gray and a decoder to go from gray to binary?

Note that there is no single gray code -- a gray code is merely any sequence of states in which only a single bit changes between any two adjacent states. What you are probably working with is what is known as a "reflected gray code", although there are more ways to construct that than just a single way. So you need to provide a description of the specific gray code sequence you are working with.
I am supposed to implement just one circuit. Going from binary to gray code. Based on the truth table I am being asked to implement the circuit in two ways. One with a decoder and OR gates.

What I mean by a decoder plush OR gates is this: for each bit of the output, you can use a OR gate to put together all the minterms. I am attaching a picture to show you how I did it. The problem I am having is coming out with the implementation with the decoder and encoder.
 

Attachments

Last edited:

WBahn

Joined Mar 31, 2012
29,978
Got it. When you said "decoder plus OR gates" I was thinking of "decoder" as being the circuit that converted from gray to binary. But you are talking about a basic 4:16 decoder - and now I know what you mean by the decoder plus encoder part, too.

When attaching images, please take the time to make them a reasonable size. Many of us have slow connections and or download limits (for instance, those of us with satellite internet) and we just can't justify burning it up on an image that is about 100x bigger than it needs to be. Fortunately, right now I have a high speed connection so I've converted this one for you -- and all I did was use Paint to resize it to be 300 pixels wide and, poof, a factor of well over 100 smaller.

20141027_171102_1.jpg

Think about what a decoder and an encoder do:

A decoder puts a HI on exactly one output line corresponding to exactly one of the possible combinations of the input signals.

An encoder puts out exactly one of the possible combinations of the output bits when exactly one of its input signals is HI.

Now think about your basic problem -- you want to map exactly one combination of input signals to exactly one combination of output signals.
 

Thread Starter

PauAgGiron

Joined Oct 27, 2014
8
Got it. When you said "decoder plus OR gates" I was thinking of "decoder" as being the circuit that converted from gray to binary. But you are talking about a basic 4:16 decoder - and now I know what you mean by the decoder plus encoder part, too.

When attaching images, please take the time to make them a reasonable size. Many of us have slow connections and or download limits (for instance, those of us with satellite internet) and we just can't justify burning it up on an image that is about 100x bigger than it needs to be. Fortunately, right now I have a high speed connection so I've converted this one for you -- and all I did was use Paint to resize it to be 300 pixels wide and, poof, a factor of well over 100 smaller.

View attachment 74730

Think about what a decoder and an encoder do:

A decoder puts a HI on exactly one output line corresponding to exactly one of the possible combinations of the input signals.

An encoder puts out exactly one of the possible combinations of the output bits when exactly one of its input signals is HI.

Now think about your basic problem -- you want to map exactly one combination of input signals to exactly one combination of output signals.



So would it simply be this? :
 

Attachments

Thread Starter

PauAgGiron

Joined Oct 27, 2014
8
Think about what a decoder and an encoder do: A decoder puts a HI on exactly one output line corresponding to exactly one of the possible combinations of the input signals. An encoder puts out exactly one of the possible combinations of the output bits when exactly one of its input signals is HI. Now think about your basic problem -- you want to map exactly one combination of input signals to exactly one combination of output signals.[/QUOTE said:
Thank you!!! I get it now. Basically I need to map the minterms of binary code to the corresponding minterms of gray code.
 

MrCarlos

Joined Jan 2, 2010
400
Hello PauAgGiron

Your design seems to work. I did a run on my simulator ISIS from Proteus.

Like this simulator does not have an IC that does not invert its output I used a NOT gates in its outputs.
since neither has 8 input OR gates I used NOR gates with NOT gates at the outputs.

Since it is an assignment for you must do your design as somebody told you; but it would be easier using XOR gates with 2 inputs.

By the way. looks more professional designs making them in any simulator.

.
 

Attachments

Top