Where did I go wrong?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Where did I go wrong?

The Gigabiter
Can you give me as specific as possible as a hint for where my Mux4way16 went wrong?

Run it and look at the diif table.
 
    PARTS:
    Mux16(a=a , b=b , sel=sel[1] , out=internal1 );
    Mux16(a=c , b=d , sel=sel[1] , out=internal2 );  
    Mux16(a=internal2 , b=internal2 , sel=sel[0] , out=out );
Hello, I am The Gigabiter(my official Net pseudonym because if you give out your real name on the Net you're hosed), also known as Major_Monogram, ElectroPaint and lightsofpahrump(and daniel-g-cs50 on GitHub but dont go poking around my repos 'cause there's nothing there). I enrolled because I was recommended the course....it may be a bit above my pay grade. I live in Pahrump, Nevada, which is basically the middle of nowhere. I like technology; electric stuff including lighting, telephones and electric clocks; and books. DONT EMAIL ME OR ASK FOR MY ADDRESS, PHYSICAL OR EMAIL!
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
Under what value of the 'sel' input will either the 'a' or the 'b' input make it to the output?

Don't think about what you want it to be or think if should be, look at your implementation and tell me what it WILL be.
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

The Gigabiter
I've meddled with whre the SEL pins go and it still gives errors in the diff table!
Hello, I am The Gigabiter(my official Net pseudonym because if you give out your real name on the Net you're hosed), also known as Major_Monogram, ElectroPaint and lightsofpahrump(and daniel-g-cs50 on GitHub but dont go poking around my repos 'cause there's nothing there). I enrolled because I was recommended the course....it may be a bit above my pay grade. I live in Pahrump, Nevada, which is basically the middle of nowhere. I like technology; electric stuff including lighting, telephones and electric clocks; and books. DONT EMAIL ME OR ASK FOR MY ADDRESS, PHYSICAL OR EMAIL!
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
Meddling with where pins go without having any reason for doing so beyond the fact that things currently don't work is known as "design by happening", as in, "let's make random changes and hope and pray that, at some point, something good somehow just happens."

Look...at...your...code.

Don't assume that what you WANT to happen is what will happen. The chip knows nothing about your thoughts, dreams, or desires. It only knows the connections as you actually defined them in your code. You need to look at your code as you actually wrote it, not what you meant to write or what you were sure you wrote, but what is actually there.

How can the input at either 'a' or 'b' EVER make it to the chip output?

Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

The Gigabiter
I had no idea what I did wrong so I went through what I was sure every combination and still nothing.
Hello, I am The Gigabiter(my official Net pseudonym because if you give out your real name on the Net you're hosed), also known as Major_Monogram, ElectroPaint and lightsofpahrump(and daniel-g-cs50 on GitHub but dont go poking around my repos 'cause there's nothing there). I enrolled because I was recommended the course....it may be a bit above my pay grade. I live in Pahrump, Nevada, which is basically the middle of nowhere. I like technology; electric stuff including lighting, telephones and electric clocks; and books. DONT EMAIL ME OR ASK FOR MY ADDRESS, PHYSICAL OR EMAIL!
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
The Gigabiter wrote
I had no idea what I did wrong so I went through what I was sure every combination and still nothing.
Look carefully at the code:

    PARTS:
    Mux16(a=a , b=b , sel=sel[1] , out=internal1 );
    Mux16(a=c , b=d , sel=sel[1] , out=internal2 );  
    Mux16(a=internal2 , b=internal2 , sel=sel[0] , out=out );

The output of the first Mux16 is tied to the wire named 'internal1'.

Under what conditions can the signal on 'internal1' EVER make it to the 'out' wire?

Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

pm100
Just put the man out of his misery :-)
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
In reply to this post by WBahn
You are making one of the classic mistakes that we humans make -- you are seeing what you EXPECT to see, not what is ACTUALLY there.

This is a pretty fundamental way that the human mind works, and it is a trait that usually serves us very well. It allows us to generalize and infer information that is not present based on the limited information that is, and we rely on it all the time without thinking about it. But it can get in our way at times, particularly in science and engineering where we have to make the effort to see only what is actually there.
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

The Gigabiter
In reply to this post by The Gigabiter
I am now going through the compare-file and diff-table and trying to figure out WHAT is going the wrong place.
Hello, I am The Gigabiter(my official Net pseudonym because if you give out your real name on the Net you're hosed), also known as Major_Monogram, ElectroPaint and lightsofpahrump(and daniel-g-cs50 on GitHub but dont go poking around my repos 'cause there's nothing there). I enrolled because I was recommended the course....it may be a bit above my pay grade. I live in Pahrump, Nevada, which is basically the middle of nowhere. I like technology; electric stuff including lighting, telephones and electric clocks; and books. DONT EMAIL ME OR ASK FOR MY ADDRESS, PHYSICAL OR EMAIL!
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

The Gigabiter
I solved it, now working on Mux8way16 which is even more frustrating 'cos I can't expand the diff table pane or print the diff tables bleep it!
Hello, I am The Gigabiter(my official Net pseudonym because if you give out your real name on the Net you're hosed), also known as Major_Monogram, ElectroPaint and lightsofpahrump(and daniel-g-cs50 on GitHub but dont go poking around my repos 'cause there's nothing there). I enrolled because I was recommended the course....it may be a bit above my pay grade. I live in Pahrump, Nevada, which is basically the middle of nowhere. I like technology; electric stuff including lighting, telephones and electric clocks; and books. DONT EMAIL ME OR ASK FOR MY ADDRESS, PHYSICAL OR EMAIL!
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
In reply to this post by The Gigabiter
If you would post the compare-to file and the diff table, we could point you at what you should be focusing on. Without that, all we know is that somewhere there is some mismatch, but the best we can do is say to look at the first place they disagree. Since we can't see what that is, we can't give you any hints on what signal to look at.
Reply | Threaded
Open this post in threaded view
|

Re: Where did I go wrong?

WBahn
Administrator
This post was updated on .
In reply to this post by The Gigabiter
The Gigabiter wrote
I solved it, now working on Mux8way16 which is even more frustrating 'cos I can't expand the diff table pane or print the diff tables bleep it!
If you have the Mux4Way16 and the Mux16 implemented, the Mux8Way16 should be almost trivial (it only has three parts in it), especially if you understand how the Mux4Way16 works, as opposed to just throwing stuff together and making random changes until it just happened to pass the tests.

If you aren't already, I would recommend drawing a schematic of the logic you are trying to implement, including giving each wire a label that matches the name you plan to use in your HDL code. This will help you visually see how the signal flow goes and make it much easier to verify if your implementation ends up matching your design.

For instance, the HDL code you posted originally corresponds to the following schematic:
Mux4Way16 that matches the HDL code.

Hopefully, seeing this makes the error jump out at you. If something is not working, start from your HDL code as if it is something that someone else did and sent to you and then draw the schematic that matches it based strictly on the code, without inferring or assuming anything. Often, you will slap your forehead part way through and say, "Of course, why couldn't I see that before!"