Introduction to Computer and
Programming
Lecture 1: Introduction to Computer
© Fall 2023 - Prof. Mohamed Sobh, Dr. Ayman Taha
References
● An Introduction to Python and Computer Programming, 2015, Springer
○ https://link.springer.com/book/10.1007/978-981-287-609-6
● A Beginners Guide to Python 3 Programming, 2019, Springer
○ https://link.springer.com/book/10.1007/978-3-030-20290-3
● W3C Tutorial
○ https://www.w3schools.com/python
● Tutorialspoint
○ https://www.tutorialspoint.com/python/index.htm
● Online Python
○ https://www.online-python.com
● Download Python
○ https://www.python.org/downloads
LMS
● Course Materials: Lectures and Lab Assignments
● Online Quizzes
● Project Submission
● Lab Assignment Submission
Grades
● Midterm: 15 Degree
● Activities
○ Project: 20 Degree
○ Quizzes (Practical/LMS): 20 Degree (6 quizzes, Inside lab, best 5)
○ Practical Assignments: 20 Degree (LMS + Discussion)
● Final Exam: 25 Degree
Calendar
● Week 1: Introduction to Computer
● Week 2: Basic IO, Variables
● Week 3: Conditions, If and While Statements
● Week 4: Basic List, Tuple and Dictionaries, For Statement
● Week 5: Binary System
● Week 6: Advanced Data
● Week 7: Midterm
Calendar
● Week 8: Functions + Project Explanation
● Week 9: Advanced Programming Topics
● Week 10: Files
● Week 11: Dealing with Binary, Text, JSON files
● Week 12: Revision and Case Studies + Project Discussion
● Week 13: Revision and Case Studies + Project Discussion
● Week 14: Revision and Case Studies + Project Discussion
● Week 15: Practical Discussion
Table of Contents
● What is computer systems?
● Computer system components.
● Understand memory types.
● Understand input/output devices.
● Understand computer communication.
● Understand Operating System Types.
● Understand File System and File Types
● Understand Windows Command Line
What is Computer Systems ?
What Is a Computer?
● A programmable, electronic device that accepts data, performs operations on that
data, and stores the data
● Follows instructions, called programs, which determine the tasks the computer will
perform
Page - 9
What Does
Computer Do?
Page - 10
Data Processing
Computer data is a Raw Facts describing a specific features like text or image or audio or
other. Information is a Processed Data.
Processing
Data Information
Page - 11
Data Representation
● Computer store data as numbers
● Computer uses only 1 or 0 which is called binary number
● For example 9 is equivalent to 1001
● Another ‘A’ is equivalent to 01000001
● Computer stores and reads 1 or 0 using different ways
● Magnetic: 1 magnetized, 0 not-magnetized
● Electronic: 1 charged 3.3 or 5V, 0 not-charged
● Electronic: 1 gate close, 0 gate open
● Optical: 1 Pit, 0 land
● Paper: 1 hole, 0 no-hole
Page - 12
Data Size
● 1 Bit
● 1 Byte = 8 Bit
● 1 KB = 1024 Byte
● 1 MB = 1024 KB = 1024 * 1024 Byte
● 1 GB = 1024 MB = 1024 * 1024 * 1024 Byte
● 1 TB = 1024 GB = 1024 * 1024 * 1024 * 1024 Byte
● Example:
○ One page of text: 600 Byte
○ Small Photo: 200 KB
○ Image: 1 MB
○ Short Video: 70 MB
○ Long Film: 1.5 GB
Page - 13
Types of Computer Systems
Personal Computer, Mobile Mainframe, Server
Supercomputer
Industry Computer
Page - 14
Personal Computer (PC), Mobile
● Small computer designed to be used by one person at a time
● Also called a microcomputer
● Available in different sizes and shapes
● Desktop Computers
● Portable computers
○ Notebook
○ Laptop
○ Tablets
○ Mobile
Page - 15
Mainframe, Server
● Computer with medium to large computing and storage capabilities
● Provide services to many users locally inside organization networks or globally over
internet
● Host applications like databases systems, websites, email server software, file server
software, domain controller software …
● High power consumption and cost (10 to 100 thousand of USD)
Page - 16
Supercomputer
● Computer with large to huge computing and storage capabilities
● Used to perform complex calculation related to applications like weather forecasting,
system simulation
● Consume huge amount of power with very expensive (millions of USD)
Page - 17
Industrial Computer
● Small computer with small memory and storage
● Integrated peripherals inside small chip as required (processor,
memory, storage, network, wifi, sound, video, bluetooth and
more …)
● Used in industry inside machines, cars, toys, medical devices
● Very low power consumption and cost (1 to 20 USD)
Page - 18
Self Study: Search and answer following?
● What is the difference between mainframe and servers?
● What is virtualization?
● What is the difference between supercomputer, grid computer, cluster, data center
and cloud?
● What is the difference between “microcontroller” and “PLC” as both are used in
industry.
Page - 19
Computer System Components
Desktop Computer Components
● Case
● Display
● Keyboard
● Mouse
● Printer
● Sound System
● Cables
Page - 21
Page - 22
Motherboard
Page - 23
Motherboard
● Printed circuit board containing electronic chips and other electronic components
● Holds many electronic components like: processor, external cash, rom, ram,
integrated cards, flash drive and communication ports.
● Contains connectectors to external devices like: disk drives, network cards, gaming
card, display, printer, mouse, keyboard, flash drives and power supply.
● All components and connectors are communicating with each other using set of
wires called bus.
Page - 24
Processor
● The CPU (Central Processing Unit), called also microprocessor
● Contains components like: ALU (Arithmetic and Logic Unit), Programs
Execution Unit, Registers, Internal Cache Memory
● Connected to motherboard buses to, exchange data (data bus), select
addresses (address bus), execute external commands (control bus)
● Common manufacturers: Intel (i3, i5, i7, xeron), AMD (ryzen family)
● Contains multiple CPUs (Cores) to make parallel operations.
● Comes with different speeds (EX: 2.1, 3.4 GHZ)
Page - 25
Registers
Processor
Register A: 5 Register B: 6
Arithmetic and Logic Unit
Add, Subtract, Multiplicate, Divide, Compare …
Register C: 5 + 6
Page - 26
Bus
Memory Storage Connectors
USB, HDMI, Extension
Processor RAM, ROM, External Disk Drive, Flash Drive,
Slots, PS/2,
Cash Optical Drive Serial/Parallel Ports
Data Bus
Address Bus
Control Bus
Page - 27
Cash, ROM, RAM, Storage
External Cash (L2)
Processor
RAM ROM Storage
Internal Cash (L1)
Buses
Page - 28
External or Integrated Cards
● Graphics Card
○ Interface with graphical display device (monitor)
○ Sometimes, performs additional graphical calculations (Gaming Cards)
○ Sometimes, contains additional memory for graphical processing.
● Ethernet or Network Card
○ Provides wired connection to network or internet
○ Provides different speed of communication 1Gbps, 10Gbps, 100GBps, 100GBps
○ Provides electrical or optical communication
● Wireless Card
○ Provides wireless connection to network or internet
● ADSL Card
○ Provide internet communication via mobile communication channels (3G, 4G, 5G …)
○ Authenticate to mobile operator using SIM card or eSIM
Page - 29
Connection Ports
● USB for flash memory, portable storage, mouse, printer, external keyboard …
● HDMI for external monitor
● PS/2 for old mouse and keyboards
● Ethernet for network
● 3.5mm Audio Port
● SIM Card slot
● Serial/Parallel Port for old printers
Page - 30
Data Storage Types
Hard
Disk
RAM Optical
Disk
ROM
Punshed Card Magnetic Tab
Page - 31
Floppy Disk
Data Storage Types
Volatile Storage
● Registers: used by processor while calculation and internal processing of programs
● Cash: used to speed up execution as it is faster than RAM
● RAM: used by processor to execute programs and store its temporary data while execution
Permanent Storage
● ROM: contains basic program required to start the computer (BIOS)
● Flash Memory: used to store and exchange data, bigger size are used instead of disks
● Disk Drives: used to store huge amount of data inside computer
● Optical Drives, Floppy Disks, Magnetic Taps: old ways to store and exchange data
● Punched Cards: the oldest way to store data
Page - 32
Data Storage Types
Type Retention Access Speed Size Components
Registers Volatile Read/Write 1 (Fastest) 4, 8 Byes Electronic
Cash L1, L2 ... Volatile Read/Write 2 1, 10, 100 KB Electronic
RAM Volatile Read/Write 3 ~ 16 GB Electronic
ROM Permanent Read Only 4 ~ 100 KB Electronic
Flash Memory Permanent Read/Write 5 ~ 64 - 512 GB Electronic
Disk Drives Permanent Read/Write 6 ~ 2 TB Magnetic/Mechanical
Optical Drives Permanent Read Only 7 ~ 512 MB Optical/Mechanical
Disk/Taps Permanent Read/Write 8 ~ 512 KB Magnetic/Mechanical
Page - 33
Punched Cards Permanent Read Only 9 (Slowest) ~ 1 KB Optical/Mechanical
External Devices (Input/Output)
Mouse
Monitor
Keyboard
Printer
Earphone
Speaker
Headphone
Page - 34
Exercise?
● What is your mobile specification?
● What is your computer specification?
● How to enhance programs performance?
● How to video card affect your gaming experience?
● How do you exchange large data like movies with your friends?
● What input/output devices you are using?
● What is the best computer configuration for technology students?
Page - 35
Computer Communication
Devices Communication
● Using motherboard bus system (data, address, control) to communicate with disk
drive.
● Using motherboard expansion slots like PCI and PCIe to communicate with extension
cards.
● Using cables like USB/PS-2/HDMI/Serial/Parallel/3.5 Audio to communicate with
printers, flash memory, ear phone, speakers …
● Using network ethernet connection to communicate with network printers
● Using wireless communication like wifi/bluetooth/infrared to communicate with
headphones, joystick
Page - 37
WAN/LAN
● LAN: Local Area Network
● WAN: Wide Area Network
Page - 38
Wide Area Network (WAN) - Internet
● Connect billions of computing devices across the world.
● Connection can be established either with wire or wireless.
● The network consists of billions of routing devices, domain name servers (DNS).
● Each device must have address called (IP V4 or V6). Ex: IP4 = 192.186.7.8
● Routing device are used to determine best route for messages.
● DNS responsible on translating domain names into IP (www.google.com =
142.250.201.14)
● Devices are connected using copper cables, fiber cables, mobile network, satellite.
Page - 39
Local Network Communication LAN
● Communicate with other computers and devices inside organization
● Number of devices range from 10 to 1000
● Uses wired or wireless connection
● Allow users to share files and services inside network.
● Servers are used inside network to provide central services.
● Required devices like routers and switches to connect computers.
● Communication to internet via external connector “gateway” protected by firewall.
● Firewall are used to protect network from external attacks and manage internal
users access to internet according to organization policy.
Page - 40
Operating Systems
Operating System
● An operating system is the most important software that runs on a computer.
● It manages all computer's software and hardware.
● It allows users to work with the computer easily without any prior knowledge.
● Operating system uses special system software called driver to operate every
hardware resource like display, sound, network, hard disk, bluetooth, mouse …
● Operating system organizes programs execution and allows multiple applications to
run simultaneously.
● Operating system also manages user accounts and files.
● Operating system provide security services like authentication and access control to
computer, accounts, files, programs and hardware resources.
Page - 42
Operating System Types
● For personal computers and servers, ex:
○ Windows
○ Linux
○ MacOS
● For mobiles and tablets, ex:
○ Android
○ iOS
● For industrial computers, ex:
○ Embedded Linux
○ RTOS
Page - 43
Operating System Interface
Graphical User Interface Command Line Interface
Page - 44
Operating System Interface
● Graphical User Interface
○ Suitable for personal computers and mobile.
○ Required to create or view graphical information like documents, images, videos, designs.
○ Easy for user, no prior knowledge are required.
○ Consume portion of computer resources.
● Command Line Interface
○ Suitable for servers.
○ Required prior study to operating system commands.
○ In most cases server administrators access those computer remotely.
○ Consume very small amount of resources. EX: Linux Server (0.5 GB), Linux Desktop (2 GB)
Page - 45
Exercise
● What operating system you are using?
● How many partitions in your computer, what is the size of each?
● What folders in your computer occupied by the operating system?
● How many applications are running whenever you start your computer?
Page - 46
File System
Storage and File System
● Disk drive space is divided into partitions (EX, for
windows: C, D, E, F)
● Inside each partition, user can create folders and
files.
● Folder are only a container of sub-folders and files
● Files contains specific data type like images,
documents, videos and executables.
● Executable file is the main software file that
contains the program instructions.
Page - 48
File Explorer
● Graphical windows application manage disks, folders and files.
● View disk information, format disk, change disk label.
● Manage folders: create, delete, rename, copy, move.
● Manage files: create, delete, rename, cope, move.
● Folder and files names contains letters or numbers.
● In addition file name contains additional section called extension to identify the
type. Example: information.txt, resume.docx, mountain.jpg, matrix.mp4
● Common file types: text files, image files, document files, program executables files
Page - 49
Text Files
● Extension: .txt
● Contains pure text contents
● Common editors like notepad,
notepad++
● Text files can have different encoding:
ASCII, UTF8, UTF16, UTF32 to allow
multiple languages and this affect file
size even with the same number of
letters
Page - 50
Image Files
● Extension: .bmp, .jpg, .gif, .png, .tif …
● Contains 2D graphical contents
● Common editors: mspaint, microsoft photo,
adobe photoshop, corel draw.
● Different extension uses different compression
technique for that reason same image with same
dimension have different file size.
● Compression technique may affect image
quality. High compression lead to poor quality.
Page - 51
Document Files
● Extensions: .docx, .xlsx, .pptx …
● Contains mixed contents text, image, tables and more
● Allow user to change text size, font, color and alignment
● Common editors, Microsoft Word, Excel, Power Point
● Word are used to create books, articles
● Excel are used to create tables
● Power point are used to create presentations
Page - 52
Document File
Page - 53
Command Line
Command Line
● Basic and faster way to communicate with computer.
● Used specially for servers, linux users and by IT
specialists.
● Operating systems offer both graphical and command
line interface.
● If only command line interface is allowed the
operating system will take less hardware resources as
disk space, memory usage, processor occupation and
more.
● Command line allow user to do manythings like
manage files and folders, network, applications and
more
Page - 55
Window Command Line Examples
notepad book1.txt
c:
notepad book2.txt
dir
mspaint
mkdir test
then save to c:\test three files
mkdir test\temp
home1.bmp, home2.png, home3.jpg
cd test
copy book1.txt .\books
cd temp
copy book2.txt c:\test\temp
cd ..
copy home?.* photos
rename temp temp1
mkdir allfiles
rmdir temp1
move *.txt allfiles
mkdir books
move home?.* allfiles
mkdir photos
mkdir temp
dir
move allfiles temp
notepad temp.txt
del temp.txt
Page - 56
Questions ??