Arithmetic Logic Devices (ALU)
The purpose of ALU. Arithmetic Logic Devices are designed to perform arithmetic and logical operations on the & quot; -bit operands A = A n x ... A x A 0 and B = B n j ... B x B 0. The type of operation to be performed is specified by the signal M (Mode - mode). For example, four-bit ALU (n = 4) perform 16 arithmetic (M = 0) and 16 logical (M = 1) operations. The choice of one of the arithmetic or logical operations is carried out using the 4-bit code E 3 E 2 E i E 0 . Logical operations on operands are performed bitwise
where the & quot; * & quot; - any two-place operation of the algebra of logic (OR, AND, OR-HE, AND-NOT, exclusive OR, etc.).
In addition to the operands, a carry signal C0 is applied to the ALU input. The result of the operation is removed from the outputs in the form of functions F j (r = 0,1,2,3) for individual digits. When performing arithmetic operations, the ALU is a 4-bit adder with parallel transfer. Therefore, in ALU, as in the adder, there are outputs C4, G and P, used for sequential or parallel cascading of 4-bit sections. Consider the functions and principles of building 4-bit ALU.
ALU functions
The basis for constructing ALUs are binary summators, for which the expression (4.20) of the sum of the r'th bit has the form
(4.20)
To perform logical operations and expand the functionality of the adder, we take the following measures:
Table 4.17
Code |
F i |
||
M = 0 |
M = 1 |
||
0000 |
|||
0001 |
|||
0010 |
|||
0011 |
|||
0100 |
|||
0101 |
|||
0110 |
|||
0111 |
|||
1000 |
|||
1001 |
|||
1010 |
|||
1011 |
|||
1100 |
|||
1101 |
|||
1110 |
|||
1111 |
• By changing the transfer in (4.20) C i to C i v M, we create conditions for the transfer lock (for M = 1, the transfer is blocked);
• Instead of the digits A i and B i of the operands A and B in (4.20), we use the functions
(4.21)
Assuming in (4.20) S j = F j, we obtain the following expression for describing the ALU functions:
(4.22)
For M = 0 expression (4.22) allows to determine 16 arithmetic operations, and for M = 1 - 16 logical operations performed by ALU. The type of the arithmetic and logical operation to be performed is determined by the 4-bit code E 3 E 2 E j E 0.
In Table. 4.17 shows the transformations of the initial expressions (4.22) and the final expressions (graphs M = 0 and M = 1) for the operations F j performed by the ALU over the individual bits A j and B j operands. For the transformations, the following formulas were used:
To proceed to operations on operands, we must replace A j with A, B j with B, C j with CO = OOOC0, 0 to 0000, 1 to 1111, and for arithmetic operations (M = 0) additionally - the symbol ® to the symbol "+" arithmetic addition.
Table 4.18
k |
Arithmetic operations M = 0 |
Logical operations M = 1 |
||||
0 |
0 |
0 |
0 |
0 |
||
1 |
0 |
0 |
0 |
1 |
||
2 |
0 |
0 |
1 |
0 |
||
3 |
0 |
0 |
1 |
1 |
||
4 |
0 |
1 |
0 |
0 |
||
5 |
0 |
1 |
0 |
1 |
||
6 |
0 |
1 |
1 |
0 |
||
7 |
0 |
1 |
1 |
1 |
||
8 |
1 |
0 |
0 |
0 |
||
9 |
1 |
0 |
0 |
1 |
||
10 |
1 |
0 |
1 |
0 |
||
11 |
1 |
0 |
1 |
1 |
||
12 |
1 |
1 |
0 |
0 |
||
13 |
1 |
1 |
0 |
1 |
||
14 |
1 |
1 |
1 |
0 |
||
15 |
1 |
1 |
1 |
1 |
The operations performed by the ALU on the input operands are shown in Table. 4.18. When describing operations, the following notations were used:
• A, B - input 4-bit operands;
• 0 = 0000, 1 = 1111 4-bit operands with the values of each bit equal to 0 and 1 respectively;
• CO = 000 C0 is the 4-bit operand whose least significant bit is involved for the transfer input signal;
• the & quot; + & quot; for the operation of arithmetic addition of operands;
• the symbols v, & amp ;, ® for the operations of logical addition, multiplication and exclusive OR of operands;
• A, B - the bitwise inverting of the operands A, B.
Table comparison. 4.18 with Table. 3.2 indicates that ALU performs all 16 possible logical operations on two variables, i.e. ALU is a universal device in terms of performing logical operations.
We note some features of arithmetic operations. To expand the functional capabilities of ALU:
• It is possible to implement arithmetic operations with the values of the input transfer signal C 0 = 0 and C 0 = 1, for C 0 = 1, the additional operand 0001 appears on the input of the ALU;
• Most arithmetic operations are combined with pre-executed logical operations. From this point of view, the operation A + + B + CO (r = 6), which at CO = 0001 allows obtaining the difference of operands A-Bc with the representation of the result in the additional code. For A = 0000 and CO = 0001, an additional operand code B is generated using this operation. Other operations can also be used to represent the operand in the additional code, for example (A v B) + CO 0 = 2);
• There is an operation of addition of two identical operands A + A + CO 0 = 12). When this operation is performed, the operand A is shifted one digit to the left (towards the higher digits) with the entry of the value of the input transfer signal C0 into the lower bit. This shift is caused by an increase in the number A by a factor of two, which is equivalent to multiplication by 2, and consequently for binary numbers - a shift to the left by one digit;
• There is an operation A + CO (r = 0), which at CO = 0001 is analogous to the incrementation operation (increase by +1) performed by the counters.
How to ...
We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)