#import "@preview/mannot:0.3.1"
#import "@preview/cetz:0.4.2"
#import "@preview/zap:0.5.0"

#import "../lib/common_rewrite.typ" : *
#import "../lib/truthtable.typ" : *
#import "../lib/fetModel.typ" : *

#show math.integral: it => math.limits(math.integral)
#show math.sum: it => math.limits(math.sum)

#set page(
  paper: "a4", 
  margin: (
    bottom: 10mm,
    top: 5mm,
    left: 5mm,
    right: 5mm
  ),
  flipped:true,
  footer: context [
    #grid(
      align: center,
      columns: (1fr, 1fr, 1fr),
      [#align(left, datetime.today().display("[day].[month].[year]"))], 
      [#align(center, counter(page).display("- 1 -"))], 
      [Thanks to Daniel for the circuit Symbols],
      [#align(right, image("../images/cc0.png", height: 5mm,))]
    )
  ],
)

#let pTypeFill = rgb("#dd5959").lighten(10%);
#let nTypeFill = rgb("#5997dd").lighten(10%);

#place(top+center, scope: "parent", float: true, heading(
  [Digitaltechnik]
))

#let SeperatorLine = line(length: 100%, stroke: (paint: black, thickness: 0.3mm))
#let MathAlignLeft(e) = {
  align(left, block(e))
}

#let colorBoolscheLogic = color.hsl(105.13deg, 92.13%, 75.1%)
#let colorOptimierung = color.hsl(202.05deg, 92.13%, 75.1%)
#let colorRealsierung = color.hsl(280deg, 92.13%, 75.1%)
#let colorState = color.hsl(356.92deg, 92.13%, 75.1%)
//#let colorIntegral = color.hsl(34.87deg, 92.13%, 75.1%)

#let LNot(x) = math.op($overline(#x)$)

