KEMBAR78
EE171 Lecture 1 2 Computer Basics | PDF | Random Access Memory | Computer Data Storage
0% found this document useful (0 votes)
36 views75 pages

EE171 Lecture 1 2 Computer Basics

EE171 is an introductory course on computers and programming for engineers, covering computer basics, programming algorithms, and the C programming language. The course includes lectures, tutorials, and assessments with a total weight of 8 credits, consisting of continuous assessment (40%) and a university examination (60%). Key topics include computer hardware and software, programming concepts, and the use of input/output devices.

Uploaded by

dtweve124
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)
36 views75 pages

EE171 Lecture 1 2 Computer Basics

EE171 is an introductory course on computers and programming for engineers, covering computer basics, programming algorithms, and the C programming language. The course includes lectures, tutorials, and assessments with a total weight of 8 credits, consisting of continuous assessment (40%) and a university examination (60%). Key topics include computer hardware and software, programming concepts, and the use of input/output devices.

Uploaded by

dtweve124
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/ 75

EE171

Introduction to Computers &


Programming for Engineers
Instructor: Omary, S. Kasinge
Office: CoET Block A – Room A209

1
Degree Programmes:

2
Mode of Delivery
3

 Course Weight: 8 Credits

 Lecture: 2 hours per week


(Tuesday, 15:00 -17: 00 hrs)

 Tutorial/Practical: 1 hour per week


Course Assessment
4

 Continuous Assessment – CA: (40%)


• First Test (15%)
• Second Test (15%)
• Lab/Quiz (10%)

 University Examination – UE: (60%)


Course Outline
5

 Computer Basics: Classification of Computers, Computer


Hardware, Computer Software, MS-DOS, Computer Languages,
Computer Number System
 Introduction to Computer Programming: Machine, Assembly
and High level languages.
 Computer Programming Algorithms: Algorithms, Pseudo-codes,
Flowcharts.
 Computer Programming in C: Identifiers, Operators, Basic
structure of a C program
Course Outline
6

 Simple Input and Output statements: Input and Output Functions,


Programming Errors in C
 Decision Making Statements: if, if-else, nested if-else, switch
 Loop Control Statements: for loop, while loop, do-while loop
 Jump Statements: goto, break, continue, return
 Arrays: Array declaration, one dimension and multi-dimensional arrays,
sorting and searching arrays elements.
Course Outline
7

 Strings: String arrays, string manipulation functions, Introduction to


Pointer-Based String Processing
 Functions: User defined functions, function declaration, definition,
calling function, built in functions, recursive functions.
 Structures and Unions: Declaration, Structure of Arrays, Structures
within Structures
 Pointers: Pointer Variable Declarations, Pointer Operators, Passing
Arguments to Functions by Reference, Pointer Arithmetic to simple
data types
Text/Reference Books
8

 Sinha P.,“Computer Fundamentals”

 Kernighan, B. W. and Ritchie, D. M., “The C Programming


Language”, 2nd ed. Prentice-Hall,1988.

 Vine, Michael. “C Programming for the Absolute Beginner” 2nd


Ed. 2008

 Chaudhary H. “C Programming __ The Ultimate Way to Learn


The Fundamentals of The C Language”, 2014
EE171
Introduction to Computers &
Programming for Engineers

Lecture 1:
Computer Basics
9
What is a Computer?
10
What is a Computer?
11
What is a Computer?
12

Computer is an electronic device that accepts input data,


process data, store data and produce output according to a set
of instructions given to it.
Computers come in many forms, from the traditional desktop
PC to portable devices (laptop, tablet, smartphone).
The basic principles of how a computer operates are generally
the same, irrespective of its purpose.
Characteristics of Computers
13
Characteristics of Computers
14

Speed: Process data at very high speed (millions of tasks per second)
Accuracy: Performs calculations with almost 100% accuracy.
Reliability: Gives consistent result for similar set of data i.e., if we give same set
of input any number of times, we will get the same result.
Diligence: Capable of doing any work for a long time without getting tired.
Versatility: Performing different tasks at the same time.
Memory: Can store and recall massive amount of data stored within their
capacity.
No I.Q: Does only what it is programmed to do. It cannot make its own
decision.
Classification of Computers
15

 Based on their processing power (speed), cost and size


