MS1 Chap1
MS1 Chap1
Machine Structure
Teaching staff
Students concerned
Faculty/Institute Département Year Speciality
New Technologies ING ING1 ING
Course objectives
The first objective of this chapter is to provide a comprehensive introduction to the
architecture of computers and initiate the student to the coding and representation of numbers.
The second objective is to familiarise the student with the notion of binary and machine code.
The third objective is to introduce the student to a mathematical support for the mastery of
binary (Boolean algebra).
1
Module : MS1 2024-2025
Chapter 1: Part-1
Codification and
representation of numbers
2
Module : MS1 2024-2025
1.1. Introduction :
Nowadays, information technology is part of every human activity. The computer is the most
widely used tool in the world. To understand how a computer works, we first need to understand how
it represents and processes information in general. In this chapter we will focus on the codification and
representation of numbers.
The machine only manipulates two binary values (0 and 1) to represent and process information, and
in particular numbers, which is why we will be focusing on binary codification and representation in
this chapter.
Each number X expressed in base B will be represented by a concatenation of the symbols 𝑋𝑖 in set E.
Examples :
Note:
To avoid ambiguity in the representation of numbers, always specify the base used to
represent the number, except for base 10.
Example :
X = 101 in base 2 is different from X = 101 in base 10.
Therefore, X = 101 in base 2 will be expressed as X=(101)2
3
Module : MS1 2024-2025
Example
Let the integer X= 44 be expressed in base 10. To express X in base 3, divide successively by 3 :
44 = 14*3 + 2
14 = 4*3 + 2
4 = 1*3 + 1
Examples
1) Consider the number X expressed in base 7, X = (3425)7
The decimal value of X is:
𝑿 = 𝟓. 𝟕𝟎 + 𝟐. 𝟕𝟏 + 𝟒. 𝟕𝟐 + 𝟑. 𝟕𝟑 , therefore X=1244 in base 10
Knowing that each binary symbol requires one bit (0 or 1), a binary number is therefore a collection of
bits. Knowing also that the number 8 is a puissance 3 of 2 and that the number 16 is a puissance 4 of 2,
each octal digit corresponds to 3 bits and each hexadecimal digit to 4 bits.
4
Module : MS1 2024-2025
Examples :
Note:
The missing bits on the left are filled with zeros.
Note :
The base 16 digits are:{0,1,2,3,4,5,6,7,8,9, 𝐴, 𝐵, 𝐶, 𝐷, 𝐸, 𝐹}
Example :
Let the integer X be expressed in binary: X=(1101111011)2
X is converted to hexadecimal by grouping four bits from right to left, as follows:
5
Module : MS1 2024-2025
Note:
Direct conversion from a Base B to a Base K is possible if one of the two bases is an integer power
of the other (e.g. B=3, K=9) and vice versa.
1.2.3. Arithmetic
Classical arithmetic operations for other bases are performed in the same way as in decimal. In
the following, we will present binary arithmetic operations as illustrative examples. The details will be
explained in the course work.
The binary addition of two numbers is processed bit by bit from right to left, carrying forward the carry
over.
Example :
Let be the two numbers X = (1101101)2 and Y = (10101011)2
10111101111101
+ X+Y = (100011000)2
1 01 0 1 0 11
10 00 1 1 0 00
The binary subtraction of two numbers is carried out bit by bit from right to left, carrying forward the
carries
6
Module : MS1 2024-2025
Example :
11010
x 1010
= 00000
+ 11010 .
+ 00000 . .
+11010 . . .
= 100000100
Note :
The product of two positive numbers is always greater than the multiplied numbers,
which poses a problem for the internal representation of numbers (size and capacity)
Binary division is a fairly complex operation, generally using the same principle as decimal
division (division by subtraction).
The development of arithmetic in the different bases will be explained in the supervised work
sessions..
7
Module : MS1 2024-2025
Example1 :
On 4 bits we will have 16 integers: (-7,-6,-5,-4,-3,-2,-1,-0,+1,+1,+2,+3,+4,+5,+6,+7).
Note : for a number encoded on an n-bit word, we will actually have 2n-1 different numbers (zero has
two codes)
Example2 :
The integer X=-20 will be coded in SAV on at least 6 bits as follows: 20 =(10100)2
X will be coded by: 110100.
Example3 :
The integer number X=+ 20 will be coded in 6 bits SAV as follows:
20 = (10100)2
X will be coded as: 010100.
Example4 :
The integer number X=-20 will be coded in 8 bits SAV as follows:
20 =(10100)2
X will be coded as: 10010100.
Note:
In SAV, addition and subtraction operations are complicated because the sign bit has to be handled
separately. This method is not used by computer manufacturers for addition and subtraction
operations. SAV arithmetic applications will be covered in more detail in the supervised classes.
8
Module : MS1 2024-2025
1.3.2.1. Principle:
A negative integer is obtained in 1's complement (logical complement) by replacing each 0 bit
by 1 and vice versa, in the binary code of the positive number. The highest bit in the number code is
reserved for the sign (1 for the '-' sign and 0 for the '+' sign).
Example:
Consider the integer X = - 5 coded on 4 bits;
We have: +5 = (0101)2 in binary (the highest bit is a sign bit, 0 for a positive sign).
The CP1 (+5) = - 5, so X = 1010 inCP1.
1.3.2.1. Properties:
In 1's complement,CP1(X) is the symmetric of (X).
The integers coded on n bits in CP1 will be numbers of 2n-1 positive number and 2n-1 negative
number. The range of representation of an integer X coded on n bits is:
– (𝟐𝒏−𝟏 − 𝟏) ≤ 𝑿 ≤ +(𝟐𝒏−𝟏 − 𝟏) .
Knowing that on n bits we have 2n representations, and from 0 to 2n-1-1 we have 2n-1 numbers. So
zero counts 2 times (+0) and (-0).
1.3.2.1. ARITHMETICS
Addition in CP1:
Principle :
In addition, a carry generated by the sign bit must be added to the result obtained because the
complements are added together, including the sign bit (carry). A necessary condition for adding
the carry is that a carry must also be generated by the bit just before the sign one.
If a carry is generated exclusively by the sign bits or by the bit just before the sign, addition cannot
be performed. An overflow error is declared.
Example1:
Consider the two integers X = 7 and Y = 6,
We want to perform the X-Y operation on 4 bits in CP1
)6-( + )7( = 6-7 thus, 7- 6 = 7 + CP1(6).
7= (0111)2 and 6= (0110)2 with CP1(6) = 1001
1
So, 01 11 1 1
+
1 0 0 1
9
Module : MS1 2024-2025
Example2 :
Let be the two integers X= 7 and Y = 6, We want to perform the X+Y operation on 4 bits in CP1
7= (0111)2 et 6= (0110)2
1
So , 0 11 1 1
+
0 110
= 1 1 0 1 Wrong result
Note: In CP1, subtracting a number is reduced to adding its complement to 1 (the subtraction circuit
is useless). In addition, CP1 does not handle the sign bit separately.
1.3.2.1. Principle :
The 2's complement (arithmetic complement) of a negative integer is obtained by adding +1 to its
CP1 representation.
This representation gives an additional configuration because the zero will have a single
representation.
Example:
Let the integer X = - 5 be coded on 4bits;
We have : X = 1010 in CP1.
The CP2(+5)= CP1(+5) +1, thus X = 1011 in CP2.
1.3.2.2. Properties
The value of a number represented in CP2 is the same as reading a binary number Xn-1Xn-2…X0 as
follows:
𝑿 = 𝟐𝒏−𝟐 𝑿𝒏−𝟐 + ⋯ + 𝟐𝟏 𝑿𝟏 + 𝟐° 𝑿𝟎 − 𝟐𝒏−𝟏 𝑿𝒏−𝟏
Thus, 𝑿 = (∑𝒏−𝟐 𝒊
𝒊=𝟎 𝑿𝒊 𝟐 ) - 𝑿𝒏−𝟏 𝟐
𝒏−𝟏
11
Module : MS1 2024-2025
1.3.2.2. ARITHMETICS
Addition in CP2
Principle :
In CP2 addition, a carry generated by the sign bit will be ignored. A necessary condition for
accepting the result thus obtained is that a carry must also be generated by the bit just before sign.
If a carry is generated exclusively by the sign bits or by the bit just before the sign, addition cannot
be performed.
Example1 :
Let the two integers X= 7 and Y = 6
We want to perform the operation X-Y on 4 bits in CP2
7- 6 = (7)+(-6) thus, 7- 6 = 7 + CP2(6).
7= (0111)2 et 6= (0110)2 with CP1(6) = 1001 thus, CP2(6) = 1010
1
So, 0 11 1 1
+
1 010
= 10 001
A carry is generated by the sign bit and the bit before the sign one. It will be ignored and the result is
correct (7 – 6 = 1).
Example2 :
Given the two integers X= 7 and Y = 6,
We want to perform the operation X+Y on 4 bits in CP2
7= (0111)2 and 6= (0110)2
1
So, 0 11 1 1
+
0 1 1 0
= 1 1 0 1 Incorrect result
11
Module : MS1 2024-2025
Note :
Subtracting a number is the same as adding its opposite, i.e. its 2's complement.
Multiplying two numbers involves multiplying the absolute values of the 2 numbers and taking
the opposite of the result if the numbers have different signs.
To divide, go through the division of absolute values and reposition the signs of the quotient
and rest if necessary.
Computers only manipulate bits, so we need to define a representation of decimal numbers that
is suitable for calculations. In addition, the space available for storing a number on a machine is
limited, which limits the precision of calculations.
The basic idea for the representation of decimal numbers is to define the location of a comma separating
the integer part from the decimal part and to consider that the digits to the right of the comma correspond
to the negative powers of the base (as for decimals).
Example :
12
Module : MS1 2024-2025
Example :
0,125 =(0,001)2
1.4.1.3. Arithmetic
Fixed-point arithmetic operations in base B are performed in the same way as in base 10.
Note :
More details will be given in the supervised classes..
1.4.2.1. Principle :
Floating point representation consists of representing real numbers in the following form:
X =± M.BE , with:
B : Base (2, 8, 10, 16, …)
M : Mantissa (a purely fractional number)
E : Exponent (an integer number)
The mantissa is standardized (it has the maximum number of significant digits), so:
(𝟎, 𝟏)𝟐 ≤ |𝑴| < (𝟏)𝟐 thus, (𝟎, 𝟓)𝟏𝟎 ≤ |𝑴| < (𝟏)𝟏𝟎
13
Module : MS1 2024-2025
Exponent and mantissa must be able to represent positive and negative numbers. They could
be coded as SAV, CP1 or CP2, often M is coded in SAV form, E is sign less but shifted
(Biased).
The internal representation of a real number normalized to n bits will have the following form:
SM E M
Mantissa sign Exponent Mantissa
Principle:
E : is an exponent coded on 8 bits, the exponent is shifted by +127 because it will be represented
without a sign on the 8 bits (Ed = E + 127)
S Ed M
Sign Exponent shifted Mantissa
One (1) sign bit, 8 bits for the exponent and 23 bits for the pseudo mantissa
Description:
1) The highest bit is a sign bit, representing the sign of the mantissa (1 for a negative sign and 0
for a positive sign).
2) The 8-bit exponent is shifted by +127 to represent positive and negative powers. The exponent
range is :– (𝟐𝟖−𝟏 ) ≤ 𝑬 ≤ +(𝟐𝟖−𝟏 − 𝟏) with , – 𝟏𝟐𝟕 ≤ 𝑬 ≤ +𝟏𝟐𝟕
The shifted exponent will be represented on 8 unsigned bits and will be in the range:
0 ≤ 𝑬𝒅 ≤ 𝟐𝟓𝟓 .
The accepted values for Ed are the interval𝟏 ≤ 𝑬𝒅 ≤ 𝟐𝟓𝟒. The values zero and 255 will be
reserved for other purposes.
14
Module : MS1 2024-2025
Similarly, the accepted values for E are : −𝟏𝟐𝟔 ≤ 𝑬𝒅 ≤ +𝟏𝟐𝟕. Values -127 and +128 will be
reserved for other purposes.
The pseudo-mantissa is the fractional part, occupying the lowest 23 bits in the internal
representation.
Example :
Representation of the number X= 25.127 in IEEE-754 floating point in single precision:
1) Set X in the Form 𝑿 = ∓𝟏, 𝑴. 𝟐𝑬
25 = (11001)2 , 0.125 =(0,001)2
25,125 = +1,1001001 . 24
2) The pseudo-mantisse : M=(0,1001001)2
3) The biased exponent : Ed = 4+127= 131 ; 131 =(10000011)2
4) le bit de signe = 0
0 10000011 10010010000000000000000
S Ed M
Note :
The internal representation of the real number can be expressed in hexadecimal, octal, etc...
In the previous example, if we proceed by grouping 4 bits from right to left, then replace the
groupings by their hexadecimal equivalents, we obtain the internal hexadecimal
representation of the real number: X= 41C90000
Remark: Floating-point real arithmetic and more detailed applications of the IEEE-754 standard will
be covered in supervised classes.
The table below summarises the ranges of real number values represented in IEEE-754 single precision
standards.
15
Module : MS1 2024-2025
Shifted
Signe Exponent Mantisse Value
Exponent
0 0 -127 0 Zéro
1 0 -127 0 Zéro
Denormalized number
0 0 -127 ≠ 0
𝑿 = +𝟎, 𝑴. 𝟐−𝟏𝟐𝟕
Denormalized number
1 0 -127 ≠ 0
𝑿 = −𝟎, 𝑴. 𝟐−𝟏𝟐𝟕
Normalized number
0 1 ≤ Ed ≤ 254 -126 ≤ Ed ≤ +127 Any
𝑿 = +𝟏, 𝑴. 𝟐−𝑬
Normalized number
1 1 ≤ Ed ≤ 254 -126 ≤ Ed ≤ +127 Any
𝑿 = −𝟏, 𝑴. 𝟐−𝑬
0 255 128 0 +∞
1 255 128 0 -∞
0 255 128 ≠ 0 NaN
1 255 128 ≠ 0 NaN
16
Module : MS1 2024-2025
Part-2
α-Numeric coding
17
Module : MS1 2024-2025
In the ASCII table, the coding is done on 7 bits and the internal representation is done on 8
bits. The 8th bit (the strongest bit) is reserved for the system. The ASCII table is organized
into rows and columns where:
Each line represents a state of the four lowest bits of the byte, called least significant bits
(LSB).
Each column represents a state of the three highest bits in the byte, known as the most
significant bits (MSBs).
Each cell of the table represents an α-numeric character encoded on seven bits.
Note :
The number of α-numeric characters encoded in the table is 128 ( 27).
18
Module : MS1 2024-2025
Examples:
The ASCII code for the character "A" is: 1000001 or 41 in hexadecimal.
The ASCII code for the character "?" is: 0111111 or 3F in hexadecimal.
The ASCII code 4E represents the character "N".
The ASCII code was originally developed for the English language. Later, computer
technology invaded the world, requiring the introduction of coding for several other languages
and special characters. The 7-bit ASCII code table proved insufficient to cover the new codes.
The ASCII code has been extended to 8 bits in order to be able to code more characters. The
ISO/IEC 8859 standard provides extensions for coding by including the 8th strongest bit.
The ASCII table is organized into rows and columns where:
Each column represents a state of the four lowest bits of the byte, known as the least
significant bits (LSB).
Each row represents a state of the four highest bits of the byte, called MSBs.
Each box in the table represents an α-numeric character encoded on eight bits. The
number of α-numeric characters encoded in the table is 256 (28).
19
Module : MS1 2024-2025
Notes :
The extended ASCII code does not support characters that are not in the Latin
alphabet (Chinese or Arabic).
Unicode is intended to replace the ASCII code. This standard encodes each
character on 16 bits, offering 65536(216) possibilities. This makes it possible to code
different languages and many other symbols.
21
Module : MS1 2024-2025
Gray code, also known as reflected binary code, is obtained by modifying a single
bit at a time in the binary code of a number when it is increased by one unit. The
following table shows the construction of the Gray code for numbers from 0 to 15:
2.2.1. Generalization :
X is a positive integer coded in binary on n+1 bits by: X = Bn Bn-1…………..B1B0
and coded in Gray code on n+1 bits by: X = Gn Gn-1…………..G1G0
a- The conversion Binary-Gray : The Gray code is calculated from a pure binary code using the
following procedure:
Gn= Bn and Gi=Bi+1 ⊕ Bi for i=n-1 to i=0.
b- The Conversion Gray-Binary: The binary code is calculated from a Gray code using the
following procedure:
B n = Gn
Bi=Gi ⊕ Gi+1 ⊕……. ⊕Gn for i=n-1 to i=0.
21
Module : MS1 2024-2025
Note :
Gray code is used in digital sensors (angular or linear) and in the design of logic circuits, particularly
in karnaugh tables, etc...
The BCD code, which stands for Binary Coded Decimal, maps the base 10 digits (0 to 9) to their four-
bit binary equivalents, so that each number expressed in base 10 is coded in BCD by replacing each
decimal digit with its four-bit binary equivalent. In this way, each number expressed in base 10 is coded
in BCD by replacing each decimal digit with its four-bit binary equivalent.
Exemple :
Note: Details of the exercises relating to this part of the chapter will be given in the tutorial
session.
22
Module : MS1 2024-2025
Part-3
Boolean algebra
23
Module : MS1 2024-2025
1.Introduction :
In this part of the course we focus on the work of the English mathematician George Boole,
published in 1854, relating to binary logic applied to the logic circuits.
1.1 Terminologies and basic operations
1.1.2. Boolean variables :
A Boolean variable takes its value from the set {0 , 1}, and is often represented by the
symbols of the alphabet (x, y, z, etc ...).
The values 0 and 1 are logical values: "0" equals the logical value "false" and "1" equals
the logical value "true".
Lowest Highest
24
Module : MS1 2024-2025
The evaluation of this expression for the respective values 0, 0 and 1 of X, Y and Z is as follows:
(X + Y) . ( X + Z + Y).
1 2 3 4
Note:
When two operators with the same priority follow each other, priority is given to the
operator on the left.
Example : given the Boolean expression x.y+z, the truth table associated with this expression is given
in the figure below:
X Y Z X.Y+Z
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
Truth table
25
Module : MS1 2024-2025
Note :
A Boolean function is evaluated in the same way as a Boolean expression.
Boolean functions take Boolean values when they are evaluated
Example: Consider the Boolean function F(X, Y, Z) = (X+ Y). (X +Y+ Z).
The Boolean function contains two terms (X+Y) and (X+ Y+ Z), in each term the variables
are connected by the operator (OR) (sum).
The two terms of the function are connected by the (AND) operator (product).
The terms of the function are then product of sums (POS).
Definition: a function is said to be in Sop or Pos canonical form if and only if each term of the
function contains all the variables of the function.
Example : Consider the Boolean function (𝑋, 𝑌) = 𝑋𝑌 + 𝑋𝑌̅ , F is in canonical Sop form.
26
Module : MS1 2024-2025
1.2.2 Procedures for extracting the Sop and Pos forms of a Boolean function using a
truth table
a- Principle :
In a truth table, each line groups together a binary code for the viables of the function
represented, as well as the binary code of the function itself. For each value of 1 for the
function in a line of the truth table, a term is constructed in conjunction with the
function's variables such that each variable appears uncomplemented if its value is 1 and
complemented if its value is 0. The term constructed is called the "min-term". The
disjunction of the min-terms represent the Sop’s forme of the boolean function.
For the 0 value of the function in a line of the truth table, we construct a term by
disjunction of the variables of the function such that each variable appears
uncomplemented if its value is 0 and complemented if its value is 1. This term is called
the "Max-term". The conjunction of the Max-terms represent the Pos’s forme of the
boolean function.
Example: Given the Boolean function F defined by the following truth table:
X Y Z X.Y+Z
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
27
Module : MS1 2024-2025
Note :
To simplify the use of the Sop canonical form, we use a compact format called
Numeric Sop
The numeric Sop format is obtained by replacing each min term with the decimal
value of the binary code of the variables in the function that generates this min
term.
̅𝒀
In the example above, The term: 𝑿 ̅ 𝒁 will be replaced by the value 1 (001 in base
2 = 1 in base10),
The term 𝑿𝒀𝒁̅ will be replaced by the value 6 (110 in base 2 = 6 in base10),
Thus : 𝑭(𝒙, 𝒚, 𝒛) = ∑𝒎𝒊𝒏(𝟏, 𝟑, 𝟓, 𝟔, 𝟕)
Example : Given the Boolean function F defined by the following truth table:
X Y Z X.Y+Z
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 1
28
Module : MS1 2024-2025
Note:
To simplify the use of the Pos canonical form, we use a compact format called
Numeric Pos
The numeric Pos format is obtained by replacing each Max-term with the decimal
value of the binary code of the variables in the function that generates this Max-
term.
In the example above, The term, (𝒙̅ + 𝒚 + 𝒛) will be replaced by the value 4 (100 in
base 2 = 4 in base10),
Example :
We want to sort objects by weight P as follows:
𝑥 = 0 𝑖𝑓 𝑃 < 400𝑔 𝑎𝑛𝑑 𝑥 = 1 𝑖𝑓 𝑃 ≥ 400𝑔
𝑦 = 0 𝑖𝑓 𝑃 ≤ 500𝑔 𝑎𝑛𝑑 𝑦 = 1 𝑖𝑓 𝑃 > 500𝑔
The objects that will be accepted must have a weight of 400g ≤ P ≤ 500g. Let F be the
function that accepts or rejects the object.
X Y F(x,y)
0 0 0 F(x,y) =1 if 400g ≤ P ≤ 500g
0 1 ? F(0,1) is not defined because 𝑃 < 400𝑔 et P≥500g at the same
1 0 1 time.
1 1 0
Note: The undefined value of a Boolean function is represented either by "d" or by "X".
29
Module : MS1 2024-2025
a- postulates
P2 : Commutativity : P5 : Complementation :
𝑎) 𝑥 + 𝑦 = 𝑦 + 𝑥 𝑎) 𝑥 + 𝑥̅ = 1
𝑏) 𝑥 . 𝑦 = 𝑦 . 𝑥 𝑏) 𝑥 . 𝑥̅ = 0
𝑥̅ is the complement of x.
P3 : Associativity:
Note: Two expressions are equivalent if one
𝑎) 𝑥 + (𝑦 + 𝑧) = (𝑥 + 𝑦) + 𝑧 can replace the other.
𝑏) 𝑥 . (𝑦 . 𝑧) = (𝑥 . 𝑦). 𝑧
b- Duality :
The dual of an expression is obtained by replacing every "+" in the expression with ".", every
"." with "+", every 1 with 0 and every 0 with 1.
Example:
𝑥 + 𝑦. 𝑧 = (𝑥 + 𝑦). (𝑥 + 𝑧)
Note: In the definition of Boolean algebra (postulates), for each postulate P_i (i=1...5), (b) is
always the dual of (a).
c- Theorems :
T1 : Idempotence : T5 : Demorgan Law:
𝑎) 𝑥 + 𝑥 = 𝑥 𝑎) ̅̅̅̅̅̅̅
𝑥 + 𝑦 = 𝑥̅ . 𝑦̅
𝑏) 𝑥 . 𝑥 = 𝑥 𝑏) ̅̅̅̅̅̅
𝑥 . 𝑦 = 𝑥̅ + 𝑦̅
T4 : Half-absorption:
𝑎) 𝑥 + 𝑥̅ 𝑦 = 𝑥 + 𝑦
𝑏) 𝑥. (𝑥̅ + 𝑦) = 𝑥 𝑦
31
Module : MS1 2024-2025
Why simplification?
In classical algebra, simplification means finding a form of writing a function that is dense
enough and easily evaluated.
Example :
𝑎2 − 𝑏 2
𝐹(𝑎, 𝑏) = → 𝐹(𝑎, 𝑏) = 𝑎 − 𝑏
𝑎 + 𝑏 𝑎+𝑏≠0
In Boolean algebra, simplification also means finding a way of writing a function that is dense
enough and requires a reduced number of logical operators (and, or, not, etc.), so that the hardware
implementation (circuit) does not require a large number of components.
Example :
𝐹(𝑎, 𝑏) = 𝑎̅ 𝑏 + 𝑎 𝑏
= (𝑎̅ + 𝑎) 𝑏 (Factorisation)
= 1 .𝑏 (Complementation)
=𝑏 (Existence of 1)
The Karnaugh method offers a simple procedure for minimising Boolean functions. It is known as the
Karnaugh Table or VEITCH diagram.
The table is a diagram of cells. Each cell represents a min term marked with a "1" (the "0s" in the
table represent max terms) of the Boolean function.
To index the table, each variable fills a set of adjacent cells. A product of two variables results in the
intersection of the cells assigned to each variable. The N Karnaugh cells correspond to theExample
1 : Two-variable Karnaugh table
Truth table:
A B F
0 0 0
0 1 1
1 0 1
1 1 1
Karnaugh table :
b
a 0 (𝑏̅) 1 (𝑏)
0 (𝑎̅) 1
1 (𝑎) 1 1
Note :
Two cells in the Karnaugh table are said to be adjacent if and only if the two min-terms of the two cells
differ by a single variable (as in the gray code).
Note :
The Karnaugh table is considered to be a cylinder closed both horizontally and vertically.
a. Simplification procedure :
Step 1: Using the truth table or directly the expression of the function in Sop form, we place 1's in
the cells corresponding to the min-terms of the function.
Step 2: Group all the ADJACENT cells containing 1s in the maximum way, i.e. form groupings of
ADJACENT cells of maximum size equal to a decreasing power of two.2N , 2N−1 , … , 21 , 20
Step 3: Form a minimum number of groupings of 1 in order to obtain a simplified function with no
redundant terms, called the minimum non-redundant base for the Boolean function, where
each grouping is called a "prime monomial".
Examples:
Consider the Boolean function F:
𝐹(𝑎, 𝑏, 𝑐) = 𝑎̅𝑏̅𝑐̅ + 𝑎𝑏̅𝑐 + 𝑎𝑏̅𝑐̅ + 𝑎𝑏𝑐
= ∑𝑚𝑖𝑛(0,4,5,7)
bc 𝑏̅ 𝑐̅ 𝑏̅ 𝑐 𝑏𝑐 𝑏𝑐̅
a 00 01 11 10
𝑎̅ 0 1 3 2
0 1
𝑎 4 5 7 6
1 1 1 1
𝐹(𝑎, 𝑏, 𝑐) = 𝑏̅𝑐̅ + 𝑎𝑐 (Minimum complete non-redundant base for F)
cd 00 01 11 10
ab
00 0 1 3 2
1 1
4 5 7 6
01
1 1 1 1
12 13 15 14
11
1 1 1 1
8 9 11 10
10
1
𝐹(𝑎, 𝑏, 𝑐, 𝑑) = 𝑏 + 𝑎̅𝑑̅ + 𝑎𝑐̅𝑑 (Minimum non-redundant complete base for F)
Note :
The Karnaugh table is useful for simplifying Boolean functions where the number of logical
variables is ≤ 6.
Conclusion
Boolean simplification methods are used to rewrite functions in a more compact format with the aim of
creating the associated combinatorial circuits at lower cost.
This chapter presents two simplification methods (algebraic simplification and the Karnaugh method).