|
|
|
|
Wiring Units
Module: extender
This unit takes an input of one bit width and
produces an output of a larger bit width. The intended use is to perform
extension task on the immediate portion of instructions. The CTL signal
determines how the extension is performed. The module performs the
following operations:
-
zero extension - fills in required bits with 0's
-
sign extension - maintain the sign of the number
-
left alignment - make the msb of the input the msb of the
output ( equivalent to left-shift by O_WIDTH - I_WIDTH bits)
-
shift amount extraction - shift the input right 6 bits and
mask with 0x1F (extracts the shamt field from R-Format instructions )
Parameters:
|
|
Name |
Default |
Description |
ALIGN_L |
2'b10 |
Value to input to CTL for left alignment |
DIFF |
16 |
Difference in width between input and output ports |
GET_SHIFT |
2'b11 |
Value to input to CTL for getting shift amount |
SIGN_EX |
2'b01 |
Value to input to CTL for sign extension |
ZERO_EX |
2'b0 |
Value to input to CTL for zero extension |
|
|
Port Description:
|
|
Name |
Dir |
Width |
Description |
IN |
In |
16 |
input bits |
CTL |
In |
2 |
controls the type of
transformation |
OUT |
Out |
32 |
shifted output bits |
|
|
|
|