0% found this document useful (0 votes)
5 views

Introduction to Computer Science Sem1

Uploaded by

Aung Wai phyo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Introduction to Computer Science Sem1

Uploaded by

Aung Wai phyo
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

Introduction to Computer Science

By U Khun Kyaw Thet Zaw


Introduction to computer science
• Computer science is the study of computers and computational
systems, including their design, development, and application.
– Computers
– Programming Languages
– Data Structure and Algorithm
– Operating System and Networking
– Databases and Web Development
– Computational Theory
Importance of Computer Science
• Foundation of Modern Technology
• Driving Force Behind Innovations: AI, IoT, Cloud Computing
• High Demand for Skilled Professionals
• Opportunities Across Industries:
– Healthcare
– Business and Finance
– Education and Research
– Entertainment and Media
What are computers?
• Definition
– A computer is an electronic device that
processes data and performs tasks based on
instructions.
– A computer is a problem-solving tool for people
to use, it is a machine that accepts data, stores
data, performs certain operations on the data and
presents the results of those operations.
History of computers
• First Generation (1940s):
– Used vacuum tubes
– Magnetic tape
– Punched cards and paper
– Machine and assembly language
– Large, slow, and expensive
– UNIVAC 1
History of computers
• Second Generation (1950s):
– Transistors replaced vacuum tubes
– Magnetic disk
– Punched cards and paper
– High-level language: FORTRAM, COBOL, BASIC
– Smaller and faster
– Honeywell 200
History of computers
• Third Generation (1960s):
– Integrated Circuits (ICs) introduced
– Improved disk storage
– Monitors and keyboards
– High-level languages: RPG and Pascal
– Minicomputers used commercially
– Increased reliability and efficiency
– IBM System 360
History of computers
• Fourth Generation (1970s):
– LSI and VLSI
– Microprocessors developed
– Microcomputers and application software
– Personal computers became common
– Compaq Deskpro 386
• Fifth Generation (Present):
– Focus on Artificial Intelligence (AI) and Quantum Computing
What computers can do?
Design and Data
Data processing Control
development communication
• Process of • Control many • Design a • Process of
converting the mechanical product and test sending data
data (raw facts) devices and it using a from one point
into information processes computer before to another
(organized, • E.g. robot in manufacturing electronically
usable form) factories and • Enable data to
• Statistics, monitor traffic be shared and
mathematical light updated at
calculations, different
filling tasks and locations
word processing
Functions of a Computer
• Three basic tasks:
– Perform arithmetic functions such as adding, subtracting,
multiplying and dividing
– Test relationship between data items by comparing values
– Store and retrieve data
How computers operate?
• Involves the collecting, verifying and
Input encoding of data into a machine readable
form for computer

• Computer creates useful information from the input


Processing data through such operations as classifying, sorting,
calculating, summarizing and storing.

• Includes retrieving the data, converting


Output them into human-readable form and
displaying the information to the user
Components of a computer system
• Hardware
– Computer
• CPU and related circuitry
• Power supply and cooling system
– Storage devices
• Floppy disks, hard disk, magnetic disk, HDD, SSD
– Input devices
• Keyboard, mouse, scanner, etc.
– Output devices
• Printers, monitors, plotter, etc.
Components of a computer system
• Software
– Operating software
• Window, Mac OS, Linux
– Application software
• Microsoft office, Adobe
• User
Where computers are used?
• Computers are found in a diversity of areas or applications
– Business and Industry
– Science and Technology
– Education
– Government
– Recreation and Entertainment
Data Representation
• Refers to the internal method used to represent various types of
data stored on a computer.
• Computers use different types of numeric codes to represent
various forms of data, such as text, number, graphics and sound.
• Computers identify only signals in the form of digital pulses that
represent either a high-voltage state (on) or a low voltage state
(off).
• The on and off conditions are commonly labeled with 1s and 0s
is called binary system.
Introduction

• A bit is the most basic unit of information in a computer.


– It is a state of “on” or “off” ( 1 or 0) in a digital circuit.
– Sometimes these states are “high” or “low” voltage instead of “on”
or “off..”
• A byte is a group of eight bits.
– A byte is the smallest possible addressable unit of computer
storage.
– The term, “addressable,” means that a particular byte can be
retrieved according to its location in memory.

16
Introduction

• A word is a contiguous group of bytes.


