
Master bitmap level programming to design a bitmap map library, using bit masking, wild cards, and pattern matching, while handling endianness and building bit oriented data structures.
Access and write bitmap.h and bitmap.c in your own GitHub repository, with pre-built codes available at the GitHub URL and practice git basics by committing and pushing.
Advanced bit programming recap: this assignment reinforces basic bit level operations in C or C++ using bitwise operators, including and, or, xor, and bit toggling on integers.
Explore the fundamentals of bit programming: most and least significant bits and bytes (octets), memory layout, and how endianness affects bit manipulation in a 32-bit unsigned int.
Explore how a 192-bit bitmap acts as a bit-level view of a byte array, manipulated via wrapper apis and bitwise operations with 32-bit cells and multiples of 32.
Explore bitmap applications from md5, sha, crc in cryptography, and bloom filters to routing tables and grayscale image processing, including two-dimensional bitmaps and Huffman coding for compression.
Learn to implement bitmap APIs for setting, unsetting, and testing bits in a 32-bit cell bitmap with constant time and space, using pointer arithmetic and bitwise operations.
Implement bitmap_print to return a static buffer of the bitmap pattern, grouped in eight bits with spaces, using the exact prototypes in bitmap.h and bitmap.c, with automation testing.
Use the bitmap api automation testing framework to download the command parser, switch to the bitmap test branch, replace bitmap.c and bitmap.h, compile, and run set/unset bit tests.
Discover how to write endianness independent code by manipulating memory at the bit level, compare big endian and little endian machines, and apply the s2 and n2 hl functions correctly.
you may skip this video if you already know what is Big and Little Endian Machine Arch.
fav ques for interviews.
Explore how a code snippet outputs differently on big endian and little endian machines, identify the culprit instructions, and grasp register versus memory value to write endianness independent code.
Explore how memory value and register value differ in a little-endian machine, and how read, write, and assignment operations manipulate these values with byte-level patterns.
Explore how read operations fetch memory bytes into CPU registers and how write operations copy register bytes back to memory on a little endian machine, using pointers.
Explore hton and ntoh functions and their host-to-network and network-to-host byte order conversions. Learn when to flip bytes on little-endian vs big-endian machines for 16- and 32-bit integers, and use them consistently.
Set the 15th bit in a 32-bit bitmap and demonstrate endian-independent code using register-based bit operations, memory reads/writes, and endianness handling with hton.
Understand how CPU cycles vary across 16, 32, and 64-bit machines as the CPU reads and writes memory in chunks, and learn why 32-bit chunks optimize bitmap operations.
Learn to implement a 32-bit bitmap copy API that transfers bits from a source to a destination using a nine-bit count and shift operations, with separate read and write steps.
Define and test a looping macro in C to iterate a bitmap, emitting the index and whether the bit is set, then rewrite the bitmap print function to use it.
Learn to generate a mask by setting consecutive bits in a 32-bit unsigned integer, using a start offset and end offset from the left, and validate with test case four.
Compare two 32-bit bit patterns by examining the first count bits from the left, using a mask to zero out the rest and test equality within the masked region.
Explore left and right shift operations on bitmaps, test cases six and seven, and the combined test case 67, using block-level, 32-bit shifts with zero-filled holes.
Implement a bitmap copy api that copies a source bitmap segment to a destination bitmap using a start index and count, then mask out residual bits and left-shift to finalize.
Master bitmap compare techniques in advanced bit programming with C and C++, focusing on efficiently comparing bitmap data structures.
Explain how a prefix bitmap pairs with a mask or wild card to represent don't care bits, define three bit types (zero, one, don't care), and note memory storage.
Implement bitmap_effective_bit_at to compute the effective bit from a main prefix and a wildcard bitmap at a given position, returning either the main prefix bit or a don't care value.
The lecture introduces a looping macro for iterating over an effective prefix in the main prefix bitmap, detailing input and output parameters and header implementation using a helper API.
Implement bitmap_print_prefix API to print effective prefix, combining main prefix and wild card, returning a pointer to static memory. Format with spaces after eight bits; use X for don't care.
Implement the prefix32bit_match API to check a 32 bit input against an effective prefix using a main prefix, a wildcard mask, and don't cares and prefix length.
Implement the uint32_apply_mask API to apply a bitwise and with mask on the prefix, using mask length bits and zeroing the remainder; a zero mask length yields no operation.
Validate the bitmap library on big-endian and little-endian machines to ensure independent code, then leverage the Mtry data structure for IPv4 routing tables and access control lists.
Explore giant integers, or big integers with hundreds of digits, and their applications in cryptography, scientific computing, number theory, and compression techniques, plus algorithms for giant integers and binary conversion.
Implement giant integer APIs in C, including converting a digit-array giant integer to a bitmap and back, and adding per-digit arithmetic, with the fourth API provided as homework.
Convert a giant integer to a bitmap by dividing a digit array by two. Expand the bitmap dynamically, carry through divisions, reverse the bitmap, and shift to have leading zeros.
This course is designed for System Programmers, Kernel developers, Embedded programmers Or anyone who need to work at low-level memory manipulation ( at bit level ).
This is an Advance level Course in bit-programming, so it is assumed that the student is already familiar with basic bit-wise operators in C/C++.
In this course we will implement a bitmap library that is endian-ness independent. A bitmap is nothing but an array of bits. We will be going to implement some advanced operations on bitmaps.
We will also be introduced to the concept of Masks and WildCards and how to use them.
We ended this course by Implementing some real-world problems and data structures that conceptually works at the bit level. For example, Bloom Filters, Checksum, File-Compression Or Cryptographic algorithms to name a few.
The End Product of this course is a bitmap library which will be needed in sequel course which we will be dedicated to implementing a Advance Data structures extensively used in Networking - Routing Tables and Access Control Lists. We will then see how to implement more sophisticated Networking utilities such as packet sniffers Or Packet Filters OR integrate our Libraries within Linux Networking stack.
So, be ready to write lots of bit-level code and see how things works at bit level.