본문 바로가기
csapp

2.1.7 Bit-Level Operations in C

by 정구지개발자 2023. 3. 31.
728x90
  • one common use of bit-level operations is to implement masking operations, where a mask is a bit pattern that indicates a selected set of bits wihtin a word.

2.1.8 Logical Operations in C

  • C also provides a set of logical operators ||,&& and !, which correspond to the OR, AND and NOT operations of logic.

2.1.9 Shift Operations in C

  • Shift operations associate from left to right, so x << y << k is equivalent to (x << y) << k.

2.2  Integer Representations

  • we describe two different ways bits can be used to encode integers one that can only represent nonnegative numbers, and one that can represent negative, zero, and positive numbers.

2.2.1 Integral Data Types

  • One important feature to note in Figures 2.9 and 2.10 is that the ranges are not symmetric - the range of negative numbers extends one further than the range of positive numbers.

 

 

728x90

'csapp' 카테고리의 다른 글

2.2.5 Signed versus Unsigned in C  (0) 2023.04.04
2.2.2 Unsigned Encodings  (0) 2023.04.02
2.1.3 Addressing and byte Ordering  (0) 2023.03.30
2 Representing and Manipulating Information  (0) 2023.03.28
1.9.2 Concurrency and Parallelism  (0) 2023.03.28

댓글