







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Computer Architecture
d O
i^
ti
and Organization
You add two numbers together. If the sumis greater than the number base, you addone to the next column. When you addtwo numbers, you may also have to addthe carry from the column to the right.
A and B and Carry in. There are two
t^
t^
th
d C
t
outputs, the Sum and Carry out.
A
B
one bit adder
Cin
Cout
Sum
A one bit adder
B
A one bit adder
B
A one bit adder
B
Cout
Sum
Sum
Sum
figure from textbook
Cin’
Cin
Sum = A’BC’ + AB’C’ + A’B’C + ABC
Cin’
Cin
Cout = AB + BC + AC
Status
flag
Detection
flag Overflow
XOR of carry into and out of the sign bit
Sign
Copy of the sign bit
Zero
NOR of all result bits
Carry
Carry into the sign bit
ti
th
i^
t^
ti
executing the instruction.
register.
subtraction but doesn’t store the resultssubtraction, but doesn t store the results.It just sets the status flags.
status register
numbers X and Y and Borrow in. There
t^
t^
t^
th
Diff
d B
are two outputs, the Difference and Borrowout.
X
Y
one bit subtract
Borrow
in
Borrow
out
Difference
X
Y
B
in
B
out
Diff
0
0
0
0
0
in
in
0
0
0
0
0
0
0
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
0
0
1
1
0
1
0
0
X’ Y’
X’ Y
X Y
X Y’
Bin’
in
in
1
0
1
0
0
1
1
0
0
0
1
1
1
1
1
Bin
out
25%
25%
25%
25%
out
in
out
in
out
in
in
out
in
in
out
in
Bout = XY + Bi...
Bout = YBin + ...
Bout = XBin’+Y...
Bout = XY + X’...
out
X
Y
B
in
B
out
Diff
0
0
0
0
0
out
in
in
0
0
0
0
0
0
0
1
1
1
0
1
0
1
1
0
1
1
1
0
1
0
0
0
1
1
0
1
0
0
X’ Y’
X’ Y
X Y
X Y’
Bin’
out
in
in
1
0
1
0
0
1
1
0
0
0
1
1
1
1
1
Bin
circuit, you can add the negative of theoperand.
negative, you must invert the bits and add one
add one to the result.
or NOT gates, draw the logic diagram for aor NOT gates, draw the logic diagram for afour bit twos complement A - B subtractioncircuit.
A
B
one bit adder
Carry
out
Carry
in
i+
i^
)i
i+
i+
i+
) + (Pi^
i+
i^
)i
i+
i+
i+
i+
i+
i+
i+
i+
i+
i+
) +i
i+
i+
i+
)i
diagram from Digital Fundamentals by Thomas Floyd
ti
t^
dd
bit
d
t^
ti
time to add n bits due to carry propagation.
propagate the carry. The look aheadrequires more circuitry.
adders can reduce propagation and circuitry
As four bit adder
Bs
As four bit adder
Bs
As four bit adder
Bs
Cout
Sums
Sums
Sums
Decimal
Binary
1
2
3
4
5
6
7
8
9
10
1
1
2
3
4
5
6
7
8
9
10
2
2
4
6
8
10
12
14
16
18
20
3
3
6
9
12
15
18
21
24
27
30
4
4
8
12
16
20
24
28
32
36
40
5
5
10
15
20
25
30
35
40
45
50
6
6
12
18
24
30
36
42
48
54
60
7
7
14
21
28
35
42
49
56
63
70
0
1
0
0
0
1
0
1
7
7
14
21
28
35
42
49
56
63
70
8
8
16
24
32
40
48
56
64
72
80
9
9
18
27
36
45
54
63
72
81
90
10
10
20
30
40
50
60
70
80
90
100
decimal
binary
copy number when bit is one
1 add zero when bit is zero
01 copy number when bit is zero
add the results in proper column
add the results in proper column
adds and left shifts.adds and left shifts.
Product P (initially zero).
for
each
bit
i
in
if (B
i
is
one)
i
add
to
shift A
left
by
one
bit
1
2
+
3
4
(Every elementary school
hild k
h
child knows that.)
multiplication or division.