11CS EM Lessons1 To 8
11CS EM Lessons1 To 8
COMPUTER SCIENCE
9345299522
THAAI PATHIPPAGAM
VIRUTHUNAGAR
PREFACE
It has been prepared keeping all students in mind with the primary motto
" - என்றும் மாணவர்கள் நலனில்".
Simplicity and elegant answers have been effectively prepared by teachers with
more than 20 years of experience with a view to achieving full marks.
Keeping in view the public examination answer keys, the answers, syntax, examples
with explanation and output are given for better understanding and reading.
Following the answers to the book questions, additional questions have been given
at the end of each lesson with emphasis on compulsory questions.
Our Services,
(set of model question papers and public exam papers)
(Minimum learning material)
(set of questions not to be missed at the last moment)
Best Wishes to Get Full Marks and a successful future.
SECTION – A
Choose the correct answer. 1 Mark
1. First generation computers used
(a) Vacuum tubes (b) Transistors
(c) Integrated circuits (d) Microprocessors
2. Name the volatile memory
(a) ROM (b) PROM (c) RAM (d) EPROM
3. Identify the output device
(a) Keyboard (b) Memory (c) Monitor (d) Mouse
4. Identify the input device
(a) Printer (b) Mouse (c) Plotter (d) Projector
5. …....… Output device is used for printing building plan.
(a) Thermal printer (b) Plotter (c) Dot matrix (d) inkjet printer
6. Which one of the following is used to in ATM machines
(a) Touch Screen (b) speaker (c) Monitor (d) Printer
7. When a system restart which type of booting is used.
(a) Warm booting (b) Cold booting (c) Touch boot (d) Real boot
8. Expand POST
(a) Post on Self Test (b) Power on Software Test
(c) Power on Self Test (d) Power on Self Text
9. Which one of the following is the main memory?
(a) ROM (b) RAM (c) Flash drive (d) Hard disk
10. Which generation of computer used IC’s?
(a) First (b) Second (c) Third (d) Fourth
SECTION - B
Very Short Answers. 2 Marks
1. What is a computer?
It is an electronic device that processes the input according to the set of instructions
provided to it and gives the desired output at a very fast rate.
2. Distinguish between data and information.
Data Information
Data is defined as an unprocessed collection Information is a collection of facts from
of raw facts, suitable for communication, which conclusions may be drawn.
interpretation or processing.
This will not give any meaningful message. It conveys some meaning.
For example, 16, ‘Kavitha’, ‘C’ For example, Kavitha is 16 years old.
Control Unit
Internal Memory
Data path
Control path
Main Memory
Secondary Storage
Input Unit:
➢ Input unit is used to feed any form of data to the computer, which can be stored in the
memory unit for further processing.
Example: Keyboard, mouse
Central Processing Unit:
➢ CPU is the major component which interprets and executes software instructions. It also
controls the operation of all other components such as memory, input and output units.
➢ The CPU has three components which are Control unit, Arithmetic and logic unit (ALU)
and Memory unit.
Control Unit:
➢ The control unit controls the flow of data between the CPU, memory and I/O devices.
➢ It also controls the entire operation of a computer.
Arithmetic and Logic Unit:
✓ The ALU is a part of the CPU where various computing functions are performed on data.
✓ The ALU performs arithmetic operations such as addition, subtraction, multiplication,
division and logical operations.
Memory Unit:
The Memory Unit is of two types which are primary memory and secondary memory.
✓ The primary memory is used to temporarily store the programs and data when the
instructions are ready to execute.
✓ The secondary memory is used to store the data permanently.
SECTION – A
Choose the correct answer. 1 Mark
1. Which refers to the number of bits processed by a computer’s CPU?
A) Byte B) Nibble C) Word length D) Bit
2. How many bytes does 1 Kilo Byte contain?
A) 1000 B) 8 C) 4 D) 1024
3. Expansion for ASCII
A) American School Code for Information Interchange
B) American Standard Code for Information Interchange
C) All Standard Code for Information Interchange
D) American Society Code for Information Interchange
4. 2^50 is referred as
A) Kilo B) Tera C) Peta D) Zetta
5. How many characters can be handled in Binary Coded Decimal System?
A) 64 B) 255 C) 256 D) 128
6. For 11012 the equivalent Hexadecimal is?
A) F B) E C) D D) B
7. What Is the 1’s complement of 00100110?
A) 00100110 B) 11011001 C) 11010001 D) 00101001
8. Which amongst this is not an Octal number?
A) 645 B) 234 C) 876 D) 123
SECTION - B
Very Short Answers. 2 Marks
1. What is data?
The term data comes from the word datum, which means a raw fact. The data is a fact
about people, places or some objects.
2. Write the 1’s complement procedure.
Step 1: Convert given Decimal number into Binary
Step 2: Check if the binary number contains 8 bits , if less add 0 at the left most bit, to make it
as 8 bits.
Step 3: Invert all bits (i.e. Change 1 as 0 and 0 as 1)
Example:
1. The binary number equivalent to the decimal number 15 is 11112
2. Convert to 8 bits 000011112
3. 1’s complement value is 111100002
2 20 2 25
2 10 –0 2 12 –1
2 5 –0 2 6 –0
2 2 –1 2 3 -0
1 -0 1 -1
8 65
8 8 –1
1 -0
16 65
4 -1
SECTION – A
Choose the correct answer. 1 Mark
1. Which is a basic electronic circuit which operates on one or more signals?
(A) Boolean algebra (B) Gate
(C) Fundamental gates (D) Derived gates
2. Which gate is called as the logical inverter?
(A) AND (B) OR (C) NOT (D) XNOR
3. A + A = ?
(A) A (B) O (C ) 1 (D) A
4. NOR is a combination of ?
(A) NOT(OR) (B)NOT(AND) (C ) NOT(NOT) (D) NOT(NOR)
5. NAND is called as …… Gates
(A) Fundamental Gate (B) Derived Gate
(C ) Logical Gate (D) Universal gate
SECTION – B
Very Short Answers. 2 Marks
1. What is Boolean Algebra?
Boolean algebra is a mathematical discipline that is used for designing digital circuits in a
digital computer. It describes the relation between inputs and outputs of a digital circuit.
2. Write a short note on NAND Gate.
➢ The NAND is the combination of NOT and AND.
➢ It acts in the manner of the logical operation “AND” followed by inversion.
➢ The output of the NAND gate is 0 if and only if both the inputs are 1, otherwise the output
is 1.
The logic symbol of NAND gate is The truth table for NAND gate is
Input Output
A B C = (𝐴 . 𝐵)
0 0 1
The output of the NAND gate is
0 1 1
C = (𝐴 . 𝐵)
1 0 1
1 1 0
3. Draw the truth table for XOR gate.
Input Output
A B C=A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
0 0 0
XNOR 0 1 0
1 0 0
1 1 1
3. Reason out why the NAND an NOR are called universal gates?
NAND and NOR gates are called Universal gates, because the fundamental logic gates
can be realized through them.
4. Give the truth table of XOR gate. 5. Write the De Morgan’s law.
❖ (𝐴 + 𝐵) = 𝐴 . 𝐵
Input Output
❖ (𝐴 . 𝐵) = 𝐴 + 𝐵
A B C = A⊕B
0 0 0
0 1 1
1 0 1
1 1 0
SECTION – A
Choose the correct answer. 1 Mark
1. Which of the following is said to be the brain of a computer?
(a) Input devices (b) Output devices
(c) Memory device (d) Microprocessor
2. Which of the following is not the part of a microprocessor unit?
(a) ALU (b) Control unit (c) Cache memory (d) register
3. How many bits constitute a word?
(a) 8 (b) 16 (c) 32 (d) determined by the processor used
4. Which of the following device identifies the location when address is placed in the memory
address register?
(a) Locator (b) encoder (c) decoder (d) multiplexer
5. Which of the following is a CISC processor?
(a) Intel P6 (b) AMD K6 (c) Pentium III (d) Pentium IV
6. Which is the fastest memory?
a) Hard disk (b) Main memory (c) Cache memory (d) Blue-Ray disc
7. How many memory locations are identified by a processor with 8 bits address bus at a time?
(a) 28 (b) 1024 (c) 256 (d) 8000
8. What is the capacity of 12cm diameter DVD with single sided and single layer?
(a) 4.7 GB (b) 5.5 GB (c) 7.8GB (d) 2.2 GB
9. What is the smallest size of data represented in a CD
(a) blocks (b) sectors (c) pits (d) tracks
10. Display devices are connected to the computer through.
(a) USB port (b) Ps/2 port
(c) SCSI port (d) VGA connector
SECTION – B
Very Short Answers. 2 Marks
1. What are the parameters which influence the characteristics of a microprocessor?
❖ Clock speed ❖ Instruction set ❖ Word size
2. What is an instruction?
A command which is given to a computer to perform an operation on data is called an
instruction.
3. What is a program counter?
The Program Counter (PC) is a special register in the CPU which always keeps the
address of the next instruction to be executed.
4. What is HDMI?
High-Definition Multimedia Interface is an audio/video interface which transfers the
uncompressed video and audio data from a video controller, to a compatible computer
monitor, LCD projector, digital television etc.
SECTION – A
Choose the correct answer. 1 Mark
1. Which of the following activities is algorithmic in nature?
(a) Assemble a bicycle. (b) Describe a bicycle.
(c) Label the parts of a bicycle. (d) Explain how a bicycle works.
2. Which of the following activities is not algorithmic in nature?
(a) Multiply two numbers. (b) Walk in the park.
(c) Draw a kolam. (d) Swapping of two numbers.
3. Omitting details inessential to the task and representing only the essential features of the
task is known as
(a) specification (b) abstraction
(c) composition (d) decomposition
4. Stating the input property and the input-output relation a problem is known
(a) specification (b) statement (c) algorithm (d) definition
5. Ensuring the input-output relation is
(a) the responsibility of the algorithm and the right of the user.
(b) the responsibility of the user and the right of the algorithm.
(c) the responsibility of the algorithm but not the right of the user.
(d) the responsibility of both the user and the algorithm.
6. If i = 5 before the assignment i := i-1 after the assignment, the value of i i
(a) 5 (b) 4 (c) 3 (d) 2
7. If 0 < i before the assignment i := i-1 after the assignment, we can conclude that
(a) 0 < i (b) 0 ≤ i (c) i=0 (d) 0>=i
SECTION-B
Very Short Answers. 2 Marks
1. Define an algorithm.
An algorithm is a sequence of instructions to accomplish a task or solve a problem.
2. Distinguish between an algorithm and a process.
➢ An algorithm is a sequence of instructions to accomplish a task or solve a problem.
➢ Processes are generated by executing algorithms. When the instructions are executed, a
process evolves, which accomplishes the intended task or solves the given problem.
3. Initially,
farmer, goat, grass, wolf = L, L, L, L
and the farmer crosses the river with goat. Model the action with an assignment
statement.
❖ Farmer, Goat, Grass, Wolf := L, L, L, L
The action taken to cross the river with the farmer goats along with an assignment
statement as follows
❖ Farmer, Goat := R, R
SECTION – A
Choose the correct answer. 1 Mark
1. Suppose u, v = 10 ,5 before the assignment. What are the values of u and v after the sequence
of assignments? 1 u := v 2 v := u
a) u, v = 5 ,5 (b) u, v = 10 ,5
(c) u, v = 5 ,10 (d) u, v =10,10
2. Which of the following properties is true after the assignment at line 3?
1 -- i, j = 0
2 i, j := i+1, j -1
3 --?
(a) i + j >0 (b) i + j < 0 (c) i + j = 0 (d) i = j
3. If C1 is false and C2 is true, the compound statement
1 if C1
2 S1
3 else
4 if C2
5 S2
6 else
7 S3
(a) S1 (b) S2 (c) S3 (d) None
4. If C is false just before the loop, the control flows through 1 S1 2 while C 3 S2 4 S3
1 S1
2 while C
3 S2
4 S3
(a) S1 ; S3 (b) S1 ; S2 ; S3
(c) S1 ; S2 ; S2 ; S3 (d) S1;S2;S2;S2;S3
5. If C is true, S1 is executed in both the flowcharts, but S2 is executed in
(1) (2)
3. Both conditional statement and iterative statement have a condition and a statement.
How do they differ?
❖ Conditional statement is executed only if the condition is true. Otherwise, nothing is done.
❖ Iterative statement repeatedly evaluates a condition and executes a statement as long as
the condition is true.
4. What is the difference between an algorithm and a program?
Algorithm Program
An algorithm is a step-by-step sequence of An algorithm expressed in a programming
statements to solve a problem. language is called a program.
Can't run on computers. Can be run on computers.
Syntax is not compulsory. Must be follow the syntax.
5. Why is function an abstraction?
❖ A function is an abstraction of a subproblem and specified by its input property and its
input-output relation.
❖ Users of function need to know only what the function does and not how it is done. So it
is abstract.
6. How do we refine a statement?
In refinement, starting from high level, each statement is repeatedly expanded into more
detailed statements in the subsequent levels.
(1) (2)
Pseudo code:
(1) (2)
if C if C
S1 S1
S2 else
S2
2. If C is false in line 2, trace the control flow in this algorithm.
1 S1 Control flow:
2 -- C is false S1
3 if C S3
4 S2 S4
5 else
6 S3
7 S4
3. What is case analysis?
❖ Case analysis statement generalizes it to multiple cases.
❖ Case analysis splits the problem into an exhaustive set of disjoint cases. For each case, the
problem is solved independently.
✓ If C1, C2 and C3 are conditions and S1, S2, S3 and S4 are statements, a 4-case analysis
statement has the form,
1. case C1
2. S1
3. case C2
4. S2
5. case C3
6. S3
7. else
8. S4
False
True
Is C2 S2
False
True
Is C3 S3
False
S4
Next St
Specification: Algorithm:
Circulate ( A, B, C ) Step 1: Circulate ( A, B, C )
-- Input: A, B, C Step 2: -- Input: A, B, C
-- Output: A, B, C Step 3: T := A
T := A Step 4: A := C
A := C Step 5: C := B
C := B Step 6: B := T
B := T Step 7: Output A, B, C
3. Decanting problem. You are given three bottles of capacities 5 ,8 and 3 litres. The 8L
bottle is filled with oil, while the other two are empty. Divide the oil in 8L bottle into
two equal quantities. Represent the state of the process by appropriate variables. What
are the initial and final states of the process? Model the decanting of oil from one
bottle to another by assignment. Write a sequence of assignments to achieve the final
state.
To divide the oil equally in the oil bottle, the following 7 steps are needed:
Pour 5L of oil into the second bottle. (3,5,0)
Pour 3L from the second bottle to the third. (3,2,3)
Pour 3L from the third to the first. (6,2,0)
Pour all 2L from the second to the third bottle (6,0,2)
Pour 5L from the first to the second bottle. (1,5,2)
Pour 1 L from the second to the third bottle. (1,4,3)
Finally, pour now all 3L from the third bottle to the first (4,4,0)
Assignment statement as follows:
A, B, C = 8,0,0
A, B, C = 3,5,0
A, B, C = 3,2,3
A, B, C = 6,2,0
A, B, C = 6,0,2
A, B, C = 1,5,2
A, B, C = 1,4,3
A, B, C = 4,4,0
SECTION – A
Choose the correct answer. 1 Mark
1. A loop invariant need not be true
(a) at the start of the loop. (b) at the start of each iteration
(c) at the end of each iteration (d) at the start of the algorithm
2. We wish to cover a chessboard with dominoes, the number of black squares and the number
of white squares covered by dominoes, respectively, placing a domino can be modelled by
(a) b := b + 2 (b) w := w + 2 (c) b, w := b+1, w+1 (d) b := w
3. If m x a + n x b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are
(a) m = 8, n = 7 (b) m = 7, n = -8 (c) m = 7, n = 8 (d) m = 8, n = -7
4. Which of the following is not an invariant of the assignment? m, n := m+2, n+3
(a) m mod 2 (b) n mod 3
(c) 3 X m – 2 X n (d) 2 x m – 3 x n
5. If Fibonacci number is defined recursively as
❖ Now, we have four corner-covered boards, each of size 2n-1 × 2n-1. Size of each sub-board
23-1 × 23-1 = 22 × 22 = 4 x 4