Machine Structure
Dr Benabderrezak
Researcher in Cyber Security
Full-stack Web developer 1
Work Plan
1. Introduction
2. Numeration Systems
3. The representation of information
4. Boolean Algebra
2
1. Introduction
- The aim of this course notes is to present and deepen the concepts
concerning the different digitalization systems as well as the
representation of information, whether digital or character.
- The basics of Boolean algebra are also covered in depth.
3
2. Numeration System
- Numeration System, or number systems, is a method of representing
numbers using a consistent set of symbols or digits.
- Different number systems are used for various applications, from
daily counting to complex computing.
4
2. Numeration System
5
2. Numeration System - Passing between different bases
6
2. Numeration System - base 8 to base 10
7
2. Numeration System - base 10 to base 2
8
2. Numeration System - Passing between different bases
9
2. Numeration System - Arithmetic operation in Binary base
10
10
2. Numeration System - Arithmetic operation in Binary base
11
11
2. Numeration System - Arithmetic operation in Binary base
12
12
2. Numeration System - Arithmetic operation in Binary base
13
13
2. Numeration System - Arithmetic operation in Binary base
14
14
3. The representation of information
3.1. Binary coding system
1. Pure Binary Coding
2. Gray code
3. Binary coded decimal (BCD)
4. Excess-3 code
15
15
1. Pure Binary Coding : is the basic numerical system in which each
digit is represented by a unique combination of 0 and 1
16
16
2. Gray code : is a type of binary encoding where two consecutive values
differ by only one bit. This minimizes errors in data transmission.
17
17
3. Binary coded decimal (BCD) : is a type of encoding where each
decimal digit is represented by its four-bit binary equivalent.
18
18
19
19
4. Excess-3 code : is a type of encoding where each decimal digit is
represented by its binary equivalent plus three.
20
20
3. The representation of information
3.2. Character representation
1. EBCDIC
2. ASCII
3. UTF code
21
21
1. EBCDIC : is an 8-bit character encoding used mainly on IBM
mainframe and IBM midrange computer operating systems
22
22
2. ASCII : is a 7-bit character encoding standard used widely in
computers and electronic devices to represent text
23
23
3. UTF code : is a variable-length character encoding for Unicode,
capable of encoding all 1,112,064 valid character (UTF-8)
24
24
3. The representation of information
3.3. Integers
1. Unsigned representation.
2. Representation with sign and absolute value.
3. Complement to 1 (or Restricted Complement)
4. Complement to 2 (or Complement True)
25
25
1. Unsigned representation
- Represents only non-negative integers using all bits to represent the
value.
- The range for an n-bit unsigned integer is 0 to 2^n-1
- For example with 5 bits : [0 , 31]
26
26
2. Representation with sign and absolute value
Represents integers using one bit for the sign (0 for positive, 1 for
negative) and the remaining bits for the absolute value
27
27
3. Complement to 1 (or Restricted Complement)
Represents negative integers by inverting all bits of the binary
representation of the positive counterpart
ﯾﻤﺜﻞ اﻷﻋﺪاد اﻟﺼﺤﯿﺤﺔ اﻟﺴﺎﻟﺒﺔ ﻋﻦ طﺮﯾﻖ ﻋﻜﺲ ﺟﻤﯿﻊ أﺟﺰاء اﻟﺘﻤﺜﯿﻞ اﻟﺜﻨﺎﺋﻲ ﻟﻠﻨﻈﯿﺮ اﻟﻤﻮﺟﺐ
28
28
4. Complement to 2 (or Complement True)
- Represents negative integers by inverting all bits and adding 1 to the
least significant bit (LSB).
- This method allows for easier arithmetic operations
29
29
3. The representation of information
3.4. Fractional numbers
1. Fixed comma
2. Floating point (IEEE 754 standard)
30
30
1. Fixed comma :
- In fixed-point representation, numbers are expressed with a fixed
number of digits before and after the decimal (or binary) point.
- The position of the decimal point is fixed, which simplifies arithmetic
operations but limits the range and precision
31
31
To convert a number with a fixed decimal (fixed-point) to another base
1. Convert the Integer Part
2. Convert the Fractional Part
32
32
1. Convert the Integer Part
● Divide the integer part by the base 𝑏 and record the remainders.
● Continue dividing the quotient by 𝑏 until the quotient is zero.
● The remainders, read in reverse order, give the integer part in
base 𝑏
33
33
2. Convert the Fractional Part
● Multiply the fractional part by the base bbb.
● Record the integer part of the result as the next digit.
● Use the fractional part of the result for the next multiplication.
● Continue multiplying and recording the integer parts until the
desired precision is reached or the fractional part becomes zero.
34
34
35
35
2. Floating point (IEEE 754 standard) :
- Floating-point representation allows for a wider range of values by
using scientific notation in binary.
- The IEEE 754 standard defines formats for single and double
precision
36
36
2. Floating point (IEEE 754 standard) :
37
37
2. Floating point (IEEE 754 standard) :
38
38
To convert a number from any base to the IEEE 754 :
1. Convert the number to decimal.
2. Convert the decimal number to binary.
3. Normalize the binary number.
4. Determine the sign bit.
5. Calculate the exponent and encode it with bias (127 in
simple precision; 1023 in double precision )
6. Extract the mantissa.
7. Assemble the IEEE 754 representation. 39
39
Example : to convert 16,675 from decimal to IEEE 754 (simple precision)
40
40
4. Boolean Algebra
- Boolean algebra is a branch of algebra that deals with boolean values,
typically represented as true (1) and false (0).
- It is fundamental in the design of digital circuits and computer
programming.
41
41
4. Boolean Algebra - Basic operations
42
42
4. Boolean Algebra - Basic operations
43
43
4. Boolean Algebra - Basic operations
44
44
4. Boolean Algebra - Basic Laws and Properties
45
45
4. Boolean Algebra - Basic Laws and Properties
46
46
4. Boolean Algebra - Basic Laws and Properties
47
47
4. Boolean Algebra - Basic Laws and Properties
48
48
4. Boolean Algebra - Basic Laws and Properties
49
49
4. Boolean Algebra - Basic Laws and Properties
50
50
4. Boolean Algebra - Basic Laws and Properties
51
51
4. Boolean Algebra - Basic Laws and Properties
52
52
4. Boolean Algebra - Basic Laws and Properties
53
53
4. Boolean Algebra - Truth table
- F = m (0,1,2,5,6,7,8,10,11,13)
54
54
4. Boolean Algebra - 1FN
- F = m (0,1,2,5,6,7,8,10,11,13)
- F in 1st normal Form (1FN) :
55
55
4. Boolean Algebra - 2FN
- 2FN is derived from the maxterms (the complement of the minterms
where the function is 0).
- For this function, it includes the maxterms M(3, 4, 9, 12, 14, 15):
56
56
4. Boolean Algebra - Karnaugh Method
- A Karnaugh map (K-map) is a graphical representation of Boolean functions.
57
57
4. Boolean Algebra - Karnaugh Method
Karnaugh maps are essential because they allow for:
● Simplification of complex Boolean expressions.
● Reduction of the number of logical gates required in digital circuits.
● Easy identification of prime implicants and essential prime implicants.
● Visualization of the logic functions to minimize errors in design.
58
58
4. Boolean Algebra - Karnaugh Method Simplification
59
59
4. Boolean Algebra - Karnaugh Method Simplification
60
60
4. Boolean Algebra - Karnaugh Method Simplification
61
61
4. Boolean Algebra - Karnaugh Method Simplification
62
62
4. Boolean Algebra - Karnaugh Method Simplification
63
63
4. Boolean Algebra - Karnaugh Method Simplification
Another example :
https://www.youtube.com/watch?v=C4yvadVl8ho
64
64
4. Boolean Algebra - Quine-McCluskey Algorithm
https://www.youtube.com/watch?v=HYdQhyOsg70
65
65
4. Boolean Algebra - Implementation of the logic diagram
67
67
4. Boolean Algebra - Implementation of the logic diagram
A Buffer is a logic Gate that has only one Input, its Output follows the
same Logic State as the Input
68
68
4. Boolean Algebra - Implementation of the logic diagram
69
69
4. Boolean Algebra - Implementation of the logic diagram
70
70
4. Boolean Algebra - Implementation of the logic diagram
71
71
4. Boolean Algebra - Implementation of the logic diagram
72
72
4. Boolean Algebra - Implementation of the logic diagram
73
73
4. Boolean Algebra - Implementation of the logic diagram
74
74
4. Boolean Algebra - Study of some usual combinatorial circuits
75
75
4. Boolean Algebra - Adder
- An additionator is a circuit capable of summing two binary numbers A
and B.
- An addition implements two outputs:
● The sum, usually denoted S,
● The hold, usually R (or C: carry).
76
76
4. Boolean Algebra - Adder
- As in decimal, we must take into account the possible deduction,
result from a previous calculation.
- The following figure shows the decomposition of the addition of two
4 bit binary numbers
77
77
4. Boolean Algebra - The half-adder (2 bits)
It is a 2 bit additionator without taking into account the previous deduction
78
78
4. Boolean Algebra - The full-Additionator (2 bits)
It has three inputs A, B and Re and two outputs S and Rs: Re represents the
hold of rank n-1 and Rs that of rank n
79
79