Class XI Ch1 Ch2 1 Basics of Computer Organization Types of Software
Class XI Ch1 Ch2 1 Basics of Computer Organization Types of Software
Data vs Information
Data are raw numbers or other findings which, by themselves, are of limited value.
Information is data that has been converted into a meaningful and useful context.
Computers are being used extensively nowadays in everyday life/every field In the form of laptop, desktop,
smartphone, gadgets etc.
Functional
components
of a computer
Page |2
Hardware
Input/Output Units
Input Unit A device through which data and programs from the outside world enter the computer system.
Output unit A device through which results stored in the computer memory are made available outside
the computer system.
Hardware
Central processing unit – Comprises three parts
1. Arithmetic/Logic Unit Performs basic arithmetic operations such as addition and subtraction Performs
logical operations such as AND, OR, and NOT. Most modern ALUs have a small amount of special storage
units called registers that can be accessed faster than main memory.
2. Control unit It organizes the computer to work computer as single unit & generates control signals for
various devices regarding read/write or execute operation
3. Memory A collection of cells, each with a
unique physical address Most computers are
byte-addressable Cell at address 11111110
contains 10101010
Memory Units – How much
memory is required for a
file/data/progam etc. is
measured by memory units.
Following are the memory
units.----------------
Memory Types
*Primary Memory
Random Access Memory (RAM) - is a type of volatile memory that is stores information on an integrated
circuit which hold the data mainly when the program is being executed by the CPU. As it is volatile in
nature so it can't store data permanently.
Page |3
Read Only Memory (ROM) - a non-volatile memory chip in which data are stored permanently, and can
not be altered by the programmer.
*Secondary Memory:
A storage, which suppliments the main memory of a computer. Often refferred to as secondary storage,
this section of computer's memory is nonvolatile and has low cost per bit stored, but it generally has an
operating speed far slower than that of the primary storage.
*Cache Memory: A small high speed memory, which is used to increase the speed of processing by making
current programs and data available to the CPU at a rapid rate.
Cache Memory - is the volatile computer memory which is very nearest to the CPU, so also called CPU
memory, and is between CPU and RAM all the Recent Instructions are Stored into the Cache Memory. It is
the fastest memory that provides high-speed data access to a computer microprocessor.
Difference between RAM and ROM
Input Devices
Input devices can send data or information to a computer or another device.
Keyboard: It is an input device which sends data in to the computer. The data send depends on the key
pressed by the user.
Mouse: A mouse is a small handheld input device which controls a cursor in a graphical user interface. It
can move and select text, files, folders etc. on our computer according to the user input.
Scanner: Scanner optically reads and document, file or image and then changes it into digital signal and
sends to the computer.
OMR: optical mark recognition/ reader, is used to read marks on a document and send them to computer.
OCR: OCR stands for optical character Recognition, is an input device which reads printed text and sends
that to computer.
MICR: Magnetic Ink Character Reader is an input device which generally finds application is banks to
process cheques.
Microphone: it receives audio generated by some input source and sends it to a computer.
Webcam: it sends the captured images to a computer.
Graphics Tablets: This input device is used to draw using hand.
Trackballs: an upside down mouse ,encased within a socket. Is a cursor control device.
Barcode reader: It is used to read the barcode of various items and feed the same to computer.
Gamepad: Also known as joy pad is the input controller for video games.
Joystick: these input devices are used to control video games.
Output Devices
A device that can receive data from computer or another device and create output with that data is called
output device. Examples of various output devices are as :
Monitor: A monitor is an output device that is responsible for receiving data from a computer and
displaying that information as text or images for users to see.
Page |5
Speakers: Receives sound signal from a computer and then plays that sound signal and thus we hear songs
or music or any other audio.
Projector: Gets data from a computer and displays or projects the same information onto a screen or a
wall.
Projector cannot directly accept data from a user and send that data to another device.
Mobile System: A Mobile Phone is essentially a two-way radio, consisting of a radio transmitter and a radio
receiver.
Process management
Process a program in execution is known as process
Handling of multiple processes at a time is known as process management.
Page |8
Process States A process is typically in one of the three states
Running: has the CPU
Blocked: waiting for I/O or another thread
Ready to run: on the ready list, waiting for the CPU
Python 3.0 was released in 2008. Although this version is supposed to be backward
incompatibles, later on many of its important features have been back ported to be
compatible with version 2.7
Python Character Set
A set of valid characters recognized by python. Python uses the traditional ASCII character
set. The latest version recognizes the Unicode character set. The ASCII character set is a
subset of the Unicode character set.
Letters :– A-Z,a-z Digits :– 0-9 Special symbols :– Special symbol available over keyboard
White spaces:– blank space, tab, carriage return, new line, form feed Other characters:-
Unicode.
var1=‘Computer Science'
var2=‘Informatics Practices'
print(var1,' and ',var2,' )
Output :- Computer Science and Informatics Practices
raw_input() Function In Python allows a user to give input to a program from a keyboard
but in the form of string.
NOTE : raw_input() function is deprecated in python 3
e.g. age = int(raw_input(‘enter your age’))
percentage = float(raw_input(‘enter percentage’))
P a g e | 12
input() Function In Python allows a user to give input to a program from a keyboard but
returns the value accordingly.
e.g. age = int(input(‘enter your age’))
C = age+2 #will not produce any error
NOTE : input() function always enter string value in python 3.so on need int(),float()
function can be used for data conversion.
Indentation
Indentation refers to the spaces applied at the beginning of a code line. In other
programming languages the indentation in code is for readability only, where as the
indentation in Python is very important.
Python uses indentation to indicate a block of code or used in block of codes.
E.g.1
if 3 > 2:
print(“Three is greater than two!") # syntax error due to not indented
E.g.2
if 3 > 2:
print(“Three is greater than two!") # indented so no error
Token
Smallest individual unit in a program is known as token.
1. Keywords 2. Identifiers 3. Literals 4. Operators 5. Punctuators/Delimiters
3.Literals: Literals in Python can be defined as number, text, or other data that represent
values to be stored in variables.
Example of String Literals in Python
name = ‘Johni’ , fname =“johny”
Example of Integer Literals in Python(numeric literal)
age = 22
Example of Float Literals in Python(numeric literal)
height = 6.2
Example of Special Literals in Python
Python literals have one special literal known as None. This literal in Python is used to signify that a
particular field is not created. Python will print None as output when we print the variable with no value
assigned to it. None is also used for end of lists in Python
OUTPUT
('x + y =', 9)
('x - y =', 1)
e.g.
x = 101
y = 121
print('x > y is',x>y)
print('x < y is',x<y)
Output
('x > y is', False)
('x < y is', True)
4. Logical Operators Logical Operators are used to perform logical operations on the given
two variables or values.
Operators Description Example
e.g.
And return true if both condition are true x and y
a=30
Or return true if either or both condition x or y
b=20
are true
if(a==30 and b==20):
not reverse the condition not(x> y)
print('hello')
Output :- hello
5.Bitwise operators
In Python, bitwise operators are used to performing bitwise calculations on integers. The
integers are first converted into binary and then operations are performed on bit by bit,
hence the name bitwise operators. Then the result is returned in decimal format.
Bitwise operators are used to change individual bits in an operand.
& Bitwise AND operator: Returns 1 if both the bits are 1 else 0
| Bitwise or operator: Returns 1 if either of the bit is 1 else 0.
~Bitwise not operator: Returns one’s complement of the number.
^Bitwise xor operator: Returns 1 if one of the bits is 1 and the other is 0 else returns
false.
Output :-
True
False
7. Identity Operators Identity operators in Python compare the memory locations of two
objects.
Operators Description Example
e.g. Is returns true if two variables point the same a is b
object, else false
a = 34 returns true if two variables point the different
Is not a is not b
b=34 object, else false
if (a is b):
print('both a and b has same identity')
else:
print('a and b has different identity')
b=99
if (a is b):
print('both a and b has same identity')
else:
print('a and b has different identity')
Output :-
both a and b has same identity
a and b has different identity
Operators
Precedence :
Highest precedence
to lowest
precedence table.
Precedence is used
to decide ,which
operator to be taken
first for evaluation
when two or more
operators comes in
an expression.
P a g e | 17
Punctuators/Delimiters:
Used to implement the grammatical and
structure of a Syntax. Following are the
python punctuators. ------------
2. Global Variable
x=8
def fun():
print(x) # Calling variable ‘x’ inside fun()
fun()
print(x) # Calling variable ‘x’ outside fun()
Constants
A constant is a type of variable whose value cannot be changed. It is helpful to think of
constants as containers that hold information which cannot be changed later.
In Python, constants are usually declared and assigned in a module.
Here, the module is a new file containing variables, functions, etc. which is imported to the
main file. Inside the module, constants are written in all capital letters and underscores
separating the words.
Create a constant.py:
PI = 3.14
Create a main.py:
import constant
print(constant.PI)
Note: In reality, we can not create constants in Python. Naming them in all capital letters is
a convention to separate them from variables, however, it does not actually prevent
reassignment, so we can change it’s value.