Machine Structure Chapter 01
Machine Structure Chapter 01
Machine
Structure-1
Objectives
Number systems
Number systems:
A number system describes how numbers are
represented.
A number system is defined by:
A base
An alphabet A: a set of symbols or digits
Rules for representing numbers
Number Systems:
The number systems used in the fields of digital
electronics and computing are as follows:
On n positions:
• Minimum 0
• Maximum 10n-1
• Number of combinations10n
The binary system:
All communication within the computer is done with
electrical signals.
An electrical signal has only two states:
absence of an electrical signal
presence of an electrical signal
4 combinaisons= 22
8 combinaisons= 23
16 combinaisons= 24
The Binary Counting:
With one bit, we can encode two states; with 2 bits, four
states... With each new bit, the number of possible
combinations doubles.
Using n bits, we can form 2n different numbers, and the
largest among them is equal to (2n-1). For example, if n=
8, Nmax = (28-1) = 255, We can form 256 different
numbers from:
(0)10 =(00000000)2 -to- (255)10 =(11111111)2
Note: A group of eight bits is called a byte
The octal system:
It is the base-8 system
Eight (8) symbols are used in this system:
A={ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 }
Example of polynomial form :
(237)8 = 7*80 + 3*81 + 2*82
(53,948)8 = 3*80 + 5*81 + 9*8-1 + 4*8-2 + 8*8-3
Exemple 2 :
The number (1289) does not exist in base 8 since the
symbols 8 and 9 do not belong to the octal base.
The hexadecimal system:
It is the base-16 system
Sixteen different symbols are used:
{0,1,2,3,4,5,6,7,8,9,A, B, C, D,E, F}
Principle:
Exemple : (35)10=(?)2
After division :
you obtain :(35)10 = (100011)2
Conversion from base 10 to base 2:
(in the case of a real number): A real number consists of
two parts:
The integer part and the fractional part. The integer part is
transformed by performing successive divisions.
The fractional part is transformed by performing
successive multiplications by 2.
Exemple 1: 35,625=(?)2
0,625 * 2 =1,250
I . P =35 = (100011)2,
0,25* 2 = 0 ,50
0,5* 2 = 1 ,0,
F.P= 0,625) = (0,101)2,
Donc 35,625=(100011,101)2
Conversion from base 10 to base 2:
Exemple 2:
Perform the following conversion, (0,7)10=(?)2
(in the case of a real
0,7 * 2 = 1,4 number)
0,4 * 2 = 0,8
0,8 * 2 = 1,6 (0,7)= (0,10110)2
0,6 * 2 = 1,2
0,2 * 2 = 0,4
( 34 ) 5 3 * 5 1 4 * 5 0 15 4 (19 ) 1 0 (?) 7
19 7
5 2 7
2 0
Note: The replacement is done from right to left for the integer
part and from left to right for the fractional part.
Octal to binary conversion :
The basic idea is to group the bits in sets of 3 starting from the
least significant bit.
Then, replace each group with the corresponding octal value.
Arithmetic
operations
Arithmetic operations
General principle:
0+0 = 0 carry 0
0+1 = 1 + 0 = 1 carry 0
1 + 1 = 0 carry 1
1 + 1 + 1 = 1 carry 1
Binary Addition
Exemple:
Arithmetic operations in binary
Exercice: Perform the following operation
(1100011)2 +(10001011)2 =(?)2 :
Exemple
binary subtraction
Exemple
Binary Multiplication
Binary multiplication is performed in a similar way to decimal
multiplication. Here are the calculation rules to use:
Exemple
Binary Multiplication
Exemple
Binary Multiplicaion
Exemple
Binary Multiplication
Exemple
binary Division
Binary division is performed using subtractions and
shifts, similar to decimal division, except that the
quotient digits can only be 1 or 0. The quotient bit is 1 if
the divisor can be subtracted, otherwise it is 0.
binary Division
Exemple
binary Division
Exemple
binary Division
Exemple
binary Division
Exemple
Arithmetic Operations in Octal:
The addition
Just like in the binary system, the same rules apply to
octal numbers. However, in this case, we will have a
carry-over '1' to the left whenever the sum exceeds the
value of 7 because 7(8) + 1(8) = 10(8).
Example of addition in octal base:
Arithmetic Operations in Octal:
Subtraction
Similar to decimal subtraction but limited to 7 (octal).
Exemple:
Arithmetic Operations in Octal:
Subtraction
Similar to decimal subtraction but limited to 7 (octal).
Exemple:
Hexadecimal Arithmetic Operations
Addition
Similar to decimal addition, hexadecimal addition is
performed digit by digit. However, in this case, there will
be a carry '1' to the left each time the sum exceeds the
value F because: (F16+116)=10(16).
Hexadecimal Arithmetic Operations
The substraction in hexadecimal:
Exemple:
Hexadecimal Arithmetic Operations
The substraction in hexadecimal :
Exemple:
Hexadecimal
Division
Exemple: find division of:
3DE5 / A
Thanks a lot