Docsity

computer science it contains python basics and learning, Summaries of Computer science

Toggle sidebar
bg1
Computer Science Foundations & Python Basics
Comprehensive Study Notes & Practice Questions
1. Basic Computer Organisation
Computer organisation refers to the operational units and their interconnections that realize the architectural
specifications. The main functional components are:
Input Unit: Accepts data and instructions from the user (e.g., Keyboard, Mouse).
Central Processing Unit (CPU): The brain of the computer, consisting of:
Arithmetic Logic Unit (ALU): Performs arithmetic Operations (+, -, *) and logical comparisons (>, <, ==).
Control Unit (CU): Coordinates activities of all other units.
Registers: High-speed internal memory locations inside the CPU.
Memory Unit: Stores data and instructions temporarily or permanently.
Output Unit: Displays results to the user (e.g., Monitor, Printer).
2. Memory Units
Memory stores data in binary format (0s and 1s). The hierarchical units of data measurement are:
Unit Equivalent Value
Bit 0 or 1 (Binary Digit)
Nibble 4 Bits
Byte 8 Bits = 1 Byte
Kilobyte (KB) 1024 Bytes
Megabyte (MB) 1024 KB
Gigabyte (GB) 1024 MB
Terabyte (TB) 1024 GB
Petabyte (PB) 1024 TB
3. Number Systems
Computers represent data using various base systems:
Binary (Base 2): Uses digits 0, 1 .
Octal (Base 8): Uses digits 0 to 7 .
Decimal (Base 10): Uses digits 0 to 9 .
Hexadecimal (Base 16): Uses digits 0 to 9 and letters A to F (where A=10, F=15).
•
•
◦
◦
◦
•
•
•
•
•
•
Page 1 of 3
pf3

Partial preview of the text

Download computer science it contains python basics and learning and more Summaries Computer science in PDF only on Docsity!

Computer Science Foundations & Python Basics

Comprehensive Study Notes & Practice Questions

1. Basic Computer Organisation

Computer organisation refers to the operational units and their interconnections that realize the architectural specifications. The main functional components are:

Input Unit: Accepts data and instructions from the user (e.g., Keyboard, Mouse). Central Processing Unit (CPU): The brain of the computer, consisting of: Arithmetic Logic Unit (ALU): Performs arithmetic Operations (+, -, *) and logical comparisons (>, <, ==). Control Unit (CU): Coordinates activities of all other units. Registers: High-speed internal memory locations inside the CPU. Memory Unit: Stores data and instructions temporarily or permanently. Output Unit: Displays results to the user (e.g., Monitor, Printer).

2. Memory Units

Memory stores data in binary format (0s and 1s). The hierarchical units of data measurement are:

Unit Equivalent Value

Bit 0 or 1 (Binary Digit)

Nibble 4 Bits

Byte 8 Bits = 1 Byte

Kilobyte (KB) 1024 Bytes

Megabyte (MB) 1024 KB

Gigabyte (GB) 1024 MB

Terabyte (TB) 1024 GB

Petabyte (PB) 1024 TB

3. Number Systems

Computers represent data using various base systems:

Binary (Base 2): Uses digits 0, 1. Octal (Base 8): Uses digits 0 to 7. Decimal (Base 10): Uses digits 0 to 9. Hexadecimal (Base 16): Uses digits 0 to 9 and letters A to F (where A=10, F=15).

4. Boolean Algebra

Boolean algebra deals with binary variables and logic operations:

AND (Conjunction, .): Output is True (1) only if ALL inputs are True. OR (Disjunction, +): Output is True (1) if AT LEAST ONE input is True. NOT (Negation, ' or ~): Inverts the input (True becomes False, False becomes True).

5. Algorithm & Flowchart

Algorithm: A step-by-step finite set of instructions to solve a specific problem.

Flowchart: A graphical representation of an algorithm using standard symbols:

Oval: Start / End Parallelogram: Input / Output Rectangle: Process / Operations Diamond: Decision making (If / Else) Arrows: Flow lines

6. Introduction to Programming in Python

Python is a high-level, interpreted, and easy-to-read programming language created by Guido van Rossum.

Variables: Reserved memory locations to store values (e.g., x = 10 ). Data Types: Integers (int), Decimals (float), Text (str), Booleans (bool). Control Structure: Decision making via if, elif, and else blocks.

7. Python Program: Check Even or Odd

Program to check if a number is Even or Odd

num = int(input("Enter a number: "))

if num % 2 == 0: print(f"{num} is an Even number.") else: print(f"{num} is an Odd number.")