Multiply Accumulate Unit Part-II

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/84

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:26 PM on 9/5/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

85 Terms

1
New cards

ExtendedUnsignedProduct

The ACC_WIDTH-bit zero-extended representation of Product used when the MAC operates in unsigned mode.

2
New cards

ExtendedSignedProduct

The ACC_WIDTH-bit sign-extended representation of Product used when the MAC operates in signed mode.

3
New cards

wire [ACC_WIDTH - 1:0] ExtendedUnsignedProduct

Declares the accumulator-width version of Product used by the unsigned accumulation path.

4
New cards

wire [ACC_WIDTH - 1:0] ExtendedSignedProduct

Declares the accumulator-width version of Product used by the signed accumulation path.

5
New cards

assign ExtendedUnsignedProduct = {{(ACC_WIDTH - (2 * WIDTH)){1'b0}}, Product};

Zero-extends the 2×WIDTH-bit Product to ACC_WIDTH bits.

6
New cards

ACC_WIDTH - (2 * WIDTH)

The number of additional high-order bits required to widen Product to the accumulator width.

7
New cards

{(ACC_WIDTH - (2 * WIDTH)){1'b0}}

Generates the high-order zeros used to widen Product for unsigned accumulation.

8
New cards

{{(ACC_WIDTH - (2 * WIDTH)){1'b0}}, Product}

The complete zero-extension expression that forms ExtendedUnsignedProduct.

9
New cards

Product occupies the low-order 2×WIDTH bits.

Where is Product placed inside ExtendedUnsignedProduct?

10
New cards

Zeros occupy the newly added high-order bits.

What fills the additional high-order positions of ExtendedUnsignedProduct?

11
New cards

assign ExtendedSignedProduct = {{(ACC_WIDTH - (2 * WIDTH)){Product[(2 * WIDTH) - 1]}}, Product};

Sign-extends the 2×WIDTH-bit Product to ACC_WIDTH bits.

12
New cards

Product[(2 * WIDTH) - 1]

The most significant bit of Product and therefore the bit replicated during signed extension.

13
New cards

{(ACC_WIDTH - (2 * WIDTH)){Product[(2 * WIDTH) - 1]}}

Generates the repeated sign bits placed above Product during sign extension.

14
New cards

{{(ACC_WIDTH - (2 * WIDTH)){Product[(2 * WIDTH) - 1]}}, Product}

The complete sign-extension expression that forms ExtendedSignedProduct.

15
New cards

Because Product[(2 * WIDTH) - 1] is the sign bit of the selected two's-complement product when SignedMode is active.

Why does ExtendedSignedProduct replicate the most significant bit of Product?

16
New cards

Product sign bit = 0

Sign extension inserts zeros into the additional high-order positions.

17
New cards

Product sign bit = 1

Sign extension inserts ones into the additional high-order positions.

18
New cards

ExtendedUnsignedProduct and ExtendedSignedProduct are both ACC_WIDTH bits wide.

What width do the two extended product paths have?

19
New cards

Because the product must have a representation compatible with the ACC_WIDTH-bit Sum before the two values are added.

Why is Product extended before accumulation?

20
New cards

ACC_WIDTH = 2×WIDTH

Under the default parameter relationship, no additional product bits need to be added because product width already equals accumulator width.

21
New cards

ACC_WIDTH > 2×WIDTH

The configuration in which explicit widening adds high-order bits above Product.

22
New cards

The shown extension expressions assume ACC_WIDTH >= 2×WIDTH.

What parameter-width relationship is assumed by ACC_WIDTH - (2 * WIDTH)?

23
New cards

Because ACC_WIDTH - (2 * WIDTH) represents the number of additional high-order bits that must be generated.

Why does the shown extension construction conceptually require ACC_WIDTH to be at least 2×WIDTH?

24
New cards

Product Extension Stage

The MAC datapath stage that converts the selected 2×WIDTH-bit Product into an ACC_WIDTH-bit value while preserving its numeric interpretation.

25
New cards

SignedMode determines both product interpretation and accumulation extension.

What signal coordinates the signed/unsigned interpretation across the multiplication and accumulation portions of the MAC?

26
New cards

SignedMode = 0 → UnsignedProduct → Product → ExtendedUnsignedProduct

The unsigned data path from multiplication through accumulator-width extension.

27
New cards

SignedMode = 1 → SignedProduct → Product → ExtendedSignedProduct

The signed data path from multiplication through accumulator-width extension.

28
New cards

Because choosing signed multiplication but then zero-extending a negative Product would fail to preserve its intended signed value in the wider accumulator datapath.

Why must the extension rule remain consistent with the multiplication interpretation?

29
New cards

output reg [ACC_WIDTH - 1:0] Sum

The persistent ACC_WIDTH-bit arithmetic state that stores the running sum of accepted products.

30
New cards

Sum_current

The accumulated history of products accepted before the current enabled update.

31
New cards

Sum_next

The new accumulated history after the selected extended Product is added.

32
New cards

Sum_next = Sum_current + ExtendedProduct

The general state-update equation implemented by the MAC after product widening.

33
New cards

always @(posedge clk)

Implements the persistent Sum update as synchronous sequential state.

34
New cards

if (reset) begin Sum <= {ACC_WIDTH{1'b0}}; end

Establishes zero as the initial accumulated sum of products.

35
New cards

Because every future MAC result depends on the previous Sum, so the product history requires a known starting state.

Why must the MAC's Sum be initialized by reset?

36
New cards

if (enable)

Determines whether the current A×B product is accepted into the accumulated history on the current rising clock edge.

37
New cards

enable = 0

Sum retains its previous value, so the current product does not become part of the accumulated history.

38
New cards

enable = 1

The appropriately extended current Product is added into Sum on the rising clock edge.

39
New cards

Because a current A×B value should affect arithmetic history only when the surrounding system declares that multiplication event valid for accumulation.

Why does MultiplyAccumulateUnit require enable?

40
New cards

if (SignedMode) Sum <= Sum + ExtendedSignedProduct;

The enabled state update performed when the MAC is operating with signed interpretation.

41
New cards

else Sum <= Sum + ExtendedUnsignedProduct;

The enabled state update performed when the MAC is operating with unsigned interpretation.

42
New cards

Signed enabled update

Sum_next = Sum_current + ExtendedSignedProduct.

43
New cards

Unsigned enabled update

Sum_next = Sum_current + ExtendedUnsignedProduct.

44
New cards

Reset has priority over enable.

What happens if reset and enable are asserted on the same rising clock edge?

45
New cards

Because reset is tested before enable in the sequential always block.

Why does reset override an accumulation request?

46
New cards

Product is combinational; Sum is sequential.

What is the state distinction between Product and Sum in MultiplyAccumulateUnit?

47
New cards

Because Product represents the multiplication of the current operands, while Sum retains the history of products accepted on earlier enabled clock edges.

Why is Product not itself the arithmetic history of the MAC?

48
New cards

Multiplier

Transforms the current A and B operands into Product.

49
New cards

Extension Logic

Preserves the selected Product's numeric meaning while adapting it to ACC_WIDTH.

50
New cards

Adder

Combines the appropriately extended Product with the currently stored Sum.

51
New cards

Sum Register

Stores the updated accumulated total so it can participate in the next MAC operation.

52
New cards

Enable

Determines whether the current product-add operation becomes part of the stored arithmetic history.

53
New cards

Multiplier → extension → adder → Sum register

The main forward datapath of the MultiplyAccumulateUnit.

54
New cards

Sum register → adder

The feedback path that makes the MAC a repeated stateful arithmetic structure.

55
New cards

A, B → multiply → select interpretation → extend → add to current Sum → store next Sum

The complete arithmetic dataflow of an enabled MAC update.

56
New cards

Multiply

The transform stage of the MAC's iterative datapath pattern.

57
New cards

Extend

Preserves the product's numeric interpretation at the accumulator's width.

58
New cards

Combine with Current State

Adds the current extended Product to the previously accumulated Sum.

59
New cards

Store Next State

Captures the newly calculated Sum on the enabled rising clock edge.

60
New cards

Repeat

Allows later operand pairs to contribute additional products to the same persistent Sum.

61
New cards

New data → transform → combine with current state → store next state → repeat

The general iterative-datapath pattern demonstrated by the MAC.

62
New cards

Because the previous Sum is fed back into the next addition instead of being discarded after each product-add operation.

Why is MultiplyAccumulateUnit a stateful datapath rather than merely combinational A×B arithmetic?

63
New cards

Sum of Products

A mathematical expression formed by adding multiple products such as A0B0 + A1B1 + A2B2 + … + AnBn.

64
New cards

Σ AiBi

The compact mathematical notation for the final result of repeated multiply-accumulate operations.

65
New cards

cycle 0: Sum = 0

The initial state of a reset MAC before any products have been accepted.

66
New cards

cycle 1: Sum = A0B0

The accumulated state after accepting the first product from an initial Sum of zero.

67
New cards

cycle 2: Sum = A0B0 + A1B1

The accumulated state after accepting the second product.

68
New cards

cycle 3: Sum = A0B0 + A1B1 + A2B2

The accumulated state after accepting the third product.

69
New cards

Each enabled edge folds one new product into remembered state.

How does a MAC gradually construct a sum of products?

70
New cards

Accepted Product

A product that becomes part of Sum because enable is asserted on the corresponding rising clock edge.

71
New cards

Unaccepted Product

A combinational A×B result that may exist internally but does not alter Sum because enable is inactive.

72
New cards

Because enable determines whether a particular product becomes part of the accumulated arithmetic history.

Why is the distinction between computing a Product and accepting a Product important in a MAC?

73
New cards

MAC = multiplication + memory

The architectural interpretation emphasizing that persistent accumulation, rather than multiplication alone, defines the MAC.

74
New cards

A×B + C alone does not fully capture the defining feature of this MAC.

Is a MAC fundamentally just one isolated calculation of A×B + C?

75
New cards

Because the defining behavior is repeated feedback: the stored Sum becomes the state into which successive products are folded.

Why does Part 05 describe a MAC as multiplication plus memory?

76
New cards

Finite Impulse Response Filtering

One application area in which repeated weighted contributions naturally form sums of products.

77
New cards

Dot Product

A computation that repeatedly multiplies corresponding elements and accumulates their products.

78
New cards

Matrix Multiplication

An important computation whose output elements are constructed from repeated product accumulation.

79
New cards

Convolution

A computation involving repeated multiplication of corresponding terms followed by accumulation.

80
New cards

Control Calculations

Another class of workloads in which weighted contributions may be combined through MAC operations.

81
New cards

Because many algorithms repeatedly compute products and combine those products into a running total.

Why is MAC important enough to be considered a common datapath primitive?

82
New cards

The multiplier and adder form a recurring datapath pair.

Why can specialized MAC-capable hardware be useful?

83
New cards

The accumulator register naturally preserves the running result between cycles.

What stateful hardware property makes MAC particularly suitable for repeated sum-of-products calculations?

84
New cards

Dedicated enable/control determines exactly when a product enters the accumulated history.

What control capability makes a MAC suitable for processing sequences of valid data?

85
New cards

A MAC repeatedly folds new products into remembered state.

What is the central architectural meaning of multiply-accumulate?