1. notice
  2. English
  3. logic-topic
  4. 1. logic
  5. 2. basic
  6. 3. map
  7. 4. order
  8. 5. combinatorics
  9. calculus
  10. 6. real-numbers
  11. 7. limit-sequence
  12. 8. division-algebra
  13. 9. Euclidean-space
  14. 10. Minkowski-space
  15. 11. polynomial
  16. 12. analytic-Euclidean
  17. 13. analytic-struct-operation
  18. 14. ordinary-differential-equation
  19. 15. volume
  20. 16. integral
  21. 17. divergence
  22. 18. limit-net
  23. 19. topology
  24. 20. compact
  25. 21. connected
  26. 22. topology-struct-operation
  27. 23. exponential
  28. 24. angle
  29. geometry
  30. 25. manifold
  31. 26. metric
  32. 27. metric-connection
  33. 28. geodesic-derivative
  34. 29. curvature-of-metric
  35. 30. Einstein-metric
  36. 31. constant-sectional-curvature
  37. 32. simple-symmetric-space
  38. 33. principal-bundle
  39. 34. group
  40. 35. stereographic-projection
  41. 36. Hopf-bundle
  42. field-theory
  43. 37. point-particle-non-relativity
  44. 38. point-particle-relativity
  45. 39. scalar-field
  46. 40. scalar-field-current
  47. 41. scalar-field-non-relativity
  48. 42. projective-lightcone
  49. 43. spacetime-momentum-spinor-representation
  50. 44. Lorentz-group
  51. 45. spinor-field
  52. 46. spinor-field-current
  53. 47. electromagnetic-field
  54. 48. Laplacian-of-tensor-field
  55. 49. Einstein-metric
  56. 50. interaction
  57. 51. harmonic-oscillator-quantization
  58. 52. spinor-field-misc
  59. 53. reference
  60. ไธญๆ–‡
  61. 54. notice
  62. ้€ป่พ‘
  63. 55. ้€ป่พ‘
  64. 56. ๅŸบ็ก€
  65. 57. ๆ˜ ๅฐ„
  66. 58. ๅบ
  67. 59. ็ป„ๅˆ
  68. ๅพฎ็งฏๅˆ†
  69. 60. ๅฎžๆ•ฐ
  70. 61. ๆ•ฐๅˆ—ๆž้™
  71. 62. ๅฏ้™คไปฃๆ•ฐ
  72. 63. Euclidean ็ฉบ้—ด
  73. 64. Minkowski ็ฉบ้—ด
  74. 65. ๅคš้กนๅผ
  75. 66. ่งฃๆž (Euclidean)
  76. 67. ่งฃๆž struct ็š„ๆ“ไฝœ
  77. 68. ๅธธๅพฎๅˆ†ๆ–น็จ‹
  78. 69. ไฝ“็งฏ
  79. 70. ็งฏๅˆ†
  80. 71. ๆ•ฃๅบฆ
  81. 72. ็ฝ‘ๆž้™
  82. 73. ๆ‹“ๆ‰‘
  83. 74. ็ดง่‡ด
  84. 75. ่ฟž้€š
  85. 76. ๆ‹“ๆ‰‘ struct ็š„ๆ“ไฝœ
  86. 77. ๆŒ‡ๆ•ฐๅ‡ฝๆ•ฐ
  87. 78. ่ง’ๅบฆ
  88. ๅ‡ ไฝ•
  89. 79. ๆตๅฝข
  90. 80. ๅบฆ่ง„
  91. 81. ๅบฆ่ง„็š„่”็ปœ
  92. 82. Levi-Civita ๅฏผๆ•ฐ
  93. 83. ๅบฆ่ง„็š„ๆ›ฒ็އ
  94. 84. Einstein ๅบฆ่ง„
  95. 85. ๅธธๆˆช้ขๆ›ฒ็އ
  96. 86. simple-symmetric-space
  97. 87. ไธปไธ›
  98. 88. ็พค
  99. 89. ็ƒๆžๆŠ•ๅฝฑ
  100. 90. Hopf ไธ›
  101. ๅœบ่ฎบ
  102. 91. ้ž็›ธๅฏน่ฎบ็‚น็ฒ’ๅญ
  103. 92. ็›ธๅฏน่ฎบ็‚น็ฒ’ๅญ
  104. 93. ็บฏ้‡ๅœบ
  105. 94. ็บฏ้‡ๅœบ็š„ๅฎˆๆ’ๆต
  106. 95. ้ž็›ธๅฏน่ฎบ็บฏ้‡ๅœบ
  107. 96. ๅ…‰้”ฅๅฐ„ๅฝฑ
  108. 97. ๆ—ถ็ฉบๅŠจ้‡็š„่‡ชๆ—‹่กจ็คบ
  109. 98. Lorentz ็พค
  110. 99. ๆ—‹้‡ๅœบ
  111. 100. ๆ—‹้‡ๅœบ็š„ๅฎˆๆ’ๆต
  112. 101. ็”ต็ฃๅœบ
  113. 102. ๅผ ้‡ๅœบ็š„ Laplacian
  114. 103. Einstein ๅบฆ่ง„
  115. 104. ็›ธไบ’ไฝœ็”จ
  116. 105. ่ฐๆŒฏๅญ้‡ๅญๅŒ–
  117. 106. ๆ—‹้‡ๅœบๆ‚้กน
  118. 107. ๅ‚่€ƒ

