[Nanjing University] Professor Yuan Chunfeng’s Fundamentals of Computer Systems (1) - Chapter 3 Fundamentals of Computational Circuits Class Notes

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

Insert image description here

3.1.2 Basic logic circuit

Insert image description here
Insert image description here
Insert image description here

3.1.3 Multiplexer

Insert image description here

3.1.4 Adder

  • one bit adder
    Insert image description here
  • n-bit adderInsert image description here
  • n-bit flagged adder
    Insert image description here

3.1.5 n-bit integer addition/subtraction operator

Insert image description here
Insert image description here
Insert image description here

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?

Insert image description here
Insert image description here
Insert image description here
Insert image description here

  • 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

Insert image description here

3.3.2 Logical operations - shift operations

Insert image description here
Insert image description here

3.3.3 Examples of shift operations and bitwise operations

Insert image description here
Insert image description here
Insert image description here
Insert image description here

3.3.4 Bit truncation and bit extension operations

Insert image description here
Insert image description here
Insert image description here

3.4 Integer addition and subtraction operations

3.4.1 Flag information generated by addition and subtraction operations

Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here
Insert image description here

3.4.2 Overflow formulas and examples of addition and subtraction operations

Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/isak233/article/details/131900235