• ## Binary, bit operation, displacement operation

Time：2021-9-15

Basic concepts of binary Binary is the carry system of every 2 carry, and 0 and 1 are the basic operators. Modern electronic computer technology uses binary, because it only uses two digital symbols: 0 and 1, which is very simple and convenient and easy to be realized electronically. The information processed inside the computer […]

• ## Three usages of C language – operation symbols & (with example code)

Time：2021-8-23

&: there are two meanings in C language. One is to take the address symbol, which is a monocular operator; The other is a bitwise operator, which means “bitwise and”, which is a binocular operator.   1. For pointer assignment #include int main() { int a = 2; int*b;// Defines an integer pointer b = […]

• ## How do computers represent integers

Time：2021-8-12

[TOC] In a computer, any data is represented by binary: 0 and 1. Integers are no exception. In life10, expressed in an 8-byte integer as00001010。 But this can only represent positive numbers and zero. How to express negative numbers? So there is the concept of sign bit. In an 8-byte integer, the highest bit is […]

• ## The trouble caused by translation: the checksum of IP, ICMP, TCP and UDP packets

Time：2021-8-10

1、 Network protocol checksum definition RFC 1071The definition of checksum in: (1) Adjacent octets to be checksummed are paired to form 16-bit integers, and the 1’s complement sum of these 16-bit integers is formed.(2) To generate a checksum, the checksum field itself is cleared, the 16-bit 1’s complement sum is computed over the octets concerned, […]

• ## Bitwise operators of basic operators in C language (6)

Time：2021-8-5

For more compact data, C programs can store information with independent bits or multiple bits combined together. File access permission is a common application case. The bit operator allows processing of independent bits in a byte or larger data unit: any bit or multiple bits can be cleared, set, or inverted. You can also move […]

• ## Hey! Don’t forget this C language knowledge~ 0 = = – 1 (problem)

Time：2021-7-29

Today, I’ll take you to review a forgotten C language knowledge point, the storage of negative numbers and a typical investigation form. Let’s look at a topic first #include  int main()  {  int   a,b,c,d;    // perhaps     int   a,b,c,d;  a=0x8;   b=a>>1;   c=~(~0<<1);   d=b&c;   printf(“c is %d\n”,c);   printf(“d is %d\n”,d);  }    Resolution: Suppose the computer is storing eight […]

• ## Architecture and operating system

Time：2021-7-22

Architecture and operating system Part 1. Architecture foundation 1. Von Neumann architecture All data and instructions processed by computer are represented by binary numbers Sequential execution program In the process of computer operation, the program to be executed and the data to be processed are first stored in the main memory (memory). When the computer […]

• ## Original code, inverse code and complement code

Time：2021-5-12

1、 Concept explanation Number of machines: The binary representation of a number in a computer is called the machine number of the number. Machine number is signed, in the computer with a number of the highest place to store symbols, 0 represents a positive number, 1 represents a negative number. For example, + 2 binary […]

• ## Why is int8 in the range of [- 128127]

Time：2021-2-12

A series of articles： Why is int8 in the range of [- 128127] Do you really understand sync.Once Is that right Today’s article is very basic. I saw it the other daygoA topic is actually different fromgoIt doesn’t matter much in itself. func main() { What is the value of B? If 128 is said […]

• ## The first experiment of “deeply understanding computer system” — data Lab

Time：2021-1-20

This paper is the second chapter of the CSAPP supporting experiments, through the use of limited operators to achieve positive, negative, floating-point bit level representation. Through the completion of these 13 functions, we can better understand the computer data encoding. preparation    go to the official website firstLab AssignmentsGet the experiment related files (also can […]

• ## Reading notes of “in depth understanding of computer system” — Chapter 2 information representation and processing

Time：2021-1-18

This chapter mainly studies the coding methods of unsigned numbers, complements and floating-point numbers in the computer. By studying the actual coding methods of numbers, we can understand the range of values that can be represented by different types of data in the computer, the properties of different arithmetic operations, and know how the computer […]

• ## JS gets the current time and refreshes it in real time

Time：2021-1-2

design sketch <!DOCTYPE html> <html> <head> <meta charset=”{CHARSET}” /> < title > JS gets the current time and refreshes it in real time <script> //Page load call window.onload = function() { //Refresh time every 1 second setInterval(“NowTime()”, 1000); }; function NowTime() { //Date of acquisition var time = new Date(); var year = time.getFullYear(); var month = […]