Professional Documents
Culture Documents
مقدمة في الحوسبة2
مقدمة في الحوسبة2
2022 - 2023
1
Outline
► Introduction
► Bits and their storage
► Boolean operations
► Gates
► Main memory
► Memory organization
► Mass storage
2
Introduction
3
Bits and their storage
► Inside the computers information is
encoded as patterns of 0s and 1s. These
digits are called bits (binary digits).
► Numeric values
► Characters
► Images
► Sounds
4
Boolean operations
► bit 0 represent the value false
► bit 1 represent the value true
► Operations that manipulate
true/false values are called Boolean
operations.
► basic Boolean operations are:
► AND, OR, and XOR (exclusive or)
► There is also NOT
5
Boolean operations
► AND, OR, and XOR operators take two
operands, but the NOT operator takes a
single operand
► AND
► The AND operator performs logical
conjunction on two Boolean
expressions.
► If both expressions are equal to true
(1), then the AND return true,
otherwise all other cases should
produce an output False (0) 6
Boolean operations
► OR
► The OR operator performs logical
disjunction on two Boolean
expressions.
► OR operator returns true value
when at least one of their Boolean
expression is equal to true.
7
Boolean operations
8
Boolean operations
► NOT
► The operation NOT is another
Boolean operation. It differs
from AND, OR, and XOR because
it has only one input.
► Its output is the opposite of
that input.
9
A pictorial representation of AND, OR, XOR, and NOT
gates as well as their input and output values
Gates
11
Gates
12
Exercise
► What input bit patterns will cause
the following circuits to produce an
output of 1?
13
Main memory
14
Memory organization
A computer main memory is organized in
manageable units called cells.
Cell: A unit of main memory (typically 8 bits
which is one byte)
Each cell’s size equal to eight (8) bits.
higher-order end: the left end of the row of bits
on the memory
lower-order end: the right end
most significant bit: the last bit at the high-order
end.
least significant bit: the bit at the right end.
15
Memory organization
16
Memory organization
► To identify individual cell in a computer’s
main memory, each cell is assigned a
unique “name”, called its address.
► Address: A “name” that uniquely
identifies one cell in the computer’s main
memory. As shown in the following Figure
17
Measuring memory capacity
18
Mass storage
19
Advantages of mass storage
► less volatility
► large storage capacity
► low cost
► the ability to remove the
storage medium from machine
for archival purpose
20
Disadvantages of mass storage
21
Mass Storage Systems
► Magnetic Systems
► Disk
► Tape
► Optical Systems
► CD
► DVD
► Flash Drives
22
Magnetic systems
24
A magnetic disk storage system
25
Magnetic systems
► Magnetic disk performance evaluation depends
on four criteria's:
► Seek time, the time required to move the
read/write head from track to another.
► Rotation delay (latency time), half -average
calculation the time required for the disk to
make complete rotation.
► Access time, the sum of the seek time and
rotation delay.
► Transfer rate, the rate at which data can be
transferred to/from the disk.
26
Optical system
27
Flash drivers
► In mass storage, data storage and
retrieval is slow compared to the
speed of electronic circuitry .
► Flash memory has the potential of
solving this drawback.
► Bits are stored by sending
electronic signals directly to the
storage medium
28
Representing text
► Each of different symbol on the text
(alphabet letter) is assigned a unique
bit patterns
► the text is then representing as a long
string of bits.
► ASCII” American Standard Code for
Information Interchange”: Uses
patterns of 7-bits to represent most
symbols used in written English
text.
► Today, it is extended to 8-bits. 29
Representing Text
► Each character (letter, punctuation,
etc.) is assigned a unique bit pattern.
ASCII: Uses patterns of 7-bits to
represent most symbols used in
written English text
ISO standard: Uses patterns of
32-bits to represent most symbols
used in languages world wide
Unicode: Uses patterns of 16-bits to
represent the major symbols used in
languages world wide 30
Figure 1.13 The message “Hello.” in ASCII
31
Representing Numeric Values
► Binary notation is a way of
representing numeric values
using only digits 0 and 1.
► Limitations of computer
representations of numeric
values
► Overflow: occurs when a
value is too big to be
represented
32
Representing Numeric Values
35
Binary system
⚫ For example, here is (11001) in binary
2
⚫ (101.11)2
36
Decimal
37
Decimal system
⚫ (224)10
⚫ Note that the digit 2 in position 1 has the value 20, but the
same digit in position 2 has the value 200
38
Figure 1.15 The base ten and binary
systems
39
Figure 1.16 Decoding the binary
representation 100101
40
Exercise
41
Figure 1.18 An algorithm for finding
the binary representation of a
positive integer
42
Figure 1.18 Applying the algorithm in Figure 1.15
to obtain the binary representation of thirteen
43
Hexadecimal (Hex)
• Hex is a numbering system that uses Base 16. The numbers
0-910 are represented normally, but the numbers 1010 through
1510 are represented by the letters A through F
• 1 hex digit is equivalent to 4 bits
• Numbers are 0,1,2…..8,9, A, B, C, D, E, F.
• The following shows that the number (2AE)16 in hexadecimal is
equivalent to 686 in decimal.
= 1 × 161 + A × 160
=16 + 10 ×1
=16+10 = 26
convert (F4C)16 to decimal
► 111001112 = 3478
► 11000 010101010 010 0012 = 30252218
Octal to binary
(110011010)2
Binary addition
56
Binary addition
57
Fraction in binary
58
Fraction in binary
59
Decimal fraction to binary
0.625 x 2 = 1.25
0.625 = .1
0.25 x 2 = 0.50
0.625 = .10
0.50 x 2 = 1.00
0.625 = .101
60
Representing images
61
Black and white image
62
Color image
► RGB encoding
► Each pixel is represented as three color: red, green and
blue.
► One byte is normally used to represent the intensity of
each color.
► Three byte of storage are required to represent a single
pixel.
63
Representing sounds
64
Figure 1.14 The sound wave represented
by the sequence 0, 1.5, 2.0, 1.5, 2.0, 3.0,
4.0, 3.0, 0
0-65
Storing integers
66
Two’s complement Notation
68
Two’s complement Notation
69
Coding the value using Two’s complement
70
Example of encoding value
71
Addition in two’s complement
72
Addition in two’s complement
73
The problem of overflow
75
Figure 1.24 An excess eight conversion table
76
Figure 1.25 An excess notation system using bit patterns
of length three
77