Arithmetic and Logic Unit (ALU) PDF
Arithmetic and Logic Unit (ALU) PDF
com
Arithmetic operations
Logical operations
: arithmetic operation
: logical operation.
Control lines
and
are used to identify any one of the four operations in a group. One
possible combination is given here.
mywbut.com
A
decode is used to decode the instruction. The block diagram of the ALU is shown in
figure 2.1.
mywbut.com
EX-OR gate: The output is high if either of the input is high. The EX-OR gate and its truth table
is given in Figure 2.4.
mywbut.com
If we want to construct a circuit which will perform the AND operation on two 4-bit number, the
implementation of the 4-bit AND operation is shown in the Figure-2.5.
Arithmetic Circuit
Binary Adder:
Binary adder is used to add two binary numbers.
In general, the adder circuit needs two binary inputs and two binary outputs. The input variables
designate the augends and addend bits; the output variables produce the sum and carry.
The binary addition operation of single bit is shown in the truth table.
C:
Carry Bit
S:
Sum Bit
mywbut.com
Full Adder:
A full adder is a combinational circuit that forms the arithmetic sum of three bits. It consists of
three inputs and two outputs.
Two of the input variables, denoted by x and y, represent the two bits to be added. The third input
Z, represents the carry from the previous lower position.
The two outputs are designated by the symbols S for sum and C for carry.
mywbut.com
mywbut.com
To demonstrate the binary addition of four bit numbers, let us consider a specific example.
Consider two binary numbers
A =1 0 0 1
B=0011
To get the four bit adder, we have to use 4 full adder blocks. The carry output the lower bit is
used as a carry input to the next higher bit.
The circuit of 4-bit adder shown in the Figure 2.8.
Binary Subtractor:
The subtraction operation can be implemented with the help of binary adder circuit, because
mywbut.com
We know that 2's complement representation of a number is treated as a negative number of the
given number.
We can get the 2's complements of a given number by complementing each bit and adding 1 to
it.
The circuit for subtracting A-B consist of an added with inverter placed between each data input
B and the corresponding input of the full adder. The input carry
performing subtraction.
The operation thus performed becomes A , plus the 1's complement of B , plus 1. This is equal to
A plus 2's complement of B.
With this principle, a single circuit can be used for both addition and subtraction. The 4 bit adder
subtractor circuit is shown in the figure. It has got one mode ( M ) selection input line, which will
determine the operation,
If
If
then
then
1's complement of
mywbut.com
if
if
The process consists of looking at successive bits of the multiplier, least significant bit first. If
the multiplier bit is a 1, the multiplicand is copied down, otherwise, zeros are copied down. The
numbers copied down in successive lines are shifted one position to the left from the previous
number. Finally, the numbers are added and their sum forms the product.
When multiplication is implemented in a digital computer, the process is changed slightly.
Instead of providing registers to store and add simultaneously as many binary numbers as there
are bits in the multiplier, it is convenient to provide an adder for the summation of only two
binary numbers and successively accumulate the partial products in a register. It will reduce the
requirements of registers.
Instead of sifting the multiplicand to the left, the partial product is shifted to right.
mywbut.com
When the corresponding bit of the multiplier is 0, there is no need to add all zeros to the partial
product.
An algorithm to multiply two binary numbers. Consider that the ALU does not provide the
multiplication operation, but it is having the addition operation and shifting operation. Then we
can write a micro program for multiplication operation and provide the micro program code in
memory. When a multiplication operation is encountered, it will execute this micro code to
perform the multiplication.
10
mywbut.com
The flow chart of the multiplication operation is given in the Figure 2.11.
11
mywbut.com
Problems
Q: Assume that the EX-OR gate has a propagation delay of 20ns and that the AND and OR
gate has a propagation delay of 10ns. What is the propagation delay of the full adder circuit?
What is the propagation delay of an 8-bit adder, which is constructed by connecting 8 full adder
in cascading manner.
Ans:
The propagation delay of the full adder circuit is 40ns, i.e. if we provide both the input and carry
at time ti, then after 40ns we will get stable output at sum and carry_out bit.
12
mywbut.com
Since the 8-bit adder is constructed by connecting 8 full adder in cascading manner, there will be
some delay in propagating the carry bit.
Since the carry output of i-th full adder is provided as an input to the (i+1)-th full adder, the
addition operation of (i+1)-th full adder cannot be performed until there is a stable output from ith full adder and which will appear after 40ns.
The first bit takes 40ns to provide the carry output. Similarly, second bit will take another 40ns
to produce the stable output.
Therefore, the total propagation delay is 40 X 8 = 320ns.
13