sp25-cs252 cs252
Chapter 2: Bits, Data Types, and Operations Chapter 2: Bits, Data Types, and Operations
Content locked
The catalog is public. Reading this content requires approved access.
Sign in to readChapter 2: Bits, Data Types, and Operations
2
Bits, Data Types, and Operations
2.1 Bits and Data Types
2.1.1 The Bit as the Unit of Information
2.1.2 Data Types
2.2 Integer Data Types
2.2.1 Unsigned Integers
2.2.2 Signed Integers
2.3 2’s Complement Integers
Example 2.1
2.4 Conversion Between Binary and Decimal
2.4.1 Binary to Decimal Conversion
Example 2.2
2.4.2 Decimal to Binary Conversion
2.4.3 Extending Conversion to Numbers with Fractional Parts
2.5 Operations on Bits— Part I: Arithmetic
2.5.1 Addition and Subtraction
2.5.2 Sign-Extension
2.5.3 Overflow
2.6 Operations on Bits— Part II: Logical Operations
2.6.1 A Logical Variable
2.6.2 The AND Function
Example 2.6
Example 2.7
2.6.3 The OR Function
Example 2.8
2.6.4 The NOT Function
2.6.5 The Exclusive-OR Function
Example 2.9
Example 2.10
2.6.6 DeMorgan’s Laws
2.6.7 The Bit Vector
2.7 Other Representations
2.7.1 Floating Point Data Type (Greater Range, Less Precision)
2.7.1.1 Normalized Form
Example 2.14
2.7.1.2 Infinities
2.7.1.3 Subnormal Numbers
2.7.2 ASCII Codes
2.7.3 Hexadecimal Notation
Exercises
Source