Reread Computer System a programmer's perspective Chapter_2by luvex

A review of rereading chapter 2–Representing and Manipulating Information.

Contents of Chapter 1:

  1. Information Storage
  2. Integer Representations
  3. Integer Arithmetic
  4. Floating Point
  5. Summary

Information Storage

  • 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

  • Boolean Algebra : & ~ ^
  • Other Operations:
  • In this part, it mainly talks about bit-level calculation.

Integer Representations

Integer Arithmetic

Floating Point

Summary

Published 05 August 2015