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. convex_hull
  20. 16. volume
  21. 17. integral
  22. 18. divergence
  23. 19. limit_net
  24. 20. topology
  25. 21. compact
  26. 22. connected
  27. 23. topology_struct_operation
  28. 24. exponential
  29. 25. angle
  30. geometry
  31. 26. manifold
  32. 27. metric
  33. 28. metric_connection
  34. 29. geodesic_derivative
  35. 30. curvature_of_metric
  36. 31. Einstein_metric
  37. 32. constant_sectional_curvature
  38. 33. simple_symmetric_space
  39. 34. principal_bundle
  40. 35. group
  41. 36. stereographic_projection
  42. 37. Hopf_bundle
  43. field_theory
  44. 38. point_particle_non_relativity
  45. 39. point_particle_relativity
  46. 40. scalar_field
  47. 41. scalar_field_current
  48. 42. scalar_field_non_relativity
  49. 43. projective_lightcone
  50. 44. spacetime_momentum_spinor_representation
  51. 45. Lorentz_group
  52. 46. spinor_field
  53. 47. spinor_field_current
  54. 48. electromagnetic_field
  55. 49. Laplacian_of_tensor_field
  56. 50. Einstein_metric
  57. 51. interaction
  58. 52. harmonic_oscillator_quantization
  59. 53. spinor_field_misc
  60. 54. reference
  61. ไธญๆ–‡
  62. 55. notice
  63. ้€ป่พ‘
  64. 56. ้€ป่พ‘
  65. 57. ๅŸบ็ก€
  66. 58. ๆ˜ ๅฐ„
  67. 59. ๅบ
  68. 60. ็ป„ๅˆ
  69. ๅพฎ็งฏๅˆ†
  70. 61. ๅฎžๆ•ฐ
  71. 62. ๆ•ฐๅˆ—ๆž้™
  72. 63. ๅฏ้™คไปฃๆ•ฐ
  73. 64. Euclidean ็ฉบ้—ด
  74. 65. Minkowski ็ฉบ้—ด
  75. 66. ๅคš้กนๅผ
  76. 67. ่งฃๆž (Euclidean)
  77. 68. ่งฃๆž struct ็š„ๆ“ไฝœ
  78. 69. ๅธธๅพฎๅˆ†ๆ–น็จ‹
  79. 70. convex_hull
  80. 71. ไฝ“็งฏ
  81. 72. ็งฏๅˆ†
  82. 73. ๆ•ฃๅบฆ
  83. 74. ็ฝ‘ๆž้™
  84. 75. ๆ‹“ๆ‰‘
  85. 76. ็ดง่‡ด
  86. 77. ่ฟž้€š
  87. 78. ๆ‹“ๆ‰‘ struct ็š„ๆ“ไฝœ
  88. 79. ๆŒ‡ๆ•ฐๅ‡ฝๆ•ฐ
  89. 80. ่ง’ๅบฆ
  90. ๅ‡ ไฝ•
  91. 81. ๆตๅฝข
  92. 82. ๅบฆ่ง„
  93. 83. ๅบฆ่ง„็š„่”็ปœ
  94. 84. Levi_Civita ๅฏผๆ•ฐ
  95. 85. ๅบฆ่ง„็š„ๆ›ฒ็އ
  96. 86. Einstein ๅบฆ่ง„
  97. 87. ๅธธๆˆช้ขๆ›ฒ็އ
  98. 88. simple_symmetric_space
  99. 89. ไธปไธ›
  100. 90. ็พค
  101. 91. ็ƒๆžๆŠ•ๅฝฑ
  102. 92. Hopf ไธ›
  103. ๅœบ่ฎบ
  104. 93. ้ž็›ธๅฏน่ฎบ็‚น็ฒ’ๅญ
  105. 94. ็›ธๅฏน่ฎบ็‚น็ฒ’ๅญ
  106. 95. ็บฏ้‡ๅœบ
  107. 96. ็บฏ้‡ๅœบ็š„ๅฎˆๆ’ๆต
  108. 97. ้ž็›ธๅฏน่ฎบ็บฏ้‡ๅœบ
  109. 98. ๅ…‰้”ฅๅฐ„ๅฝฑ
  110. 99. ๆ—ถ็ฉบๅŠจ้‡็š„่‡ชๆ—‹่กจ็คบ
  111. 100. Lorentz ็พค
  112. 101. ๆ—‹้‡ๅœบ
  113. 102. ๆ—‹้‡ๅœบ็š„ๅฎˆๆ’ๆต
  114. 103. ็”ต็ฃๅœบ
  115. 104. ๅผ ้‡ๅœบ็š„ Laplacian
  116. 105. Einstein ๅบฆ่ง„
  117. 106. ็›ธไบ’ไฝœ็”จ
  118. 107. ่ฐๆŒฏๅญ้‡ๅญๅŒ–
  119. 108. ๆ—‹้‡ๅœบๆ‚้กน
  120. 109. ๅ‚่€ƒ

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 law or De Morgan law

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