computers can be classified into four classes:
• Super computers
• Mainframe Computers
• Mini Computers
• Micro Computers
Super Computers
16

 Focused on performing tasks involving intense numerical calculations.


 Nuclear weapon testing, space exploration, and global weather patterns
Mainframe Computers
17

 Not as powerful as supercomputers, but handles bulk data processing.


 Data centers, Banks,Telecom
Mini Computers
18

 Also called workstations


 Used to handle data processing for many users simultaneously who are
connected via terminals
Micro Computers
19

 General purpose computer/Personal Computers (PC).


 Designed for general usage like entertainment, education and personal
work
Computer System
Computer Languages
Computer Number System

20
Hardware

Computer System
Software

21
Computer System…
22

Hardware Software
Computer
23

 A computer hardware consists of four main components:


Input Devices
24

 Input devices feeds data and instructions into a form which the
computer understands
Examples of Input Devices?
25

• Mouse
• Trackball
• Keyboard
• CD-ROM
• Scanner
• DVD-ROM
• Touch pad
• Bar Code
• Light pen
• Reader
• Joysticks
• Microphones
• Digital
Cameras
• Touch Screen
Output Devices
26

 Peripherals used to provide processed information to the user either in


softcopy or hardcopy.
Examples of Output Devices?
27

• VDU
• Screen monitors
• Printer
• Plotters
• Speakers
• Headphone
• Projectors
Computer Memory
28

 Computer memory refers to devices that store data or instructions on


temporary or permanent basis.
Computer Memory Sizes
29

• Bit: Smallest unit of computer information(1/0)


• Byte: Smallest addressable memory (8 Bits)
• Kilobyte: A kilobyte (KB) consists of 1024 Bytes
• Megabyte: A megabyte (MB) consists of 1024 KB
• Gigabyte: A gigabyte (GB) consists of 1024 MB
• Terabyte: A terabyte (TB) consists of 1024 GB
• Petabyte: A petabyte (PB) consists of 1024 TB
Types of Computer Memory
30
Primary Memory
31

Random Access Memory (RAM)


 The main working memory of the computer that is used to store data
temporarily.
 It holds instructions for processing data, processed data, and raw data.
 The CPU can utilize only those instructions and data that are stored in
RAM.
 The more RAM a computer has, the more instructions and data can be
processed at a time.
Primary Memory…
32

Read Only Memory (ROM)


 A special type of memory chip which holds software which
can be read but not written to.
 A good example is the ROM-BIOS chip, which contains read-
only software necessary for power-on startup.
Secondary Memory
33

 Designed to retain data even if the computer is shut down.


 While secondary memory is much slower than primary
memory, it typically offers greater storage capacity
 Unlike primary memory, secondary memory is not accessed
directly by the CPU.
 Instead, data accessed from secondary memory is first
loaded into RAM and is then sent to the processor.
 This facilitates data processing speed.
Secondary Memory…
34

CPU RAM Secondary


Storage
Secondary Memory…
35

Solid State Devices (SSD) Magnetic Disk


Uses semiconductor-based Contains circular disc made of metal.
integrated circuits to store Uses magnetic memory store
information. information.
Secondary Memory…
36

Magnetic Tape Optical Storage


• Contains thin plastic ribbon used Data is written and read with a laser
for storing data diode.
• Mainly used for data backups
Central Processing Unit
37

 Is an integrated circuit or “chip” which processes instructions and data


Central Processing Unit…
38

 The CPU is attached to the system's motherboard, which connects all


the computer's devices together, enabling them to communicate.
Central Processing Unit…
39

 Arithmetic and Logical Unit (ALU)


 The control unit (CU)
 Registers
Central Processing Unit…
40

 Arithmetic and Logical Unit (ALU): Performs the arithmetic


