
Month: May 2023
Synchronization methods
Synchronization Methods:-
For optimum demodulation of ASK, FSK and PSK waveforms, timing information is needed at the receiver. In particular, the integrate and dump operation in correlation receivers and the sampling operation in other types of receivers must be carefully controlled and synchronized with the incoming signal for optimum performance.
Three general methods are used for synchronization in digital modulation schemes. These methods are
- Use of primary (or) Secondary time standard.
- Utilization of a separate synchronization signal.
- Extraction of clock information from the modulated waveform itself, referred to as self-synchronization.
In the first method, the receiver and transmitter are solved to a precise master timing source. This method is often used in large data communication networks. In point to point data communication this method is very seldom used because of its cost.
separate synchronization signals in the form of pilot tones are widely used to in point to point data communication systems. In this method, a special synchronization signal (or) sinusoidal signal of known frequency is transmitted along with the information carrying modulation wave form the synchronization signal is sent along with the modulation wave form using one of the following methods.
- By frequency division Multiplexing, where in the frequency of the pilot tone is chosen to coincide with a null in the power spectral density of the signalling wave form.
- By time division Multiplexing where the modulated wave form is interrupted for a short period of time during which the synchronizing signal is transmitted.
- By additional modulation such as the one shown in figure.

In all of the above methods, the synchronization signal is isolated at the receiver and the zero crossings of the synchronization signal control the sampling operations at the Receiver.
All three methods discussed above and over head(or additional requirements) to the system in terms of an increase in power and Band Width requirements (or) a reduction in the data rate in addition to increasing the equipment complexity.
Self-synchronization methods extract a local carrier reference as well as timing information from the received wave forms. The Block Diagram of a system that derives a coherent local carrier from a PSK wave form is shown in figure(1) similar systems can be used to extract such a reference signal for other types of digital modulation schemes.
A feedback version of the squaring synchronizer is shown figure(2) . This version makes use of a PLL for extracting the correct phase and the frequency of the carrier wave form.
<
p style=”text-align: justify;”>
Problem2- Cyclic Codes
Problem 2. If the received code vector R = { 1 1 0 1 1 1 0} for a (7,4) Cyclic Code, check whether R is a valid code word (or) not if g(x) = 1+x+x3 .

S is non -zero R is not a valid Code Vector that means there exists some transmission error in R.
Problem1-Cyclic Codes
pb 1. for a (7,4) Cyclic code if V={0101110} is the received code word . Then find the Syndrome if the generating polynomial is g(x) = x3 + x + 1
Ans. The syndrome polynomial S(x) can be find by dividing V(x) by g(x).

