1/108
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
ArithmeticEngineControl
The global behavioral controller that remembers the arithmetic engine's selected operation and signed/unsigned interpretation mode and registers the execute command.
Operation
A 4-bit register in ArithmeticEngineControl that stores which arithmetic operation is currently selected.
SignedMode
A 1-bit register in ArithmeticEngineControl that stores whether the engine is currently configured for unsigned or signed interpretation.
Operation = global function state
What persistent controller state remembers which arithmetic function the user has selected?
SignedMode = global interpretation state
What persistent controller state remembers whether arithmetic should use unsigned or signed interpretation?
They must remain selected across clock cycles even when the corresponding selection button is no longer being pressed.
Why are Operation and SignedMode stored as registers rather than generated only from the current button inputs?
The controller remembers user intent.
What architectural purpose is served by storing Operation and SignedMode?
4 bits
How wide is the Operation register?
16 possible binary encodings
How many different binary encodings can a 4-bit Operation register represent?
10 named operation encodings
How many operation encodings are explicitly defined by ArithmeticEngineControl?
Six encodings are unused by the defined operation set.
If Operation can represent 16 encodings but only 10 operations are defined, what follows?
ADD_OPERATION
The localparam representing addition.
4'b0000
What binary encoding is assigned to ADD_OPERATION?
SUBTRACT_OPERATION
The localparam representing subtraction.
4'b0001
What binary encoding is assigned to SUBTRACT_OPERATION?
COMPARE_OPERATION
The localparam representing comparison.
4'b0010
What binary encoding is assigned to COMPARE_OPERATION?
MULTIPLY_OPERATION
The localparam representing combinational multiplication.
4'b0011
What binary encoding is assigned to MULTIPLY_OPERATION?
SEQUENTIAL_MULTIPLY
The localparam representing sequential multiplication.
4'b0100
What binary encoding is assigned to SEQUENTIAL_MULTIPLY?
ACCUMULATE_OPERATION
The localparam representing ordinary accumulation.
4'b0101
What binary encoding is assigned to ACCUMULATE_OPERATION?
WIDE_ACCUMULATE_OPERATION
The localparam representing wide accumulation.
4'b0110
What binary encoding is assigned to WIDE_ACCUMULATE_OPERATION?
MAC_OPERATION
The localparam representing multiply-accumulate operation.
4'b0111
What binary encoding is assigned to MAC_OPERATION?
DIVIDE_OPERATION
The localparam representing division.
4'b1000
What binary encoding is assigned to DIVIDE_OPERATION?
SQUARE_ROOT_OPERATION
The localparam representing integer square root.
4'b1001
What binary encoding is assigned to SQUARE_ROOT_OPERATION?
Named Operation Constants
The localparams that give meaningful symbolic names to the binary values representing the available arithmetic operations.
They let the RTL express operation meaning with names such as ADD_OPERATION and DIVIDE_OPERATION instead of repeatedly using unexplained binary literals.
Why are localparams used for the operation encodings?
They improve readability and make the controller's state meanings explicit.
What architectural advantage do symbolic operation names provide over raw binary values?
Operation Selection Sequence
ADD → SUBTRACT → COMPARE → MULTIPLY → SEQUENTIAL_MULTIPLY → ACCUMULATE → WIDE_ACCUMULATE → MAC → DIVIDE → SQUARE_ROOT → ADD.
SUBTRACT_OPERATION
Which operation follows ADD_OPERATION when NextOperationPulse is asserted?
COMPARE_OPERATION
Which operation follows SUBTRACT_OPERATION when NextOperationPulse is asserted?
MULTIPLY_OPERATION
Which operation follows COMPARE_OPERATION when NextOperationPulse is asserted?
SEQUENTIAL_MULTIPLY
Which operation follows MULTIPLY_OPERATION when NextOperationPulse is asserted?
ACCUMULATE_OPERATION
Which operation follows SEQUENTIAL_MULTIPLY when NextOperationPulse is asserted?
WIDE_ACCUMULATE_OPERATION
Which operation follows ACCUMULATE_OPERATION when NextOperationPulse is asserted?
MAC_OPERATION
Which operation follows WIDE_ACCUMULATE_OPERATION when NextOperationPulse is asserted?
DIVIDE_OPERATION
Which operation follows MAC_OPERATION when NextOperationPulse is asserted?
SQUARE_ROOT_OPERATION
Which operation follows DIVIDE_OPERATION when NextOperationPulse is asserted?
ADD_OPERATION
Which operation follows SQUARE_ROOT_OPERATION when NextOperationPulse is asserted?
Operation Wraparound
The transition from SQUARE_ROOT_OPERATION back to ADD_OPERATION so repeated selection pulses cycle continuously through the available operations.
The user can repeatedly advance through the operation list without reaching a terminal selection state.
Why does SQUARE_ROOT_OPERATION transition back to ADD_OPERATION?
NextOperationPulse
A one-clock event that requests advancement from the currently selected operation to the next operation in the predefined sequence.
Operation advances to the next defined arithmetic function.
What happens to Operation when NextOperationPulse is asserted during normal non-reset operation?
Operation holds its current value.
What happens to Operation when NextOperationPulse is not asserted?
Because a register retains its previous value when a clocked block executes without assigning it a new value on that path.
Why does Operation not require an explicit Operation <= Operation; statement when NextOperationPulse is low?
Implicit Register Hold
The behavior in clocked RTL where a register retains its previous value when no assignment to that register occurs on the active execution path.
The case statement
Which Verilog structure maps the current Operation value to the next operation in the selection sequence?
The current Operation
What expression is examined by case (Operation)?
Only when NextOperationPulse is asserted.
When is the case (Operation) statement evaluated in this controller?
The case statement is nested inside if (NextOperationPulse).
Why does ArithmeticEngineControl not continuously execute the operation-transition case logic on every clock edge?
default case
A case branch used when Operation does not match any explicitly listed valid operation encoding.
ADD_OPERATION
What value does the default branch assign to Operation?
Recovery to a known operation
What architectural purpose does default: Operation <= ADD_OPERATION; serve?
It provides a defined destination if the stored Operation value is not one of the ten recognized operation encodings.
Why is a default branch useful even though normal operation should keep Operation within valid states?
No. The default branch is reached only when the case statement itself executes, and that case statement is inside if (NextOperationPulse).
Does an invalid Operation encoding automatically recover to ADD_OPERATION on the very next clock edge regardless of inputs?
A NextOperationPulse or reset
What events can recover an invalid Operation encoding in this implementation?
The invalid value can remain stored until NextOperationPulse causes the case statement to evaluate it, unless reset occurs first.
What happens if Operation somehow contains an invalid encoding while NextOperationPulse remains low?
Default Recovery Is Conditional
In ArithmeticEngineControl, recovery through the case default occurs only when NextOperationPulse causes the operation-selection case statement to execute.
Because placing a default inside conditional logic does not cause that branch to execute unless the surrounding conditional path is entered.
Why is it incorrect to say that the default branch continuously protects Operation from invalid encodings?
ADD_OPERATION
To which operation does reset initialize Operation?
Unsigned mode
To which arithmetic interpretation does reset initialize SignedMode?
1'b0
What value does reset assign to SignedMode?
1'b0
What value does reset assign to ExecutePulse?
Known Global Configuration
The reset condition establishes addition as the selected operation, unsigned interpretation, and no active execute pulse.
It gives the arithmetic engine a deterministic and safe user-visible configuration after reset.
Why does ArithmeticEngineControl initialize its persistent control state during reset?
Synchronous reset
What type of reset behavior is implemented by if (reset) inside always @(posedge clk)?
The reset condition is evaluated only when the positive clock edge triggers the always block.
Why is the reset in ArithmeticEngineControl synchronous?
posedge clk
What event causes ArithmeticEngineControl's sequential always block to execute?
Reset has priority over all normal controller updates.
What is the highest-priority behavior inside ArithmeticEngineControl?
The reset branch is the first branch of the if (reset) ... else ... structure.
Why do NextOperationPulse and SignedModePulse not modify their states when reset is asserted?
Operation becomes ADD_OPERATION rather than advancing.
If reset and NextOperationPulse are both high at the same active clock edge, what happens to Operation?
SignedMode becomes 0 rather than toggling.
If reset and SignedModePulse are both high at the same active clock edge, what happens to SignedMode?
SignedMode Toggle
The operation SignedMode <= ~SignedMode, which reverses the stored signed/unsigned interpretation state.
SignedMode changes to its logical complement.
What happens when SignedModePulse is asserted during normal operation?
0 → 1 and 1 → 0
How does SignedMode change each time a valid SignedModePulse occurs?
Signed interpretation
What mode is represented when SignedMode = 1?
Unsigned interpretation
What mode is represented when SignedMode = 0?
SignedMode <= ~SignedMode;
Which RTL statement implements mode toggling?
The current stored SignedMode value is inverted and stored as the new mode.
What does the ~ operator accomplish in SignedMode <= ~SignedMode?
SignedMode holds its previous value.
What happens to SignedMode when SignedModePulse is low?
Because SignedMode is a register and no assignment to it occurs on that normal clock path when SignedModePulse is low.
Why does SignedMode remain selected between toggle pulses?
Toggle-Based Configuration
A control style in which each accepted pulse reverses a persistent binary configuration rather than directly specifying its new value.
One button event can alternate between two persistent modes without requiring separate signed and unsigned selection inputs.
Why is toggling convenient for SignedMode?
Persistent Configuration State
State that remembers a selected operating configuration across many cycles until another control event changes it.
Operation and SignedMode
Which two outputs of ArithmeticEngineControl primarily act as persistent configuration state?
Operation changes only on NextOperationPulse, while SignedMode changes only on SignedModePulse.
How are operation selection and signed-mode selection independently controlled?
Yes. Their updates are controlled by separate if statements inside the normal-operation branch.
Can Operation and SignedMode both change on the same clock edge?
Operation advances and SignedMode toggles.
What happens if NextOperationPulse and SignedModePulse are both asserted on the same non-reset clock edge?
Independent Control Updates
The ability of separate state variables to update during the same clock event because their assignments are controlled by independent conditions rather than mutually exclusive branches.
They represent independent aspects of global intent: which function is selected and how values should be interpreted.
Why is it reasonable for Operation and SignedMode to update independently?
An if followed by a separate if allows both conditions to execute, whereas an if/else if structure would make the alternatives mutually exclusive.
Why do the two separate if statements matter when NextOperationPulse and SignedModePulse occur together?
Operation Selection State
The persistent global state indicating which arithmetic subsystem should be considered selected.
Interpretation Mode State
The persistent global state indicating whether signed-aware arithmetic paths should interpret values as signed.
It selects and remembers system behavior but does not itself calculate the selected arithmetic result.
Why is ArithmeticEngineControl a controller rather than an arithmetic datapath?