# CHAPTER 3: HARDWARE AND VIRTUAL MACHINES

## 3.1 RISC AND CISC PROCESSORS

### 3.1.1 RISC (Reduced Instruction Set Computers)

**Characteristics:**

- Fewer instructions
- Simpler instructions
- Small number of instruction formats
- Single-cycle instructions where possible
- Fixed-length instructions
- Only load/store instructions access memory
- Fewer addressing modes
- Multiple register sets
- Hard-wired control unit
- Pipelining easier

### 3.1.2 CISC (Complex Instruction Set Computers)

**Characteristics:**

- More instructions
- Complicated instructions
- Many instruction formats
- Multi-cycle instructions
- Variable-length instructions
- Many types of memory addressing instructions
- More addressing modes
- Fewer registers
- Microprogrammed control unit
- Pipelining difficult

### 3.1.3 Pipelining

**Definition:** Instruction-level parallelism where the fetch-decode-execute cycle is separated into several stages.

**Five Stages:**

1. Instruction Fetch (IF)
2. Instruction Decode (ID)
3. Operand Fetch (OF)
4. Instruction Execution (IE)
5. Result Write Back (WB)

**Advantages:**

- Multiple instructions processed simultaneously
- Increased throughput
- More efficient use of processor components

**Disadvantages:**

- Interrupt handling complex
- Pipeline stalls possible

**Interrupt Handling in Pipelines:**

- When interrupt occurs, must clear pipeline
- Store current state of all instructions in pipeline
- Execute ISR
- Resume interrupted instructions

### 3.1.4 Parallel Processing Architectures

**SISD (Single Instruction Single Data):**

- Single processor
- Early computers
- No pipelining

**SIMD (Single Instruction Multiple Data):**

- Multiple processors
- Array processors
- Same instruction on multiple data points

**MISD (Multiple Instruction Single Data):**

- Multiple processors
- Same data, different instructions
- Used for sorting

**MIMD (Multiple Instruction Multiple Data):**

- Modern computers
- Each processor executes different instructions
- Most common parallel architecture

**Massively Parallel Computers:**

- Vast amounts of processing power
- Bus structure for multiple processors
- Network infrastructure for multiple hosts
- Used for complex mathematical problems

---

## 3.2 BOOLEAN ALGEBRA AND LOGIC CIRCUITS

### 3.2.1 Boolean Algebra Laws

**Identity Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-0-%3D-a-a-%C2%B7" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + 0 = A</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · 1 = A</span></span></div></div></div></div></div></div></div></div>**Null Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-1-%3D-1-a-%C2%B7" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + 1 = 1</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · 0 = 0</span></span></div></div></div></div></div></div></div></div>**Idempotent Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-a-%3D-a-a-%C2%B7" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + A = A</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · A = A</span></span></div></div></div></div></div></div></div></div>**Inverse Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-a%27-%3D-1-a-" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + A' = 1</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · A' = 0</span></span></div></div></div></div></div></div></div></div>**Commutative Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-b-%3D-b-%2B-a" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + B = B + A</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · B = B · A</span></span></div></div></div></div></div></div></div></div>**Associative Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-%28a-%2B-b%29-%2B-c-%3D" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">(A + B) + C = A + (B + C)</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">(A · B) · C = A · (B · C)</span></span></div></div></div></div></div></div></div></div>**Distributive Law:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-a-%2B-b%C2%B7c-%3D-%28a-" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A + B·C = (A + B) · (A + C)</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A · (B + C) = A·B + A·C</span></span></div></div></div></div></div></div></div></div>**De Morgan's Laws:**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-%28a-%2B-b%29%27-%3D-a%27" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 42px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">(A + B)' = A' · B'</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">(A · B)' = A' + B'</span></span></div></div></div></div></div></div></div></div>### 3.2.2 Karnaugh Maps (K-Maps)

**Purpose:** Simplify Boolean expressions and reduce number of gates needed.

**Benefits:**

- Minimises Boolean expressions
- Minimises logic gates
- More efficient circuits

**Methodology:**

1. Fill K-map from truth table
2. Group '1's in powers of 2 (1, 2, 4, 8)
3. Wrap around edges allowed
4. Within each group, only constant values remain
5. Write expression from groups

**Example K-map (2 variables):**

