Internal Bus Pins

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

Internal Bus Pins

The Gigabiter
Can an internal pin be a bus and how do I use 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: Internal Bus Pins

WBahn
Administrator
I don't know what you mean by an "internal pin". A 'pin' is the port on a part that connects between wires outside the part and wires inside the part.

I suspect (could be wrong) that you are taking about the wires used to route signals between internal part pin with the larger part being implement. If so, the answer is, "Yes, but...."

This is covered in the Hardware Construction Survival Kit (look for the section on sub-busing).

If you want to connect a 16-bit output of PartA to a 16-bit input of PartB, then you can just use a named wire, say 'fred', just like anywhere else. A wire automatically becomes a bus that is the same width as the pin it is connected to.

Now for the 'but'.

You can only create sub-buses at the pin level.

Say you have two Mux16 chips and you want to take the lower eight bits of the first and OR those with the lower eight bits from the second. The "obvious" way to do this might be

Mux16(a=data1a, b=data1b, out=out1);
Mux16(a=data2a, b=data2b, out=out2);
Or(in={out1[7:0],out2[7:0]}, out=oroflowbytes);

There are some HDLs where this is what you would do. But not this HDL. Once a wire is created, it cannot be split or combined or tapped off of.

How this HDL handles this is straightforward, but not intuitive (and would be a bit clumsy for large designs, but is fine for N2T scale projects).

Mux16(a=data1a, b=data1b, out[7..0]=out1);
Mux16(a=data2a, b=data2b, out[7..0]=out2);
Or(in[15:8]=out1, in[7..0]=out2, out=oroflowbytes);

We can subbus input and output pins at the chip interface, but not the wires. In this case out1 and out2 are both 8-bit buses.

The same is true for the IN/OUT pins of the part being constructed, but with a slight twist. Four convenience, we can connect internal part pins directly to IN/OUT pins without using a wire. As a result, when we subbus an IN/OUT pin, it LOOKS like we are subbusing a wire bus, but we really aren't.




and you want to send the lower eight bits to an

 
Let's say that I have a Mux16