0% found this document useful (0 votes)
6 views36 pages

Chapeter1 Part 1

computer architecture

Uploaded by

inforphyt
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)
6 views36 pages

Chapeter1 Part 1

computer architecture

Uploaded by

inforphyt
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/ 36

Ingineer School of Computer Science and Digital Technologies

Option : Cloud Computing

Chapter 1 (Part 1)

Presented by:
Dr L. CHELOUAH

1
I. NUMERATION SYSTEMS

Definition:
 A numeration system is a set of conversions used to represent information
(number, text, …).
 Each number is represented by a symbol called a digit.
 The number of symbols used defines the base of a numeration system.

Let b be a natural number (positive integer) greater than or equal to 2. Let N be


any integer. In the b-based numeration system, the number N can be written as
follows :
N= (cncn-1……c3c2c1c0)b

Such as : each digit ci (i=0,n) is an integer between 0 and b-1: 0 ≤ ci < b

2
I. NUMERATION SYSTEMS
1. Decimal System
Base 10 -> (𝑁)10 symbols {0,1,2, 3, 4, 5, 6, 7, 8, 9}

2. Binary system
Base 2 -> (𝑁)2 symbols {0,1}

3. Octal system
Base 8 -> (𝑁)8 symbols {0,1, 2, 3, 4, 5, 6, 7}

4. Hexadecimal system
Base 16 -> (𝑁)16 symbols {0,1,2, …, 9, A,B,C,D,E,F}

3
I. NUMERATION SYSTEMS

COUNTING BETWEEN DIFFERENT BASES

4
I. NUMERATION SYSTEMS

 Digit weight: this is the rank of the digit in a number when counting from the
right; the rightmost number has zero weight.

POLYNOMIAL FORM OF A NUMBER IN THE DECIMAL SYSTEM


(1978)𝟏𝟎 = 1× 𝟏𝟎𝟑 + 9× 𝟏𝟎𝟐 + 7× 𝟏𝟎𝟏 +8× 𝟏𝟎𝟎

What’s the Polynomial Form of number (1978,265)𝟏𝟔 ?

5
II. CONVERSIONS
From base 10 to base b
The successive divisions method is generally used to convert a number
written in base 10 to base b.

6
II. CONVERSIONS

Examples :
(42)10 = (? )2
(47)10 = (? )8
(94)10 = (? )16

7
II. CONVERSIONS

2. From base b to base 10


The successive multiplications method is generally used to convert a
number written in base b to base 10.

Examples :
(10111)2 = (? )10
(1𝐴2)16 = (? )10

8
II. CONVERSIONS
3. From base 2 to base 8
The number is grouped into subsets of 3 digits. Each subset is then
converted to base 8.
(110011000)2 = (630)8

4. From base 2 to base 16


The number is grouped into subsets of 4 digits, then each subset is converted
to base 16.
(11110010110000)2 = (3𝐶𝐵0)16

Examples :
(11110011)2 = (? )16
(1110011)2 = (? )8

9
II. CONVERSIONS
5. From base 8 to base 2
Each digit of the number is broke down into 3 bits.
(753)8 = (111101011)2

6. From base 16 to base 2


Each digit of the binary number is broke down into 4 bits.
(𝐴51)16 = (101001010001)2

Examples :
(𝐹𝐶1)16= (? )2
(164)8 = (? )2

10
II. CONVERSIONS
7. From base b1 to base b2
To convert a number from base b1 to base b2, we need to go through an
intermediate base, which is base 10 ∶ (𝑁)𝑏1 = (? )10 = (? )𝑏2

Example : (45)6 = (131)4

11
8. Convert a fractional number from base 10 to base b
We multiply the fractional part by base b and repeat this operation with
the fractional part of the product until it becomes equal to 0. The desired
value is in fact made up of the concatenation of the integer parts of the
various products obtained.
(9,5)10 = (1001,1)2

9. Convert a fractional number from base b to base 10


(101,11)2 = (5,75)10

12
III. BINARY ARITHMETIC
Basic operations
A. Binary addition

Operation Addition Carry