operations and the logical comparisons.
 Control unit (CU): CPU Controls the entire operation of the
computer. Directs the flow of data through the CPU, to and
from other devices.
 Registers: Memory location within CPU which temporarily hold
data and program instructions while they are being processed.
Central Processing Unit…
41
Central Processing Unit…
42

 In order to process instructions and data, the CPU needs to


retrieve them from memory.

 Registers – saves the most frequently used instructions and data

 To do this, it follows a process known as Fetch-Execute Cycle


(or, sometimes, the Fetch-Decode-Execute cycle).

 This cycle repeats billions of times each second, giving the illusion
that the CPU is doing many things at the same time when, in reality,
it is really only processing one instruction at a time.
Self Study:

Fetch-Execute Cycle

43
Central Processing Unit…
44

 Clock: Ensures synchronization to all activities between components within the


computer.
 Decoder: Decodes instructions that are retrieved from memory during the fetch-
execute cycle
 Memory Address Register (MAR): Holds the address of the location in memory
where data or an instruction is to be retrieved or stored.
 Memory Data Register (MDR): Holds the data or instruction that has been retrieved
from memory or is about to be stored in memory
 Accumulator Register (AR): Holds the results of calculations and operations
performed by the ALU
 Program Counter(PC): Holds the memory address of the next instruction to be
executed.
System Bus
45

 Electronic communication path through which information (data, address,


commands) are transmitted between various components of the
computer.
Hardware

Computer System
Software

46
Computer Software
47

Hardware Software
Computer Software
48

 Computer Software consists of a series


of instructions that tells the computer
what to do, when to do and how to do.
 Is a collection of programs/
documentation that directs the
computer to perform a certain task.
Classification of Computer Software
49
Application Software
50

Application software is designed to enable the user to carry


out some specific task
System Software
51

 Software that controls and maintain the entire operation of


the computer and connected devices.
 It also serves as a platform for running the application
software.
 System software includes:
• Operating System
• Utilities and Drivers
• BIOS software
Operating System (OS)
52

Operating System (OS) coordinates all activities among


computer hardware
Operating System (OS)…
53

Operating Systems usually come in two forms:


 Command Line Interface (CLI): Allows the user to
interact with the system using commands
 Graphical User Interface (GUI): Allows the user to
interact with the system using graphical elements such as
windows, icons, menus
 While GUI is more user-friendly, CLI is more advanced and
powerful.
Function of the Operating System (OS)
54

 File Management: Keeps track of each file information, user access


settings and status of every file.
 Memory Management: Keeps track of primary memory, decides the
order in which processes are granted access to memory
 Processor Management: Decides the order in which processes have
access to the processor. De-allocates processor when athe process is has
finished execution.
 Device Management: Keeps track of all devices connected to the
system via their respective drivers, De-allocates devices when no longer
required.
Function of the Operating System (OS)…
55

 Program Execution: Oversees execution of all types of programs


whether it be user programs or system programs. The OS utilizes various
resources available for the efficient running of all types of programs.
 Job Accounting & System Performance: Keeps track of time and
resources used by various tasks and users, errors occurred are recorded
by the OS
 Security: Monitors malware programs, prevents unauthorized access to
programs and user data
Disk Operating System (DOS)
56

 It is a CLI based operating system.


 Was developed by Microsoft for the newly introduced IBM-
PC in 1981.
Disk Operating System (DOS)…
57

 Almost every OS has inbuilt DOS firmware (shell)


 DOS provides direct access to the BIOS and its underlying
hardware.
 It provides the user with disk cleaning tasks, disk partition,
disk check, formatting, organize files and execute programs.
 Although MS-DOS ceased to be marketed as a stand-alone
OS, it is still an ideal platform for embedded control systems.
DOS – Files
58

 A file is a collection of organized data (Records).


 Any document created inside a computer is a file.
 DOS is not case sensitive
 The filename in DOS has two parts the name and the
extension: <name>.<ext>
 The name can be of 8 characters and the extension of 3
