Académique Documents
Professionnel Documents
Culture Documents
Circuits arithmétiques
possible inputs
inputsthere
thereare
areeight
eightcombinations
combinationsofofoutputs
summed
summedbut butalso thecarry
alsothe carrybitbit(in(incase
caseititisispresent)
La table de vérité de(2possible present)ofof est : outputs
(2cette op ération 3
he ==8). 3
thenext
nextlower
lowersignificant
significantdigit.
digit.This
Thisoperation
operationmay
8). maybebe
carried
carriedoutoutinintwotwo steps: first add the two bits corre-
k steps: first add the two bits corre-
sponding to the
sponding to the 2 k–12 kdigit, and then add the resultant to
digit, and then add the resultant to
he
thecarry
carryfromfromthe the2 2k–1bit.
bit.When
Whenyou yousubtract
subtractseveral
several
columns A1 B1 Cin S1 Cout
columnsofofbinarybinarydigits,
digits,youyoumustmusttake
takeintointoaccount
account CC
in
in
CCin
in
A1 B1 Cin S1 Cout
he
theborrowing
borrowingand andshould
shouldalsoalsokeep
keeptrack
trackofofthe thediffer-
differ- AA AA 0 0 0 0 0
1 0 0 0 0 0 0
ences
encesandandborrows.
borrows. ++ BB1
1
BB0
0 0
0
0
0
1
0
1
0
1
1
1
1
0
0
0
10.1 1 0 0 1 0 1 0
10.1 Explain the general form of binary additioninin
Explain the general form of binary addition
SS
2 SS1 SS0
0
0
1
1
1
1
0
0
1
1
the
theleast
leastsignificant
significantand andmoremoresignificant
significant 2 1 0 1 0 0 1 0
++ ++ 1 0 0 1 0
columns.
columns. 1
1
0
0
1
1
0
0
1
1
CCout CCout 1 1 0 0 1
Solution: out out 1 1 0 0 1
Solution: 1
1
1
1
1
1
1
1
1
1
Thegeneral
The generalform formofofbinary
binaryaddition
additionininthetheleast
leastsignifi-
signifi-
cant
cantcolumn
columncan canbebewritten
writtenas: as:
AA0 + +BB0 = =SS0 + +CC out 10.1
10.1
0 0 0 out
The
Thesum
called
sumoutput
sigma, Le terme C provient
outputisisgiven
and the
givenbybythe
carry-out
Fig.de
Fig. 10.1 la
10.1
thesummation
is given
called sigma, and the carry-out is given by Cout. The
valeur
Addition
in
Requires
by
ininthe
summationsymbol
Addition deSignificant
theMore
symbol(S)
More
IncludingCC with
RequiresIncluding
C out . The
(S) CoutColumns
Significant
withAA ++BB
de l’addition précédente
Columns
in 1 1
in 1 1
to get
A0 – B0 the
10.2 Explain = R0general
+ Bout form of binary subtraction 10.2 0011 (3 10and
numbers ). performing arithmetic in computer sys-
The difference, or significant
in the least remainder,and from the significant
more subtractioncol-
is tems is by using the two’s-complement
10.5 What is the most widely used method of repre- method. With
R0, andumns.
if a borrow is required, Bout is 1. The truth table this method
senting both positive
binary and negative
numbers numbers can
and performing be
arith-
La forme générale de la soustraction binaire dans la colonne LSB
inSolution:
Table 10.2 shows the four possible conditions when
subtracting
represented
meticusing the samesystems?
in computer
tion is greatly simplified.
format, and binary subtrac-
The generaltwo binary
form digits.subtraction in the least sig-
of binary Solution:
peut s’écrire : A0 − B0Table
=10.2
nificant R0Truth+
column can beB
A –B =R +B
written as:
out
Table for Subtraction of Two Binary
10.2
TheMost
numbers.
computer
most
numbers Inand
widely systems
used method
an performing
are based on 8-bit or 16-bit
of representing
the total number
8-bit system,arithmetic
binary
of differ-
in computer sys-
0 0 0
Digits in the Least Significant Column out
ent combinations is 256 (28); in a 16-bit
is by usingofthebitstwo’s-complement system
La différence, ou le reste, de
The difference,
A0
or la soustraction
remainder,
B0
from the subtraction is est R , et si un
R0
R , and if a borrow is required, B is 1. The truth table
0
Bout 0out
tems
the number is 65,536 (2 16
).
this method both positive and negative numbers can be
method. With
To be ableusing
represented to represent
the same bothformat,positive and negative
and binary subtrac-
in Table 10.2 shows the four possible conditions when
emprunt est nécessaire, Bout
subtracting
0
0 estdigits.1
two binary
0
1
0
1
0
1
Borrow required
because A0 < B0
numbers,
mostMost
the simplified.
tion is greatly
significant
two’s complement format uses the
(MSB) ofare
bit systems thebased
8-or 16-bit number to
1 0 1 0 computer on 8-bit or 16-bit
La table de vérité de cette
Table 10.2op 1
If a borrow is
ération
Truth
Digits
1
in the ALeast
required, must
estof Two
Table for Subtraction 0
Significant
: Binary
Column
borrow from A in
0 signify
numbers.
The MSB
whether
is
the number
In an 8-bit
therefore
system, the
called
is positive
the
or negative.
total number
sign
ent combinations of bits is 256 (2 ); in a 16-bit system
of differ-
8 bit and is defined
0 1 asthe0 number
for positive numbers
the next
A0 more-significant
B0 R0 column.
Bout When A0 borrows is 65,536 (216and
). 1 for negative numbers.
SignedTo betwo’s
able tocomplement
represent both numbers areand
positive shown in
negative
from its left, A0 increases by 2 (just as in decimal sub-
0 0 0 0 Borrow required Fig. 10.3. the two’s complement format uses the
numbers,
traction
0
where1 the number
1
increases
1
by 10).
because A < B 0 0
10.3 1Elaborate
0 on binary
1 subtraction
0 in the second most significant bit (MSB) of the 8-or 16-bit number to
D7 D6 D5 D4 D3 D2 D1 D0
1and more
1 significant
0 columns.
0 signify whether the number is positive or negative.
The MSB is therefore called the sign bit and is defined
Solution:
If a borrow is required, A0 must borrow from A1 in Sign bit
as 0 for positive numbers and 1 for negative numbers.
The
the second column and allcolumn.
next more-significant more significant
When A0 columns
borrows (a)
Si un emprunt est nécessaire, A0 doit emprunter de A1 dans la
first
fromhave
subtracting
to determine
its left,
traction where
if Aby
A0 increases
theTherefore,
A – B.
was borrowed-from
2 (just as in decimal
they havebythree
number increases
before
sub-
10). input con-
Signed two’s complement numbers are shown in
D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Fig. 10.3.
0 binary0digits
two 0 is known out
0 as0 a half adder. 0 Gates
3 inputs
0 for Addition
Cin
2 outputs
in the LSB Column.
carry 644 4A07444 8 644 74 48 Cin
0110 A0 A1 B1 Cin Fig.
S 1 10.8 Cout Carry-out
Cout =(CAout) Function of the Full-adder.
0B 0
S0 = A 0B0 + A0 B 0
1110 0111 B0
0 0 0 0 0
0110 0 0 1 1 0 S 0 = A 0B0 + A0AB10B1 Fig. 10.9
0 1 0 1 0
10100 0111 = 0001 0100 0111BCD Cout = A0B0
0 B10 1 0 1 combinat
Cout
1 0 0 11 0 A
= 1 4 710 B01 digits is k
Fig. 10.5 Half-adder Circuit, using Ex-1 OR and
0 AND1 1
Fig. 10.6 Alternative
Un circuit logique combinatoire utilisé pour additionner 2 chiffresHalf-adder Circuit Built from
Cin an
( A 1B1 + A1 B 1)
1 1 0 0
Gates for Addition in the LSB Column. AND-NOR-NOR 1 10.20 Ap
UBTRACTORS 1 1 1 1 1 Configuration.
Fi
binaires
s a basic adder circuit.ABy
0
estitappel
itself cannot é
demi-additionneur
(c) C S in 1
C
Pr. of
Younes Cout = A10.19
0B 0 With the help of a suitable
2ème sketch describe the 6 / 31 i
on of numbers more JABRANE
than 1 bit. It lacks année CP 2023/2024
Additionneur Cet Csoustracteur
2 inputs 2 outputs
in in 64 8 64
4744 4744
8
A1 A0 A0 B0 S0 Cout
+ B1 B0
nvalid BCD number S1 S0
0 0 0 0
001 0001 0101BCD + + 0 1 1 0
Cout Cout 1 0 1 0
Décrivez le fonctionnement
1 1 510 d’un
1 additionneur
1 0 1 complet à partir de
oth groups of 4 BCD
sa table de vérité
its are invalid
(a) (b)
3 inputs 2 outputs
644 8 64
47444 4744
8
A1 B1 Cin S1 Cout
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0001 0100 0111BCD
0 1 1 0 1
1 0 0 1 0
1 4 710 1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
uit. By itself it cannot (c)
ore than 1 bit. It lacks
ing bits. Full-adders Fig. 10.4 (a) Addition of Two 2-bit Binary numbers
carries as well as the (b) Truth Table for the LSB Addition; (c) Truth
arry input, CI, is the Table for the More Significant Column.
addition. A full-adder 10.18 With the help of a suitable sketch,2ème
describe
Pr. Younes JABRANE année CP 2023/2024 7 / 31
tion B1
NORAdditionneur
A1 et soustracteur
rry, Cin Cout = 1 for any Two
tion P Inputs HIGH
B1
add 1 = A1 ⊕ B1 ⊕ Cin
Cout = C
Ain1 B1 + Cin (A1 ⊕ B1 )
Schéma logique d’un additionneur complet
Fig. 10.8 Carry-out (Cout) Function of the Full-adder.
A1B1
Cout
A1
B1
AND Cin ( A 1B1 + A1 B 1)
Cin S1
(MSB) (LSB)
A3 B3 A 2 B2 A1 B1 A0 B0
4-Bit Addition: A B Ci A B Ci A B Ci A B
bit representations
A 3 A2 A1 A 0 FA FA FA HA
+ B 3 B2 B1 B 0
S4 S 3 S 2 S1 S 0 C0 S C0 S C0 S C0 S
S4 S3 S2 S1 S0
(LSB)
B2 Additionneur et soustracteur
A1 B1 A0 B0
B Ci A B Ci A B
Additionneur 4 bits : 7483
FA FA HA
S
le sch
C
éma
S
fonctionnel
0 C S
logique du 7483
0
Least
Significant A1 Co
B1 FA1 S1
Binary Inputs Ci
arry 20
arry Cin 7483
arry
the YounesThe
Fig.Pr.10.13 7483, 4-Bit Full-adder.
JABRANE 2ème année CP 2023/2024 11 / 31
Device Family Description
7483
Additionneur TTL
et soustracteur 4-Bit binary full-adder, fast carry
74HC283 CMOS 4-Bit binary full-adder, fast carry
4008 CMOS 4-Bit binary full-adder, fast carry
Le ”fast-look ahead carry” garantit que Cout de l’addition d’ordre <
Figure 10.13 shows the functional diagram and the
est fourni
logic dans le report
diagram for d’entr
the ée Cin de
7483. In l’addition d’ordre
the figure the> least
danssignificant
un laps de temps trèsinputs
binary court (2°) come into the A B
1 1
terminals, and the most significant (23) come into the
Additionneur
A4B44 terminals.
bits : 7483
En se basant sur l’architecture du 7483 4 bits
10.23 Show the external connections to two 4-bit
formez un additionneur
adder ICs 8tobits capable
form d’effectuer
an 8-bit adder l’addition
capable of
performing the following addition:
A8 A7 A6 A5 A4 A3 A2 A1
+ B8 B7 B6 B5 B4 B3 B2 B1
S9 S8 S7 S6 S5 S4 S3 S2 S1
Solution:
We can choose any of the IC adders listed in Table
10.3
Pr. Younes for our design. Let’s choose 74HC283,
JABRANE 2ème année CP which is12 / 31
2023/2024
Figure 10.13 shows the functional diagram and the Fig
logic diagram for the 7483. In the figure the least
Additionneursignificant et soustracteur
binary inputs (2°) come into the A1 B 1 num
terminals, and the most significant (23) come into the eac
AdditionneurA4 B 4 4bits : 7483
terminals. the
En se 10.23
basantShow sur l’architecture
the external du 7483 4 bits to two 4-bit
connections
adder ICs to
formez un additionneur 8 bits capable d’effectuer form an 8-bit adderl’addition
capable of gro
performing the following addition: hal
A8 A7 A6 A5 A4 A3 A2 A1 not
+ B8 B7 B6 B5 B4 B3 B2 B1
S9 S8 S7 S6 S5 S4 S3 S2 S1 mu
218 2000 Solved Problems in Digital Electronics add
Solution:
We can choose any of the IC adders listed in Table
8 bit Inputs ens
10.3 for our design. Let’s choose 74HC283, which is ord
the Ahigh-speed
B 4 A B
4 3 A B CMOS
3 2 A B
2 1
version
1 A B ofA the
B
4 A4-bit
B
4 A adder
3B 3
(it has
2 2 1 1
hig
theC same7483logic symbol
out C in asC the 7483).
7483
out TheC two 8-bit in
so
S4 S3 S2 S1 S4 S3 S2 S1
S9
(High-Order) (Low-Order)
Sum Output
Pr.10.14
Fig. Younes8-Bit
JABRANE
Binary Adder using two 74HC283 ICs. 2ème année CP 2023/2024 13 / 31
Additionneur et soustracteur
HA
B
2 6
A B + AB S1
1 4 5 8 Sum
C D Sum
A 3 7
A ◊B A◊B A
A E C0
B C2
Ci
9 C0
B
C1
(a) (b)
Fig. 10.15
Demi-additionneur Additionneur complet
Adder Circuit using NAND Gates: (a) Half Adder (b) Full Adder.
Problème
Dans un circuit additionneur utilisant des portes NAND
la construction d’un additionneur // 8 bits serait assez compliquée
Les additionneurs N bits sont sous forme de circuits intégrés
mais une fois construits un additionneur // est limité
à la taille des nombres qu’il peut gérer
Un additionneur 8 bits ne peut pas gérer les nombres de 9 bits
Co S Co S Co S Co S B
B
Full Full Full Half
Adder Adder Adder Adder
Ci
Ci
(MSB) Ci Ci Ci (LSB)
A3 A2 A1 A0
(MSB) B3 B2 B1 B0 (LSB)
Additionneur BCD
Formez un additionneur BCD en utilisant les additionneurs
binaires 4 bits du circuit intégré 7483
A3 B3 A2 B2 A 1 B1 A0 B0
0 0 1 1 1 1 1 0
A4 B4 A3 B 3 A 2 B2 A1 B 1
Error Correction 01 11 1 0 0 1
(add 6) A 4 B4 A3 B3 A2 B2 A 1 B1
Not 7483
Cout Correction Adder Cin
used
S4 S3 S2 S1
0 0 1 1
MSD = 1
Corrected LSD BCD Sum = 3
Fig. YounesBCD
Pr.10.23 Adder Illustrating the Addition 7 + 6 = 13 (0111 + 0110 = 0001
JABRANE 2ème0011
année ).
BCDCP 2023/2024 19 / 31
01 11 1 0 0 1
(add 6) A 4 B4 A3 B3 A2 B2 A 1 B1
Not 7483
Additionneur et soustracteur
used
Cout
S4
Correction Adder
S3 S2 S1
Cin
0 0 1 1
A B Bo D
binary subtraction can be tackled in a 0 0 0 0
o that of addition. We can construct a 0 1 1 1
as shown in Fig. 10.24(a), with a truth 1 0 0 1
Fig. 10.24(b). 1 1 0 0
now concerned with subtraction rather + –
e have difference (D) and borrow (B)
an sum and carry. It is also necessary
between the two inputs A and B to A B
h one is subtracted from which. In the (a) Block Diagram (b) Truth Table
the output isPuisque nous nous intéressons maintenant à la soustraction
equal to (A–B).
h table we can see that Fig. 10.24 A Half-subtractor.
B plutôt qu’à l’addition
10.11
+ AB = A ≈ B 10.32 Explain multiple-bit binary subtraction.
nous avons des sorties de différence D et d’emprunt B plutôt que
10.12
Solution:
n that D is identical to S for a half-
de S
he borrow output etthede
is not Cas the
same In order to perform multiple-bit subtraction we again
need to consider the effect of one stage on the next.
Il est également nécessaire de différencier les deux entrées A et B
pour déterminer laquelle est soustraite de l’autre (A − B dans
l’exemple)
Pr. Younes JABRANE 2ème année CP 2023/2024 20 / 31
numbers to be used.
Additionneur et soustracteur Bo D3 D2 D1 D0
Bo Bo Bo Bo
Full
Table de vérité: nousSubtractor
avons: BFull0 = AB
Subtractor
Full
et D =
Subtractor
Full
AB + AB = A ⊕ B
Subtractor
+
0
2023/2024
Les circuits soustracteurs décrits fonctionnent comme prévu
ou construites à partir de deux demi-soustracteurs (à faire)
Ces fonctions peuvent être implémentées directement
2ème année CP
ronics
g four full- D
Bo
allow larger
à condition que le résultat ne soit pas négatif
D0
Bo
Half
Full Subtractor
Subtractor
Additionneur et soustracteur
+ –
Bi
A0 Half
B0 Subtractor
+ –
for a full- A Bi
B
nted by the
Fig. 10.27 Constructing a Full-subtractor from Two
Half-subtractors.
10.13
10.14 a LOW INVERT produces
contrôlé
0 X7 . . . X0 = 1001 0001
1 The controlled inverter is important because it is very
1 helpful in subtraction. During a subtraction, we first
0 need to take the 2’s complement of the subtrahend.
1 Then we can add the complemented subtrahend to obtain
0 the answer. With a controlled inverter, we can produce
0 the 1’s complement. There is an easy way to get the 2’s
1 complement.
Figure 10.28 can be used to provide the
Additionneur et soustracteur
TÀF
Donnez le schéma logique d’un inverseur 8 bits avec une entrée
de contrôle à base de portes XOR
D0
X0
D1
X1
D2
X2
D3
8-Bit X3 Controlled Output
D4 if C = 1, X0, 7 = D0, 7
Input X4
D5 if C = 0, X0, 7 = D0, 7
X5
D6
X6
D7
X7
Complementing
Control Signal (C)
TÀF
Illustrez la soustraction 42 − 23 = 19 en utilisant 7483
1 1 1 0 1 0 0 0
A4 B4 A 3 B3 A2 B 2 A1 B1 A 4 B4 A3 B 3 A2 B 2 A1 B1
S4 S3 S2 S1 S4 S3 S2 S1
27 26 25 24 23 22 21 20
Le CEight-bit
. 10.29 Twos-Complement Adder/Subtractor, Illustrating the Subtraction 42 23 = 19.
out du MSB est ignoré
Pr. Younes JABRANE 2ème année CP 2023/2024 27 / 31
Comparateurs
228 2000 Solved Problems in Digital Electronics
A0 P0
0 1
B0 Q0
0
A1
B1
Out = 1 if P1
1 1
A2 A0 = B0 Q1
B2 A1 = B1 1
A2 = B2
A3 = B3 (
A3
B3 P0
1 0
Q0
Fig. 10.36 Binary Comparator for Comparing two 4- 0
bit Binary Strings.
si A0 et B0 sont égaux le XNOR supérieur produira un 1
10.45 Referring to Fig. 10.36 determine if the
P1
following
Il en va de même pour pairs
les of input
2ème, binary et
3ème numbers
4èmewillportes
Q XNOR
1 1
output a 1. 1
1
A3A12Aindiquant
la porte ET produit(a)un 1A0 = 1 0 1 1 l’égalité entre A et B
B3B2B1B0 = 1 0 1 1 (
2023/2024
2ème année CP
La sortie A B est à 1 si A est supérieur à B
Arithmet
B3 1 16 VCC Le 7485 est un comparateur 4 bits A3
A2
A Input A1
A= B 6 11 B1
IA < B
A3
B3 1 16 VCC A2
A Input A1
IA < B 2 15 A3 A0
IA = B 3 14 B2
B3
IA > B 4 13 A2 B2 A< B
B Input
B1 A= B Ouptuts
A> B 5 12 A1 B0 A> B
A= B 6 11 B1
IA < B
A< B 7 10 A0 Expansion IA = B
Inputs
IA > B
GND 8 9 B0
(a) (b)
(a) (b)
Fig. 10.38 The 7485 Four-bit Magnitude Comparator: (a) Pin Configuration, (b) Logic Symbols.
A3 A3 A7 A3
A2 A2 A6 A2
A1 A1 A5 A1
A0 A0 A4 A0
Low-order High-order
Inputs Inputs
B3 B3 A< B B7 B3 A< B 8-Bit
B2 B2 B6 B2
B1 7485 A= B 7485 A= B Comparison
B1 B5 B1
B0 Outputs
B0 A> B B4 B0 A> B
IA < B IA < B
1 IA = B IA = B
IA > B IA > B
Fig. 10.39 Magnitude Comparison of Two 8-bit Binary Strings (or Binary Words).
10.48 Describe a simple parity generator/checker the parity bit that is added must make the sum of all 5-
system. bits odd. In an even-parity system, the parity bit makes
the sum of all 5 bits even.
Solution:
The parity generator is the circuit that creates the
Parity systems are defined as either odd parity or even
parity bit. On the receiving end, a parity checker
parity. The parity system adds an extra bit to the digital
determines if the 5-bit result is of the right parity. The
information being transmitted. A 4-bit system will type of system (odd or2èmeeven)ann
must be decided before
Pr. Younes
require a fifth JABRANE
bit, an 8-bit system will require a ninth ée CP 2023/2024 31 / 31