Wednesday

DATA REPRESENTATION

 

DATA REPRESENTATION

Very Short answer Type Questions

Q.1       Add the binary numbers (a) 110101 and 101111                                   (b) 10110 and 1101

Ans: (a) 1100100              (b) 100011

Q.2     Convert 111110111101012 to octal.

Ans: 37365

Q.3    Covert  the following binary numbers to decimal  - 

           (a)1010                   (b) 111000        (c) 10101111               (d) 10110

Ans: (a) 10             (b) 56           (c) 175                                                  (d) 22

Q.4 Covert  the following Decimal numbers to binary  - 

           (a) 23                      (b) 100                    (c) 161                     (d) 145

Ans: (a) 10111                  (b) 1100100                      (c) 10100001  (d) 10010001

Q.5         Covert  the following Hexadecimal numbers to Binary  - 

           (a) BE                      (b) BC9                    (c) A07                   (d) 7AB4

Ans: (a)10111110          (b) 101111001001 (c) 101000000111 (d) 0111101010110100

Q.6    Covert  the following binary numbers to Hexadecimal  - 

           (a)101000001        (b) 11100011                                            (c) 10101111                                           (d) 101101111

Ans: (a) 141                      (b) E3                                                   (c) AF                                                  (d)16F

Q.7 Covert  the following Octal numbers to Binary - 

           (a) 456                    (b) 26                       (c) 751                                   (d) 777

Ans: (a) 100101110           (b) 010110                                         (c) 111101001                                       (d)111111111

Q.8     Convert the following:

           (a) 4468 to (           )16          (b) 47.58 to (      )10          (c) 45.910 to (           )2 Ans:  (a) 126                           (b) 39.625                              (c) 101101.1110

 

Short Answer Type Questions  Q.1 What is the use of encoding schemes?

Ans: A character encoding provides a key to unlock (ie. crack) the code. It is a set of mappings between the bytes in the computer and the characters in the character set. Without the key, the data looks like garbage.

 So, when you input text using a keyboard or in some other way, the character encoding maps characters you choose to specific bytes in computer memory, and then to display the text it reads the bytes back into characters. Unfortunately, there are many different character sets and character encodings, ie. many different ways of mapping between bytes, code points and characters. The section Additional information provides a little more detail for those who are interested.

Q.2     Discuss UTF-8 encoding Scheme.

Ans: UTF-8 is a compromise character encoding that can be as compact as ASCII (if the file is just plain English text) but can also contain any unicode characters (with some increase in file size). UTF stands for Unicode Transformation Format. The '8' means it uses 8-bit blocks to represent a character.

Q.3   How UTF-8 encoding scheme different from UTF-32 encoding scheme?

Ans: UTF-8: Variable-width encoding, backwards compatible with ASCII. ASCII characters (U+0000 to U+007F) take 1 byte, code points U+0080 to U+07FF take 2 bytes, code points U+0800 to U+FFFF take 3 bytes, code points U+10000 to U+10FFFF take 4 bytes. Good for English text, not so good for Asian text.

UTF-32 uses 32-bit values for each character. That allows them to use a fixed-width code for every character. UTF-32 is opposite, it uses the most memory (each character is a fixed 4 bytes wide), but on the other hand, you know that every character has this precise length, so string manipulation becomes far simpler. You can compute the number of characters in a string simply from the length in bytes of the string. You can't do that with UTF-8. Q.4 What are ASCII and extended ASCII schemes?

Ans: The standard ASCII character set uses just 7 bits for each character. There are several larger character sets that use 8 bits, which gives them 128 additional characters. The extra characters are used to represent non-English characters, graphics symbols, and mathematical symbols.

 The extended ASCII character set uses 8 bits, which gives it an additional 128 characters. The extra characters represent characters from foreign languages and special symbols for drawing pictures.

Q.5      What is the utility of ISCII encoding schemes?

ISCII is a bilingual character encoding (not glyphs) scheme. Roman characters and punctuation marks as defined in the standard lower-ASCII take up the first half the character set (first 128 slots). Characters for indie languages are allocated to the upper slots (128-255). T Q.6 What is Unicode? What is its significance?

