Hardware Reference
In-Depth Information
D
0
D
1
D
2
D
3
D
4
D
5
D
6
D
7
C
S
0
S
1
S
2
S
3
S
4
S
5
S
6
S
7
Figure 3-15.
A 1-bit left/right shifter.
Adders
A computer that cannot add integers is almost unthinkable. Consequently, a
hardware circuit for performing addition is an essential part of every CPU. The
truth table for addition of 1-bit integers is shown in Fig. 3-16(a). Two outputs are
present: the sum of the inputs,
A
and
B
, and the carry to the next (leftward) posi-
tion. A circuit for computing both the sum bit and the carry bit is illustrated in
Fig. 3-16(b). This simple circuit is generally known as a
half adder
.
Exclusive OR gate
A
B
Sum
Carry
A
B
Sum
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0
1
Carry
Figure 3-16.
(a) Truth table for 1-bit addition. (b) A circuit for a half adder.