<div class="sc-zOxLx iJoNFs code-block" id="bkmrk-%3Ctext%3E-ab%27-0-1-a-0-0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; width: 647px; min-width: 35ch;"><div class="sc-cgHfjM iurpwe" style="box-sizing: border-box; font-weight: bold; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 10px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: center; color: rgb(0, 0, 0); font-size: 14px; line-height: 1; border-top-left-radius: 8px; border-top-right-radius: 8px; height: 34px; background-color: rgb(238, 238, 238);">&lt;TEXT&gt;</div><div class="sc-iQqcaB jMJkfu" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: sticky; top: 28px; z-index: 10;"><div class="sc-kcLKEh sc-dntSTA sc-dFVmKS sc-fcSHUR kIsGeY jNoXSY cklChQ kmrhIw code-toolbar" style="box-sizing: border-box; font-weight: normal; border: none; margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; width: auto; height: 24px; flex: 0 0 auto; inset: auto 0.5rem 0.3rem auto; opacity: 0; border-radius: 4px; gap: 4px; display: flex; justify-content: flex-start; align-items: center; flex-direction: row; position: absolute; background-color: rgb(238, 238, 238); transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div><div class="sc-fpikKz lhQggy split-view-wrapper" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; border-radius: 0px 0px 8px 8px;"><div class="shiki one-light code-viewer source-view shiki-light" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; font-family: "', 'Cascadia Code', 'Fira Code", Consolas, Menlo, Courier, monospace; line-height: initial; --color-scrollbar-thumb: rgba(0, 0, 0, 0.15); --color-scrollbar-thumb-hover: rgba(0, 0, 0, 0.2); flex: 1 1 auto; width: 647px; border-radius: inherit; background-color: rgb(250, 250, 250); color: rgb(56, 58, 66);"><div class="sc-jCWzJg ednTDb shiki-scroller" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0.5em 0px 0.5em 1em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: block; overflow: auto hidden; position: relative; border-radius: inherit; --gutter-width: 0ch; font-size: 13px;"><div class="shiki-list" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; height: 84px; width: 634px; position: relative;"><div style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 0px; left: 0px; width: 634px; transform: translateY(0px);"><div data-index="0" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;"> AB'</span></span></div></div><div data-index="1" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;"> 0 1</span></span></div></div><div data-index="2" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;">A 0 0 1</span></span></div></div><div data-index="3" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><div class="line" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; width: 634px; line-height: 21px; contain: none; will-change: auto;"><span class="line-content" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px 1em 0px 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; flex: 1 1 0%;"><span style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; white-space: pre; overflow-wrap: normal;"> 1 1 1</span></span></div></div></div></div></div></div></div></div>### 3.2.3 Half Adders and Full Adders

**Half Adder:**

- Adds two bits
- Outputs sum and carry

<div class="sc-fYRIQK gLjTUz table-wrapper" id="bkmrk-a-b-sum-carry-0-0-0-" style="box-sizing: border-box; font-weight: 400; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: relative; color: rgb(0, 0, 0); font-family: "', Ubuntu, -apple-system, 'system-ui', 'Segoe UI', system-ui, Roboto, Oxygen, Cantarell, 'Open Sans', 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji"; font-size: 14px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><table style="box-sizing: border-box; font-weight: normal; border-image: none 100% / 1 / 0 stretch; margin: 2em 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); text-indent: 0px; border-collapse: separate; -webkit-tap-highlight-color: transparent; --table-border-radius: 8px; font-size: 0.9em; width: 647px; border-radius: 8px; overflow: hidden; border-spacing: 0px; border: 0.5px solid rgba(0, 0, 0, 0.098);"><thead style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><th style="box-sizing: border-box; font-weight: 600; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">A</th><th style="box-sizing: border-box; font-weight: 600; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">B</th><th style="box-sizing: border-box; font-weight: 600; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">Sum</th><th style="box-sizing: border-box; font-weight: 600; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; background-color: rgb(238, 238, 238); text-align: left;">Carry</th></tr></thead><tbody style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-width: 0px 0.5px 0.5px 0px; border-style: solid; border-color: oklch(0.92 0.004 286.32) rgba(0, 0, 0, 0.098) rgba(0, 0, 0, 0.098) oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: 0.5px solid rgba(0, 0, 0, 0.098); border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td></tr><tr style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;"><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: 0.5px solid rgba(0, 0, 0, 0.098); border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: 0.5px solid rgba(0, 0, 0, 0.098); border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: 0.5px solid rgba(0, 0, 0, 0.098); border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">0</td><td style="box-sizing: border-box; font-weight: normal; border-top: 0px solid oklch(0.92 0.004 286.32); border-right: none; border-bottom: none; border-left: 0px solid oklch(0.92 0.004 286.32); border-image: initial; margin: 0px; padding: 0.5em; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent;">1</td></tr></tbody></table>

<div class="sc-MHKXp dNlhAz table-toolbar" style="box-sizing: border-box; font-weight: normal; border: 0px solid oklch(0.92 0.004 286.32); margin: 0px; padding: 0px; outline-color: oklab(0.705 0.00415142 -0.0144141 / 0.5); -webkit-tap-highlight-color: transparent; position: absolute; top: 8px; right: 8px; z-index: 10; display: flex; gap: 4px; border-radius: 4px; opacity: 0; transition: opacity 0.2s; transform: translateZ(0px); will-change: opacity;">  
</div></div>**Sum = A XOR B** **Carry = A AND B**

**Full Adder:**

- Adds three bits (two operands + carry in)
- Outputs sum and carry out

### 3.2.4 Flip-Flops

**SR Flip-Flop:**

- Set-Reset flip-flop
- Stores 1 bit of data
- Two inputs: S (set) and R (reset)

**JK Flip-Flop:**

- Improvement over SR
- All input combinations valid
- Uses clock pulse for synchronization
- Toggle action when J=K=1

**Purpose:**

- Store bits of data
- Create memory from flip-flops
- Used in registers and counters

---

## 3.3 VIRTUAL MACHINES

### 3.3.1 Concept of Virtual Machines

**Definition:** Software that provides an exact copy of hardware. The process interacts with the software interface provided by the OS, which provides this copy. The OS kernel handles interaction with actual host hardware.

**Benefits:**

- Multiple OS on single system
- Testing without affecting main system
- Legacy software on newer hardware
- Server consolidation

**Drawbacks:**

- Performance drop from native OS
- Time and effort for implementation

**Examples:**

- VMware
- VirtualBox
- Hyper-V