– Words can be any number of bits or bytes.
– Word sizes of 16, 32, or 64 bits are most common.
– In a word-addressable system, a word is the smallest addressable
unit of storage.
• A group of four bits is called a nibble.
– Bytes, therefore, consist of two nibbles: a “high-order nibble,” and
a “low-order” nibble.

17
Number Systems

• Bytes store numbers using the position of each bit to


represent a power of 2.
– The binary system is also called the base-2 system.
– Our decimal system is the base-10 system. It uses powers of 10 for
each position in a number.
– Any integer quantity can be represented exactly using any base (or
radix).

18
Number Systems

• The decimal system is a base-10 system, the position


weights are based on the power of 10
• 0,1,2,3,4,5,6,7,8,9,10,11,…
• The number 947 in powers of 10 is:
9  10 2 + 4  10 1 + 7  10 0

• The binary system is a base-2 system, the position


weights are based on the power of 2
• The binary number 11001 in powers of 2 is:
124+123+022 +021+120

19
Number Systems

• The hexadecimal system is a base-16 system, the position


weights are based on the power of 16
• 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,……
• The octal system is a base-8 system, the position weights are
based on the power of 8
• 0,1,2,3,4,5,6,7,10,11,……

20
Decimal Binary Hexadecimal Octal
0 00000 0 0
1 0001 1 1
Decimal, 2 0010 2 2
Binary, 3
4
0011
0100
3
4
3
4
Hexadecimal, 5 0101 5 5
6 0110 6 6
Octal 7 0111 7 7
8 1000 8 10
9 1001 9 11
10 1010 A 12
11 1011 B 13
12 1100 C 14
13 1101 D 15
14 1110 E 16
15 1111 F 17

21
Converting decimal to binary

• Converting 190 to base 2


19010 = 101111102 2 190
2 95 0
2 47 1
2 23 1
2 11 1
2 5 1
2 2 1
2 1 0
0 1

22
Converting binary to decimal

• Converting (1011011)2 to decimal

6 5 4 3 2 1 0
(1011011) 2=1 × 2 + 0 × 2 +1 × 2 +1 × 2 + 0 × 2 +1 × 2 +1 × 2

¿ (91)10

• Converting fraction binary (10+0.11) 2 to decimal

(10 + 0.11)2=1 × 2 1+ 0 × 20 +1 × 2− 1 +1 × 2− 2

¿ (2.75)10

23
Conversion of hexadecimal to decimal

• Converting (1D7F)16 to decimal

(1 𝐷 7 𝐹 )16 = 1 × 16 3 + 𝐷 × 162 +7 × 161 + 𝐹 × 16 0

¿ (7551)10

• Converting hexadecimal to binary

𝐻𝑒𝑥𝑎𝑑𝑒𝑐𝑖𝑚𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 =9 3 𝐹 𝐴
𝐵𝑖𝑛𝑎𝑟𝑦 𝑛𝑢𝑚𝑏𝑒𝑟 =1001 0011 1111 1010

(93 𝐹𝐴)1 6=100100111111101 0 2


24
Floating-Point Representation

• Floating-point numbers allow an arbitrary


number of decimal places to the right of the
decimal point.
– For example: 0.5  0.25 = 0.125
• They are often expressed in scientific notation.
– For example:
0.125 = 1.25  10-1
5,000,000 = 5.0  106

26
Floating-Point Representation

• Computers use a form of scientific notation for


floating-point representation
• Numbers written in scientific notation have three
components:

27
Floating-Point Representation
• Computer representation of a floating-point
number consists of three fixed-size fields:

• This is the standard arrangement of these fields.

Note: Although “significand” and “mantissa” do not technically mean the same thing, many people use these terms interchangeably. We use the

term “significand” to refer to the fractional part of a floating point number.

28
Floating-Point Representation

• We introduce a hypothetical “Simple Model” to


explain the concepts
• In this model:
– A floating-point number is 14 bits in length
– The exponent field is 5 bits
– The significand field is 8 bits

29
Floating-Point Representation
• Example:
– Express 3210 in the simplified 14-bit floating-point model.
• We know that 32 is 25. So in (binary) scientific notation
32 = 1.0 x 25 = 0.1 x 26.
– In a moment, we’ll explain why we prefer the second
notation versus the first.
• Using this information, we put 110 (= 610) in the
exponent field and 1 in the significand as shown.

30
Computer Architecture

You might also like