<<

Arithmetic Unit (ALU) By : Khawar Nehal 18 June 2020

Updated 21 June 2020

1 / 32 (ALU)

An arithmetic-logic unit (ALU) is the part of a (CPU) that carries out arithmetic and logic operations on the operands in computer instruction words. In some processors, the ALU is divided into two units, an arithmetic unit (AU) and a logic unit (LU).

2 / 32 Arithmetic Logic Unit (ALU)

Some processors contain more than one AU - for example, one for fixed-point operations and another for floating-point operations. (In personal floating point operations are sometimes done by a floating point unit on a separate chip called a numeric .)

3 / 32 Co processor examples

4 / 32 Co processor details

30 year old story of autocad, BOQ, Autolisp, co processors and co processor emulators available for those interested.

5 / 32 Co processor word in the 2020s

EnsembleSeries™ GSC6204 - Powerful GPU co-processor 6U OpenVPX GPU NVIDIA Quadro Co-Processor

6 / 32 Co processor future

Those interested in the future of high performance computers and super can discuss research papers in this field.

7 / 32 Arithmetic Logic Unit (ALU)

Typically, the ALU has direct input and output access to the processor controller, main memory (random access memory or RAM in a personal computer), and input/output devices. Inputs and outputs flow along an electronic path that is called a . The input consists of an instruction word (sometimes called a machine instruction word) that contains an operation code (sometimes called an "op code"), one or more operands, and sometimes a format code.

8 / 32 Arithmetic Logic Unit (ALU)

The operation code tells the ALU what operation to perform and the operands are used in the operation. (For example, two operands might be added together or compared logically.) The format may be combined with the op code and tells, for example, whether this is a fixed- point or a floating-point instruction.

9 / 32 Fixed point and floating point https://www.tutorialspoint.com/fixed-point-and-fl oating-point-number-representations There are two major approaches to store real numbers (i.e., numbers with fractional component) in modern computing. These are (i) Fixed Point Notation and (ii) Floating Point Notation. In fixed point notation, there are a fixed number of digits after the decimal point, whereas floating point number allows for a varying number of digits after the decimal point.

10 / 32 Fixed-Point Representation:

This representation has fixed number of bits for integer part and for fractional part. For example, if given fixed-point representation is IIII.FFFF, then you can store minimum value is 0000.0001 and maximum value is 9999.9999. There are three parts of a fixed-point number representation: the sign field, integer field, and fractional field.

11 / 32 Fixed-Point Representation:

12 / 32 One’s complement

13 / 32 Two’s complement

14 / 32 Fixed-Point Representation:

0.50000000 = 4/8 = ½ + 0.12500000 = 1/8 ------= 0.62500000 = 5/8

101011 in binary = 43 in base 10

15 / 32 Fixed-Point Representation:

16 / 32 Fixed-Point Representation:

17 / 32 Arithmetic Logic Unit (ALU)

The output consists of a result that is placed in a storage register and settings that indicate whether the operation was performed successfully. (If it isn't, some sort of status will be stored in a permanent place that is sometimes called the machine status word.)

18 / 32 Arithmetic Logic Unit (ALU)

In general, the ALU includes storage places for input operands, operands that are being added, the accumulated result (stored in an ), and shifted results. The flow of bits and the operations performed on them in the subunits of the ALU is controlled by gated circuits.

19 / 32 Arithmetic Logic Unit (ALU)

The gates in these circuits are controlled by a sequence logic unit that uses a particular algorithm or sequence for each operation code. In the arithmetic unit, multiplication and division are done by a series of adding or subtracting and shifting operations. There are several ways to represent negative numbers. In the logic unit, one of 16 possible logic operations can be performed - such as comparing two operands and identifying where bits don't match.

20 / 32 16 common operations https://en.wikipedia.org/wiki/74181 For details. This example is for the 74181 chip.

21 / 32 16 common operations

22 / 32 Active low

Active LOW is a term used in the field of to describe the required logic state of an (IC) pin that will enable its internal function. Usually, the physical pin provides access to a function within the IC, and changing its state to LOW activates this function.

23 / 32 Active low and high

Active low and high reasons are not discussed as of now. There are advantages and disadvantages to both methods.

24 / 32 Arithmetic Logic Unit (ALU)

The design of the ALU is obviously a critical part of the processor and new approaches to speeding up instruction handling are continually being developed.

25 / 32 Logic Gates

The ALU is made with logic gates. They are presented in the next slide. We shall not go into how to make these gates using transistors or other methods. That is a topic for electronics courses and digital computer logic. If you need to get those explained, then it can be provided as extra. But it shall not be tested in this course.

26 / 32 27 / 32 and Decoders

Multiplexers and decoders are used in ALU design to convert from binary to separate parallel wires and the reverse .

28 / 32 29 / 32 30 / 32 31 / 32 32 / 32