Ans: Unicode is a character encoding standard that has widespread acceptance. Microsoft software

uses Unicode at its core. Whether you realize it or not, you are using Unicode already! Basically, ―computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before Unicode was invented, there were hundreds of different encoding systems for assigning these numbers. No single encoding could contain enough characters.1 This has been the problem we, in SIL, have often run into. If you are using a legacy encoding your font conflicts with the font someone in another area of the world uses. You might have an  in your font while someplace else someone used a  at the same codepoint. Your files are incompatible. Unicode provides a unique number for every character and so you do not have this problem if you use Unicode. If your document calls for U+0289  it will be clear to any computer program what the character should be

Q.7       What are ASCII and ISCII? Why are these used?

Ans: ASCII uses a 7-bit encoding and ISCII uses an 8-bit which is an extension of ASCII. These are encoding schemes to represent character set in s computer system.

Q.8  Compare UTF-8 and UTF-32 encoding schemes. Which one is most popular scheme?

Ans: UTF-8: Variable-width encoding, backwards compatible with ASCII. ASCII characters (U+0000 to U+007F) take 1 byte, code points U+0080 to U+07FF take 2 bytes, code points U+0800 to U+FFFF take 3 bytes, code points U+10000 to U+10FFFF take 4 bytes. Good for English text, not so good for Asian text.

UTF-32 uses 32-bit values for each character. That allows them to use a fixed-width code for every character. UTF-32 is opposite, it uses the most memory (each character is a fixed 4 bytes wide), but on the other hand, you know that every character has this precise length, so string manipulation becomes far simpler. You can compute the number of characters in a string simply from the length in bytes of the string. You can't do that with UTF-8. Q.9 What do you understand by code point and code unit?

Ans: A code point is the atomic unit of information. ... Each code point is a number which is given meaning by the Unicode standard. A code unit is the unit of storage of a part of an encoded code point. In UTF-8 this means 8-bits, in UTF-16 this means 16-bits. Q.10 What is code space? How is it related to code point?

Ans: In computing, Code space may refer to: In memory address space: code space, where machine code is stored. For a character encoding: code space (or code space), the range of code points.  

 

 

COMPUTER SYSTEM OVERVIEW || Computer Science || Class 11

 

COMPUTER SYSTEM OVERVIEW

Very Short answer Type Questions Q.1 What is volatile memory?

Ans: RAM is known as Volatile Memory because when we switch off the computer its data is vanished.

Q.2     Define each of the following:

(a)  byte        (b) kilobyte (c) megabyte                (d) gigabyte           (e) terabyte

Ans: (a) byte: This is the unit of memory in computer. 1 byte = 8 bits

(b)  kilobyte: This is the unit of memory in computer. 1 kilobyte = 1024 bytes

(c)  megabyte: This is the unit of memory in computer. 1 megabyte = 1024 kilobytes

(d)  gigabyte: This is the unit of memory in computer. 1 gigabyte = 1024 megabytes      (e) terabyte: This is the unit of memory in computer. 1 terabyte = 1024 gigabytes.

Short Answer Type Questions 

Q.1 State the basic units of computer. Name the subunits that make up the CPU, and give the function of each of the unit.

Ans: Basic units of computer are Input Unit, Central Processing Unit and Output Unit. Sub unites of CPU are Arithmetical Logical Unit(ALU), Control Unit (CU) and Memory Unit(MU). Q.2 What is the function of memory? What are its measuring units?

Ans: The computer memory is a temporary storage area. It holds the data and instructions that the Central Processing Unit (CPU) needs. Before a program can run, the program is loaded from some storage medium into the memory. This allows the CPU direct access to the program. Its measuring units are byte, kilobyte, megabyte, gigabyte, terabyte etc. 

Q.3 Why is primary memory termed as „destructive write‟ memory but „non-destructive read‟ memory?

Ans: The primary memory is called destructive write because the data enter here are temporary.

That‘s why your RAM gets cleared after every restart.

Q.4        What is the role of CPU of a mobile system?

