typedef.v 297 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
`default_nettype none

// Verilog unwraps the typedef

module Example(
    input wire [3:0] data_in,
    output wire [31:0] data_out
);

    reg [31:0] word;
    always @* begin
        // This is the repeat operator
        word = {8{data_in}};
    end

    assign data_out = word;

endmodule