The external circuitry connected to the ALU is responsible for ensuring the stability of ALU input signals throughout the operation, and for allowing sufficient time for the signals to propagate through the ALU before sampling the ALU result. In normal operation, stable signals are applied to all of the ALU inputs and, when enough time (known as the " propagation delay") has passed for the signals to propagate through the ALU circuitry, the result of the ALU operation appears at the ALU outputs. The combinational logic circuitry of the 74181 integrated circuit, which is a simple four-bit ALUĪn ALU is a combinational logic circuit, meaning that its outputs will change asynchronously in response to input changes. Typically, this is a single "carry-in" bit that is the stored carry-out from a previous ALU operation. The status inputs allow additional information to be made available to the ALU when performing an operation.
INSTRUCTION DECODER LOGICWORKS 5 CODE
The collection of bit registers that store the status outputs are often treated as a single, multi-bit register, which is referred to as the "status register" or "condition code register". Upon completion of each ALU operation, the status output signals are usually stored in external registers to make them available for future ALU operations (e.g., to implement multiple-precision arithmetic) or for controlling conditional branching. Parity, which indicates whether an even or odd number of bits in Y are logic one.Overflow, which indicates the result of an arithmetic operation has exceeded the numeric range of Y.Negative, which indicates the result of an arithmetic operation is negative.Zero, which indicates all bits of Y are logic zero.Carry-out, which conveys the carry resulting from an addition operation, the borrow resulting from a subtraction operation, or the overflow bit resulting from a binary shift operation.General-purpose ALUs commonly have status signals such as: The status outputs are various individual signals that convey supplemental information about the result of the current ALU operation. Generally, an ALU opcode is not the same as a machine language opcode, though in some cases it may be directly encoded as a bit field within a machine language opcode. The opcode size (its bus width) determines the maximum number of different operations the ALU can perform for example, a four-bit opcode can specify up to sixteen different ALU operations. The opcode input is a parallel bus that conveys to the ALU an operation selection code, which is an enumerated value that specifies the desired arithmetic or logic operation to be performed by the ALU. Typically, the A, B and Y bus widths (the number of signals comprising each bus) are identical and match the native word size of the external circuitry (e.g., the encapsulating CPU or other processor). Each data bus is a group of signals that conveys one binary integer number. When an ALU is operating, external circuits apply signals to the ALU inputs and, in response, the ALU produces and conveys signals to external circuitry via its outputs.Ī basic ALU has three parallel data buses consisting of two input operands ( A and B) and a result output ( Y). An ALU has a variety of input and output nets, which are the electrical conductors used to convey digital signals between the ALU and external circuitry.