The main Objectives is to understand the operation of logic gates.
Logic Gates are used to build digital systems. The basic gates are AND, OR, NOT, NOR, NAND, EXOR and EXNOR gates. NAND and NOR gates are called universal gates as these gates can implement any Boolean function without any use of other gates. The basic operations of gates are explained below with truth table and gate symbol.
The AND Gate is an electronic circuit which gives high output only when all of its inputs are high, in all other cases output is low. The logical equation for AND gate is
Y=A.B where Y is output and A and B are inputs.The dot (.) symbol is used to indicate AND operation.
Pin Configuration of AND gate
The OR gate is an electronic circuit, that gives output high when any one or more inputs are high, in all other cases output is low. The logical equation for OR gate is X= A+ B.Where X is output and A and B are inputs.The plus (+) symbol is used to indicate OR operation.
Pin configuration of OR gate
The NOT gate is an electronic circuit, that produces output which is inverted version of input. It is also called as inverter. The logical equation for NOT gate is X= ~X.
Pin Configuration of NOT gate
The NAND gate is electronic circuit, that gives output low when all of its inputs are high, in all other cases output is high. The logical equation for NAND gate is X= ~ (AB).
Pin configuration of NAND gate.
The NOR gate is electronic circuit, which gives output high when all of its inputs are low, in all other cases output is low. The logical equation for NOR gate is Q= ~ (A+B). Where Q is output and A and B are inputs.
Pin Configuration of NOR Gate
The XOR gate is electronic circuit, which gives output high only when any one of its input is high, in all other cases output is low. The logical equation for XOR gate is X= A⊕B. Where x is output and A and B are inputs.
The symbol is used to indicate XOR operation.
Pin Configuration of XOR gate
The XNOR gate is electronic circuit, which gives output high only when all of its inputs are identical, in all other cases output is low. The logical equation for XNOR gate is Y= ~(AxorB). Where Y is output and A and B are inputs.
Logical Symbol of XNOR Gate:
Pin Configuration of XNOR gate:
What is 555 timer and how will it works ?
So, today we will discuss about the 555 IC. What is 555 timer and how will it works.
What is 555 timer IC?
555 timer is introduced in 1972 by signatics corporation.it is usually described as a highly stabled device for generation of accurate delay and oscillation. This is very cheap and popular timing device.
Let’s start a discussion about 555 timer. This is normally an IC (integrated circuit) and also a type of timer. Have you thought about why it’s named as 555 time? The answer is, it made up with THREE 5k ohm RESISTOR in series connection. Let we see how it is working, construction and application.
555 Timer PIN DIAGRAM
Construction of 555 timer:
Once you start studying about IC you don’t go with an IC. First you learn internal diagram of IC. It will helpful for you know where will get an output in which condition and input? Let starts discuss about internal connection.
In introduction itself, I told, 555 timer made of THREE 5k ohm RESISTOR in series connection. Why they would connected in series connection? Because in series connection voltage should be divided.
Based on this three resistors has been connected in series, so voltage divided into 3 parts. The 1st part is VCC/3, 2nd part is 2VCC/3 and last part is 3VCC/3 (refer Fig 1).
Then this two voltages (2VCC/3 and VCC/3 ) is connected to the two separate comparator. One is called as a lower comparator and another one is upper comparator. This two comparators will have two terminals are inverting (-) and non- inverting (+). The VCC/3 is connected to non-inverting terminal which in lower comparator. 2VCC/3 is connected to inverting terminal in upper comparator (refer fig 1.1).
Next the lower comparator inverted pin goes outside which is the trigger pin 2 of the IC. Upper comparator non-inverting terminal is connected to the Threshold pin 6 of the IC.(refer Fig 1.2)
The output of two comparators is giving to the flip flop which is SR FLIP FLOP. On that flip flop have 4 terminals, which are the S,R,Q,Q’. Here we consider Q is an output of SR flip flop and Q’ is an output of 555 timer. So Q’ is connected to the output of IC pin 3. Then Q is connected through the resistor to the PN transistor, the transistor’s VCC pin is a discharge pin.(refer fig 1.3).
The reset pin is connected to the SR flip flop. In 2VCC/3 through that control pin has to be connected. (ref Fig 1.4)
Working of 555 timer IC:
The 555 timer shown above is configured as an astable circuit. This means that the output voltage is a periodic pulse that alternates between the VCC value and 0 volts.
The frequency is the number of pulses per second. The formula to calculate the frequency of the output voltage is:
The period is the time covered for one pulse. This is just the reciprocal of the frequency:
The high time (T1) and low time (T0) can be calculated using the formulas below. Note that the period is the sum of the high time and the low time.
The mark space ratio is the ratio between the high time and the low time or:
Mark Space Ratio=T1T0
The duty cycle is more commonly used than the mark space ratio. The formula for the duty cycle is:
Duty Cycle=T1T x 100
A 50% duty cycle means the high time is equal to the low time. If an LED is placed at the output of this astable circuit, it will turn on at the same span of time as it is turned off. Note that getting an exact 50% duty cycle is impossible with this circuit.
- Increase C to increase the period (reduce the frequency).
- Increase R1 to increase High Time (T1), without affecting the Low Time (T0).
- Increase R2 to increase High Time (T1), increase Low Time (T0) and decrease the duty cycle.
Light dimmer using NE555:
These are the final image of 555 timer circuit astable circuit connection and graphical representation of frequency. From this we learned about 555 timer working, construction, and how to calculate the 50% of frequency.
Write a C Program to Create Function Pointer ?
In this ongoing C programming tutorial series, we learned many C programming language.In this tutorial, we will learn how to declare a function pointer and what is a function pointer.
A pointer is the backbone of c language, without the pointers, we cannot imagine the C Language. A good cognizance of pointers enables the programmer to indite the optimize and robust code.
In the C language, a pointer is like a variable but only there is one distinction between the pointers and variables. A variable store value but pointer store address of the variable or other pointers.
C programming code to create function pointer:
int add(int a,int b);
int sub(int a,int b);
int mul(int a,int b);
int div(int a,int b);
int mode(int a,int b);
int (*ope9r)(int b,int c);
struct foo foo1;
printf(“enter where u want add”);
printf(“enter where u want sub”);
printf(“enter where u want mul”);
printf(“enter where u want div”);
printf(“enter where u want mod”);
printf(“enter the value of a,b”);
printf(“enter the key what u want to perform”);
int add(int a,int b)
int sub(int a,int b)
int mul(int a,int b)
int div(int a,int b)
int mode(int a,int b)
Leave a comment if you have any problem,we will try our best to solve your problem.
Write a C Program to Create Multiplication Table ?
If you are looking for a C program to generate multiplication table.So, In this blog, we will help you to learn and how to write a program for multiplication table in C, and also the logic to print multiplication table of any given number in C program.Just go through this C programming tutorial to learn about multiplication table in C.
Enter any integer number as an input of which you want multiplication table. After that, we use for loop from one to ten to generate multiplication of that number.Inside for loop just multiply numbers and print result in each iteration.Now let’s have a look in a programmatic way
C Programming Code to print multiplication table:
int table( int num )
Let us know if you are stuck somewhere and need help.Send us your problem and we will publish the solution,We will try our best to provide you a solution to your problem. You are also free to request some other problem using our comments section.See our more C Programming Language.
Write a C Program to print pyramid ?
Hello friends, we are back with another simple and most interesting C Program.In our last blog we saw you how to write c program to check whether the number is palindrome or not.In this program we will make a pyramid with the help of C programming Language.This kind of problems is useful for beginners to understands the fundamentals of loops and spaces.
A pattern of numbers, star or characters is a way of arranging these in some logical manner or they may form a sequence. Some of these patterns are triangles which have special importance in mathematics.Let’s see the programming part of this program.
C Programming Code to print pyramid:
int pyramid(int row )
for ( i=1;i<=row;i++)
return ( row );
printf(“enter the number of lines”);
pyramid ( line );
Logic behind this program:
We first take the number of rows in the pattern as input from user using scanf function.
One iteration of outer for loop will print a row of pyramid.
Inner for loop prints the initial spaces for every line and nested while loop prints (2*r – 1) space separated stars for rth row of pyramid.
Stay connected with us for more C Programming Language.Leave a comment for any question.
Write a C Program to check whether the number is palindrome or not ?
What is Palindrome number?
A palindrome is a number that remains the same when its digits are reversed.For example – 1551,121,32423, etc, if these digits are reversed then also we get the same result.The term palindromic is derived from palindrome, which refers to a word (such as rotor or racecar) whose spelling is unchanged when its letters are reversed.
This program reverses an integer (entered by the user) using while loop. Then, if statement is used to check whether the reversed number is equal to the original number or not.
C Programming code for Palindrome number or not:
int integer( int n )
while( n!=0 )
if ( a == rev)
printf(“%d is a palindrome”,a);
printf(“%d is a not palindrome”,a);
printf(“enter the num”);
integer( num );
Logic behind this program to check number is palindrome or not:
1. Input a number from user. Store it in some variable.
2. Find reverse of the given number. Store it in some variable say reverse.
3. Compare it with the number entered by the user.
4. If both are the same then print palindrome number else print not a palindrome number.
Leave a comment for any queries or question.Stay connected with us for more C programming Language.
Write a C Program to find vowel or consonant using if-else statement ?
In English, A, E, I, O, and U are the five alphabets which are known as Vowels.Except these five alphabets all the remaining alphabets are called as consonants. In this tutorial, we will show you, How to write a C Program to check Vowel or Consonant with the explanation.
C Programming Code:
printf(“enter the charter”);
printf(“%c is vowel\n”,alphabet);
printf(“%c is consonant\n”,alphabet);
The user will first ask to enter any character, and then we are assigning the character to the previously declared variable.
Then, we used the If Else Statement to check whether the character entered by the user is equal to, A, E, I, O, U, for both upper and lower case. And if it is TRUE, it is a Vowel otherwise, it’s a Consonant.
Leave a comment if you have any doubt or difficulties.
Write a C Program to find lcm of two number ?
Today, let’s learn how to find LCM of two numbers in C Programming Language. But before executing the program, we will see what is LCM.
Least common multiple (LCM) The least common multiple (LCM) of two numbers is the smallest number that they both divide evenly into. In simple language,the smallest positive number that is a multiple of two or more numbers.
Code of the C Program to calculate the LCM of two numbers:
printf(“enter the value of n1,n2”);
for(i=2;i<=n1 && i<=n2;i++)
if(n1%i==0 && n2%i==0)
Leave a comment, if you have any querries or doubt.We will try our best to rectify your problem.
Write a C Program to Find Total Salary ?
In our last blog we learn how to write a c program to check whether the number is prime or not. In this article, we will show you, how to write a C Program to Calculate Gross Salary of an Employee with example.This program will read Basic Salary of an employee, calculate other parts of the salary on percent basic and finally print the Gross Salary of the employee.This was another simple program which has been taught to the beginners.
C Program Code:
int gross( int basic_salary)
printf(“enter value basic_salary”);
If you have any doubt or queries regarding C Programming Language, feel free to ask anytime or just leave a comment.
Write a C Program to check whether the number is prime or not ?
In our last program, we saw how to calculate profit and loss in c programming. In this program, we will use an if-else statement to check whether the number is prime or not.
A prime number is a positive integer which is divisible only by 1 and itself. For example: 2, 3, 5, 7, 11, 13.When a number has more than two factors then it is called a composite number.
This program takes the number from the user and then checks whether the input number is prime or not. Then the program displays the result.
C programming code:
int prime(int num)
printf(“%d num is prime\n”,num);
printf(“%d num is not prime\n”,num);
printf(“enter the value of a”);
Let us know if you are stuck somewhere and need help.We will try our best to provide you a solution to your problem. You are also free to request some other problem using our comments section.