it basics: types and number representation

types (int,long,..) often vary in size and therfore one uses standard types: qtypes_t where q is a qualifier, type is the base type, s is the width in bits and _t is an extension so you know you are using the C99 defined types (e.g., uint8_t)

negative binary number representations:

  1. sign bit: one bit is specialized as a sign bit
  2. one’s complement:
    • “not” operator applied to positive number yields neg. number
    • advantage: subtraction is easy (just add and also add additional carry over bit)
  3. two’s complement:
    • same as one’s comp. but you always add an additional one
    • advantag: subtraction is even easier (just add) and all simple math op. are now easy to manage




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s