characters.
DOS – Files…
59

Some common files


.exe – Executable program file
.bak – Backup file
.bat – Batch file, a set of DOS commands file
.sys – System file, reserved for DOS configurations
.doc – Document file (word)
.txt – Text file
DOS – Directories
60

 Data in a hard drive is organized in directories.

 A directory is a collection of files.

 The DOS file system is a hierarchical file system.

 There is always a directory which is not contained by any other,


called the root directory which is represented by the
backslash '\' character.
DOS Directory Management Commands
61

 DIR - Displays the contents of the current directory


 DIR /w – Shows only names of files/directories
 DIR *.doc – Displays all files with extension doc
 CD subdirectory- Move from the current directory to another
directory
 CD.. – To move back one level of the directory
 CD\ – To move back to the root directory
 MD or MKDIR - Creates a new directory
 RMDIR or RD – Deletes a directory (if it is empty)
DOS File Management Commands
62

 C:\filename – Opens a file (using a default program)


 REN OldFileName NewFileName – Renames a file
 COPY Filename NewDirectory – Copies a file
Filename to another location NewDirectory
 DEL filename - Deletes specified file.
 DEL *.doc - It will delete all the files with the extension .doc
 DEL *.* - It will delete all files in the current directory
 MOVE – Moves a file to another location
DOS Common Commands
63

 CLS – clears the screen


 VER - Show version number of installed OS
 Exit – Exit the command processor/window
 CHKDSK – Checks Issues and Repairs Corrupted Disk
 DISKPART - Make changes to Disk partitions
 DIR /? – Describes the meaning of the command
 Format - Format a disk
Computer Software
Computer Languages
Computer Number System

64
Computer Languages
65

 Computer languages are the basic building blocks of


any software.
 Allow a programmer to write instructions that a
computer can understand.
 Computer language is a set of rules that provides a
way of telling a computer what operations to perform
Computer Languages Levels
66
Computer Languages Levels
67

 Machine Language: The only language the computer understands.


Consists of strings of 1's and 0's and stored as binary numbers.
• Drawback: Difficult to work on, Very easy to make a mistake, and very hard
to find it once you realize the mistake has been made.

 Assembly Language: A computer language in which the instructions


are created using predefined words called mnemonics.
• It is efficient, making optimum use of both computer memory and
processing time.
• It is written with specific to a given architecture of the Central Processing
Unit (CPU).
Computer Languages Levels
68

 High-level Language: Languages close to human language, Facilitates


faster development of large programs.
Usage/Application Language
Mobile Applications Java, Kotlin, Swift, Python
Gaming, Embedded Systems C, C++, Python, Java
Machine Learning, Scientific Computations Python, C++, R
Web Development PHP, Java, JavaScript, Ruby
OS, Compliers, Desktop Applications Java, C, C++, C#, Python
Computer Software

Computer Languages

Computer Number System

69
Computer Number System
70

 Information in a computer is handled by electronic


components.
 Electronic components operate in two possible states
• HIGH (1) / LOW(0)
 Handling two possible states simplifies internal circuit design.
 However, humans prefer decimal number system when
representing data.
Decimal Binary Hexadecimal
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
71
15 1111 F
Decimal Number System
72

 Has ten (10) symbols/digits (0,1,2,3,4,5,6,7,8,9).

 Hence base (10) number system.

 Each position of a digit represent a specific power of


the base (10)

 We use this number system in our day-to-day life.


Binary Number System
73

 Has two (2) symbols/digits (0 and 1).

 Hence base (2) number system.

 Each position of a digit represent a specific power of


the base (2)

 Computers use BINARY numbers for internal data


representation.
Hexadecimal Number System
74

 Has sixteen (16) symbols/digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9,


A, B, C, D, E, F).

 Hence base (16) number system.

 Each position of a digit represent a specific power of


the base (16)

 Used to represent binary numbers in compact form.


Number System Conversion

Self Study
Computer Fundamentals_by_Sinha
Chapter 03: Number System

75

You might also like