DPGEN_AND4(3)

πŸ“¦ version 5.1.1-unstable-2025-02, in nixos 26.05, nixpkgs unstable

πŸ’– DPGEN_AND4 β€” the AND4 Macro-Generator πŸ’–

okay so bestie, welcome to DPGEN_AND4(3) from the Alliance - genlib User's Manual, and no cap this one is a whole vibe: it's the little macro-generator that spins up a 4-input AND gate for you. let's get into it πŸŽ€


✨ SYNOPSIS ✨

#include  <genlib.h>

void GENLIB_MACRO (DPGEN_AND4, char *modelname, long flags, long N, long
drive);

like. that's the whole summoning ritual. copy it exactly, don't freestyle πŸ’…


🌸 DESCRIPTION 🌸

bestie it literally generates an N-bit four-input AND, with an output power of drive, and names it modelname. that's the whole job. she's simple, she's iconic, she serves 🫢

Valid drive values are: 2 or 4. that's it. those two. don't try to be different, the gate will not be amused πŸ’€


πŸ¦‹ TERMINAL NAMES πŸ¦‹

the pins, in order, and what each one is giving:

  1. i3 β€” input. πŸ’–
  2. i2 β€” input. ✨
  3. i1 β€” input. 🌸
  4. i0 β€” input. πŸŽ€
  5. q β€” output. πŸ‘‘
  6. vdd β€” power. ⚑
  7. vss β€” ground. 🌱

🌈 BEHAVIOR 🌈

the way that she thinks is literally just:

q <= i0 and i1 and i2 and i3

every single input has to say yes. all four. no exceptions. it's giving unanimous decision ✨


πŸ’… EXAMPLE πŸ’…

here's what it looks like when you actually use her, fr fr:

GENLIB_MACRO(DPGEN_AND4, "model_and4_32"
                        , F_BEHAV|F_PLACE
                        , 32
                        , 2
                        );

GENLIB_LOINS( "model_and4_32"
            , "instance1_and4_32"
            , "i3[31:0]"
            , "i2[31:0]"
            , "i1[31:0]"
            , "i0[31:0]"
            ,  "q[31:0]"
            , "vdd", "vss", NULL
            );

so first we generate the model, then we loins it into an instance. 32 bits wide, drive of 2, F_BEHAV|F_PLACE flags. ate. πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€

go read those too, iykyk πŸ’œ


and that's the page bestie!! this one came from ASIM/LIP6 and it's dated 30 July 2004 β€” yeah she's an elder but she still slays πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from