Reread Computer System a programmer's perspective Chapter_2by luvex
A review of rereading chapter 2–Representing and Manipulating Information.
Contents of Chapter 1:
- Information Storage
- Integer Representations
- Integer Arithmetic
- Floating Point
- Summary
- transfer among Binary, Decimal&Hexadecimal
- Every computer has a word size(representing virtual address 32bit/64bit)
- Big endian or Little endian (should be noticed when data are communicated over a newwork)
-
swapping value
>
void inplace_swap(int *x, int *y)
{
*y = *x ^ *y;
*x = *x ^ *y;
*y = *x ^ *y;
}
//For an array with odd length, we must be careful with the middle element which could be set to 0 under such swapping
-
- Other Operations:
- In this part, it mainly talks about bit-level calculation.
Integer Representations
Integer Arithmetic
Floating Point
Summary
Published 05 August 2015