0+0 0 0
0+1 1 0
1+0 1 0
1+1 0 1

Example :
(1110011)2 +(11101)2 =(? )2

13
III. BINARY ARITHMETIC
Basic operations
B. Binary subtraction

Operation Difference Carryover


0-0 0 0
0-1 1 1
1-0 1 0
1-1 0 0
Example :
(11000)2 - (111)2 = (? )2

14
III. BINARY ARITHMETIC
Basic operations
C. Binary multiplication
Operation Product
0×0 0
0×1 0
1×0 0
1×1 1

Example :
(1101)2 × (1011)2 = (? )2

15
III. BINARY ARITHMETIC
Basic operations
D. Binary division
Operation Division
0÷0 Impossible
0÷1 0
1÷0 Impossible
1÷1 1

Example :
(100101,1)2 ÷ (1,01)2 = (? )2

16
IV. REPRESENTATIONS OF INFORMATION
Basic computer units of measurement

Bit (0 or 1)
Byte
Kilobyte (Kb)
Megabyte (Mb)
Gigabyte (Gb)
Terabyte (Tb)

17
IV. REPRESENTATIONS OF INFORMATION

Remark :
With n bits we can achieve :
𝟐𝒏 combinations
ቊ 𝒏
𝟐 −1 is the largest number

Example :
With n=2, we have 22 = 4 combinations and 22 -1 = 3 is the largest
number. The four combinations are :
A B
0 0
0 1
1 0
1 1

18
IV. REPRESENTATIONS OF INFORMATION
1. Coding of unsigned numbers

Unsigned integer ? (Positif or Zero numbers)


Examples :
(+5)10 = (0000101)2 // on 7 bits

A coding with n bits allows for encoding all integers belonging to the range :
[0, 𝟐𝒏 - 1]

19
IV. REPRESENTATIONS OF INFORMATION

2. Coding of signed numbers

A signed integer ? (Relative integer)

A. Representation by Sign + Absolute Value (S+AV)


Example :
(−5)10 = (1000101)𝑆+𝐴𝑉 // on 7 bits

A coding with n bits allows for encoding any relative integer belonging to the
range : [-(𝟐𝒏−𝟏 -1), + (𝟐𝒏−𝟏 -1)].

20
IV. REPRESENTATIONS OF INFORMATION
2. Coding of signed numbers
B. Restricted complement
RC(0)=1, RC(1)=0
Example :
(−5)10 = (1111010)𝑅𝐶 // on 7 bits

A coding with n bits allows for encoding any relative integer belonging to the
range : [-(𝟐𝒏−𝟏 -1), + (𝟐𝒏−𝟏 -1)].

21
IV. REPRESENTATIONS OF INFORMATION
2. Coding of signed numbers
C. True Complement

TC(A) = RC(A) + 1

Example :
(−5)10 = (1111011) 𝑇𝐶 // on 7 bits

A coding with n bits allows for encoding any relative integer belonging to the
range : [-(𝟐𝒏−𝟏 ), + (𝟐𝒏−𝟏 -1)].

22
V. SUBTRACTION BY THE COMPLEMENT METHOD
1. Restricted Complement

Property : (−𝐴)10 = (𝐴)𝑅𝐶

Example:
Perform the following operation using the RC technique on 8 bits :
(63)10 - (28)10 = (63)10 + 𝑅𝐶(28)
= (00100011)𝑅𝐶
= (+35)10

Remark:
If the operation generates a carry, it will be added to the result.

23
V. SUBTRACTION BY THE COMPLEMENT METHOD
2. True Complement

Property : (−𝐴)10 = (𝐴) 𝑇𝐶

Example:
Perform the following operation using the TC technique on 8 bits :
(63)10 - (28)10 = (63)10 + 𝑇𝐶 28
= (00100011) 𝑇𝐶
= (+35)10

Remark:
If the operation generates a carry, it will be ignored.

24
V. SUBTRACTION BY THE COMPLEMENT METHOD

Remark:

If the operation does not generate a carry, it means the number is negative. You
simply need to find the Restricted complement/True complement of this result to
obtain the desired value.