As Syndrome S(x) is zero, the received code word is a valid code word and is nothing but the transmitted code word.
Binary Cyclic Codes
Binary Cyclic Codes:-
Binary Cyclic Codes form a sub class of linear block codes.
Binary Cyclic Codes have two advantages
- Encoding and syndrome calculations can be easily implemented using simple shift registers with feedback connections.
- These codes have a fair amount of mathematical structure that makes it possible to design codes with useful error correcting properties.
we know that a linear block code can be represented in Matrix form. Here, we will develop a polynomial representation for cyclic codes and this representation is used to derive procedures for encoding and syndrome calculations.
A special sub classes of cyclic codes that are suitable for correcting burst type of errors in a system.
Algebraic structure of Cyclic Codes:-
An (n , k) linear block code C is also called as a cyclic code if it has the following property
if an n-tuple code vector of C is V then the n-tuple
Obtained by shifting V Cyclically one place to the right is also a code vector of ‘C’.
This we can illustrate by using an example
This Cyclical shifting property, allows us to treat the elements of a code word as the coefficients of a polynomial of degree(n-1).
for example is an n-bit code word can be represented as a polynomial of degree (n-1) as
where vo , v1 , v2 , ……..vn-1 are elements of code word are represented as coefficients of polynomial.
The elements are binary 1’s and 0’s in general. Hence these codes are called Binary Cyclic Codes . Then binary addition and multiplication of these elements is as follows
if V is shifted i positions to the right then
we can obtain from Vi(x) from V(x) as the remainder resulting xi V(x) by dividing with xn+1 when
Constructor & Passing Information to Constructor
1.Can a constructor have a return type in Java?
Ans. No.
2. _____ keyword is used to call a constructor from another constructor in Java?
Ans. this.
The varargs argument
1. What is the purpose of using varargs in Java?
Ans. To pass a variable number of arguments to a method.
2. Which of the following is a valid declaration of a method that uses varargs in Java?
Ans. public static void myMethods(String str,int …..args).
Method Overloading
1. Which of the following is true about method overloading?
Ans. All of the above.
2. Which of the following is not true about method overloading?
Ans. is possible by changing the return of the method.
Defining Methods & Passing Information
1. The signature of a method in Java includes ________________
Ans. Method name, return type and parameter types.
2. Which keyword in Java is used to indicate that a method does not return a value?
Ans. void.
Declaring a Class & Creating Objects
1. Which of the following statements creates a new object from the Person class with the name “Alice”?
Ans. Person alice = new person();
2. Which of the following is true about object creation in Java?
Ans. Objects are created by invoking a constructor on a class.
Inheritance
1. In Java, inheritance allows a subclass to:
Ans. Override or extend the methods and fields from the superclass.
2. To create a subclass in Java, you use the ___ keyword followed by the name of the superclass.
Ans. extends.
3. The superclass in Java is also known as the
Ans. Parent class.
4. Which keyword in Java is used to refer to the methods and fields of the superclass?
Ans. Super.
Polymorphism
1. What are the two main mechanisms of polymorphism in Java?
Ans. Method Overloading and Method Overriding.
2. What is method overloading in Java?
Ans. A way to provide different implementations of the same method for different types of input.
3. What is method overriding in Java?
Ans. A way to provide new implementation for a method that is already defined in a super class.
Abstraction
1. What is the purpose of abstraction in Java?
Ans. To provide a way to hide the implementation details of a class.
2. What is an abstract class in Java?
Ans. A class that can not be instantiated.
3. What is an abstract method in Java?
Ans. A method that has no implementation.
Encapsulation
1. What is encapsulation in Java?
Ans. All of the above.
2. What is the purpose of encapsulation in Java?
Ans. All of the above.
3. Which access modifier is used for encapsulation in Java?
Ans. Private.
Class & Object in Java
1. A class in java means _______________
Ans. A blueprint for creating objects.
2. A object in java means______________
Ans. An instance of a class.
3. How do you create an object in Java?
Ans. ClassName objectName = new ClassName();
Object Oriented Programming
1. Which among the following is oldest object-oriented programming language?
Ans. Simula.
2. What is an object in object-oriented programming?
Ans. A data structure that combines data and functions.
Multi-D Array Practical
1. What is the purpose of the following java code?
int[][] arr = new int[3][4];
Ans. It creates a two- dimensional array with 3 rows and 4 columns.
2. What is the output of the following Java code?
int[][] arr = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
System.out.print(arr[i][j] + ” “);
}
System.out.println();
}
Ans. 1 2 3 4 5 6 7 8 9.
3. What is the output of the following Java code?
int[][] arr = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
int sum = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr[i].length; j++) {
sum += arr[i][j];
}
}
System.out.println(sum);
Ans. 45.
Multi-Dimensional Array
1. What is the correct syntax for declaring a 2D array of integers with 2 rows and 3 columns in Java?
Ans. int[][] array = new int[2][3];
One Dimensional Array – Practical 2
- What is the output of the following code?
int[] numbers = {1, 2, 3, 4, 5};
int sum = 0;
for(int i=0; i<numbers.length; i++)
sum += numbers[i];
}
System.out.println(sum);
Ans. 15.
2. Give the output of the given code below.
String[] nums = new String[] { "1", "9", "10" };
Arrays.sort(nums);
System.out.println(Arrays.toString(nums));
Ans. [1, 10, 9] .
One Dimensional Array – Practical 1
- What is the output of the following code?
int[] numbers = {1, 2, 3, 4, 5};
System.out.println(numbers[3]);
Ans. 4.
2.
What is the output of the following code snippet?
int[] numbers = {1, 2, 3, 4, 5};
for(int i=0; i<numbers.length; i++)
System.out.print(numbers[i] + ” “);
}
Ans. 1 2 3 4 5.
Introduction to Arrays
1. What is the output of the following pseudo-code?
String[] languages = {“Telugu”, “Tamil”, “Sanskrit”, “English”};
languages[4] = “Japanese”;
System.out.println(languages[0]);
Ans. Array Index Out of Bounds exception.
2. What is the syntax for initializing an array in Java?
Ans. type[] array Name = new type[size];
3. How do you access a specific element in a one-dimensional array in Java?
Ans. array[index];
4. What is the default value of an integer array element in Java?
Ans. 0.
Break & Continue Practical
1. What is the output of the given code?
public class Test{
public static void main(String []args){
for(int i = 0; i < 10; i++){
if(i % 2 == 0){
continue;
}
System.out.println(i);
}
}
}
Ans. program will print all odd numbers between 0 to 10.
2. Where can the “break” statement be used in Java?
Ans. Inside both a loop and switch statement.
Branching Statement (Break & Continue)
1. What is the purpose of the “break” statement in Java?
Ans. It is used to terminate a loop or switch statement prematurely.
2. What is the purpose of the “continue” statement in Java?
Ans. It is used to skip over a particular iteration in a loop.
For Loop Practical
1. What is the output of the following code?
int i = 0;
for(i = 0 ; i < 5; i++){
}
System.out.println(i);
Ans. 5.
2. What is the output of the following code?
public class Test{
public static void main(String []args){
int i = 0;
for(i = 0; i < 10; i++){
break;
}
System.out.println(i);
}
}
Ans. 0.
The for loop
1. What is the difference between a while loop and a for loop?
Ans. A for loop is used when the number of iterations is known, while while loop is used when the number of iterations is unknown.
2. What will be the output of the following for loop?
for (int i = 10; i >= 1; i /= 2) { System.out.print(i + ” “); }
Ans. 10 5 2 1.
while and do…while Practical
1. What is the syntax for a do-while loop in Java?
Ans. do{} while (condition).
2. How many times will the following do-while loop execute?
int i = 0;
do {
i++;
} while (i < 5);
Ans. 5 times.
3. What is the output of the below Java program?
int a=1;
while(a<4)
{
System.out.print(a + " ");
a++;
}
Ans. 1 2 3 .
The switch….case Practical
1.What is the output of the Java program below?
String animal = "GOAT";
switch(animal)
{
break: System.out.println("DOMESTIC");
}
Ans. Compile error.
2. What is the output of Java program with SWITCH?
int num=20;
switch(num)
{
case 10: System.out.println("TEN"); break;
case 20: System.out.println("TWENTY"); break;
case 30: System.out.println("THIRTY");
}
Ans. TWENTY
The switch…case Statement
1. What is the purpose of the “break” statement in a switch-case block in Java?
Ans. To continue executing the next case statement.
2. What is the purpose of the “default” case in a switch-case block in Java?
Ans. To provide a default behavior if none of the cases match.
If….else Condition Practical
1.What is the output of following pseudo code?
int a= 2+3<<5/6;
int b=6>>4%4;
if(a>b)
{
System.out.println(a+6);
}
else
{
System.out.println(b-3);
}
Ans. 3.
2. Can an if statement be used inside another if statement in Java?
Ans. Yes.
Operators Practical
1. What is the value of x after executing the following code in Java?
int x = 5;
x += 2 * 3;
Ans. 11.
2. What is the value of y after executing the following code in Java?
int x = 5, y = 7;
y = x++ + ++y;
Ans. 13.
3. What is the value of z after executing the following code in Java?
int x = 5, y = 10; int z = x > y ? x : y;
Ans. 10.
Operators – Part 2
1. What is the result of the following Java expression?
10 & 6
Ans. 2
2. What will be the output for the following expression?
12 ^ 5
Ans. 9
3. What is the syntax of ternary operator in Java?
Ans. condition? expression1 : expression2;
4. What is the result of the following expression in Java? int x = 10, y = 5;
int z = x > y ? x : y;
System.out.println(z);
Ans. 15.
Operators – Part 1
1. What is the output of following pseudo code? int a=350; System.out.println(~a)
Ans. -351.
2. What is the output of following pseudo code? int a=118; System.out.println(a++ + ++a);
Ans. 238.
3. What is the output of the following pseudo-code? int a= 118; System.out.println(a++ + a++);
Ans. 237.
4. What is the output of the following pseudo-code? System.out.println(102*110/15+43-21*94/20);
Ans. 693.
5. What is the output of the following pseudo-code? System.out.println(115<<42);
Ans. 117760.
6. What is the output of following pseudo code? int a= 2+3<<5/6; int b=6>>4%4; int res= (a<b)?b:a; system.out.println(res);
Ans. 6
Practical 2
1. Which of the following is a valid variable declaration in Java?
Ans. double pi= 3.14159;
2. Which of the following is a valid Java identifier?
Ans. _myVariable.
<
p style=”text-align: justify;”>
Practical 1
1.Choose the correct answer
What is the output of the following Java program?
public class Main {
public static void main(String[] args) {
int x = 5;
int y = 10;
System.out.println(x + y);
}
}
Ans. 15.
2. What is the correct way to declare a variable in Java?
Ans. int x=5;
3. What is the output of the following Java program?
public class Main {
public static void main(String[] args) {
String message = “Hello, World!”;
System.out.println(message);
}
}
Ans. Hello, World!
Types of variables & Final keyword
1.A variable that is declared inside the method is ________
Ans. local variable.
2. What is the output of following pseudo code?
int price;
static int tax = 300;
public static void main(String args[])
{
int a = 100;
Main obj = new Main();
System.out.println(Main.tax);
}
Ans. 300
Variables
1. What are the three main parts of a variable in Java?
Ans. Value, type, identifier.
2. What is the scope of a local variable in Java?
Ans. Within the method in which it is declared.
Keywords in Java
1.Which among the following is not a keyword in java?
Ans. loop.
2. Which among the following keyword indicates that a class is derived from some other class
Ans. extends.
3. In which of the following cases this keyword can be used?
Ans. Both A and B are True.
Identifiers
1. How many identifiers are there in java?
Ans. 5.
Literals
1. Boolean literals have how many values in java?
Ans. 2.
2. Does literals consists of characters that are mutable?
Ans. No.
3. Which among the following are not types of literals in java?
Ans. Class.
Data Types in Java
1. Which among the following is a primitive data type in Java?
Ans. int.
2. What is the default value of char data type in Java?
Ans. ‘\u0000’
Working with Eclipse IDE
1. Eclipse 4.3 version can be called as ?
Ans. Kepler.
2. In Eclipse IDE, where does the log file gets stored?
Ans. Workspace/.metadata/.log
Working with Intelij IDEA
1. What is IntelliJ IDEA?
Ans. An integrated development environment (IDE) for java.
2. What is the keyboard shortcut to run a Java program in IntelliJ IDEA?
Ans. Ctrl+Shift+F10.
3. What is the shortcut to navigate to a specific line number in a file in IntelliJ IDEA?
Ans. Ctrl+G.
Working with VS Code IDE
Ans. It allows developers to track changes to the Source code over time.
2. Which programming language is commonly used for developing web applications?
Ans. Ruby.
Architecture of Java Virtual Machine (JVM)
Ans. Stack.
2. ___ provides storage for the objects in java
Ans. Heap.
3. Which among the following operations is/are performed by JVM?
Ans. Both A & B.
Compilation and execution of a program
Ans. javac filename.java.
Program Structure
1.Which among the following order is true about program structure in java?
Ans. Documentation section, Package Statement, Import Statement, Interface Definition, Class definition.
2. From where does the program execution starts in java?
Ans. From Main() method.
History and features of Java
1. Which among the following about java is true?
Ans. All of these.
2. With Java, is it possible to develop virus-free applications?
Ans. Yes.
3. Which of the following mechanism, makes java, platform independent
Ans. Write once Run anywhere.
4. In java, does the size of primitive types is fixed?
Ans. Yes.
Common Errors in Python – Notes
The key takeaways are: 1). Errors in python: -Errors are the problems in a program due to which the program will stop the execution. On the other hand, exceptions are raised when some internal events occur which changes the normal flow of the program. 2). Syntax error: -When the proper syntax of the language is not followed then a syntax error is thrown. 3). Index error: – Lists are one of the most used data structures in Python. Index is the one used in a List. You might have gotten the message “Index Error: list index out of range” when your program ran into an error while using lists. 4). Module error: – As the name implies, this error occurs when you’re trying to access or use a module that cannot be found. In the case of the title, the “module named Python” cannot be found. 5). Key error: – generally means the key does not exist in a dictionary result in key error. 6). Import error: – There are two conditions when the Import Error will be raised. one is If the module does not exist and the second one is If we are trying to import submodule from the module. 7). Stop iteration error is thrown when the next function is going beyond the number of items in the iteration. 8). Type error: – Type Error is an exception in Python programming language that occurs when the data type of objects in an operation is inappropriate. For example, if you attempt to divide an integer with a string, the data types of the integer and the string object will not be compatible. Due to this, the Python interpreter will raise a Type Error exception as shown in the following example. 9). Value error: – A Value error in Python is a fairly simple concept. When you assign the wrong value to an object, you will get a Value error. 10). Name error: – It occurs when the variable is not defined. 11). Zero division error: – It occurs when the variable is divided by zero. 12). keyboard interrupt error: – Keyboard Interrupt exception is a part of Python’s built-in exceptions. When the programmer presses the ctrl + c or ctrl + z command on their keyboards, when present in a command line (in windows) or in a terminal (in mac os/Linux), this abruptly ends the program amidst execution
Numbers and Math Functions – Activity
Numbers and Math Functions – Notes
Numbers and Math functions: – There are three numeric types in Python int, float, complex. Variables of numeric types are created when you assign a value to them. example: -complex=1j To verify the type of any object in Python, use the type() function as print(type(variable)). example: – a=5 print(type(a)) You can convert from one type to another with the int(), float(), and complex() methods. example: – a=2 x=float(a) Mathematical functions: – Operators are used to perform operations on variables and values. Arithmetic operations are addition, subtraction, multiplication, division, modulus, exponential and floor division. addition: – The operator ‘+’ is used to add two numbers. subtraction: – The operator ‘-‘ is used to subtract two numbers. Multiplication: – The operator ‘*’ is used to multiply two numbers. division: – The operator ‘/’ is used to divide two numbers. Modulus: – The operator ‘%’ is used to find the remainder in division operation. Exponential operation: – (a**b) is used to find a to the power of b value. floor division:-(a//b) is dividing one number by another and then rounding the result to the closest integer that is smaller.

