Professional Documents
Culture Documents
to Computer Science
Computer Science Dept.
Helwan University
Lecture 1
Computational
Thinking – Part 1
1.1 Computers & Computer Science
What is a Computer? – The Evolution of
Computers. – Computer Science? – Informatics?
1.2 Binary versus Decimal Numeral System
1.3 Representation Faculty of
ASCII & UNICODE – RGB, Pixels, Videos, & Audio Computers &
– Computer Graphics / Vision, Image & Signal Artificial Intelligence
Processing. FALL 2023
Where are we now .. ?!
0: Course Introduction & Plan
1: Computational Thinking – Part 1 (Computers, Computer Science, & Binary Representation)
2: Computational Thinking – Part 2 (Types of Hardware, Algorithms, & Programming
Languages)
3: Computational Thinking – Part 3 (Types of Software, Basics of Programs, & Compilation)
4: Variables, Constants, & Data Types in C
5: Arithmetic & Bitwise Operations, Logical & Relational Operators, and Precedence
6: Control Structures – Selection (Decisions)
7: Control Structures – Repetition (Loops)
8: C Built-In Functions & Solved Examples (1st Set)
9: User–Defined Functions & Scope of Variables
10: Number Systems, Binary Arithmetic, & the Complements Representation
11: Recursion, Function Overloading, & Call-by-Reference versus Call-by-Value
12: Solved Examples (2nd Set)
Computer Science?
Informatics?
1.3 Representation
ASCII & UNICODE
4
The Evolution of Computers
George Boole; Invented
Ismail al-Jazari; Ada Lovelace;
Boolean logic, the basis of
Invented the first Writer of the world's modern digital computer
programmable first computer program. logic.
humanoid robots
in 1206.
6
Computer Science?
o Data; Raw, unorganized facts (can be in the form of text,
graphics, audio, or video).
o Information; Data that has been processed into a meaningful
form.
o Information Processing; Converting data into information
Information
Processing
data → → information
(data + meaning)
7
Computer Science?
Its fields can be divided into various theoretical and practical disciplines.
Programming
Computer Concepts & Data Structures Algorithms Databases
Languages
Science Data/Digital
Parallel &
Operating Computer Communication
Distributed
Systems Architecture & Computer
Computation
Networks
Artificial
Computer Computer Intelligence &
Robotics
Graphics Vision Machine
Learning
Health Informatics
Biomedical Medical Clinical
Bioinformatics
Informatics Informatics Informatics
11
Exercises
What have we learned?
Computer Science?
Informatics?
1.3 Representation
ASCII & UNICODE
15
Decimal Vs. Binary
Number Systems
16
When we first learned to count, we might have
used one finger to represent one thing. That
system is called unary.
0123456789
17
Digital devices understand only two different
states: ON and OFF ..
💡💡
01
18
Why does the following represent
one hundred and twenty-three?
123
19
1
The 3 is in the ones column.
123
10
The 2 is in the tens column.
123
100
And ..
The 1 is in the hundreds column.
123
20
Each place for a digit represents a power of ten,
since there are ten possible digits for each place.
100 10 1
123
100 × 1 + 10 × 2 + 1×3
21
100 10 1 100 10 1
000 006
001 007
002 008
003 009
004 ….?
005 22
100 10 1 100 10 1
000 006
001 007
002 008
003 009
004 010
005 23
In binary, with just two digits, we have powers of
two for each place value:
4 2 1
000
24
So, Decimal (powers of 10) ..
000
.. versus Binary (powers of 2).
22 21 20
000 25
Counting in Binary ..
4 2 1
000
26
Counting in Binary ..
4 2 1
001
27
Counting in Binary ..
4 2 1
010
28
Counting in Binary ..
4 2 1
011
29
Counting in Binary ..
4 2 1
100
30
Counting in Binary ..
4 2 1
101
31
Counting in Binary ..
4 2 1
110
32
Counting in Binary ..
4 2 1
111
33
How can we represent 8 in binary?
34
Binary makes sense for computers because we
power them with electricity, which can be either on or
off, so each bit only needs to be on or off.
💡
bit
In a computer, there are millions, or billions of
switches called transistors that can store electricity
and represent a bit by being “on” or “off”.
35
With enough bits, or binary digits, computers can
count to any number.
💡💡💡💡💡💡💡💡
bit bit bit bit bit bit bit bit
byte
8 bits make up one byte.
36
What is the value of the following
byte?
💡💡💡💡💡💡💡💡
37
Binary Data Representation:
Computer memory is normally represented in terms of Kilobytes or
Megabytes. In the Metric System, one Kilo represents 1000 grams,
that is 103. In the Binary System, one Kilobytes represent 1024 bytes,
that is 210.
The following table shows the representation of various memory
sizes: Name Abbreviation Size (in bytes)
Kilo K 210
Mega M 220
Giga G 230
Tera T 240
Petta P 250
Exa E 260
Zetta Z 270
Yotta Y 280
Exercises
What have we learned?
Computer Science?
Informatics?
1.3 Representation
ASCII & UNICODE
42
- ASCII & UNICODE
To represent letters, all we need to do is decide how
numbers map to letters. Some humans, many years
ago, collectively decided on a standard mapping
called ASCII (stands for American Standard Code for
Information Interchange). It's a 7-bit character code
where every single code represents a unique
character.
A
The letter “A”, for example, is the number 65, and
“B” is 66, and so on.
44
A
ASCII 65
1000001
45
... A B C D E F G H I ...
ASCII
... 65 66 67 68 69 70 71 72 73 ...
46
The mapping includes upper and lowercase Latin
alphabet, the numbers 0-9, and some extra
characters (punctuation and other symbols).
47
The first thirty-two codes (0 to 31) in ASCII are reserved for
control codes that control computer equipment (such as
printers). For example, code 10 represents the "line feed"
function (which causes a printer to advance its paper). Table 1
shows the printable characters with the ASCII.
48
So, if you received the following
message, what does it mean?
49
So, if you received the following
message, what does it mean?
G o o d D a y !
50
How is the following message sent?
65
51
How is the following message sent?
6 5
54 53
110110 110101
52
Other characters, like letters
with accent marks, and emoji,
are part of a standard called
Unicode that use more bits
than ASCII to accommodate
all these characters.
53
Unicode
Unicode – Egyptian Hieroglyphs
Examples:
54
Unicode – Arabic
Unicode
55
- Pixels, & the RGB System
- Image, Video, and Audio Files
An image, too, is comprised of many smaller square dots,
or pixels, each of which can be represented in binary with a
system called RGB:
.. with values for red, green, and blue light in each pixel.
By mixing different amounts of each color, we can
represent millions of colors. 57
We can see this in an emoji if we zoom in far
enough:
58
Pixels; Picture Elements
59
What does the following numbers
mean in the context of images
(pixels)?
72 73 33
60
What does the following numbers
mean in the context of images
(pixels)?
RGB: 72 73 33
61
The red, green, and blue values are
combined to get a light-yellow color:
RGB: 72 73 33
62
An RGB Example ..
63
Videos are just many, many images
displayed one after another, at some
number of frames per second.
64
65
66
67
68
Sub-fields of CS dealing
with images?
Computer vision; deals with how
computers can gain high-level
understanding from digital images
or videos. It seeks to understand
and automate tasks that the
human visual system can do.
Thank you!