
"Knowledge is a process of piling up facts; wisdom lies in their simplification"
...Martin Fischer
Here is video to explain scope of the whole course. This course is an extension to our course "Demystifying C programming language". Thorough knowledge of C programming language is must before you start this course.
This video explains the introduction to this section.
Please refer to the attached file in the resources section of this lecture for knowing importance of "Bit operations in C".
Here is a video to understand Numbering systems viz.
The video also covers advantages and disadvantages of binary, hex and octal numbering system.
If you are well versed with numbering system, which is prerequisite to Bit Operations, you can skip this lecture.
Here is video to understand how One's complement works. Though Two's complement is not a bit-wise operator, it has been also covered to understand how negative numbers are stored by the computer
The video explains the bitwise AND operator and the operator in C is &
Here is a second operator in the first category of bit-wise operators i.e. Bitwise OR. It is also called as Inclusive OR operator. The animation is interesting to watch but needs to be viewed and listened to very carefully. The operator in C is |
Here is a video of third bit-wise operator in the category logical bit-wise operators in C. It's exclusive because of its behavior and versatility. Watch the video carefully. Applications would be in the following video.
There are two operators viz. Right Shift (>>) and Left Shift (<<) which are used to shift individual bits. The video explains both of them using extensive animation
Using string in C.
The program has been written using string concepts in C and use of modulus operator.
The source code is made available for download. Type it, compile it, execute it and debug it to know internal processing.
Here is a wonderful program explained by co-instructor Daryl Newell to find the decimal value of a number from the binary pattern. You need to know concepts of string to understand the program.
Since we have seen concepts of Bitwise operations in C in the first section, it's time to write an understand some programs and applications of Bitwise operations in C.
Here is a single program consisting of 3 functions to find
Listen and view the program carefully. There is one common function printbinary() in all programs to find the binary equivalent of a decimal number. The same has been explained in the curriculum ahead.
In the first section, we studied a program to convert a decimal number into binary using modulus operator. Now that we have learnt basics of bit-wise operations in C, here is a program to convert decimal number into a binary equivalent.
Watch the video carefully, listen it with full concentration and Write a program made available in the resources in the PDF format.
Play with the code to understand the basics of the program.
Here is a video to explain a method to convert a decimal number into its Hex equivalent.
Extensive animation is used to explain the logic used to write a program.
Though the video length is just 10 minutes, view and listen it carefully, maybe you would spend 5x minutes to understand the concepts. Note that animation has been done at multiple locations at a single time in some portion of the video.
The source code along with necessary comments has been provided in the resources section.
An interesting video of bitwise operator application
Here is an interesting and cryptic code explained by co-instructor Mr. Daryl. Watch and listen the program carefully. Animation has been done in detail to explain minute details of the processes inside the loop.
Watch it again and again.
Here is an interesting program with given objective as to find 1's and 0's in a binary number.
The program is intentionally taken here to strengthen concepts of bit-wise operators in the first chapter like:
Here are a few interesting assignments on Bit-Wise operations in C. Try these assignments on your own.
In this course we will discuss the importance of bitwise operations in modern programming, how bitwise operations are performed, how to set up a “bit mask” to test for a particular bit pattern, or to turn on a specific bit, etc.
This course is an additional course to our “Demystifying Object Oriented Programming with C++” and “C programming language demystified”. If you have not completed the C programming Demystified course, I recommend that you complete it or maybe take them at the same time. This course is essential in understanding the lower level operators in the C and C++ language. Having an understanding of these concepts will help you to be a better programmer by learning the how and why these features are used in the programs we write each day.
We will write small utility applications that will convert Decimal to Binary, Binary to Decimal, Decimal to Hex and more. In the section 2 we are going to add minimum 7 videos of applications of bit-wise operators at periodic intervals