[meta:edit-log]: # "2020/12/10"
[meta:title]: # "A completely incomplete guide to computer basics - PART2 Hardware: process unit"
[meta:keywords]: # "code, guide, computer"
[meta:description]: # "How come silicon brick learnt to think, what magic is this? Or the question may be is it actually thinking?"


The process unit, or just the chip,
  is some silicon getting hot to touch while electric current passing though.
In some sense,
  the unit is basically a space heater when the computing capability is removed,
  or a fancy [Resistor](https://wikipedia.org/wiki/Resistor),
  which is both funny and sometimes useful.

First let's try to get a brief understanding of what chips do:
  they get "numbers" from "boxes",
  "adding" the "number" up,
  then put the result in maybe a different "box".

## The "numbers"

The quoted "numbers" is actually [binary](https://wikipedia.org/wiki/Binary_number),
  that means 2-based, or represented in only 0 and 1,
  for example to count in binary is like:
  `0, 1, 10, 11, 100, 101, 110, ...`.
By the way, each digit also called a [bit](https://wikipedia.org/wiki/Bit),
  so `0` is a 1bit binary number, `100100` is 6bit,
  and 8bit is a called [byte](https://wikipedia.org/wiki/Byte).

The unique quality binary number has is it can easily be represented,
  in this case, by electricity.
We can have one wire and use on/off to represent `1`/`0`,
  or use high/low voltage for `1`/`0`.
Now if we prepare 32 wires, we can represent all 32bit, or 4byte binary numbers.

## The "boxes"

How to put a 32bit electric number in a box?
  use a [register](https://wikipedia.org/wiki/Hardware_register), or memory, or storage.

But how can electric be stored in a chip?
  well, use a [flip-flop](https://wikipedia.org/wiki/Flip-flop_(electronics)), like an SR latch.
Those circuit is designed to "hold" the electric current,
  what that mean is, the circuit will keep one of the current path open,
  depend on two switches, and a smart (or twisted) feedback design.

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="520" height="500" version="1.0" xml:lang="en"><style>svg{background-color: #fff;}</style><defs><linearGradient id="d"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="a"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="b"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="c"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="p" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(2.0214 0 0 2.02755 -56.998 268.956)" gradientUnits="userSpaceOnUse" xlink:href="#c"/><linearGradient id="o" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(2.0214 0 0 2.02755 -56.998 31.264)" gradientUnits="userSpaceOnUse" xlink:href="#b"/><linearGradient id="n" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(2.0214 0 0 2.02755 -588.59 10.463)" gradientUnits="userSpaceOnUse" xlink:href="#a"/><linearGradient id="m" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(2.0214 0 0 2.02755 -241.929 11.568)" gradientUnits="userSpaceOnUse" xlink:href="#d"/><linearGradient id="e"><stop offset="0" stop-color="#ff0707"/><stop offset=".5" stop-color="#fff"/><stop offset="1" stop-color="#0725ff"/></linearGradient><linearGradient id="k" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(6.34197 0 0 .63487 -540.742 -161.1)" gradientUnits="userSpaceOnUse" xlink:href="#e"/><linearGradient id="f"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient><linearGradient id="g"><stop offset="0" stop-color="#ff0707"/><stop offset=".5" stop-color="#fff"/><stop offset="1" stop-color="#0725ff"/></linearGradient><linearGradient id="l" x1="55.051" x2="67.935" y1="68.726" y2="68.726" gradientTransform="matrix(6.34197 0 0 .63487 -540.742 -507.761)" gradientUnits="userSpaceOnUse" xlink:href="#g"/><linearGradient id="h"><stop offset="0" stop-color="#848484"/><stop offset=".587" stop-color="#fff"/><stop offset="1" stop-color="#fff"/></linearGradient></defs><g opacity=".05" transform="translate(0 250)"><animateMotion dur="3s" from="0,0" repeatCount="indefinite" to="0,240"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from=".9" to=".05"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from=".05" to=".9"/><path fill="#feffab" d="M414.588-235.074h80.148L454.662-195zM414.588 4.926h80.148L454.662 45zM414.588-475.074h80.148L454.662-435z"/></g><g transform="translate(0 250)"><animateMotion dur="3s" from="0,0" repeatCount="indefinite" to="0,240"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from=".9" to=".05"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from=".05" to=".9"/><path fill="#feffab" d="M83.98-235.074h80.147L124.054-195zM83.98-475.074h80.148L124.054-435zM83.98 4.926h80.148L124.054 45z"/></g><g id="i" display="inline" opacity=".05" transform="translate(0 250)"><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from=".9" to=".1"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from=".1" to=".9"/><rect width="136.366" height="133.79" x="294.938" y="89.586" fill="#50ff42" fill-opacity=".394" fill-rule="evenodd" rx="28.693" ry="27.383"/><text x="366.659" y="195.515" font-family="Bitstream Vera Sans" font-size="24.044" font-weight="400"><tspan x="366.659" y="195.515">Set</tspan></text><path fill="none" stroke="#000" stroke-width="2.004" d="M357.944 108.994h20.037v40.074h20.037v-40.074h20.037"/></g><g id="j" display="inline" transform="translate(0 250)"><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from=".9" to=".1"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from=".1" to=".9"/><rect width="134.401" height="133.79" x="149.207" y="89.583" fill="#50ff42" fill-opacity=".394" fill-rule="evenodd" rx="28.279" ry="27.383"/><path fill="none" stroke="#000" stroke-width="2.004" d="M222.21 110.958h-20.037v40.074h-20.037v-40.074h-20.037"/><text x="161.914" y="196.028" font-family="Bitstream Vera Sans" font-size="24.044" font-weight="400"><tspan x="161.914" y="196.028">Reset</tspan></text></g><g transform="translate(0 250)"><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from="1" to="0"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from="0" to="1"/><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M438.32 42.185l-111.537-.135"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M438.32 27.575L463.74 5.523v-120.54M142.32 42.185l107.93-.135"/><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M142.32 27.575L116.9 5.523V-115.017M206.205-66.911h20.037L323.176 42.05"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M253.857 42.05L354.212-67.532l20.302.62M442.683-67.76h22.036"/><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M137.822-67.76H114.23"/><path fill="#ff0707" d="M259.574 42.966a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#0725ff" d="M331.385 42.099a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#ff0707" d="M471.043-67.532a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#0725ff" d="M124.2-67.532a7.302 7.305 0 11-14.603 0 7.302 7.305 0 1114.604 0z"/><path fill="none" stroke="#ff0707" stroke-width="4.007" d="M252.49 38.683v72.534"/><path fill="none" stroke="#0725ff" stroke-width="4.007" d="M326.226 38.082v75.94"/><path fill="url(#k)" stroke="#000" stroke-linecap="round" stroke-width="1.986" d="M-185.828-128.497h70.147v22.058h-70.147z" transform="rotate(90)"/><path fill="#ff0707" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M475.466-114.586h-22.358v-70.447h22.358z"/><path fill="#0725ff" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M135.387-56.125v-22.358h70.447v22.358z"/><path fill="#ff0707" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M373.079-56.125v-22.358h70.447v22.358z"/></g><g opacity=".05" transform="translate(0 250)"><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="i.click" dur="500ms" from="1" to="0"/><animate fill="freeze" attributeName="opacity" attributeType="CSS" begin="j.click" dur="500ms" from="0" to="1"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M438.32 42.185l-111.537-.135"/><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M438.32 27.575L463.74 5.523v-120.54M142.32 42.185l107.93-.135"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M142.32 27.575L116.9 5.523V-115.017M206.205-66.911h20.037L323.176 42.05"/><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M253.857 42.05L354.212-67.532l20.302.62M442.683-67.76h22.036"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M137.822-67.76H114.23"/><path fill="#0725ff" d="M259.574 42.966a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#ff0707" d="M331.385 42.099a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#0725ff" d="M471.043-67.532a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#ff0707" d="M124.2-67.532a7.302 7.305 0 11-14.603 0 7.302 7.305 0 1114.604 0z"/><path fill="none" stroke="#0725ff" stroke-width="4.007" d="M252.49 38.683v72.534"/><path fill="none" stroke="#ff0707" stroke-width="4.007" d="M326.226 38.082v75.94"/><path fill="url(#l)" stroke="#000" stroke-linecap="round" stroke-width="1.986" d="M-185.828-475.158h70.147v22.058h-70.147z" transform="rotate(90)"/><path fill="#ff0707" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M135.387-56.125v-22.358h70.447v22.358z"/><path fill="#0725ff" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M373.079-56.125v-22.358h70.447v22.358z"/><path fill="#ff0707" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M128.805-115.691h-22.358v-70.447h22.358z"/></g><path fill="none" stroke="#ff0707" stroke-width="3.777" d="M44.007 23.646h449.09"/><path fill="none" stroke="#ff0707" stroke-width="3.652" d="M463.757 23.646V64.18M116.899 23.646V64.18"/><path fill="#ff0707" d="M124.2 23.646a7.302 7.305 0 11-14.603 0 7.302 7.305 0 1114.604 0z"/><text x="3.843" y="-219.657" fill="#ff0707" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="3.843" y="-219.657">+V</tspan></text><text x="69.363" y="-146.63" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="69.363" y="-146.63">R1</tspan></text><text x="412.185" y="-140.739" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="412.185" y="-140.739">R2</tspan></text><text x="394.468" y="-86.107" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="394.468" y="-86.107">R4</tspan></text><text x="157.098" y="-86.107" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="157.098" y="-86.107">R3</tspan></text><path fill="url(#m)" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M-128.805 115.691h22.358v70.447h-22.358z" opacity=".5" transform="rotate(180 0 125)"/><path fill="#ff0707" d="M470.607 24.406a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="url(#n)" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M-475.466 114.586h22.358v70.447h-22.358z" opacity=".5" transform="rotate(180 0 125)"/><path fill="url(#o)" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M56.125 135.387h22.358v70.447H56.125z" opacity=".5" transform="rotate(-90 125 125)"/><path fill="url(#p)" stroke="#000" stroke-linecap="round" stroke-width="2.004" d="M56.125 373.079h22.358v70.447H56.125z" opacity=".5" transform="rotate(-90 125 125)"/><text x="5.542" y="243.969" fill="#0725ff" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="5.542" y="243.969">0V</tspan></text><path fill="none" stroke="#0725ff" stroke-width="3.652" d="M438.32 307.598l25.421 21.781v157.15M493.097 486.73H44.007M142.32 307.598L116.9 329.38v157.15M326.176 430.264v55.363M250.278 429.8v57.565"/><path fill="#0725ff" d="M124.2 486.73a7.302 7.305 0 11-14.603 0 7.302 7.305 0 1114.604 0zM471.358 486.893a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path d="M257.733 365.363a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path fill="#0725ff" d="M258.021 485.566a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0zM333.614 485.566a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path d="M257.733 430.731a7.302 7.305 0 11-14.604 0 7.302 7.305 0 1114.604 0z"/><path stroke="#000" stroke-width="5.21" d="M249.94 368.403l22.615 56.343"/><path d="M319.436 365.363a7.302 7.305 0 1014.604 0 7.302 7.305 0 10-14.604 0zM319.436 430.731a7.302 7.305 0 1014.604 0 7.302 7.305 0 10-14.604 0z"/><path stroke="#000" stroke-width="5.21" d="M327.516 368.617L304.9 424.96"/><path fill="none" stroke="#000" stroke-linecap="square" stroke-width="2.004" d="M92.83 292.185c0 23.312 18.888 42.21 42.189 42.21 23.3 0 42.189-18.898 42.189-42.21 0-23.311-18.889-42.209-42.19-42.209-23.3 0-42.188 18.898-42.188 42.21h0z"/><path fill="#0725ff" fill-rule="evenodd" stroke="#0725ff" stroke-width="3.652" d="M122.24 325.06h10.953l-10.953-10.958v10.958z"/><path stroke="#000" stroke-linecap="round" stroke-width="7.303" d="M145.971 262.964h-1.876v58.444h1.876z"/><text x="76.093" y=".7" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="76.093" y=".7">Q1</tspan></text><path fill="none" stroke="#000" stroke-linecap="square" stroke-width="2.004" d="M487.81 292.185c0 23.312-18.888 42.21-42.189 42.21-23.3 0-42.189-18.898-42.189-42.21 0-23.311 18.889-42.209 42.19-42.209 23.3 0 42.188 18.898 42.188 42.21h0z"/><path fill="#0725ff" fill-rule="evenodd" stroke="#0725ff" stroke-width="3.652" d="M458.4 325.06h-10.953l10.953-10.958v10.958z"/><path stroke="#000" stroke-linecap="round" stroke-width="7.304" d="M434.669 262.964h1.876v58.444h-1.876z"/><text x="473.56" y="-2.167" font-family="Bitstream Vera Sans" font-size="21.911" font-weight="400" transform="matrix(.99976 0 0 1.00024 0 250)"><tspan x="473.56" y="-2.167">Q2</tspan></text><g transform="translate(0 250)"><rect width="218.87" height="78.786" x="164.306" y="-205.073" fill="#cdcdcd" fill-opacity=".394" fill-rule="evenodd" rx="20.515" ry="21.037"/><text x="271.333" y="-174.774" style="text-align:center" font-family="Bitstream Vera Sans" font-size="24.044" font-weight="400" text-anchor="middle"><tspan x="271.333" y="-174.774">Press the</tspan><tspan x="271.333" y="-144.719">green button</tspan></text></g></svg>
<br/>
[Animation of SR latch](https://wikipedia.org/wiki/Flip-flop_(electronics))

## The "adding"

The circled Q1/Q2 components in the image are called
  [Bipolar junction transistor (BJT)](https://wikipedia.org/wiki/Bipolar_junction_transistor),
  which is also three-decades-the-device-of-choice in the design of
  discrete and [integrated circuits](https://wikipedia.org/wiki/Integrated_circuits),
  with that said, it is logical, but very basic.
BJT allows an extra current injected as input (`C`) to control the main current (`A` to `B`),
  meaning the on/off of `C` can control the open/close or increase/decrease the main current from `A` to `B`.
In other words, it's `if (C and A) then B`, sound like logic, didn't it?

But it's not calculating yet, with BJT we can get the [AND gate](https://wikipedia.org/wiki/AND_gate) (`&`),
  and a OR gate (`|`) or NOT gate (`!`) is also simple to make,
  with those in hand, let's design a `2bit + 2bit -> 3bit` adder:
```
     Ia1 Ia0  |    1 0  |    1 1 
 +   Ib1 Ib0  | +  0 1  | +  1 1 
 ------------ | ------- | -------
  O2  O1  O0  |  0 1 1  |  1 1 0 
```

So for each output, we get the following logic:
```js
const getO0 = (Ia0, Ib0) => { // | * 1
  return Ia0 | Ib0
}

const upI0 = Ia0 & Ib0 // increase to higher bit // & * 1
const getO1 = (upI0, Ia1, Ib1) => { // & * 8, | * 3, ! * 6
  return (
    (upI0 & Ia1 & Ib1) |
    (!upI0 & !Ia1 & Ib1) |
    (!upI0 & Ia1 & !Ib1) |
    (upI0 & !Ia1 & !Ib1)
  )
}

const upI1 = ( // increase to higher bit // & * 8, | * 3, ! * 3
  (upI0 & Ia1 & Ib1) |
  (!upI0 & Ia1 & Ib1) |
  (upI0 & !Ia1 & Ib1) |
  (upI0 & Ia1 & !Ib1)
)
const getO2 = (ipI1, Ia2, Ib2) => { // & * 8, | * 3, ! * 6
  return (
    (ipI1 & Ia2 & Ib2) |
    (!ipI1 & !Ia2 & Ib2) |
    (!ipI1 & Ia2 & !Ib2) |
    (ipI1 & !Ia2 & !Ib2)
  )
}
```

The total gate count for our very basic 2bit adder will be:
  `50 = 1 + 1 + 8+3+6 + 8+3+3 + 8+3+6`,
  not a small number for mere 2bits, and let's not count the wires!
Modern computer CPU provides 64bit adder, and many other binary operations,
  luckily a bunch of smart people optimized the adder logic to some extreme,
  and we now use the more compact [MOSFET](https://wikipedia.org/wiki/MOSFET) transistor technology to make chips.

## The missing piece

One thing is still missing, as you must be thinking:
  even with the "number", "boxes", and "adding",
  the state of the current will not change by itself!
The adding operation, along with the input and output bits,
  will be represented by the current in the circuit, forever.

There's next operation to do, it shouldn't lock up like this,
  so here comes the "clock" chip to solve the problem.
The "clock" chip emits high frequency signals,
  and it's called an [Oscillator](https://wikipedia.org/wiki/Electronic_oscillator).
If the "clock" output a single on/off or high/low electric signal per second,
  that'll be 1tick/sec, or 1Hz, and 1kHz would be 1000tick/sec.
With some more circuits, our adder result can "move" to next "box",
  based on the rhythm of the "clock",
  and then the next operation can finally happen on the next tick of the "clock".
There's also MHz and GHz used for frequency,
  and modern computer CPU often have variable clock speed around 2~5GHz.

## Wrap up

I think this much of explanation should be just (and barely) enough
  to explain how and why a process unit chip work.

To repeat it simply:
- there's electric circuit able to hold binary number (the storage)
- there's electric circuit able to add up binary number (perform the math/logical operation)
- there's electric circuit able to tell other circuits to do next task (the clock)

"And that's just a calculator, not the same level as a computer or phone!"
  you may be thinking.

Well, it's correct, but also not quite:
  with enough number of these circuits working together,
  then the output will not just be numbers, you can get picture, music, and anything else,
  if the hardware and software is connected.

But the actual computing still happen in forms of binary numbers,
  they represent the input, the output, the type of operation to perform,
  they're both data and code, the boundary is really blurred at this level.

That's all for this part...
  wait, I seem to miss all the tech terms for modern CPU,
  like [Register](https://wikipedia.org/wiki/Processor_register),
  [Cache](https://wikipedia.org/wiki/CPU_cache),
  [Opcode](https://wikipedia.org/wiki/Opcode),
  [Cores](https://wikipedia.org/wiki/Multi-core_processor),
  [Threads](https://wikipedia.org/wiki/Multithreading_(computer_architecture)),
  and more!
Whelp, there's [Wikipedia](https://wikipedia.org/wiki/Central_processing_unit),
  dig on, please!


> #### Extended thinking: model the electric current
>
> Most people model the electric current as water,
>   which flows from higher to lower places, and the height difference as voltage.
>
> But I find compressed air a better model for electricity,
>   say we have a can of spray paint, which looks like a big "battery",
>   and it's high pressure inside, we can let some "electron" out,
>   but over time, the pressure, or "voltage" will drop, then finally run out.
> If we think wire as metal tubes, and there's compressed air inside,
>   then we can understand the energy stored inside more easily.
> But electron rarely move out of the wire, so we add one restriction to our model:
>   the compressed air won't flow out of the metal tubes, maybe the tube is sealed on both ends.

> #### Extended thinking: model the BJT
>
> With the above compressed air model in mind,
>   the BJT can be thought as a rubber cork with a hole to pass through air.
>
> Below image shows 2 version of BJT,
>   of the 3 input, input `C` is the control,
>   the above one allows air pass from `A` to `B` when "activated",
>   and the other denies it.
>
> ![Image of BJT model][i:p2-bjt-model]


[i:p2-bjt-model]: data:image/webp;base64,UklGRkIIAABXRUJQVlA4TDYIAAAv8UFeAL/BNratRB+LLCSm/w6ogR5Y34wdd5ci3Ma2rVQbJ4QeyIkpiVppwd3dv7KNZLuJvJdaEDHl0g05PRB6yBjkIuz87wIAwh+4+CETGqPbND/+5uX1e/M/uxZpfV2OE1koFoqFgv07NUFNUBN0Vhb8Q8SgJqgJVOiU5S7PV+fvc/1/54UtHVZJgzCcui3iSU3r3pQyyuvVBIaKHxvXIjnXsk4LbAAMwEBRANi6jeKWdK/c7q6EAHuUdmk6CAH2ysH/fxqN48iyrdpbr5Ei+i+Lta2oofZNAJsJDmnVW/oGz988wWPyn8l/TvKwg8TjzvfwRZ7HHUnywLShRx+/hoPKoZfnFSkm/5lYxK8ZfK+kH8PkPylF2FMoU1QITqCBOdJw5dHGEL48/IogIObA301QPXYvgIvdONyCow8aCDq7xFZ3A9bzPABBnxQvPGF9uwkDL+Q5uDy/+MuMbzch4Ik8B5bb2f2LOyq1gqAG/DDjfhJN+yp0WETE7gWG1GofHaI8hv4b0BuG/uCCow+ePKLYCIbuGlbjNjHWn//hfcNCn67XpwbTtGpr96bVJ9HfwkSvU7PHsTxuCs/kqbuVhFLsA3SHIW2vUQVltW3ZjuEkBkHX9riWxys+XbqQp6sbDoZBw4JKbYFseb81wvMMGLcb/6n0zz/38njEl3J5iS5Ppar91gjPM2/D0ADTqDmQlkVUbebbjC0nUSFjtW8cg1k/QrCTBwXmfwcNhcJXkR9/FT1YZNnHL6IHF6UIL+YKVZ7+1lUzTigN1WO+uYHSf+S0HdIUMj/5vtEqEQlLnnl5Jn+cmWIxEl/K4vMCW57+Tg0HB/PdGlSIamHUSosKh7sHzA0nh2LDPZ4X8mBiJ8/1lzN0ebashYTGb0/rOYxmBcBw9LNqzNhMYCD4II83ZCLotJ0u0ghhtNAwidau4HmA0QlU2GCcB5s+pg3Dt5MHngcY8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