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

Discussion in 'Homework Help' started by PauAgGiron, Oct 27, 2014.

  1. PauAgGiron

    Thread Starter New Member

    Oct 27, 2014
    8
    1
    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 :)
     
    oussama123443 likes this.
  2. WBahn

    Moderator

    Mar 31, 2012
    17,751
    4,799
    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.
     
  3. PauAgGiron

    Thread Starter New Member

    Oct 27, 2014
    8
    1
    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.
     
    Last edited: Oct 27, 2014
  4. WBahn

    Moderator

    Mar 31, 2012
    17,751
    4,799
    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.
     
    PauAgGiron likes this.
  5. PauAgGiron

    Thread Starter New Member

    Oct 27, 2014
    8
    1



    So would it simply be this? :
     
  6. PauAgGiron

    Thread Starter New Member

    Oct 27, 2014
    8
    1
     
  7. WBahn

    Moderator

    Mar 31, 2012
    17,751
    4,799
    Can't tell, because you don't identify the encoder input that each output line from the decoder goes to, but you have the right basic topology.
     
  8. WBahn

    Moderator

    Mar 31, 2012
    17,751
    4,799
    Yes, I think you've got it.
     
    PauAgGiron likes this.
  9. PauAgGiron

    Thread Starter New Member

    Oct 27, 2014
    8
    1
    Thank you sir!
     
  10. MrCarlos

    Active Member

    Jan 2, 2010
    400
    134
    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.

    .
     
    PauAgGiron likes this.
Loading...