note-math

Propositional Logic

Examples in natural language

Proposition Truth value (bool)
Humans are living beings True, true, 1
Iron is a living being False, false, 0

Digital circuits represent bool

Circuit value bool
High level 1
Low level 0

The hardware implementation of digital circuits is not handled here. I donโ€™t know the details either

[logic-operator] logical and, or, not

  • And, , and, logical conjunction
  • Or, , or, logical disjunction
  • Not, , not, logical negation

Examples in natural language

Proposition Truth value
Humans are living beings and 1 is a natural number 1
Humans are living beings and 1 = 2 0

Formal language

1 1 1
1 0 0
0 1 0
0 0 0
1 1 1
1 0 1
0 1 1
0 0 0
1 0
0 1

Digital circuit and logic gate representations of

Are gates designed to disallow reverse current?

A not gate turns low level into high level, which shows the hardware implementation of a gate needs external energy, it needs to be powered

are โ€œredundantโ€, e.g. logically equivalently, we can use to represent

Circuit gate implementation starts with not,nand, i.e., . But I think maintaining the symmetry of is useful, whether cognitively or in terms of the duality of with respect to

[computability] Computability of circuits

Any function can be made using logic gates

(image from p.85 of ref-1)

Consider the input and output of the function separately

  • Construction of inputs

According to the image above, using circuits + not gates + and gates , for a total of input possibilities

Some functions only need a part of the inputs, not all of them. In these cases, some wires donโ€™t need to be connected

represents the โ€œmultiplicativeโ€ property of value parallel circuits

Regarding the output, letโ€™s first discuss the output

  • Construction of output

Among the inputs, connect the wires that you want to output as to an or gate

Example not xor function. Connect the inputs to the output or gate

xor is called exclusive or, . The truth table for this function

1 1 0
1 0 1
0 1 1
0 0 0
  • Construction of output. Can be thought of as as its components

If a full function isnโ€™t needed, the circuit computing elements donโ€™t necessarily have to be built in this fixed way. They can be further simplified based on the situation to reduce the number of gates used. But we wonโ€™t get into details here

A symbolic representation for multiple input or output lines in a computing unit (p. 54 of ref-1) (3 inputs 2 outputs)

[control-circuit] Control circuit, selector or multiplexer

is the control circuit. Its function is

  • When , outputs to , doesnโ€™t output to
  • When , outputs to , doesnโ€™t output to

(p. 81โ€“82 of ref-1)

inputs need control circuits

[De-Morgan-law] negative dual ๅพ‹ or De Morgan ๅพ‹

Prove by exhaustion, just like how humans counting is actually exhaustion. Same below

[boolean-algebra]

bool algebra is denoted as or

[bool-distributive-law] Distributive Law

ๅ…ถ negative dual

Inductively ( and refers to taking all functions)

Similarly

[bool-commutative-law] ไบคๆขๅพ‹ . same for

[bool-associative-law] ็ป“ๅˆๅพ‹ . same for

[periodic-circuit] Periodic Circuit

Implemented by crystal oscillators

[memory-circuit] Circuit Memory

Black box model

Possible implementation

  • The middle of the diagram uses a loop circuit to reuse the Bool value from the previous cycle. If write control is turned off, the values of remain unchanged
  • Inverters (not gates) ensure current direction and prevent attenuation (via external energy)
  • Suppose the value of the yellow part in the loop circuit is , and the blue part is . To write into an existing , a higher write voltage than the one in the loop circuit is needed to override the loop, i.e. using higher voltage thus to override the existing

[finite-machine] Finite State Machine

[i/o] The input of a circuit might come from the outside world (e.g. sensors, keyboards), and the output of a circuit might also go to the outside world (e.g. signal lights, screens)

The rhythm of external inputs is usually inconsistent with the rhythm of the computerโ€™s internal periodic circuits, so the external inputs need to pass through synchronization components first

[memory-array] Memory array

Example is the number of steps taken when counting from 000, 001, 010 to 111, although this assumes we can recognize three bits. ,

Use the range of natural numbers contained in multiple bits, for example 3 bits as parameters, to correspond to real-world content. Example The representation of characters in a computer e.g. ASCII, Unicode, the position and color of pixels on a screen

