Posts

Voltage follower using Op-amp IC TL082

Image
  What is a Voltage Follower? A voltage follower (also known as a buffer amplifier, unity-gain amplifier, or isolation amplifier) is an op-amp circuit whose output voltage is equal to the input voltage (it “follows” the input voltage). Hence a voltage follower op-amp does not amplify the input signal and has a voltage gain of 1. The voltage follower provides no attenuation or amplification—only buffering. A voltage follower circuit has a very high input impedance. This characteristic makes it a popular choice in many different types of circuits that require isolation between the input and output signal. Below figures shows implementation of Voltage follower in Proteus design suite. You can see how the output voltage is approximately equal to the given input voltages.

Python: Anagram check program

  def anagram (s1, s2):     #s1 and s2 are two strings which are to be checked for anagram     s1 = s1.replace( ' ' , '' ).lower() # s1 is reaasigned with removing spaces and then made all lowercase       s2 = s2.replace( ' ' , '' ).lower() # s2 is reaasigned with removing spaces and then made all lowercase     return sorted (s1) == sorted (s2)  # sorted both s1 and s2 and checked, if equal then returns True else False print (anagram( 'this is right', 'is this right' )) #printed True for anagram and False for not anagram Output: >> True

Python: Finding largest continuous sum in a list/array

 Problem Statement: Given a list of integers (both positive and negative) find the largest continuous sum. e.g.  Input: list1 = [1, 2, -1, 3, 4, 10, 10, -10, -1] Output: 29 Solution: def   largest_cont_sum ( list1 ):     max_sum  =  current_sum  =   0           if   len ( list1 )   ==   0 :          return   " There is no any element in the List "           for  num  in  list1 :         current_sum  =   max ( current_sum  +  num ,  num )         max_sum  =   max ( current_sum ,  max_sum )           return  max_sum list1  =   [ 1 , 2 ,- 1 , 3 , 4 , 10 , 10 ,- 10 ,- 1 ] print ...

Python: Find the missing element

 Problem Statement: Consider array/list of non-negative integers. The second array/list is formed by shuffling the elements of the first array/list and deleting a random element. Given these two arrays/lists, find which element is missing in second array. e.g. list1 = [1, 2, 3, 4, 5, 6] list2 = [2, 5, 4, 6, 3] here missing element is 1. Solution: def   missing_ele ( list1 ,   list2 ):     list1 . sort ()     list2 . sort ()      for  num1 ,  num2  in   zip ( list1 ,  list2 ):          if  num1  !=  num2 :              return  num1      return  list1 [- 1 ] list1  =   [ 1 ,   2 ,   3 ,   4 ,   5 ,   6 ] list2  =   [ 2 ,   4 ,   6 ,   3 ,   5 ] print ( " Missing element is:...

555 Timer as Monostable Multivibrator

Here, I have simulated a Monostable Multivibrator in Proteus design suite.

Python: Addition, Subtraction, Multiplication and Division using function

Program:   #Addition function def addition(a,b):     c=a+b     print("Addition= ",c) print("Enter two numbers") #Subtraction function def subtraction(a,b):     c=a-b     print("Subtraction= ",c) #Multiplication function def multiplication(a,b):     c=a*b     print("Multiplication= ",c) #Division function def division(a,b):     c=a/b     print("Division= ",c) a=float(input()) b=float(input()) addition(a,b) subtraction(a,b) multiplication(a,b) division(a,b) Output: Enter two numbers 8 4 Addition=  12.0 Subtraction=  4.0 Multiplication=  32.0 Division=  2.0

Python: Addition of two numbers using function

Below is a simple addition program demonstrated using function addition. This program shows you how to use function in Python  def addition(a,b): #This is funtion definitation     c=a+b     print("Addition = {}".format(c)) print("Enter two numbers to be added") a=int(input()) b=int(input()) addition(a,b) #call the function addition() by passing two numbers a & b Text in green are comments Output: Enter two numbers to be added 341 12 Addition = 353