3. Basics of computing circuits
- First, introduce the basic content of Boolean algebra and digital logic circuits;
- Then, the bitwise operations and logical operations in C language are introduced;
- Next, the integer addition and subtraction operations in high-level languages and their corresponding underlying implementation circuits are introduced.
3.1 Basics of digital logic circuits
3.1.1 Boolean algebra
3.1.2 Basic logic circuit
3.1.3 Multiplexer
3.1.4 Adder
- one bit adder
- n-bit adder
- n-bit flagged adder
3.1.5 n-bit integer addition/subtraction operator
3.2 From C expressions to logic circuits
- All operations in the computer are completed by corresponding arithmetic circuits , and these arithmetic circuits are composed of basic logic gates .
- Question : So how does the computer know what operations to perform in the arithmetic circuit and what kind of operands to perform operations on?
- The conversion process from high-level language expressions to gate circuits:
- For a high-level language to be able to be executed on a machine, it actually requires two conversions;
- Once, high-level language expressions are converted into instructions;
- This instruction is then executed on the circuit
- Various operations in high-level language program expressions will be converted into corresponding operation instructions by the compiler. When the program is running, the CPU executes these instructions to control the operands to be processed in the operation circuit.
3.3 Various operations in C language
This lecture introduces various operations involved in C language programs
3.3.1 Arithmetic operations - bitwise operations
3.3.2 Logical operations - shift operations
3.3.3 Examples of shift operations and bitwise operations
3.3.4 Bit truncation and bit extension operations
3.4 Integer addition and subtraction operations
3.4.1 Flag information generated by addition and subtraction operations
3.4.2 Overflow formulas and examples of addition and subtraction operations