(image modified from wiki media about ASCII. Hex refers to hexadecimal)

In practical applications, multiple bits per address is better than 1 bit per address, or rather, a two-dimensional memory array is more efficient than a one-dimensional one

(p. 265 of ref-1)

[instruction] ๆŒ‡ไปค

Control the computer to complete some circuit tasks through instructions. Instructions are also represented by binary (multi-bit data). The instruction stream is generated by the compiler based on the source code and stored in memory, then read and executed by the CPU

Some common circuit tasks

  • Addition of natural numbers
  • Judging whether bit data meets the required conditions, for example, judging if
  • Jumping to the execution of other instructions

Assume an instruction is completed within one circuit cycle (single-cycle computer)

Example add instruction. add x_1 x_2. The bit data fields of the instruction are divided into three areas, representing different types of information

  1. Reading the add instruction

    • The add instruction at adress_0 (add x_1 x_2 as well as adress_1, adress 2 come from source code and compiler generation)
    • The value adress_0 stored at the fixed memory address adress_of_instruction is read out, the data in the index area of the add instruction is sent to the control signal component (control unit), then control signals are calculated and output (too many details, see ref-1)
  2. Execute the add instruction

    • The output control signals are input to the memoryโ€™s control circuit components, reading out x_1 in adress_1 and x_2 in adress_2 from memory, and inputting them into the arithmetic component (ALU)
    • Based on the output control signals, the output x_1 + x_2 from the arithmetic component is written to adress_1 (overwriting the value of x_1)
  3. Enter and fetch the instruction for the next cycle

    • The value adress_0 stored in adress_of_instruction is sent by the pre-designed circuit to the arithmetic component to calculate adress_0 + 1 i.e. the next instruction address, which is then written into the data within adress_of_instruction. adress_0 + 1 will be executed in the next circuit cycle

Other instructions might have more than two data areas (non-instruction index areas)

Instruction stream

Example [loop]

The speed of the cycle circuit is far higher than human speed (1 GHz = 10^9 cycles per second)

Loops in high-level programming languages


            
let i : int = 0;

            
while (i < 10) {

            
    i = i + 1;

            
} // result = 10

            
let i : int = 0;

            
while (i < 10) {

            
    i = i + 1;

            
} // result = 10
  1. Fetch instruction

    The bgt (branch_grater_than) instruction is stored at adress_0. (Instructions are generated from source code and the compiler.) 10 is in one data area of bgt, and the number of instructions needed for the while loop 3 is in another data area of bgt

  2. Execute instruction

    Execute condition check

    Read out i and 10, compare their sizes in the arithmetic unit, give a control signal based on the result, and combine it with the control signal given by the bgt index area

    According to the result of the conditional judgment, perform different tasks

    • When

    The arithmetic unit outputs a control signal based on this judgment, changing the value stored in adress_of_instruction to the address of the next instruction adress_0 + 1

    • The instruction at adress_0 + 1 needs to perform the task

      Use the add instruction to calculate i + 1 and write it back to adress_1

    • After executing add, go back to the judgment for the next loop

      The instruction following the add instruction is a jump instruction at adress_0 + 2; its execution result is modifying the value of adress_of_instruction to adress_of_instruction - 2 = (adress_0 + 2) - 2 = adress_0, achieving an instruction jump to perform the next loop judgment

    • When
    The arithmetic unit outputs a control signal based on this bgt judgment, changing the value stored in adress_of_instruction to adress_0 + 3 instead of adress_0 + 1, jumping out of the while loop to execute the subsequent instructions

[compile] [parse]

Use a parser or compiler to verify the correctness of the token stream language; essentially, it traverses all language rules and then stores them in memory as structured data (some visual descriptions: tables, nodes, trees)

One implementation method is recursive descent, enum + match (or if else) + recursion

If you want to make software run on a computer, you have to turn the token stream of the source code into structured data, and then into an instruction stream

If language rules are complex, they can be categorized and decomposed (multiple times), first traversing categories, then traversing rules within those categories. Example split into โ€œsyntax checkโ€ and โ€œsemantics checkโ€

Heuristic examples of the concepts of abstraction and API (application programming interface): objects around you, you can use them conveniently without knowing their manufacturing principles, because they were designed that way

Computers, besides the advantage of high-speed periodic circuits, other advantages include memory storage capacity (1 GB = 2^(30+3) bit = 8589934592 bit) and memory persistence (power-on time)

Complex data structures and calculation functions can be constructed in memory. This might also be useful for many other fields

The motivation for variables or variable names is that humans cannot memorize and process that many addresses; variable names are intended to use semantics to assist human memory and usage, and let computers handle addresses automatically

Variables or variable names allow the values stored in memory to be reused through addresses, minimizing the memory and use of new addresses as much as possible