Ans: A mobile processor is found in mobile computers and cellphones.

A CPU chip is designed for portable computers, it is typically housed in a smaller chip package, but more importantly, in order to run cooler, it uses lower voltages than its desktop counterpart and has more sleep mode capability. A mobile processor can be throttled down to different power levels or sections of the chip can be turned off entirely when not in use. Further, the clock frequency may be stepped down under low processor loads. This stepping down conserves power and prolongs battery life.

Q.5     What is SoC? how it is different from CPU? Why is it considered a better development?

Ans: A system on a chip (SoC) combines the required electronic circuits of various computer components onto a single, integrated chip (IC). SoC is a complete electronic substrate system that may contain analog, digital, mixed-signal or radio frequency functions. Its components usually include a graphical processing unit (GPU), a central processing unit (CPU) that may be multi-core, and system memory (RAM).

Because SOC includes both the hardware and software, it uses less power, has better performance, requires less space and is more reliable than multi-chip systems. Most system-onchips today come inside mobile devices like smartphones and tablets. These are considered a better development because of their small size and speed capability. Q.6 What are various categories of software?

Ans: Software are classified into following categories – 

(i)          System Software                            

a.    Operating System

b.    Language Processor

(ii)         Application Software  

a.    Packages

b.    Utilities

c.    Customized software

d.    Developer Tools 

Q.7       What is the difference between an interpreter and a compiler?

Ans: Interpreter: Interpreter is a type of system software that translates and executes instructions written in a computer program lini-by-line, unit by unit etc. It is slower in execution because each time when you run the program translation is required.

 Compiler: Compiler is another type of system software that translates and executes instructions written in a computer program in one go. Once compiled program need not to translate again so it works faster.

Q.8       What is application software? Why it is required?

Ans: Application software is the set of programs necessary to carry out operations for a specific task.

Such as for word processing there are many application software like MS-Word, Wordpad etc. These software are required to perform special task using the computer like painting, recording, typing, data handling etc.  

Q.9       Briefly explain the basic architecture of a computer.

Ans: Computer organization refers to logical structure of a computer describing how its components are connected to one another, how they affect one another‘s functioning and contributes to overall performance of computer. 

          Computers follow the ‗IPO‘ principal i.e. 

          Input àProcess àOutput

(That means a certain input is processed to 

          Generate specific output)

           

Q.10    What do you understand by input unit? What is its significance? What does computer system consist of?

Ans: Input unit is formed by the input devices(Keyboard, mouse, MICR, OBCR etc.) attached to the computer. Input unit is responsible for taking input and converting it into computer understandable form(the binary code). Some common input devices are:

(i)          Keyboard

(ii)         Mouse 

(iii)        Microphone

(iv)       Scanner

(v)        Webcam

(vi)       Optical Bar Code Reader

(vii)      Optical Mark Reader

(viii)     Magnetic Ink Character Reader

(ix)       Touch Pad

(x)        Track Ball

(xi)       Joy stick

(xii)      Touch Screen

(xiii)     Biometric Sensors. Etc.

Q.11 What is the function of CPU in a computer system? What are its sub units?

Ans: The central processing unit (CPU) of a computer is a piece of hardware that carries out the instructions of a computer program. It performs the basic arithmetical, logical, and input/output operations of a computer system. The CPU is like the brains of the computer - every instruction, no matter how simple, has to go through the CPU. So let's say you press the letter 'k' on your keyboard and it appears on the screen - the CPU of your computer is what makes this possible. The CPU is sometimes also referred to as the central processor unit, or processor for short. So when you are looking at the specifications of a computer at your local electronics store, it typically refers to the CPU as the processor. Its sub units are: 

           (i) Control Unit                   (ii) Arithmetical and Logical Unit (ALU)             (iii) Memory Unit  Q.12 What functions are performed by the control unit?


The CU controls and guides the interpretation, flow and manipulation of all data and information. CU sends control signals until the required operations are done properly by ALU and memory. Another function of CU is the program execution. It means carrying out all the instructions stored in the program. CU gets program instruction from the memory and executes them one after the other. CU acts as a supervisor by controlling and guiding the operation taking place.