25
VI. PROBLEMS RELATED TO NUMBER LENGTH

1. Addition of two positive numbers

Example :
Perform the following operation using the TC technique on 8 bits :
(+49)10 + (88)10 =(10001001) 𝑇𝐶 → Overflow

2. Addition of two negative numbers

Example :
Perform the following operation using the RC technique on 6 bits :
(−21)10 + (−17)10 = (101010)10 + (101110)10 = (011001)𝑅𝐶 → Overflow

26
VII. REPRESENTATION OF REAL NUMBERS
Floating point
Definition :
A floating-point number is generally defined by: ± m . 𝑏 𝑒

 Sign + or –
 Mantissa m
 Exponent e
 Base b

27
VII. REPRESENTATION OF REAL NUMBERS

IEEE754 standard
Normalized floating-point coding

Mantissa Sign (MS) : sign - → bit 1, sign + → bit 0 (coded on 1 bit)

Biased Exponent (BE) : BE= E+ 𝟐𝒑−𝟏 -1 (coded on p bits)

Standardized Mantissa (M) : the point is placed after the most significant bit at
1 (coded on q bits).

28
VII. REPRESENTATION OF REAL NUMBERS

THE IEEE 754 STANDARD VARIANTS


1. Single Precision (32 bits)

Example : (+35,5)10 = (? )𝐼𝐸𝐸𝐸 754 𝑆𝑃


(+35,5)10 = (100011,1)2 𝑓𝑖𝑥𝑒𝑑 𝑝𝑜𝑖𝑛𝑡 = (1,000111 × 25 ) 𝑓𝑙𝑜𝑎𝑡𝑖𝑛𝑔 𝑝𝑜𝑖𝑛𝑡
BE= E+ 𝟐𝒑−𝟏 -1 // p=8
1,M= 1,000111 ->M=000111

29
VII. REPRESENTATION OF REAL NUMBERS

THE IEEE 754 STANDARD VARIANTS


2. Double Precision (64bits)

Example :
(+35,5)10 = (? )𝐼𝐸𝐸𝐸 754 𝐷𝑃
BE= E+ 𝟐𝒑−𝟏 -1 // p=11

30
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS

1. BCD Code (Binary Coded Decimal)


Definition:
 It is a binary code which encodes each decimal digit by its 4-bit binary
equivalent.
Example : (789)10 = (011110001001)𝐵𝐶𝐷

Use cases of the code BCD : systems where there’s an exchange of


information.

31
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS

2. Gray Code
Definition:
 Also known as reflected binary code. In this code, to move from one
number to the next, a single bit is inverted so that it is the rightmost
possible bit leading to a new number.

Use cases :
- Design of logic circuits.
- Binary numeric progression while avoiding transitional states.

32
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS

Transition from Binary Code → Gray Code


Example :
(100)2 =(110)𝐺𝑟𝑎𝑦

Transition from Gray Code → Binary Code


Example :
(110)𝐺𝑟𝑎𝑦 =(100)2

33
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS

3. ASCII Code
Definition:
 American Standard Code for Information Interchange : character encoding
standard in computing.

A. First ASCII version : it is coded on 7 bits (128 characters). It allows the


coding of keyboard characters (lowercase letters, special characters, …) as well
as a certain number of commands (Start of Heading, Start of TeXt, End of TeXt,
…).

34
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS
The first version of the ASCII table

35
VIII. NUMERIC AND ALPHANUMERIC CHARACTER
REPRESENTATIONS
3. ASCII Code
B. Second ASCII version (ISO 8859 standard)
 At the end of the 1980s, the ISO-8859 encodings were defined, which are various
extensions of the ASCII encoding to encode accented Latin letters (French, Greek,
…).

 All of these encode characters with 8-bit binary words.

4. Unicode
Definition:
Unicode (1990’s) is a family of encodings, a different standard to ASCII, which has
the advantage of offering a unified version of the different character encodings that
complement ASCII.
With UTF (Unicode Transformation Format)-32, it’s possible to represent 232
different characters, which results in a very large number, more than sufficient to
encode the scripts and characters of hundreds of languages.

36

You might also like