Bytes, bits, etc.,
- R. Inkulu
http://www.iitg.ac.in/rinkulu/
(Bytes, bits, etc.,) 1 / 25
Bytes, bits, etc., R. Inkulu http://www.iitg.ac.in/rinkulu/ - - PowerPoint PPT Presentation
Bytes, bits, etc., R. Inkulu http://www.iitg.ac.in/rinkulu/ (Bytes, bits, etc.,) 1 / 25 Outline 1 Self-alignment 2 Bitwise operators 3 Bit-fields 4 Endianness (Bytes, bits, etc.,) 2 / 25 Self-alignment of primitive types int i; short s;
(Bytes, bits, etc.,) 1 / 25
(Bytes, bits, etc.,) 2 / 25
(Bytes, bits, etc.,) 3 / 25
1helps in calculating internal and trailing paddings (see below) (Bytes, bits, etc.,) 4 / 25
(Bytes, bits, etc.,) 5 / 25
(Bytes, bits, etc.,) 6 / 25
2recursively apply the self-alignment rules (Bytes, bits, etc.,) 7 / 25
(Bytes, bits, etc.,) 8 / 25
(Bytes, bits, etc.,) 9 / 25
(Bytes, bits, etc.,) 10 / 25
(Bytes, bits, etc.,) 11 / 25
(Bytes, bits, etc.,) 12 / 25
(Bytes, bits, etc.,) 13 / 25
4
(Bytes, bits, etc.,) 14 / 25
(Bytes, bits, etc.,) 15 / 25
3if the prior members are not a bit field but some other type whose size is smaller than
(Bytes, bits, etc.,) 16 / 25
(Bytes, bits, etc.,) 17 / 25
(Bytes, bits, etc.,) 18 / 25
(Bytes, bits, etc.,) 19 / 25
(Bytes, bits, etc.,) 20 / 25
(Bytes, bits, etc.,) 21 / 25
(Bytes, bits, etc.,) 22 / 25
(Bytes, bits, etc.,) 23 / 25
4IEEE 754 standard: http://www.h-schmidt.net/FloatConverter/IEEE754.html (Bytes, bits, etc.,) 24 / 25
(Bytes, bits, etc.,) 25 / 25