Q.13 Distinguish between CPU and ALU?

Ans:  Difference Between ALU and CPU is that arithmetic logic unit (ALU), another component of the processor, performs arithmetic, comparison, and other operations. While Processor also central processing unit (CPU), interprets and carries out the basic instructions that operate a computer.

The main difference between CPU and ALU is that the CPU is an electronic circuit that handles instructions to operate the computer while the ALU is a subsystem of the CPU that performs arithmetic and logical operations.

Q.14 What is the function of output unit in a computer system?

Ans: Input devices are the hardware that give computers instructions. Output devices relay the response from the computer in the form of a visual response (monitor), sound (speakers) or media devices (CD or DVD drives). The purpose of these devices is to translate the machine's response to a usable form for the computer user.

Q.15 Distinguish between internal and external memory.

Ans: Internal memory is usually chips or modules that you attach directly to the motherboard. Internal Memory is a circular disc that continuously rotates as the computer accesses its data. External memory often comes in the form of USB flash drives; CD, DVD, and other optical discs; and portable hard drives.

Q.16 What are RAM and ROM? How are they alike? How are they different? What are PROM, EPROM, EEPROM?

Ans: A ROM chip is a non-volatile storage medium, which means it does not require a constant source

of power to retain the information stored on it.

   A RAM chip is volatile, which means it loses any information it is holding when the power is

turned off.

  Both of them are known as primary memory as they can directly work with CPU.

                    Read Only Memory (ROM)

                   Programmable Read Only Memory (PROM) 

                   Erasable Programmable Read Only Memory (EPROM)

            Electrically Erasable Programmable Read Only Memory (EEPROM) Q.17 What are major functional components of a mobile system? Ans: Major functional components of a mobile system are-  

(i)          Mobile Processor 

a.    Communications Processing Unit

b.    Application Processing Unit

c.    GPU (Graphics Processing Unit)

(ii)         SoC (System on a chip)

(iii)        Display Subsystem

a.    Display Screen

b.    Touch Sensitive Interface

c.    Touch Sensitive Keyboards

(iv)       Camera Subsystem

(v)        Mobile System Memory

a.    RAM

b.    ROM

(vi)       Storage

(vii)      Power Management Subsystem

Q.18    Draw a block diagram depicting organization of a mobile system.

Ans: 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q.19    What is the role of Power Management Unit in a mobile system?

Ans:  This subsystem is responsible for providing power to a mobile system. The mobile systems work on limited power provided through an attached battery unit. This system has a battery management system that works with a battery charger and a battery unit and provides power to the mobile system in required form.

   It also contains a collection of different functions like battery charging, monitoring and supplying many different voltages these systems require. It also contains software controlled turn-on and turn-off feature to optimize the power consumption and battery life. Q.20 What does the communication processor do?

Ans: this subsystem is responsible for making and receiving phone calls on a mobile handset. It has a digital signal processor that helps it work with RF Transceiver and the Audio subsystem. Q.21 What is GPU? How is it useful?

Ans: Graphics Processing Unit assists the CPU by handling the visuals, other graphically-rich applications. In short, GPU handles all graphics-related chores of a mobile CPU. Q.22 What is system software?

Ans: The software that controls internal computer operations is called system software. It manages all the resources of a system. Its example is Operating System.

Q.23 Discuss the role of utility software in the context of computer performance?

Utilities are those application programs that assist the computer by performing housekeeping functions like backing up disk or scanning/cleaning viruses or arranging information etc. its example is Antivirus software. 

Q.24 What is the importance of an OS?

Ans: An operating system is a program which acts as an interface between a user and the hardware. It manages all the resources of the computer system. It provides and environment to the user to work with. All the application are installed after the operating system is installed. It manages memory, processing, storage, memory etc.

Q.25 How are software libraries useful? Name some software libraries of Python.

Ans: A software library is a predefined and available to use, suit of data and programming code in the form of prewritten code/ functions/scripts/classes etc. that can be used in the development of the new software programs and applications.

          Some software library  in python are:

(i)          NumPy (numerical Python)

(ii)         SciPy (Scientific Python)

(iii)        Pandas Library

Q.26 What is the utility of these software?

(a)  disk fragmentor               (b) backup software    

Ans: (a) disk fragmentor: A file is fragmented when it becomes too large for your computer to store in a single location on a disk. When this happens, your computer splits the file up and stores in pieces. You can use fragmented files, but it takes your computer longer to access them.

(b)  Backup software: This utility program facilitates the backing-up of disk. Back-up means duplicating the disk information so that in case of any damage or data-loss, this backed-up data may be used.

Monday

Chapter – 10: UNDERSTANDING SORTING || Computer Science || Class 11

 

Chapter – 10: UNDERSTANDING SORTING

Short Answer Type Questions  Q.1 What is sorting? Name some sorting Techniques.

Ans: In computer terms sorting refers to arranging elements in a specific order – ascending or descending. Some sorting techniques are –   

(i)          Selection Sort 

(ii)         Bubble Sort

(iii)        Insertion Sort

(iv)       Heap Sort

(v)        Quick Sort

Q.2       What is the basic principal of sorting in bubble sort?

Ans: The basic principal of bubble sort is to compare two adjoining values and exchange them if they

are not in proper order.

Q.3       Why do number-of-comparisons reduce in every successive iteration in bubble sort? 

Ans: For the first iteration of the outer loop, when we are trying to place the largest element in its correct position, N-1 comparisons takes place. For the second iteration of the outer loop, there is no need to compare against the last element of the list, because it was put at its correct position on the previous pass. Therefore, the second iteration requires only N-2 comparisons.

And so on.  

Q.4       On which basis can you determine if an algorithm is efficient or not?

Ans: Efficiency of the algorithm is determined by its number of operations. More number of operations means more CPU time. So the algorithm with less number of operations will be more efficient.

Q.5       What is the basic principal of sorting in Insertion sort?

Ans: Insertion sort is a sorting algorithm that builds a sorted list by taking one element at a time

from the unsorted list and by inserting the element at its correct position in sorted list.

Q.6       Number of operations wise, compare bubble sort and insertion sort techniques.

Ans: In bubble sort in ith iteration you have n-i-1 inner iterations (n^2)/2 total, but in insertion sort you have maximum i iterations on i'th step, but i/2 on average, as you can stop inner loop earlier, after you found correct position for the current element. So you have (sum from 0 to n) / 2 which is (n^2) / 4 total.

That's why insertion sort is faster than bubble sort.

Q.7       Why insertion sort is considered a better algorithm than bubble sort?

Ans: Insertion sort is slightly better than bubble sorting algorithm. Though the worst case time complexity are same for both algorithms, time complexity of insertion sort will depend on the data given. For a array which is already sorted, insertion sort takes linear time, but for the bubble sort algorithms it will take quadratic time complexity irrespective of arrangement of data.

Q.8       In which situations, insertion sort also becomes inefficient?

Ans: For large datasets, insertion sort becomes inefficient.

Q.9       What is the main difference between insertion sort and bubble sort techniques?

Ans:  Bubble Sort - It is a sorting algorithm in which two adjacent elements of an array are checked and swapped if they are in wrong order and this process is repeated until we get a sorted array.

In this first two elements of the array are checked and swapped if they are in wrong order. Then first and third elements are checked and swapped if they are in wrong order. This continues till the lat element is checked and swapped if necessary.

Insertion Sort - In this, the second element is compared with the first element and is swapped if it is not in order. Similarly, we take the third element in the next iteration and place it at the right place in the sub-array of the first and second elements (as the subarray containing the first and second elements is already sorted). We repeat this step with the fourth element of the array in the next iteration and place it at the right position in the subarray containing the first, second and the third elements. We repeat this process until our array gets sorted. Q.10 When and why would you choose insertion sort over bubble sort?

Ans: When databases are smaller, insertion sort will be beneficial. And where there are large databases than bubble sort will perform better.

            

 

 

 

Q.1

Ans:

 

 

 

 

 

 

 

Q.2

Ans: