0% found this document useful (0 votes)
1 views8 pages

0201023_classwork_97496

The document provides an overview of computer organization, detailing the distinction between hardware and software, as well as the types of software including system and application software. It explains computer memory, its units, and the role of compilers and interpreters in converting high-level programming languages into machine code. Additionally, it introduces Python as an object-oriented programming language, discussing its features, drawbacks, and fundamental concepts such as character sets and tokens.

Uploaded by

erictsam58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views8 pages

0201023_classwork_97496

The document provides an overview of computer organization, detailing the distinction between hardware and software, as well as the types of software including system and application software. It explains computer memory, its units, and the role of compilers and interpreters in converting high-level programming languages into machine code. Additionally, it introduces Python as an object-oriented programming language, discussing its features, drawbacks, and fundamental concepts such as character sets and tokens.

Uploaded by

erictsam58
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

COMPUTER ORGANIZATION

PART-1

1|Page
Computer is an electronic device that process data and gives the result in the form of information

A computer can be mainly classified as Hardware and software

Hardware are the components that can be seen and touched .

Eg-Mouse, Monitor, CPU, Printer

Software are recorded instructions and programs that governs the working of a computer.

Software can be classified into 2 categories

1. System Software- It is a software which controls the internal computer operations

Eg- OS

2. Application Software- It is a user created software that carry out certain instruction
to perform a specific task

Eg: Flight Reservation Software

An application software has two ends – front end and back end

Front end- It is the design part of the application software which we are able to see. This view is designed
using programming languages .

Eg: C, C++, Java , Python

Back end- It is the area where the data are being stored. Data is retrieved from the backend called the database
according to the requirements of the user.

Eg: SQL,MS-Access, MySQL, Oracle


2|Page
MEMORY

Memory of a computer is a predefined area where it stores data . Memory of a computer is volatile. In
memory, data are stored in the form of binary digits(0 and
1).Memory is considered as a cell which is fragmented into
smaller parts called bits. A bit is an elementary unit of memory

1 0 1 0 0 1 1 0

Memory unit is the amount of data that can be stored in the storage unit.

The various memory units are:

SNO UNIT

1 Bit (Binary Digit)-A binary digit is logical 0 and 1 representing a passive or an active state of a component
in an electric circuit.

2 Nibble-A group of 4 bits is called nibble.

3 Byte-A group of 8 bits is called byte. A byte is the smallest unit, which can represent a data item or a
character.

The following table lists some higher storage units

SNO UNIT

1 Kilobyte(KB); 1 KB=1024 BYTES

2 Megabyte (MB); 1 MB = 1024 KB

3 GigaByte (GB); 1 GB = 1024 MB

4 TeraByte (TB) ; 1 TB = 1024 GB

5 PetaByte (PB); 1 PB = 1024 TB

3|Page
Compiler and Interpreter
We write a computer program using a high-level language. A high-level language
is one which is understandable by humans. It contains words and phrases from the
English or other language. But a computer does not understand high-level
language. It only understands program written in 0's and 1's in binary, called the
machine code. A program written in high-level language is called a source code.
We need to convert the source code into machine code and this is accomplished
by compilers and interpreters. Hence, a compiler or an interpreter is a program
that converts program written in high-level language into machine code
understood by the computer.

Interpreter Compiler

Translates program one statement at a Translates the entire program


time.

Continues translating the program Translates the program till the end
until the first error is met, in which and reports the errors all together
case it stops. Hence debugging is
easy.

Eg: Basic, Python, Ruby Eg: C, C++, Java

4|Page
PYTHON PROGRAMMING LANGUAGE
Python is a Object Oriented Programming Language developed by Guido Van Rossum in
1991. It was based on two other programming languages

✓ ABC language which was a replacement of BASIC

✓ Modula-3

It is an interpreted language as it interprets and executes code line by line . Python is case-
sensitive.

Features of Python

➢ Platform Independent:- It can be executed in any platform without making any


changes in the program

➢ Easy to use:- It is a OOP’s language which is very user friendly ( does not have much
format/syntax)

➢ Interpreted Language:-It is an interpreted language as it interprets and executes code


line by line

➢ Free and Open source Software:- It is available free of cost

Drawbacks of Python

➢ Not a fast language- It is not as fast as other programming languages as it is an


interpreter

➢ Not eaisly convertible- It cannot be easily convertible to other programming


languages

➢ Lesser built in libraries- Python does not support many built in functions.

5|Page
PYTHON FUNDAMENTALS

➢ Character set:-It is a set of valid characters that a language can recognize. It


represents any character or symbol or digit. Python supports Unicode encoding
standards(Unicode is a universal character encoding standard. It defines the way
individual characters are represented in text files, web pages, and other types of
documents. Unlike ASCII, which was designed to represent only basic English
characters, Unicode was designed to support characters from all languages around the
world. The standard ASCII character set only supports 128 characters, while Unicode
can support roughly 1,000,000 characters. While ASCII only uses one byte to
represent each character, Unicode supports up to 4 bytes for each character.)

Eg:A-Z, a-z, 0-9 , all symbols

Tokens

The smallest individual unit in a program is known as Token or lexical unit.

Tokens are sub-classified into:

✓ Keywords

✓ Identifiers

✓ Literals

✓ Operators

✓ Punctuators

I. Keywords:- Keywords are words that convey a special meaning to the interpreter
.They are reserved words that cannot be used for any other purpose

6|Page
Some of the keywords are:

and def except in pass

break del for is return

class else finally import try

continue elif if or while

II. Identifiers:- They are the fundamental building blocks of a program. They are the names
given for different part of a program like variables.

Rules of naming an identifier:

✓ It can be combination of letters or digits but the first character should be a letter

✓ No other special symbols other than _


(Underscore) is allowed in naming an identifier.

✓ Uppercase and lowercase letters are considered as different names

eg: Name and name are two different identifiers

✓ The identifier can start with an underscore or letters but not with a digit

✓ Keywords cannot be used

✓ It can be of any length

Eg: MyData, _Myfile, _97, File13


7|Page
Egs of Invalid Identifier: 29c, Name of student, my.file, my-data

Qn: Identify the following as valid or invalid identifier. If invalid, justify your answer

1. Data-Rec 2. 29Data 3. break 4. file13 5. AND 6. _D5 7. My@File 8. Return 9. else


10. _6

Ans:

Identifier Valid/Invalid

Data-Rec Invalid(- is not allowed. Only _ is allowed)

29Data Invalid( Cannot start with a digit )

break Invalid( keyword cannot be an identifier)

file13 Valid

AND Valid

_D5 Valid

My@File Invalid (@ is not allowed)

Return Valid

else Invalid(keyword cannot be an identifier)

_6 Valid

8|Page

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy