multi-bit NOT

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

multi-bit NOT

Radoslav
Hi.
I just start to read this book and I have some problem
with multi-bit gates.
How to implement in HDL for example 16 bit NOT.

I have done something like this :

CHIP Not16 {
    IN in[16];
    OUT out[16];

    PARTS:

    Nand(a=in[0],b=in[0],out=out[0]);
    Nand(a=in[1],b=in[1],out=out[1]);
                .
                .
                .
    Nand(a=in[15],b=in[15],out=out[15]);
       
       }
And it works. But Is any way to to this by for loop ?
Reply | Threaded
Open this post in threaded view
|

Re: multi-bit NOT

cadet1620
Administrator
What you have done is correct. There are no looping constructs in HDL.

Keep in mind that HDL is a description of a schematic diagram, not a sequential programming language.

--Mark