#columns(4, gutter: 2mm)[
  #bgBlock(fill: colorBoolscheLogic)[
    #subHeading(fill: colorBoolscheLogic)[Allgemein]
    *Moorsches Gesetz:* 2x der Anzahl der Transistoren pro Fläche (in 2 Jahren)

    Flächenskalierung eines Transistors: $1/sqrt(2)$

    *Kombinatorisch:* Kein Gedächtnis

    *(Synchrone) sequenentielle:* Mit Gedächtnis

    *Fan-In:* Anzahl der Inputs eines Gatters

    *Fan-Out:* Anzahl der Output Verbindungen eines Gatters
  ]

  #bgBlock(fill: colorBoolscheLogic)[
    #subHeading(fill: colorBoolscheLogic)[Boolsche Algebra]

    *Dualität*
    $LNot(0) = 1$, $LNot(1) = 0$

    *Äquivalenz* $LNot((LNot(A)))=A$\
    $A dot A = A$, $A + 0 = A$ \

    *Konstanz*
    $A dot 1 = A$ $A + 1 = 1$

    *Komplementärgesetz* \
    $A dot LNot(A) = 0$, $A + LNot(A) = 1$

    *Kommutativgesetz* \
    $A dot B = B dot A$, $A + B = B + A$

    *Assoziativgesetz*\
    $A dot (B dot C) = (A dot B) dot C$\
    $A + (B + C) = (A + B) + C$

    *Distributivgesetz*\
    $A dot (B + C) = A dot B + A dot C$ \
    $A + (B dot C) = (A + B) dot (A + C)$

    *De Morgan*\
    $LNot((A + B)) = LNot(A) dot LNot(B)$\
    $LNot((A dot B)) = LNot(A) + LNot(B)$

    *Absorptionsgesetz*\
    $A + (A dot B) = A$\
    $A dot (A + B) = A$

    *Resolutionsgesetz (allgemein)*\
    $X dot A + LNot(X) + B = X dot A + LNot(X) dot B + bold(A dot B)$

    *Resolutionsgesetz (speziell)*\
    $X dot A + LNot(X) dot A = A$\
    $(X + A) dot (LNot(X) + A) = A$
  ]

  #bgBlock(fill: colorBoolscheLogic)[
    #subHeading(fill: colorBoolscheLogic)[Boolsche Funktionen]

    $f: {0,1}^n -> {0,1}$

    Variablenmenge: ${x_0, x_1, ..., x_n}$\
    Literalmenge: ${x_0, ..., x_n, LNot(x_0), ... LNot(x_n)}$ \
    Einsmenge: $F = {underline(v) in {0,1}^n | f(underline(v)) = 1}$
    Nullmenge: $overline(F) = {underline(v) in {0,1}^n | f(underline(v)) = 0}$
    Don't-Care-Set: ${underline(v) in {0,1}^n | f(underline(v)) = *}$

    Funktionsbündel: $underline(y)  = underline(f)(underline(x))$ \
    $underline(f): {0,1}^n -> {0,1}^m$

    *Kofaktoren* aka Bit $n$ fixen\ 
    $x_i : f_x_i = f(x_1, ..., 1, ..., x_n)$\
    $overline(x)_i : f_overline(x)_i = f(x_1, ..., 0, ..., x_n)$
  
    *Substitutionsregel*

    $x_i dot f = x_i dot f_x_i$

    $overline(x)_i dot f = overline(x)_i dot f_overline(x)_i$

    $x_i + f = x_i + f_overline(x)_i$

    $overline(x)_i + f = overline(x)_i + f_x_i$

    *Boolsche Expansion*\
    $f(underline(x)) = x_i dot f_x_i + overline(x)_i dot f_overline(x)_i$

    $f(underline(x)) = (x_i + f_overline(x)_i) dot (overline(x)_i + f_x_i)$

    $overline(f(underline(x))) = overline(x)_i dot overline(f_overline(x)_i) + x_i dot overline(f_x_i)$

    $overline(f(underline(x))) = (overline(x)_i + overline(f_x_i)) dot (x_i + overline(f_overline(x)_i)) $

    *Eigentschaften:*

    tautologisch: $f(underline(x)) = 1, forall underline(x) in {0,1}^n$\
    kontradiktorisch: $f(underline(x)) = 0, forall underline(x) in {0,1}^n$\
    unabhängig von $x_i <=> f_x_i  = f_overline(x)_i$\
    abhängig von $x_i <=> f_x_i  != f_overline(x)_i$\
  ]

  #bgBlock(fill: colorOptimierung)[
    #subHeading(fill: colorOptimierung)[Hauptsatz der Schaltalgebra]
    Jede $f(x_0, ...,x_n)$ kann als...
    - *Minterme $m$:* $ = LNot(x)_0 dot x_1 dot ...$\
      VerODERungen von VerUNDungen\
      $f(underline(x)) = m_0 + m_1 + ... + m_n$

    - *Maxterme $M$:* $ = LNot(x)_0 + x_1 ü ...$\
      VerUNDungen von VerODERungen\
      $f(underline(x)) = m_0 dot m_1 dot ... dot m_n$

    ... dargestellt werden

    *DNF:* Disjunktive Normalform, *Minterme*
    - Term $tilde.equiv$ $1$-Zeile
    - $LNot(x)_0 dot x_1 + x_0 dot x_1 +...$\
    - $1 tilde.equiv x_0$, $0 tilde.equiv overline(x_0)$
  
    *KNF:* Konjunktive Normalform, *Maxterme*
    - Term $tilde.equiv$ $0$-Zeile
    - $(LNot(x)_0 + LNot(x)_1) dot (x_0 + x_1) dot...$\
    - $1 tilde.equiv overline(x_0)$, $0 tilde.equiv x_0$
  
    Kanonische: In jedem Term müssen alle enthalten sein.

    *KDNF:* Kanonische DNF\
    *KKNF:* Kanonische KNF

    *DMF:* Disjunktive #underline("Minimal")-Form: \ 
    $ --> LNot(x_0)x_1 + LNot(x_1)$\

    *KMF:* Konjunktive #underline("Minimal")-Form: \
    $ --> (LNot(x_0) + x_1) dot LNot(x_1)$

    $f(underline(x)) -->$ *KKNF* / *KDNF* mit Boolsche Expansion

  ]

  // Dotierung
  #bgBlock(fill: colorRealsierung)[
    #table(
      columns: (auto, 1fr),
      [N-Type],
      [
        - Dotierung: Phosphor (V)
        - Negative Ladgunsträger ($e^-$)
        - mehr Elektron als Si
      ],
      [P-Type],
      [
        - Dotierung:  Bor (III)
        - Postive Landsträger (Löcher)
        - mehr Löcher als Si
      ]
    )


    #zap.circuit({
      import cetz.draw : *
      import zap : *

      diode("A", (0,1.7), (3,1.7), fill: black, i: (content: $i_d$, anchor: "south"))


      rect((0,0),(1,1), fill: pTypeFill, stroke: none)
      rect((2,0),(3,1), fill: nTypeFill, stroke: none)
      rect((1,0), (1.5,1), fill: color.lighten(pTypeFill, 50%), stroke: none)
      rect((1.5,0), (2,1), fill: color.lighten(nTypeFill, 50%), stroke: none)
      line((2, 0), (2, 1), stroke: (dash: "dotted"))
      line((1, 0), (1, 1), stroke: (dash: "dotted"))
      line((1.5, 0), (1.5, 1), stroke: (dash: "densely-dotted"))

      cetz.decorations.brace((2,-0.1),(1,-0.1))
      content((1.5, -0.6), "RLZ")
      content((2.5, 0.5), "N")
      content((0.5, 0.5), "P")
      content((1.25, 0.5), "-")
      content((1.75, 0.5), "+")
    })

    #grid(
      columns: (1fr, 1fr),
      column-gutter: 6mm,
      align: center,
      [#align(center)[*NMOS*]], [#align(center)[*PMOS*]],
      grid.cell(inset: 2mm,
        align(center, 
          zap.circuit({
            import "../lib/circuit.typ" : *

            registerAllCustom();
            fet("T", (0,0), type: "N", scale: 150%);
          })
        )
      ),
      grid.cell(inset: 2mm,
        align(center, 
          zap.circuit({
            import "../lib/circuit.typ" : *

            registerAllCustom();
            fet("T", (0,0), type: "P", scale: 150%);
          }),
        )
      ),
      scale(
        x: 75%, y: 75%,
        zap.circuit({
          import cetz.draw : *
          import zap : *
          rect((1.5,0),(4-1.5, 0.1), fill: rgb("#535353"), stroke: none)
          rect((0,0),(4,-1), fill: pTypeFill, stroke: none)
          rect((0.5,-0),(1.5, -0.5), fill: nTypeFill, stroke: none)
          rect((4 - 1.5,-0),(4-0.5, -0.5), fill: nTypeFill, stroke: none)
          rect((1.5,-0),(2.5, -0.5), fill: none, stroke: (paint: black, dash: "dotted", thickness: 0.06))

          line((3, 0.3), (3, 0))
          line((1, 0.3), (1, 0))
          line((2, 0.3), (2, 0.1))

          cetz.decorations.brace((2.5,-0.6),(1.5,-0.6))
          content((2, -1.3), "Channel")
          content((3, -0.25), $"n"^+$)
          content((1, -0.25), $"n"^+$)
          content((0.5, -0.75), "p")

          content((3, 0.5), "S")
          content((1, 0.5), "D")
          content((2, 0.5), "G")
        })
      ),
      scale(
        x: 75%, y: 75%,
        zap.circuit({
          import cetz.draw : *
          import zap : *
          rect((1.5,0),(4-1.5, 0.1), fill: rgb("#535353"), stroke: none)
          rect((0,0),(4,-1), fill: nTypeFill, stroke: none)
          rect((0.5,-0),(1.5, -0.5), fill: pTypeFill, stroke: none)
          rect((4 - 1.5,-0),(4-0.5, -0.5), fill: pTypeFill, stroke: none)
          rect((1.5,-0),(2.5, -0.5), fill: none, stroke: (paint: black, dash: "dotted", thickness: 0.06))

          line((3, 0.3), (3, 0))
          line((1, 0.3), (1, 0))
          line((2, 0.3), (2, 0.1))

          cetz.decorations.brace((2.5,-0.6),(1.5,-0.6))
          content((2, -1.3), "Channel")
          content((3, -0.25), $"p"^+$)
          content((1, -0.25), $"p"^+$)
          content((0.5, -0.75), "n")

          content((3, 0.5), "S")
          content((1, 0.5), "D")
          content((2, 0.5), "G")
        })
      ),
    )

    *Drain Strom:*

    NMOS: $I_"Dn" = cases(
        gap: #0.6em,
        0 & 0 < U_"GS" < U_t,
        beta_n (U_"GS" - U_t - U_"DS" / 2) U_"DS" quad & cases(delim: #none, U_"GS" >= U_t, 0 < U_"DS" < U_"GS" - U_t),
        beta_n/2 (U_"GS" - U_"th")^2 & cases(delim: #none, U_"GS" >= U_t, U_"DS" > U_"GS" - U_t)
      )$

    PMOS: $I_"Dp" = cases(
        gap: #0.6em,
        0 & 0 > U_"GS" > U_t,
        beta_p (U_"GS" - U_t - U_"DS" / 2) U_"DS" quad & cases(delim: #none, U_"GS" <= U_t, 0 > U_"DS" > U_"GS" - U_t),
        beta_p/2 (U_"GS" - U_"th")^2 & cases(delim: #none, U_"GS" <= U_t, U_"DS" < U_"GS" - U_t)
      )
    $
  ]

  // Quine McCluskey
  #bgBlock(fill: colorOptimierung)[
    #subHeading(fill: colorOptimierung)[Quine McCluskey]
  ]

  // NMOS/PMOS
  #bgBlock(fill: colorRealsierung)[
    #subHeading(fill: colorRealsierung)[CMOS]
    $hat(=)$ Complemntary MOS

    #table(
      columns: (1fr, 1fr),
      zap.circuit({
        import zap : *
        import cetz.draw : content
        import "../lib/circuit.typ" : *

        set-style(wire: (stroke: (thickness: 0.025)))

        registerAllCustom();
        fet("N0", (0,0), type: "N", angle: 90deg);
        fet("P0", (0,1), type: "P", angle: 90deg);
        wire("N0.G", (rel: (-0.1, 0)), (horizontal: (), vertical: "P0.G"), "P0.G")

        node("outNode", (0,0.5))
        node("inNode", (-0.6,0.5))
        wire((-1, 0.5), "inNode")
        wire((0.2, 0.5), "outNode")

        node("N2", (0,-0.5))
        node("N2", (0,1.5))

        wire((-1, -0.5), (0.5, -0.5))
        wire((-1, 1.5), (0.5, 1.5))

        content((-1, 0.5), scale($"X"$, 60%), anchor: "east")
        content((0.45, 0.5), scale($overline("X")$, 60%), anchor: "east")
        content((-0.9, 1.5), scale($"U"_"DD"$, 60%), anchor: "east")
        content((-0.9, -0.5), scale($"GND"$, 60%), anchor: "east")
      }),

      [
        *Inverter*
        
        $overline(X)$
      ],

      zap.circuit({
        import zap : *
        import cetz.draw : content
        import "../lib/circuit.typ" : *

        set-style(wire: (stroke: (thickness: 0.025)))

        registerAllCustom();
        fet("P0", (0.5,0.25), type: "P", angle: 90deg);
        fet("P1", (0.5,1.25), type: "P", angle: 90deg);
        fet("N0", (0,-1), type: "N", angle: 90deg);
        fet("N1", (1,-1), type: "N", angle: 90deg);

        content((-0.7, 1.75), scale($"V"_"DD"$, 60%), anchor: "east")
        content((-0.7, -1.5), scale($"GND"$, 60%), anchor: "east")

        content("N0.G", scale($"B"$, 60%), anchor: "east")
        content("P0.G", scale($"B"$, 60%), anchor: "east")
        content("N1.G", scale($"A"$, 60%), anchor: "east")
        content("P1.G", scale($"A"$, 60%), anchor: "east")

        wire((-0.75, -1.5), (1.5, -1.5))
        wire((-0.75, 1.75), (1.5, 1.75))

        wire("N0.S", "N1.S")
        node("N2", "P0.D")
        wire("N2", (horizontal: (), vertical: "N0.S"))
        node("N3", "N0.D")
        node("N4", "N1.D")
        node("N5", "P1.S")
        node("N6", (horizontal: (), vertical: "N0.S"))

        wire("N2", (horizontal: (rel: (0.5, 0)), vertical: "N2"))
        
        content((horizontal: (rel: (0.65, 0)), vertical: "N2"), scale($"Y"$, 60%))
      }),

      [
        *NOR*

        $overline(A +B) = Y$
      ],

      zap.circuit({
        import zap : *
        import cetz.draw : content
        import "../lib/circuit.typ" : *

        set-style(wire: (stroke: (thickness: 0.025)))

        registerAllCustom();
        content((-0.7,  0.5), scale($"V"_"DD"$, 60%), anchor: "east")
        content((-0.7, -2.75), scale($"GND"$, 60%), anchor: "east")

        fet("P0", (0, 0), type: "P", angle: 90deg);
        fet("P1", (1, 0), type: "P", angle: 90deg);
        fet("N0", (0.5,-1.25), type: "N", angle: 90deg);
        fet("N1", (0.5,-2.25), type: "N", angle: 90deg);

        wire((-0.75, 0.5), (1.5, 0.5))
        wire((-0.75, -2.75), (1.5, -2.75))
        wire("P0.D", "P1.D")

        node("N2", (horizontal: "N1.D", vertical: "P0.D"))
        node("N3", "N0.S")
        wire("N2", "N3")
        wire("N3", (rel: (0.5, 0)))

        content((horizontal: (rel: (0.65, 0)), vertical: "N3"), scale($"Z"$, 60%))
        node("4", "P0.S")
        node("4", "P1.S")
        node("4", "N1.D")

        content("N0.G", scale($"B"$, 60%), anchor: "east")
        content("P0.G", scale($"B"$, 60%), anchor: "east")
        content("N1.G", scale($"A"$, 60%), anchor: "east")
        content("P1.G", scale($"A"$, 60%), anchor: "east")
      }),

      [
        *NAND*

        $overline(A dot B) = Z$
      ],
    )
  ]

  // CMOS
  #bgBlock(fill: colorRealsierung)[
    #subHeading(fill: colorRealsierung)[CMOS Verzögerung]

    *Inverter*\
    $t_("p"/"nLH") ~ (C_"L" t_"ox" L_"p/n")/(W_"p/n" mu_"p/n" epsilon(V_"DD" - abs(V_"Tpn"))) $

    #grid(
      columns: (1fr, 1fr),
      [
        *Steigend mit*
        - Last $C_L$
        - Oxyddicke $T_"ox"$
        - Kandlalänge $L_"p/n"$
        - Schwellspannung $V_"Tp/n"$ 
      ],
      [
        *Sinkend mit*
        - Kanalweite
        - Landsträger Veweglichkeit $mu_"p/n"$
      ],

    )

    $t_p ~ C_L/(beta(V_"DD" - abs(V_"T")))$

    $t_p ~ C_L/(W(V_"DD" - abs(V_"T")))$
  ]

  #bgBlock(fill: colorState)[
    #subHeading(fill: colorState)[Latches, Flipflops und Register]
  ]

  #bgBlock(fill: colorState)[
    #subHeading(fill: colorState)[Timing]

    *Register Bedinungen*

    #cetz.canvas(length: 0.5mm, {
      import cetz.draw: *


      let cycle_time = 38
      let cycle_start = cycle_time*0.8
      let cycle_end = cycle_time*4
      let signal_hight = 10
      let switch_offset = cycle_time/13
      let signal_storke = (paint: rgb("#2e2e2e"), thickness: 0.3mm)

      let t_c2q = 0.6
      let t_setup = 0.6
      let t_hold = 0.4

      // clk1
      line((1*cycle_time + switch_offset/2, signal_hight + 1), (1*cycle_time + switch_offset/2, -40), stroke: (paint: rgb("#0004ff"), thickness: 0.4mm, dash: "densely-dashed"))

      // q change
      line((cycle_time*(t_c2q + 1) + switch_offset/2, -15 + signal_hight + 1), (cycle_time*(t_c2q + 1) + switch_offset/2, -40), stroke: (paint: rgb("#0004ff"), thickness: 0.4mm, dash: "densely-dashed"))

      // d change
      line((cycle_time*(t_setup + 2) + switch_offset/2, -30 + signal_hight + 1), (cycle_time*(t_setup + 2) + switch_offset/2, -40), stroke: (paint: rgb("#0004ff"), thickness: 0.4mm, dash: "densely-dashed"))

      // clk
      line((cycle_time*3 + switch_offset/2, signal_hight + 1), (cycle_time*3 + switch_offset/2, -40), stroke: (paint: rgb("#0004ff"), thickness: 0.4mm, dash: "densely-dashed"))

      // hold time
      line((cycle_time*(3+t_hold) + switch_offset/2, -30 + signal_hight + 1), (cycle_time*(3+t_hold) + switch_offset/2, -40), stroke: (paint: rgb("#0004ff"), thickness: 0.4mm, dash: "densely-dashed"))


      content(( cycle_start -7, 5), "clk")

      line((cycle_start,0), (cycle_time,0), (cycle_time + switch_offset,signal_hight), (cycle_time*2, signal_hight), (cycle_time*2 + switch_offset, 0), (cycle_time*3, 0), (cycle_time*3 + switch_offset, 10), (cycle_end, signal_hight), stroke: signal_storke)

      translate((0, -15))
      content((cycle_start -7, 5), "Q")

      line(
        (cycle_start,0), (cycle_time*(t_c2q + 1), 0), 
        (cycle_time*(t_c2q + 1) + switch_offset, signal_hight), 
        (cycle_time*(t_c2q + 3),signal_hight), (cycle_time*(t_c2q + 3) + switch_offset, 0), 
        (cycle_end + switch_offset, 0),
        stroke: signal_storke
      )
      line(
        (cycle_start,signal_hight), (cycle_time*(t_c2q + 1), signal_hight), 
        (cycle_time*(t_c2q + 1) + switch_offset, 0), 
        (cycle_time*(t_c2q + 3),0), (cycle_time*(t_c2q + 3) + switch_offset, signal_hight),
        (cycle_end + switch_offset, signal_hight),
        stroke: signal_storke
      )

      translate((0, -15))
      content((cycle_start -7, 5), "D")

      line(
        (cycle_start,0), (cycle_time*(t_setup + 2), 0), 
        (cycle_time*(t_setup + 2) + switch_offset, signal_hight), (cycle_end + switch_offset, signal_hight), stroke: signal_storke
        
      )
      line(
        (cycle_start,signal_hight), (cycle_time*(t_setup + 2), signal_hight), 
        (cycle_time*(t_setup + 2) + switch_offset, 0), (cycle_end + switch_offset, 0), stroke: signal_storke
      )
    })
  ]



  #bgBlock(fill: colorState)[
    #subHeading(fill: colorState)[Pipeline/Parallele Verarbeitungseinheiten]
  ]

  #bgBlock(fill: colorState)[
    #subHeading(fill: colorState)[Zustandsautomaten]
  ]

  #colbreak()
  #bgBlock(fill: colorRealsierung)[
    #subHeading(fill: colorRealsierung)[Verlustleistung/Verzögerung]
    
    $t_p ~ C_L / (V_"DD" - V_"Tn")$

    $P_"stat" ~ e^(-V_T)$

    $P_"dyn"~ V_"DD"^2$


    *Dynamisch:* Bei Schlaten \
    1. Kapazitiv Verlustleistung $I_C$ \
    2. Querstrom Verlustleistung $I_Q$ \

    #zap.circuit({
      import zap : *
      import cetz.draw : content
      import "../lib/circuit.typ" : *

      set-style(wire: (stroke: (thickness: 0.025)))

      registerAllCustom();
      fet("N0", (0,0), type: "N", angle: 90deg);
      fet("P0", (0,1), type: "P", angle: 90deg);
      wire("N0.G", (rel: (-0.1, 0)), (horizontal: (), vertical: "P0.G"), "P0.G")

      node("outNode", (0,0.5))
      node("inNode", (-0.6,0.5))
      wire((-1, 0.5), "inNode")
      wire((0.5, 0.5), "outNode")
      wire((0, -0.5), (0, -1))

      node("N2", (0,-1))
      node("N2", (0,1.5))

      wire((-1, -1), (0.5, -1))
      wire((-1, 1.5), (0.5, 1.5))

      content((-1, 0.5), scale($"X"$, 60%), anchor: "east")
      content((0.8, 0.5), scale($overline("X")$, 60%), anchor: "east")
      content((-0.9, 1.5), scale($"U"_"DD"$, 60%), anchor: "east")
      content((-0.9, -1), scale($"GND"$, 60%), anchor: "east")
    }),

    - Quer/Kurzschluss Strom $i_q$ \
      $P_"short" = a_01 f beta_n tau (V_"DD" - 2 V_"Tn")^3$ \
      $tau$: Kurzschluss/Schaltzeit
    - Lade Strome des $C_L$ $i_c$
      $P_"cap" = alpha_01 f C_L V_"DD"^2$
    *Statisch:* Konstant
    - Leckstom (weil Diode)
    - Gatestrom 
  ]
  
  #bgBlock(fill: colorRealsierung)[
    #subHeading(fill: colorRealsierung)[Verlustleistung]
    
    $alpha = "#Schaltvorgänge"/"#Takte (#Clk Flanken)"$

    $P_"cap" = alpha dot f_"clk" dot C dot U_"DD"$

  ]

  #SIPrefixesTable
]

#place(bottom,
  truth-table(
    outputs: (
      ("NAND", (1, 1, 1, 0)),
      ("NOR",  (1, 0, 0, 0)),
      ("XNOR", (1, 0, 0, 1)),
      ("XOR",  (0, 1, 1, 0)),
      ("AND",  (0, 0, 0, 1)),
      ("OR",   (0, 1, 1, 1)),
    ),
    inputs: ("A", "B")
  ),
  float: true
)