www.fairchildsemi.com 2
DM74LS181
Functional Description
The DM74LS181 is a 4- bit high speed parallel Arithm etic
Logic Unit (ALU). Controlled by the four Fun ction Select
inputs (S0–S3) and the Mode Control input (M), it can perform all the 16 possible logic operations or 16 different
arithmetic operations o n active HIGH or acti ve LOW operands. The Function Table lists these operations
When the Mode Control input (M) is HIGH, all internal carries are inhibited and the device p erforms l ogic oper ations
on the individual bits as listed. When the Mode Control
input is LOW, the carries are enabled and the dev ice performs arithmetic operations on the two 4-bit words. The
device incorporates full internal carry l ookahead and provides for either ripple carry between devices using the C
n+4
output, or for carry lookahead between packages using the
signals P
(Carry Propagate) and G (Carry Generate). In the
ADD mode, P
indicates that F is 15 or more, while G indi-
cates that F
is 16 or more. In the SUBTRACT mode, P indi-
cates that F
is zero or less, while G indicates that F is less
than zero. P
and G are not affected by carry in. When
speed requiremen ts are not stringent, it can be used in a
simple ripple carry mode by connecting the Carry output
(C
n+4
) signal to the Carry i nput (Cn) of the next unit. Fo r
high speed operation the device is used in conjunction with
the 9342 or 93 S42 carry lookah ead circuit. One carry loo kahead package is required for each group of four
DM74LS181 devices. Carry looka head can be provid ed at
various levels and offers high speed capability over
extremely long word lengths.
The A = B output from the device goes HIGH w hen all four
F
outputs are HIGH and can be used to indicate logic
equivalence over four bits when the uni t is in the subtract
mode. The A = B output is open-collector and can be wiredAND with other A = B outputs to give a comparison for
more than four bits. The A = B signal can also be used with
the C
n+4
signal to indicate A > B and A < B.
The Function Table lists the arithmetic ope rations that are
performed without a carry in. An incoming carry adds a one
to each operation . Thus, select code LHHL gene rates A
minus B minus 1 (2s complem ent no tation) witho ut a ca rry
in and generates A minus B when a carry is applied.
Because subtraction is actual ly performed by co mplementary addition (1s complement), a carry out means borrow;
thus a carry is gener ated when there is no underflow a nd
no carry is generated when there is underflow. As indicated, this device can be used with either active LOW
inputs producing active LOW outputs or with active HIGH
inputs producing active HIGH outp uts. For either case the
table lists the operatio ns that are performed to the operands labeled inside the logic symbol.
Function Table
Note 1: Each bit is shifted to the next most significant position.
Note 2: Arithmetic operations expresse d in 2s complement notation.
Mode Select Active LOW Operands Active HIGH Operands
Inputs & F
n
Outputs & Fn Outputs
Logic Arithmetic
(Note 2)
Logic Arithmetic
(Note 2)
S3 S2 S1 S0 (M = H) (M = L) (C
n
= L) (M = H) (M = L) (Cn = H)
LLLLA
A minus 1 A A
LLLHAB
AB minus 1 A + B A + B
LLHLA
+ B AB minus 1 A BA + B
L L H H Logic 1 minus 1 Logic 0 minus 1
LHLLA
+ B A plus (A + B)ABA plus AB
LHLHB AB plus (A + B)B (A + B) plus AB
LHHLA ⊕ B A minus B minus 1 A ⊕ B A minus B minus 1
LHHHA + B
A + B AB AB minus 1
HLLLA
B A plus (A + B) A + B A plus AB
HLLHA ⊕ B A plus B A
⊕ B A plus B
HLHLB AB
plus (A + B) B (A + B) plus AB
HLHHA + BA + B AB AB minus 1
H H L L Logic 0 A plus A (Note 1) Logic 1 A plus A (Note 1)
HHLHAB
AB plus A A + B (A + B) plus A
H H H L AB AB
minus A A + B(A + B) plus A
HHHHAA AA minus 1