Previous

ACCUMULATOR

The Accumulator takes the data on its B input port and its Carry Input port and adds this data to or subtracts it from the current value stored in the accumulator register. It then loads the result back into the register, making it available at the Q_OUT port.

There are two types of accumulators: those that accumulate the value applied to the symbol's B input port and those that accumulate a constant value. The following figure illustrates the accumulation of values applied to the symbol's B pin.

Figure 4.1 The Accumulator Module

The Carry Output and the Overflow outputs are generated by the Adder/Subtracter to indicate the status of the present arithmetic operation. You can latch these outputs by specifying the appropriate attribute. You can also load separate predefined values synchronously or asynchronously into any or all of the module's registers.

Table 4_1 Accumulator Register Truth Table

Load
Sync. Control
Clock Enable
Clock
Async. Control
Q_OUT
X
X
X
X
H
ASYNC_VAL
X
X
L
X
L
Q_OUTprev1

1. Q_OUT prev denotes the previous contents of the register.

X
H
H

L
SYNC_VAL
L
L
H

L
Q_OUTprev +/- B
H
L
H

L
B

Input Pins

Add/Sub (ADD_SUB)

The input on this pin determines whether the module should add the value on the B input port to or subtract it from the value in the Accumulator register. If the input is High, the module performs an addition. If the input is Low, the module performs a subtraction.

Connections: This pin is available only if you set the Operation attribute to Add/Subtract. If you select either of the individual Add or Subtract operation modes, the Add/Sub input pin is removed from the module.

Carry Input (C_IN)

The Carry Input port, together with the data on the B input port, is added to or subtracted from the current accumulator register value.

Connections: Carry Input is optional. Its value depends on whether the Operation mode is Add or Subtract. If Carry Input is not specified, the default values are 0 for Add and 1 for Subtract.

B

The data on the B input port, along with the Carry Input port, is added to or subtracted from the current accumulator register value.

Connections: The B input is present if a Constant value is not specified. If you set the Constant Value attribute, you generate a schematic symbol with a Constant input instead of the B input.

Load (LOAD)

When the Asynchronous Control and the Synchronous Control pins are Low and Load is High, the Accumulator register is loaded directly with the value on the B input port on the next active Low-to-High Clock transition.

Connections: Load is optional. If you do not specify this input, the accumulator always adds or subtracts; it never loads.


NOTE

The Carry Out and Overflow outputs generated by the module's adder/subtracter are unknown during a load operation.


Clock Enable (CLK_EN)

Whenever the Clock Enable input is High, either the data on the B input port, the output of the adder/subtracter, or the value assigned to the Synchronous Value attribute is loaded into the accumulator register on the next active Low-to-High Clock transition.

If the Clock Enable input is Low, the register contents are unaffected by the Clock and the register holds its current value. This input does not affect asynchronous load operations, which occur when the Asynchronous Control pin is asserted.

Connections: Clock Enable is optional. Use this input when you need to disable the clock temporarily. If you do not use the Clock Enable input, the Clock is always enabled.

Clock (CLOCK)

If the Clock Enable input is High, the rising clock edge loads the selected data into the accumulator register. The falling (negative) clock edge can be used by connecting an inverter to the Clock input.

Connections: The Clock pin is always specified.

Async. Control (ASYNC_CTRL)

The Asynchronous Control input is a level-sensitive input. When this input is High, it loads the value assigned to the Asynchronous Value attribute into the accumulator register independently of the Clock and Clock Enable.

Connections: If you specify the Asynchronous Control pin, you can assign a value to the Asynchronous Value attribute. By default, the Asynchronous Value is assigned a value of zero if it is not specified. The Asynchronous Value attribute may also be specified to define the accumulator register's power-on value.

Sync. Control (SYNC_CTRL)

Whenever the Synchronous Control and Clock Enable inputs are High, the value assigned to the Synchronous Value attribute is loaded into the accumulator register on the next active clock transition. This input has priority over the Load input if both pins are High at the same time.

Connections: If you specify the Synchronous Control pin and do not assign a value to the Synchronous Value attribute, a default value of 0 is used and a warning is issued.


NOTE

Asserting either Asynchronous Control or Synchronous Control affects all registered elements - the Accumulator register and potentially the Registered Carry Output and Registered Overflow registers. The Asynchronous Value and Synchronous Value attributes may contain data for all three registered elements. See the “Synchronous and Asynchronous Control” section of the “Understanding Attributes” chapter for more information.


Output Pins

Q_OUT

Q_OUT always reflects the current contents of the Accumulator register.

Connections: Q_OUT is always specified.

Overflow, Reg'd Overflow (OVFL)

Overflow is the overflow output from the adder/subtracter. Registered Overflow is the overflow from the Accumulator register. The overflow output is High when the result of the operation exceeds the maximum allowed value of the adder/subtracter.

Connections: Overflow and Registered Overflow are optional. If you specify one, you cannot specify the other.

Carry Output, Reg'd Carry Output (C_OUT)

Carry Output is the carry out from the most significant bit of the adder/subtracter. Registered Carry Output is the carry out from the most significant bit of the Accumulator register.

Connections: Carry Output and Registered Carry Output are optional. If you specify one, you cannot specify the other.

Attributes

C Value (C_VALUE)

Use the Constant Value attribute to replace the B input port with a constant value. If you do not define this attribute, the B pin is present.

Operation (OPTYPE)

Use the Operation attribute to specify one of the three possible arithmetic operation modes: Add, Subtract, or Add/Subtract. If you select Add/Subtract, the Add/Sub input pin is automatically added to the module.

Style (STYLE)

Style defines the implementation style (area or speed preference).

Usage: For more information, see the “Implementation Styles” section of the “Understanding Attributes” chapter.

Encoding (ENCODING)

Encoding defines the encoding scheme assumed in the generation of the overflow output logic. Valid values are Signed and Unsigned.

Async. Val (ASYNC_VAL)

The value of the Asynchronous Value attribute defines the power-on contents of the register. It also determines the data values assigned to the three registered elements: the Accumulator register, the Registered Carry Out register, and the Registered Overflow register. On assertion of the Asynchronous Control pin, the data values for the specified pins are extracted from the value assigned to the Asynchronous Value attribute.

See the “Synchronous and Asynchronous Control” section of the “Understanding Attributes” chapter for more information about specifying the Asynchronous Value of these registers.

Usage: Asynchronous Value is always available. You can define it whether or not you use the Asynchronous Control pin. If you do not specify a value, the default value is zero.

Sync. Val (SYNC_VAL)

The Synchronous Value attribute defines the value to which the register returns on assertion of the Synchronous Control pin. It also determines the data values assigned to the three registered elements: the Accumulator register, the Registered Carry Out register, and the Registered Overflow register. On assertion of the Synchronous Control pin, the data values for the specified pins are extracted from the value assigned to the Synchronous Value attribute.

See the “Synchronous and Asynchronous Control” section of the “Understanding Attributes” chapter for more information about specifying the Synchronous Value of these registers.

Usage: Synchronous Value is available only if you specify the Synchronous Control pin.

Next