
Speedster Macro Cell Library www.achronix.com PAGE 86
Chapter 5 – Arithmetic Functions
ALU
Two Input Adder / Subtractor with Programmable Load
ALU
a[1:0]
b[1:0]
d[1:0]
load
cin
s[1:0]
cout
Figure 5-1: Logic Symbol
ALU implements eithe
r a two‐bit adder or two‐bit subtractor with adder/subtractor inputs
(a[1:0],b[1:0]),loadvalue(d[1:0]),LoadEnable(load)andcarry‐in(cin)inputs.Itgenerates
the sum/difference (s[1:0]) and carry‐out (cout) outputs.Asserting the load signal high
overridesthes[1:0]outputwiththevalueoftheLoa
dValued[1:0]input.MultipleALUblocks
may be combined by connecting the cout output of one slice to the cin input of the next
significanttwo‐bitslice.SelectionofwhethertheALUisconfiguredasanadderorsubtractor
isdeterminedbythevalueoftheinvert_bparameter.
Pins
Table 5-1: Pin Descriptions
Name Type Description
a[1:0]
Data Input a. D
ata Input a is a 2-bit two’s complement signed input,
where bit 1 is the most significant bit. In subtraction mode, Data Input a is
the minuend.
b[1:0]
Data Input b. D
ata Inputs b is a 2-bit two’s complement signed input,
where bit 1 is the most significant bit. In subtraction mode, Data Input b is
the subtrahend.
d[1:0]
Load Value input. I
nput d[1:0] is the value that is loaded onto the outputs
s[1:0] upon the active-high assertion of the load input.
load
Load input
(active-high). Asserting the load input high set the s[1:0] out-
put equal to the d[1:0] input.
cin
Carry In input(ac
tive-high). The cin is the carry-in to the ALU. Note that
for subtraction, cin should be tied high.
s[1:0]
Sum/Difference output.
If the invert_b parameter is set to 1’b0, the s[1:0]
output will reflect the sum of the a, b, and cin inputs if the load input is
low. If the invert_b parameter is set to 1’b1, the s[1:0] output will reflect
the difference of the a, b, cin inputs if the load input is low.
cout
Carry-out output. T
he cout is set high during an add when the s[1:0] out-
put overflows.
input
input
input
input
output
output
Commenti su questo manuale