Define internal bus

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

Define internal bus

hemasaad
Can I define array that can hold the various internal bits.such as
Not(int=[0],out=out1[0])
Not(int=[1],out=out1[1])
Reply | Threaded
Open this post in threaded view
|

Re: Define internal bus

ybakos
Not exactly.

First, forget about "defining arrays": although the HDL syntax uses the brackets, these really are not arrays. Think of them as "bundles of wires each labeled with a number". See the Appendix for more info.

You can, however, create your own internal pins and internal buses. For example:

Not(in=a, out=notA);
Not(in=notA, out=somethingElse);

Perhaps explain what you are trying to do.
Reply | Threaded
Open this post in threaded view
|

Re: Define internal bus

cadet1620
Administrator
In reply to this post by hemasaad
Appendix A (pdf) is available on the nand2tetris site. Section A.5.3 is about buses.

Also see Hardware Construction Survival Kit sections Bit Numbering and Bus Syntax
and Sub-busing.

I assume that you are working on Not16. You need to treat Not16's in and out as 16 pairs of individual wires named "in[0]", "out[0]", "in[1]", etc.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Define internal bus

hemasaad
These files are helpful thanks
Reply | Threaded
Open this post in threaded view
|

Re: Define internal bus

hemasaad
In reply to this post by ybakos
It is a boring thing. but It is okey I will do it as you said. Thank you for your help